Generates the source files for a WebAssembly target from a Rust project.
steps:
- uses: giancosta86/aurora-github/actions/generate-wasm-target@v8
with:
target: web
npm-scope: npmuser
development: true
target-directory: pkg
project-directory: .
-
Invoke wasm-pack - with arguments depending on the inputs - to generate a WebAssembly project from the given Rust sources.
-
If
nodejs-version
is passed, inject it into theengines / node
field of package.json -
If
pnpm-version
is passed, inject it into thepackageManager
field of package.json, with value preceded bypnpm@
-
If package.json was actually generated, display it
- The
wasm-pack
command must be available in the system - for example, via install-wasm-pack.
Name | Type | Description | Default value |
---|---|---|---|
target |
string | The target of the wasm-pack build command |
|
npm-scope |
string | The package scope or <ROOT> , for npm targets |
|
nodejs-version |
string | The engines / node version within package.json |
|
pnpm-version |
string | The packageManager reference to pnpm within package.json |
|
development |
boolean | Enable debugging info | |
target-directory |
string | Directory (relative to project-directory ) for the generated target |
|
project-directory |
string | The directory containing Cargo.toml |
. |