rsnext/packages/next-swc/package.json

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
2.2 KiB
JSON
Raw Normal View History

{
"name": "@next/swc",
2024-03-03 00:21:32 +01:00
"version": "14.1.2-canary.2",
"private": true,
"scripts": {
"clean": "node ../../scripts/rm.mjs native",
"build-native": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features plugin,image-extended --js false native",
"build-native-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --features plugin,image-extended,tracing/release_max_level_info --js false native",
"build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features image-webp --js false native",
"build-native-no-plugin-woa": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --cargo-flags=--no-default-features --features image-webp --js false native",
"build-native-no-plugin-woa-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --cargo-flags=--no-default-features --features image-webp,tracing/release_max_level_info --js false native",
feat(next-swc): support wasm32-* build target (#61586) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### How? Closes NEXT- Fixes # --> ### What? This PR introduces a ground work to generate wasm bindings package from our napi bindings. This doesn't actually replace anything yet, however aim to establish our napi bindings package can be built against wasm32 target. ### Why? We currently have two bindings package to generate native / wasm target support, one for napi and one other for wasm. Recently napi-rs started to support to generate bindings for the wasm directly - which means we can get rid of the wasm-pack based bindings code entirely and maintain a single bindings code only. This'll makes our `next-swc` simpler as well, since the invocation to the bindings now becomes identical we don't have to additional wasm specific logics to invoke functions (i.e transform, transformsync..). Also napi generates wasi-supported wasm bindings, provides few more features to the current wasm bindings. #### Good - Async napi binding fn works transparently (`transform`, `minify`...) - (Experimental) thread supports depends on node.js runtime - Wasi support: i.e it can even read filesystem directly! #### Things to consider - node.js's wasi support is experimental yet - napi-rs's wasm support is in beta yet, specifically `packaging` generated wasm output. Due to `things to consider` reasons, this PR does not replace existing wasm target yet. We should be able to plan out things later. **What happens to the turbopack api in napi bindings?** Simply put, this **does not support turbopack in wasm**. Build works by disabling turbopack (more notably, underlying dependency doesn't support wasm) features. It is something to explore separately. Closes PACK-2367 There is a branch at https://github.com/vercel/next.js/pull/61586 shows quick demo for importing, running sync / async / read external files.
2024-02-06 19:15:13 +01:00
"build-native-wasi": "npx --package=@napi-rs/cli@3.0.0-alpha.36 napi build --platform --target wasm32-wasi-preview1-threads -p next-swc-napi --cwd ../../ --output-dir packages/next-swc/native",
"build-wasm": "wasm-pack build crates/wasm --scope=next",
"cache-build-native": "echo $(ls native)",
refactor(next/core): reorganize next.js custom transforms for next-swc/turbopack (#60400) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change --> ### What? This PR refactors organization for the rust side packages to build `next-swc`. ### Why? We had some historical legacy around package structures, have ambiguous name for `core` / `next-core`. One contains swc transform visitor for the next.js, and the other one is new for turbopack's core next.js features. In addition to that, there was a package dependency chain prevents to use `core` in the turobpack / next-swc both, so each time porting a transformer into turbopack it requires to extract new dependency to be imported in the both place. PR touches its organization - while PR is large to touch various files, the crux is summarized at https://github.com/vercel/next.js/pull/60400/commits/2cedd06ea55f71478206d60f832acc3cd5763362 : 1. `core` becomes `next-custom-transforms`, also this becomes an agnostic pkg can be imported in turbopack / wasm / next-swc 2. simplify dependency chain to import next-custom-transforms, organized as below ```mermaid flowchart TD C(next-custom-transforms) --> A(napi) C(next-custom-transforms) --> B(wasm) D(next-core) --> A(napi) E(next-build) --> A(napi) F(next-api) --> A(napi) C(next-custom-transforms) --> D D(next-core) --> F(next-api) D(next-core) --> E(next-build) ``` `impl CustomTransformer` for the each transform still lives in `next-core`, so turbopack specific dependency is isolated under `next-core/build/api`. Closes PACK-2201 Closes PACK-2202 --------- Co-authored-by: hrmny <8845940+ForsakenHarmony@users.noreply.github.com>
2024-01-09 21:23:47 +01:00
"rust-check-fmt": "cd ../..; cargo fmt -- --check",
"rust-check-clippy": "cargo clippy --workspace --all-targets -- -D warnings -A deprecated",
"rust-check-napi-rustls": "cargo check -p next-swc-napi",
"test-cargo-unit": "cargo nextest run --workspace --exclude next-swc-napi --release --no-fail-fast --features rustls-tls"
},
"napi": {
"name": "next-swc",
"triples": {
"defaults": true,
"additional": [
"i686-pc-windows-msvc",
"aarch64-unknown-linux-gnu",
"aarch64-apple-darwin",
"x86_64-unknown-linux-musl",
"aarch64-unknown-linux-musl",
feat(next-swc): support wasm32-* build target (#61586) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### How? Closes NEXT- Fixes # --> ### What? This PR introduces a ground work to generate wasm bindings package from our napi bindings. This doesn't actually replace anything yet, however aim to establish our napi bindings package can be built against wasm32 target. ### Why? We currently have two bindings package to generate native / wasm target support, one for napi and one other for wasm. Recently napi-rs started to support to generate bindings for the wasm directly - which means we can get rid of the wasm-pack based bindings code entirely and maintain a single bindings code only. This'll makes our `next-swc` simpler as well, since the invocation to the bindings now becomes identical we don't have to additional wasm specific logics to invoke functions (i.e transform, transformsync..). Also napi generates wasi-supported wasm bindings, provides few more features to the current wasm bindings. #### Good - Async napi binding fn works transparently (`transform`, `minify`...) - (Experimental) thread supports depends on node.js runtime - Wasi support: i.e it can even read filesystem directly! #### Things to consider - node.js's wasi support is experimental yet - napi-rs's wasm support is in beta yet, specifically `packaging` generated wasm output. Due to `things to consider` reasons, this PR does not replace existing wasm target yet. We should be able to plan out things later. **What happens to the turbopack api in napi bindings?** Simply put, this **does not support turbopack in wasm**. Build works by disabling turbopack (more notably, underlying dependency doesn't support wasm) features. It is something to explore separately. Closes PACK-2367 There is a branch at https://github.com/vercel/next.js/pull/61586 shows quick demo for importing, running sync / async / read external files.
2024-02-06 19:15:13 +01:00
"aarch64-pc-windows-msvc",
"wasm32-wasi-preview1-threads"
]
}
},
"devDependencies": {
feat(next-swc): support wasm32-* build target (#61586) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### How? Closes NEXT- Fixes # --> ### What? This PR introduces a ground work to generate wasm bindings package from our napi bindings. This doesn't actually replace anything yet, however aim to establish our napi bindings package can be built against wasm32 target. ### Why? We currently have two bindings package to generate native / wasm target support, one for napi and one other for wasm. Recently napi-rs started to support to generate bindings for the wasm directly - which means we can get rid of the wasm-pack based bindings code entirely and maintain a single bindings code only. This'll makes our `next-swc` simpler as well, since the invocation to the bindings now becomes identical we don't have to additional wasm specific logics to invoke functions (i.e transform, transformsync..). Also napi generates wasi-supported wasm bindings, provides few more features to the current wasm bindings. #### Good - Async napi binding fn works transparently (`transform`, `minify`...) - (Experimental) thread supports depends on node.js runtime - Wasi support: i.e it can even read filesystem directly! #### Things to consider - node.js's wasi support is experimental yet - napi-rs's wasm support is in beta yet, specifically `packaging` generated wasm output. Due to `things to consider` reasons, this PR does not replace existing wasm target yet. We should be able to plan out things later. **What happens to the turbopack api in napi bindings?** Simply put, this **does not support turbopack in wasm**. Build works by disabling turbopack (more notably, underlying dependency doesn't support wasm) features. It is something to explore separately. Closes PACK-2367 There is a branch at https://github.com/vercel/next.js/pull/61586 shows quick demo for importing, running sync / async / read external files.
2024-02-06 19:15:13 +01:00
"@napi-rs/cli": "2.18.0",
"cross-env": "6.0.3"
}
}