You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This crate shows how to build a Wasm-based class extender for Atomic Server. It targets the `class-extender` world defined in `lib/wit/class-extender.wit` and appends a random four-digit suffix to every folder name whenever a resource of class [`https://atomicdata.dev/classes/Folder`](https://atomicdata.dev/classes/Folder) is fetched.
3
+
This crate shows how to build a Wasm-based class extender for Atomic Server.
4
+
It appends a random number to the end of the folder name each time it is fetched.
5
+
It also prevents commits to the folder if the name contains uppercase letters.
4
6
5
7
## Building
6
8
7
-
You'll need [`cargo-component`](https://github.com/bytecodealliance/cargo-component) to compile the component:
9
+
AtomicServer plugins are compiled to WebAssempbly (Wasm) using the component model.
10
+
You should target the `wasm32-wasip2` architecture when building the project.
Copy that file into your server's `wasm-class-extenders/` directory (sits next to the sled database). Atomic Server will discover it on startup and automatically append random suffixes to folder names.
20
19
20
+
In this example the build output location is `target/wasm32-wasip2/release/random-folder-extender.wasm`.
21
21
22
+
Copy that file into your servers `plugins/class-extenders/` directory and restart AtomicServer.
23
+
The plugin should be automatically loaded.
24
+
The plugin folder is located in the same directory as your AtomicServer store.
25
+
Check the [docs](https://docs.atomicdata.dev/atomicserver/faq.html#where-is-my-data-stored-on-my-machine) to find this directory.
0 commit comments