Skip to content

Monorepo for Javascript WebAssembly packages by Wasmer

License

Notifications You must be signed in to change notification settings

Genomicsplc/wasmer-js

 
 

Repository files navigation

Wasmer-JS styled with prettier Build Status Dev Dependencies

Wasmer-JS is a mono-repo of multiple JavaScript packages enabling easy use of WebAssembly Modules in Node and the Browser.

Documentation

Documentation for the Wasmer-JS Stack, can be found on the Wasmer Docs.

Development

Contributing into Wasmer-JS it's very easy, just clone the repo and run:

npm install

NOTE: This will run lerna bootstrap, and bootstrap the JS Packages.

To start development mode, you can run the dev command:

npm run dev

This will serve the examples/wasm-shell example, which can be accessed with: http://localhost:1234/

Wasm Terminal Demo Gif

Building the project

To build all the packages in the project, you can run the build command:

npm run build

This will bundle JS Packages into ./dist directory.

Tests

To make changes to any of the sub projects, they can be tested by either: Running their local tests with npm run test in their respective package directory, or running it the root:

npm run test

Contributing

For additional contribution guidelines, please see our CONTRIBUTING.md and our Code of Conduct.

Using Lerna

Please see the website for lerna for a quick introduction into what it is. Here are some general notes about using lerna in this project:

  • Packages can be added by simply creating a new directory within the packages/ directory, and running npm init in this new package directory. Then, the new package must be botstraped using learna. For this project, this can be done running npm run lerna:bootstrap in the base project directory.

  • To add new dependencies and keep build times low, devDependencies (not CLI dependencies) must be added to the root package.json file. Project installation / runtime dependencies are managed for each package individually.

  • Sibling JS packages can depend on one another. You can do this by using @lerna/add. For example, lerna add @wasmer/package-1 --scope=@wasmer/package-2 will add @wasmer/package-1@^1.0.0 to @wasmer/package-2. However, there are issues when a published package tries to depend on a new unpublished package, please see this issue for the discussion. And, one should not be afraid of learna link convert, as file:// dependencies will be automatically converted by lerna on publish, for example see here.

About

Monorepo for Javascript WebAssembly packages by Wasmer

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.7%
  • WebAssembly 30.2%
  • TypeScript 0.1%
  • Rust 0.0%
  • Shell 0.0%
  • C 0.0%