Skip to content

Commit bd2ea4e

Browse files
docs(README): Update repository layout of project structure.
1 parent 65c2e1e commit bd2ea4e

1 file changed

Lines changed: 44 additions & 28 deletions

File tree

README.md

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,41 @@ Edge Python is distributed as a WebAssembly module — `compiler.wasm`, ~170 KB.
1212
This is a Cargo workspace. The root `Cargo.toml` declares the workspace members and shares profile settings; `cargo` commands work from any directory.
1313

1414
```text
15-
Cargo.toml Workspace manifest (members + shared profile)
16-
.cargo/config.toml Workspace-wide aliases (`cargo wasm`)
17-
18-
compiler/ Rust crate `edge-python`: lexer, parser, optimizer, VM, packages module. Compiles to compiler_lib.wasm (the only artifact the project distributes).
19-
wasm-abi/ Wire-format constants shared by the compiler (host) and wasm-pdk (guest). no_std, zero deps.
20-
wasm-pdk/ Plugin Development Kit — author-side runtime for writing `.wasm` modules importable from Edge Python scripts (`#[plugin_fn]`, Handle/Value/Error). Published independently of compiler.wasm.
21-
starter-module/ Reference `.wasm` plugin built with wasm-pdk (`slugify-mod`) — copy as the starting point for your own module.
22-
23-
demo/ Browser playground (HTML + WASM + Web Worker)
24-
documentation/ Mintlify documentation source
25-
.github/ CI/CD pipelines (lint, WASM build, demo deploy)
15+
├── .cargo
16+
├── .github
17+
│ └── workflows
18+
├── compiler
19+
│ ├── src
20+
│ └── tests
21+
├── demo
22+
│ ├── css
23+
│ ├── js
24+
│ ├── runtime
25+
│ └── static
26+
├── documentation
27+
│ ├── getting-started
28+
│ ├── implementation
29+
│ ├── language
30+
│ └── reference
31+
├── starter-module
32+
│ └── src
33+
├── target
34+
│ ├── debug
35+
│ ├── flycheck0
36+
│ └── tmp
37+
├── wasm-abi
38+
│ └── src
39+
└── wasm-pdk
40+
├── macros
41+
└── src
2642
```
2743

2844
Common commands (from anywhere in the repo):
2945

3046
```bash
31-
cargo wasm # release WebAssembly artifact (the distributed product)
32-
cargo build --release # host artifacts (.rlib + cdylib) for Rust embedders
33-
cargo test --release # full test suite
47+
cargo wasm # Release WebAssembly artifact (the distributed product).
48+
cargo build --release # Host artifacts (.rlib + cdylib) for Rust embedders.
49+
cargo test --release # Full test suite.
3450
```
3551

3652
Native modules come in two flavors: `.wasm` binaries any host can load by URL (per the [WASM ABI](documentation/reference/wasm-abi.md)) and in-process Rust bindings for embedders linking `compiler_lib` (full type coverage). See [Writing modules](documentation/reference/writing-modules.md).
@@ -43,20 +59,20 @@ Two files: the WASM module + a thin JS loader included in this repo at [`demo/ed
4359

4460
```html
4561
<script type="module">
46-
import { EdgePython } from './edge.js';
47-
48-
const ep = await EdgePython.create({
49-
wasmUrl: './compiler_lib.wasm',
50-
imports: { "math": "https://example.com/math.wasm" }
51-
});
52-
ep.onOutput(line => console.log(line));
53-
54-
await ep.run(`
55-
from math import add
56-
from "https://example.com/utils.py" import normalize
57-
print(add(2, 3))
58-
print(normalize(" hi "))
59-
`);
62+
import { EdgePython } from './edge.js';
63+
64+
const ep = await EdgePython.create({
65+
wasmUrl: './compiler_lib.wasm',
66+
imports: { "math": "https://example.com/math.wasm" }
67+
});
68+
ep.onOutput(line => console.log(line));
69+
70+
await ep.run(`
71+
from math import add
72+
from "https://example.com/utils.py" import normalize
73+
print(add(2, 3))
74+
print(normalize(" hi "))
75+
`);
6076
</script>
6177
```
6278

0 commit comments

Comments
 (0)