Now, in the root of your project, you can simply run
wapm init
And it will guide you the process of creating a new wapm.toml file for your project. At the end, it should have generated a manifest like the following:
[package]name = "username/my_package"version = "0.1.0"description = "The description of the package"[[module]]name = "my_program_wasi"source = "my_program_wasi.wasm"[[module]]name = "my_other_program_wasi"source = "my_other_program_wasi.wasm"
Now that you are registered, you can just run the following command and it will ask for your credentials
Publish the package to WAPM
Now that you have successfully created a wapm.toml manifest file for your project and have logged in into WAPM, you just need to run one more command!
And you package should now be live in wapm.io ๐
All packages on wapm.io are namespaced by username.
If your program is a WASI program, it will be automatically available in the WebAssembly shell
Commands
Commands (not to be confused with wapm-cli subcommands) are a feature that enables easily executing Wasm code from a WAPM package.
Commands are what allows one to call the run subcommand, like above when running wapm run cowsay hello wapm!.
A command requires a name and module to reference:
Now called wapm run my_cmd will execute the module defined with the name my_program_wasi. Under the hood, wapm calls wasmer, the WebAssembly server runtime.
If you want to learn more about the manifest format, please jump into the next article!