Skip to content

Commit 6d7a1b6

Browse files
committed
docs: update README.browser in fixtures
1 parent f0abd8d commit 6d7a1b6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
# filesystem
2+
3+
You are interacting with a virtual filesystem, in your browser!
4+
5+
The plugins `ls` and `cat` do real filesystem operations in their source code, like `std::fs::read_dir` or `std::fs::read_to_string`.
6+
7+
Those operations are forwarded via the `@bytecodealliance/preview2-shim/filesystem` shim, which shims the `wasi:filesystem` filesystem interface.
8+
9+
On the cli, you would interact with a real filesystem with the exact same source code as the one you are running (which was developed mainly in rust and compiled to WebAssembly, for the browser, using `jco`).
10+
11+
The virtual filesystem was generated by the `prepareVirtualFs` command, which reads the `fixtures/filesystem` directory and generates a virtual filesystem in the [`packages/web-host/src/wasm/virtualFs.ts`](https://github.com/topheman/webassembly-component-model-experiments/blob/master/packages/web-host/src/wasm/virtualFs.ts) file.

packages/web-host/src/wasm/virtualFs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export function makeVirtualFs() {
1818
"# This is a hidden file\n# It should only be visible when explicitly requested\n# Used for testing hidden file operations\n",
1919
},
2020
"README.md": {
21-
source: "# filesystem\n",
21+
source:
22+
"# filesystem\n\nYou are interacting with a virtual filesystem, in your browser!\n\nThe plugins `ls` and `cat` do real filesystem operations in their source code, like `std::fs::read_dir` or `std::fs::read_to_string`.\n\nThose operations are forwarded via the `@bytecodealliance/preview2-shim/filesystem` shim, which shims the `wasi:filesystem` filesystem interface.\n\nOn the cli, you would interact with a real filesystem with the exact same source code as the one you are running (which was developed mainly in rust and compiled to WebAssembly, for the browser, using `jco`).\n\nThe virtual filesystem was generated by the `prepareVirtualFs` command, which reads the `fixtures/filesystem` directory and generates a virtual filesystem in the [`packages/web-host/src/wasm/virtualFs.ts`](https://github.com/topheman/webassembly-component-model-experiments/blob/master/packages/web-host/src/wasm/virtualFs.ts) file.\n",
2223
},
2324
data: {
2425
dir: {

0 commit comments

Comments
 (0)