Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support cross builds and npm publish #408

Merged
merged 1 commit into from
Apr 15, 2023
Merged

Conversation

OmarTawfik
Copy link
Contributor

@OmarTawfik OmarTawfik commented Apr 14, 2023

In this PR

  • add support for publishing npm packages for slang.
  • add ability to cross-build native NAPI modules for 9 targets.
  • replace Hermit's rust package with rustup to allow installing multiple targets.
  • now CI will check to make sure TypeScript sources are up to date and pass tests on every push.
  • fill NPM packages metadata, including platform-specific ones.
  • removed yarn since it is no longer needed. standardizing on npm everywhere.
  • following publishing, moved directory structure to solidity/outputs/cargo and solidity/outputs/npm, and within each, three sub-folders: build, crate, and tests. That separation makes sure our internal codegen crates are not propagated to product crates.

Changes to dev scripts

So far we have relied on cargo workspace commands (scripts/cargo/check.sh and scripts/cargo/test.sh). Each crate uses its own build.rs to define specific build steps that need to happen.

With this PR, adding NPM publishing, we do the same with the root package.json. Each package will define custom tasks in its own package.json, and we will run all of them through scripts/npm/build.sh and scripts/npm/test.sh.

For example, the NAPI packages in crates/solidity/outputs/npm will call NAPI specific scripts defined in scripts/npm/napi to build/test/publish.

Limitations

@OmarTawfik OmarTawfik force-pushed the OmarTawfik/npm-publish branch from 630aaea to 44b36ee Compare April 14, 2023 12:33
@OmarTawfik OmarTawfik marked this pull request as ready for review April 14, 2023 12:33
@OmarTawfik OmarTawfik requested a review from a team as a code owner April 14, 2023 12:34
@OmarTawfik OmarTawfik linked an issue Apr 14, 2023 that may be closed by this pull request
@OmarTawfik OmarTawfik force-pushed the OmarTawfik/npm-publish branch from 44b36ee to ada275c Compare April 14, 2023 13:44
@OmarTawfik OmarTawfik enabled auto-merge April 14, 2023 13:56
@OmarTawfik OmarTawfik force-pushed the OmarTawfik/npm-publish branch from ada275c to 1c447fd Compare April 15, 2023 09:24
@OmarTawfik OmarTawfik added this pull request to the merge queue Apr 15, 2023
Merged via the queue into main with commit be3714b Apr 15, 2023
@OmarTawfik OmarTawfik deleted the OmarTawfik/npm-publish branch April 15, 2023 09:42
@OmarTawfik OmarTawfik linked an issue May 3, 2023 that may be closed by this pull request
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.

Move generated index.js and index.d.ts to generated dir Ship Rust crates and NPM packages for Alpha Preview
2 participants