Skip to content

Conversation

Swolebrain
Copy link
Contributor

Description of changes

With this new build process, we accommodate all possible mechanisms for consuming wasm. The node target supports the needs of teams who can't use es-modules, and the web target supports the needs of teams that need to read the wasm binary from a buffer for whatever reason.

Issue #, if available

n/a

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A change "invisible" to users (e.g., documentation, changes to "internal" crates like cedar-policy-core, cedar-validator, etc.)

I confirm that this PR (choose one, and delete the other options):

  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.

mkdir pkg
cargo build
wasm-pack build --scope cedar-policy --target bundler --out-dir pkg/esm
wasm-pack build --scope cedar-policy --target nodejs --out-dir pkg/nodejs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The readme says the subpackage is "node" but does this line mean it's actually "nodejs"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps that's ugly... what controls the subpackage name is package.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed the name of the subpackage in package.json to align with the naem of the wasm target

@cdisselkoen
Copy link
Contributor

CI is failing with mv: cannot stat 'esm/package.json': No such file or directory

@cdisselkoen cdisselkoen merged commit 5ba0e95 into main May 31, 2024
@cdisselkoen cdisselkoen deleted the build-wasm-3 branch May 31, 2024 14:54
cdisselkoen pushed a commit that referenced this pull request May 31, 2024
cdisselkoen added a commit that referenced this pull request May 31, 2024
Co-authored-by: Victor Moreno <[email protected]>
Co-authored-by: Victor Moreno <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants