diff --git a/.github/actions/artifact/download/action.yml b/.github/actions/artifact/download/action.yml new file mode 100644 index 00000000..0b1ba20d --- /dev/null +++ b/.github/actions/artifact/download/action.yml @@ -0,0 +1,31 @@ +name: Download Artifact + +description: Download file to local or artifact to quickly share files between jobs + +inputs: + name: + description: "Artifact name" + default: "artifact" + path: + description: "Destination path" + required: true + force-use-github: + description: "force download from github" + default: false + required: false + +runs: + using: composite + steps: + - name: Download artifact from github + uses: actions/download-artifact@v4.1.7 + if: ${{ inputs.force-use-github == 'true' || runner.environment == 'github-hosted' }} + with: + name: ${{ inputs.name }} + path: ${{ inputs.path }} +# - name: Download artifact from local +# uses: lynx-infra/download-artifact +# if: ${{ input.force-use-github != 'true' && runner.environment == 'self-hosted' }} +# with: +# name: ${{ inputs.name }} +# path: ${{ inputs.path }} diff --git a/.github/actions/artifact/upload/action.yml b/.github/actions/artifact/upload/action.yml new file mode 100644 index 00000000..70426c20 --- /dev/null +++ b/.github/actions/artifact/upload/action.yml @@ -0,0 +1,33 @@ +name: Upload Artifact + +description: Upload file to local or artifact to quickly share files between jobs + +inputs: + name: + description: "Artifact name" + default: "artifact" + path: + description: "A file, directory or wildcard pattern that describes what to upload" + required: true + force-use-github: + description: "force upload to github" + default: false + require: false + +runs: + using: composite + steps: + - name: Upload artifact to github + uses: actions/upload-artifact@v4 + if: ${{ inputs.force-use-github == 'true' || runner.environment == 'github-hosted' }} + with: + name: ${{ inputs.name }} + path: ${{ inputs.path }} + if-no-files-found: error + overwrite: true +# - name: Upload artifact to local +# uses: lynx-infra/upload-artifact +# if: ${{ inputs.force-use-github != 'true' && runner.environment == 'self-hosted' }} +# with: +# name: ${{ inputs.name }} +# path: ${{ inputs.path }} diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml new file mode 100644 index 00000000..ff8f8527 --- /dev/null +++ b/.github/actions/docker-build/action.yml @@ -0,0 +1,76 @@ +name: Single Docker build + +description: Docker build for a single target + +inputs: + target: + required: true + type: string + image: + required: true + type: string + profile: + default: "release" + required: false + type: string + options: + description: "Options for docker" + default: "" + required: false + type: string + pre: + required: false + default: "" + type: string + post: + required: false + default: "" + type: string + plugin: + required: false + default: true + type: boolean + +runs: + using: composite + steps: + - name: Docker Build ${{ inputs.target }} + shell: bash + run: | + code=' + set -e + if [ -x "$(command -v sccache)" ]; then + export RUSTC_WRAPPER=sccache + echo "enable sccache" + fi + ${{ inputs.pre }} + rustup target add ${{ inputs.target }} + + npm install -g corepack@0.31.0 --force + echo "Corepack version: $(corepack --version)" + corepack enable + + RUST_TARGET=${{ inputs.target }} ${{ inputs.plugin == 'false' && 'DISABLE_PLUGIN=1' || '' }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }} + ${{ inputs.post }} + ' + if [[ ! -n "$CARGO_HOME" ]]; then + CARGO_HOME="$(dirname $(dirname $(which cargo)))" + fi + + docker run \ + --rm \ + --privileged \ + --user 0:0 \ + -v $CARGO_HOME/registry/index:/usr/local/cargo/registry/index \ + -v $CARGO_HOME/registry/cache:/usr/local/cargo/registry/cache \ + -v $CARGO_HOME/git/db:/usr/local/cargo/git/db \ + -v /tmp:/tmp \ + ${{ inputs.options }} \ + -e CI=1 \ + -e HOME=$HOME \ + -v $HOME/.cache:$HOME/.cache \ + -v ${{ github.workspace }}:/build \ + -w /build \ + -i \ + ${{ inputs.image }} \ + bash -c "$code" diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml new file mode 100644 index 00000000..65b48342 --- /dev/null +++ b/.github/workflows/release-npm.yml @@ -0,0 +1,144 @@ +name: Release Full + +on: + workflow_dispatch: + inputs: + tag: + type: choice + description: "Release Npm Tag" + required: false + default: "latest" + options: + - canary + - nightly + - latest + - beta + - alpha + test: + type: boolean + description: "Run tests before release" + required: false + default: false + dry_run: + type: boolean + description: "DryRun release" + required: false + default: false + push_tags: + type: boolean + description: "push tags to github" + required: false + default: true + +permissions: + # To publish packages with provenance + id-token: write + # Allow commenting on issues for `reusable-build.yml` + issues: write + +jobs: + build: + strategy: + fail-fast: false # Build and test everything so we can look at all the errors + matrix: + array: + - target: x86_64-unknown-linux-gnu + runner: "ubuntu-22.04" + - target: aarch64-unknown-linux-gnu + runner: "ubuntu-22.04" + - target: x86_64-unknown-linux-musl + runner: "ubuntu-22.04" + - target: aarch64-unknown-linux-musl + runner: "ubuntu-22.04" + - target: i686-pc-windows-msvc + runner: "windows-latest" + - target: x86_64-pc-windows-msvc + runner: "windows-latest" + - target: aarch64-pc-windows-msvc + runner: "windows-latest" + - target: x86_64-apple-darwin + runner: "macos-latest" + - target: aarch64-apple-darwin + runner: "macos-latest" + + uses: ./.github/workflows/reusable-build.yml + with: + target: ${{ matrix.array.target }} + runner: ${{ matrix.array.runner }} + test: false + profile: "release" + + release: + name: Release + environment: npm + permissions: + contents: write + # To publish packages with provenance + id-token: write + runs-on: ubuntu-latest + needs: build +# if: ${{ github.event_name == 'workflow_dispatch' }} + steps: + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + # This makes Actions fetch only one branch to release + fetch-depth: 1 + + - name: Pnpm Setup + uses: ./.github/actions/pnpm + + - name: Download artifacts + uses: actions/download-artifact@v4.1.7 + with: + path: artifacts + + - name: ls + run: ls -R artifacts + + - name: Move artifacts + run: | + pnpm napi create-npm-dirs --package-json-path npm/package.json --npm-dir bindings + pnpm napi artifacts --package-json-path npm/package.json --npm-dir bindings --build-output-dir napi + + - name: Show binding packages + run: ls -R bindings + + - name: Obtain OIDC token + id: oidc + run: | + token=$(curl --fail -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \ + "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=cfa.rspack.dev" | jq -r '.value') + echo "::add-mask::${token}" + echo "token=${token}" >> $GITHUB_OUTPUT + shell: bash + + - name: Obtain GitHub credentials + id: github_creds + run: | + token=$(curl --fail "https://cfa.rspack.dev/api/request/${{ secrets.CFA_PROJECT_ID }}/github/credentials" \ + -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: bearer ${{ secrets.CFA_SECRET }}" \ + --data "{\"token\":\"${{ steps.oidc.outputs.token }}\"}" | jq -r '.GITHUB_TOKEN') + echo "::add-mask::${token}" + echo "token=${token}" >> $GITHUB_OUTPUT + shell: bash + + - name: Release Full + run: | + git status + cp napi/{index,browser}.js npm + cp napi/index.d.ts npm + pnpm node scripts/x.mjs publish --otp --tag ${{inputs.tag}} ${{inputs.dry_run && '--dry-run' || '--no-dry-run'}} ${{inputs.push_tags && '--push-tags' || '--no-push-tags'}} + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + REPOSITORY: ${{ github.repository }} + REF: ${{ github.ref }} + ONLY_RELEASE_TAG: true + # CFA required environment variables + CFA_HOST: https://cfa.rspack.dev + GITHUB_TOKEN: ${{ steps.github_creds.outputs.token }} + GITHUB_OIDC_TOKEN: ${{ steps.oidc.outputs.token }} + CFA_PROJECT_ID: ${{ secrets.CFA_PROJECT_ID }} + CFA_SECRET: ${{ secrets.CFA_SECRET }} diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml new file mode 100644 index 00000000..67a81b72 --- /dev/null +++ b/.github/workflows/reusable-build.yml @@ -0,0 +1,180 @@ +name: Reusable Release + +on: + workflow_call: + inputs: + target: + required: true + type: string + runner: + default: "ubuntu-22.04" + required: false + type: string + full-install: + default: true + required: false + type: boolean + profile: # Rust profile, "ci" or "production" or "profiling" + default: "release" + required: false + type: string + test: # Run tests? + type: boolean + required: false + default: false + bench: # Run benchmarks? + type: boolean + required: false + default: false + ref: # Git reference to checkout + required: false + type: string +env: + # Since CI builds are more akin to from-scratch builds, incremental compilation adds unnecessary dependency-tracking and IO overhead, reducing caching effectiveness. + # https://github.com/rust-lang/rust-analyzer/blob/25368d24308d6a94ffe8b99f0122bcf5a2175322/.github/workflows/ci.yaml#L11 + CARGO_INCREMENTAL: 0 + +permissions: + # Allow commenting on issues + issues: write + +jobs: + build: + name: Build + runs-on: ${{ inputs.runner }} + defaults: + run: + shell: bash + outputs: + runner-labels: ${{ steps.upload-artifact.outputs.runner-labels || inputs.runner }} + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + ref: ${{ inputs.ref }} + + - name: Pnpm Setup + uses: ./.github/actions/pnpm + + - uses: Boshen/setup-rust@main + with: + save-cache: true + cache-key: build-${{ inputs.target }}-${{ inputs.profile }} + + - name: Trim paths + shell: bash + run: | + mkdir -p .cargo + echo $'\n' >> .cargo/config.toml + echo '[unstable]' >> .cargo/config.toml + echo 'trim-paths = true' >> .cargo/config.toml + + # Linux + - name: Build x86_64-unknown-linux-gnu in Docker + if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' }} + uses: ./.github/actions/docker-build + with: + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian + target: ${{ inputs.target }} + profile: ${{ inputs.profile }} + pre: unset CC_x86_64_unknown_linux_gnu && unset CC # for jemallocator to compile + # runner these build in docker since we don't have github runner machine for it + - name: Build aarch64-unknown-linux-gnu in Docker + if: ${{ inputs.target == 'aarch64-unknown-linux-gnu' }} + uses: ./.github/actions/docker-build + with: + target: ${{ inputs.target }} + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 + profile: ${{ inputs.profile }} + pre: | + export CC_aarch64_unknown_linux_gnu=clang + + - name: Build x86_64-unknown-linux-musl in Docker + if: ${{ inputs.target == 'x86_64-unknown-linux-musl' }} + uses: ./.github/actions/docker-build + with: + target: ${{ inputs.target }} + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + profile: ${{ inputs.profile }} + pre: | + # musl will enable clang-sys static linking + # https://github.com/KyleMayes/clang-sys?tab=readme-ov-file#static + # llvm19-dev is used to install llvm-config + # clang19-static is used to install libclang.a + apk add llvm19-dev clang19-static + + - name: Build aarch64-unknown-linux-musl in Docker + if: ${{ inputs.target == 'aarch64-unknown-linux-musl' }} + uses: ./.github/actions/docker-build + with: + target: ${{ inputs.target }} + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + profile: ${{ inputs.profile }} + pre: | + export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc + # musl will enable clang-sys static linking + # https://github.com/KyleMayes/clang-sys?tab=readme-ov-file#static + # llvm19-dev is used to install llvm-config + # clang19-static is used to install libclang.a + apk add llvm19-dev clang19-static + + # setup rust target for native runner + - name: Setup Rust Target + if: ${{ !contains(inputs.target, 'linux') }} + run: rustup target add ${{ inputs.target }} + # runner the following in github runner directly without docker since we have related machine + # Windows + - name: Build i686-pc-windows-msvc + if: ${{ inputs.target == 'i686-pc-windows-msvc' }} + run: RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }} + + - name: Build x86_64-pc-windows-msvc + if: ${{ inputs.target == 'x86_64-pc-windows-msvc' }} + run: RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }} + + - name: Build aarch64-pc-windows-msvc + if: ${{ inputs.target == 'aarch64-pc-windows-msvc' }} + run: RUST_TARGET=${{ inputs.target }} DISABLE_PLUGIN=1 pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }} + + # Mac + - name: Build x86_64-apple-darwin + if: ${{ inputs.target == 'x86_64-apple-darwin' }} + run: | + RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }} + + - name: Build aarch64-apple-darwin + if: ${{ inputs.target == 'aarch64-apple-darwin' }} + run: | + sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; + export CC=$(xcrun -f clang); + export CXX=$(xcrun -f clang++); + SYSROOT=$(xcrun --sdk macosx --show-sdk-path); + export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; + RUST_TARGET=${{ inputs.target }} pnpm build:binding:${{ inputs.profile }} --target ${{ inputs.target }} + + - name: Upload artifact + id: upload-artifact + uses: ./.github/actions/artifact/upload + if: ${{ inputs.target != 'wasm32-wasip1-threads' }} + with: + name: bindings-${{ inputs.target }} + path: napi/resolver*.node + + # WASM + - name: Build wasm32-wasip1-threads with linux in Docker + if: ${{ inputs.target == 'wasm32-wasip1-threads' }} + uses: ./.github/actions/docker-build + with: + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian + target: ${{ inputs.target }} + profile: ${{ inputs.profile }} + plugin: false + pre: unset CC_x86_64_unknown_linux_gnu && unset CC # for jemallocator to compile + + - name: Upload wasm artifact + id: upload-wasm-artifact + uses: ./.github/actions/artifact/upload + if: ${{ inputs.target == 'wasm32-wasip1-threads' }} + with: + name: bindings-wasm32-wasi + path: napi/resolver*.wasm diff --git a/.gitignore b/.gitignore index fb498ad1..779b0627 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ target/ node_modules fuzz/Cargo.lock +artifacts +bindings diff --git a/Cargo.lock b/Cargo.lock index ef60e6ce..8cfbe3ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -992,6 +992,7 @@ dependencies = [ "napi", "napi-build", "napi-derive", + "regex", "rspack_resolver", "tracing-subscriber", ] diff --git a/Cargo.toml b/Cargo.toml index 2b84eebd..f6ad6ddf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -130,3 +130,12 @@ codegen-units = 1 strip = "symbols" # set to `false` for debug information debug = false # set to `true` for debug information panic = "abort" # Let it crash and force ourselves to write safe Rust. + +[profile.profiling] +inherits = "release" +opt-level = 3 +lto = "fat" +codegen-units = 1 +strip = false # set to `false` for debug information +debug = false# set to `true` for debug information +panic = "abort" \ No newline at end of file diff --git a/fixtures/pnpm-workspace/package.json b/fixtures/pnpm-workspace/package.json index 61c6a4ac..e273e358 100644 --- a/fixtures/pnpm-workspace/package.json +++ b/fixtures/pnpm-workspace/package.json @@ -1,5 +1,6 @@ { "name": "monorepo", + "private": "true", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/napi/Cargo.toml b/napi/Cargo.toml index 8c1f339f..2682c34a 100644 --- a/napi/Cargo.toml +++ b/napi/Cargo.toml @@ -11,13 +11,14 @@ test = false doctest = false [dependencies] -oxc_resolver = { path = "..", package = "rspack_resolver" } +rspack_resolver = { path = "..", package = "rspack_resolver" } napi = { version = "3.0.0-alpha", default-features = false, features = ["napi3", "serde-json", "async"] } napi-derive = { version = "3.0.0-alpha" } tracing-subscriber = { version = "0.3.18", default-features = false, features = [ "std", "fmt", -] } # Omit the `regex` feature +] } +regex = "1.11.1" [build-dependencies] napi-build = "2.1.3" diff --git a/napi/browser.js b/napi/browser.js index e0a24e7e..2452cae8 100644 --- a/napi/browser.js +++ b/napi/browser.js @@ -1 +1 @@ -export * from '@oxc-resolver/binding-wasm32-wasi' +export * from '@rspack/resolver-binding-wasm32-wasi' diff --git a/napi/index.d.ts b/napi/index.d.ts index bac40bcc..99f7d0dc 100644 --- a/napi/index.d.ts +++ b/napi/index.d.ts @@ -183,6 +183,12 @@ export interface NapiResolveOptions { * Default `false` */ builtinModules?: boolean + /** + * Whether to enable yarn Plug'n'Play + * + * Default `false` + */ + enablePnp?: boolean } export interface ResolveResult { diff --git a/napi/index.js b/napi/index.js index 330e4200..ea473899 100644 --- a/napi/index.js +++ b/napi/index.js @@ -65,7 +65,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-android-arm64') + return require('@rspack/resolver-binding-android-arm64') } catch (e) { loadErrors.push(e) } @@ -77,7 +77,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-android-arm-eabi') + return require('@rspack/resolver-binding-android-arm-eabi') } catch (e) { loadErrors.push(e) } @@ -93,7 +93,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-win32-x64-msvc') + return require('@rspack/resolver-binding-win32-x64-msvc') } catch (e) { loadErrors.push(e) } @@ -105,7 +105,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-win32-ia32-msvc') + return require('@rspack/resolver-binding-win32-ia32-msvc') } catch (e) { loadErrors.push(e) } @@ -117,7 +117,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-win32-arm64-msvc') + return require('@rspack/resolver-binding-win32-arm64-msvc') } catch (e) { loadErrors.push(e) } @@ -132,7 +132,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-darwin-universal') + return require('@rspack/resolver-binding-darwin-universal') } catch (e) { loadErrors.push(e) } @@ -144,7 +144,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-darwin-x64') + return require('@rspack/resolver-binding-darwin-x64') } catch (e) { loadErrors.push(e) } @@ -156,7 +156,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-darwin-arm64') + return require('@rspack/resolver-binding-darwin-arm64') } catch (e) { loadErrors.push(e) } @@ -172,7 +172,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-freebsd-x64') + return require('@rspack/resolver-binding-freebsd-x64') } catch (e) { loadErrors.push(e) } @@ -184,7 +184,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-freebsd-arm64') + return require('@rspack/resolver-binding-freebsd-arm64') } catch (e) { loadErrors.push(e) } @@ -201,7 +201,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-x64-musl') + return require('@rspack/resolver-binding-linux-x64-musl') } catch (e) { loadErrors.push(e) } @@ -213,7 +213,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-x64-gnu') + return require('@rspack/resolver-binding-linux-x64-gnu') } catch (e) { loadErrors.push(e) } @@ -227,7 +227,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-arm64-musl') + return require('@rspack/resolver-binding-linux-arm64-musl') } catch (e) { loadErrors.push(e) } @@ -239,7 +239,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-arm64-gnu') + return require('@rspack/resolver-binding-linux-arm64-gnu') } catch (e) { loadErrors.push(e) } @@ -253,7 +253,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-arm-musleabihf') + return require('@rspack/resolver-binding-linux-arm-musleabihf') } catch (e) { loadErrors.push(e) } @@ -265,7 +265,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-arm-gnueabihf') + return require('@rspack/resolver-binding-linux-arm-gnueabihf') } catch (e) { loadErrors.push(e) } @@ -279,7 +279,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-riscv64-musl') + return require('@rspack/resolver-binding-linux-riscv64-musl') } catch (e) { loadErrors.push(e) } @@ -291,7 +291,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-riscv64-gnu') + return require('@rspack/resolver-binding-linux-riscv64-gnu') } catch (e) { loadErrors.push(e) } @@ -304,7 +304,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-ppc64-gnu') + return require('@rspack/resolver-binding-linux-ppc64-gnu') } catch (e) { loadErrors.push(e) } @@ -316,7 +316,7 @@ function requireNative() { loadErrors.push(e) } try { - return require('@oxc-resolver/binding-linux-s390x-gnu') + return require('@rspack/resolver-binding-linux-s390x-gnu') } catch (e) { loadErrors.push(e) } @@ -336,15 +336,15 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { nativeBinding = require('./resolver.wasi.cjs') } catch (err) { if (process.env.NAPI_RS_FORCE_WASI) { - console.error(err) + loadErrors.push(err) } } if (!nativeBinding) { try { - nativeBinding = require('@oxc-resolver/binding-wasm32-wasi') + nativeBinding = require('@rspack/resolver-binding-wasm32-wasi') } catch (err) { if (process.env.NAPI_RS_FORCE_WASI) { - console.error(err) + loadErrors.push(err) } } } diff --git a/napi/resolver.wasi-browser.js b/napi/resolver.wasi-browser.js index d311ac56..1ccfde8a 100644 --- a/napi/resolver.wasi-browser.js +++ b/napi/resolver.wasi-browser.js @@ -64,9 +64,8 @@ function __napi_rs_initialize_modules(__napiInstance) { __napiInstance.exports['__napi_register__TsconfigOptions_struct_3']?.() __napiInstance.exports['__napi_register__ResolveResult_struct_4']?.() __napiInstance.exports['__napi_register__sync_5']?.() - __napiInstance.exports['__napi_register__ResolveTask_impl_6']?.() - __napiInstance.exports['__napi_register__ResolverFactory_struct_7']?.() - __napiInstance.exports['__napi_register__ResolverFactory_impl_14']?.() + __napiInstance.exports['__napi_register__ResolverFactory_struct_6']?.() + __napiInstance.exports['__napi_register__ResolverFactory_impl_13']?.() } export const ResolverFactory = __napiModule.exports.ResolverFactory export const EnforceExtension = __napiModule.exports.EnforceExtension diff --git a/napi/resolver.wasi.cjs b/napi/resolver.wasi.cjs index fd6a176f..423ebc03 100644 --- a/napi/resolver.wasi.cjs +++ b/napi/resolver.wasi.cjs @@ -39,9 +39,9 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) { __wasmFilePath = __wasmDebugFilePath } else if (!__nodeFs.existsSync(__wasmFilePath)) { try { - __wasmFilePath = __nodePath.resolve('@oxc-resolver/binding-wasm32-wasi') + __wasmFilePath = __nodePath.resolve('@rspack/resolver-binding-wasm32-wasi') } catch { - throw new Error('Cannot find resolver.wasm32-wasi.wasm file, and @oxc-resolver/binding-wasm32-wasi package is not installed.') + throw new Error('Cannot find resolver.wasm32-wasi.wasm file, and @rspack/resolver-binding-wasm32-wasi package is not installed.') } } @@ -88,9 +88,8 @@ function __napi_rs_initialize_modules(__napiInstance) { __napiInstance.exports['__napi_register__TsconfigOptions_struct_3']?.() __napiInstance.exports['__napi_register__ResolveResult_struct_4']?.() __napiInstance.exports['__napi_register__sync_5']?.() - __napiInstance.exports['__napi_register__ResolveTask_impl_6']?.() - __napiInstance.exports['__napi_register__ResolverFactory_struct_7']?.() - __napiInstance.exports['__napi_register__ResolverFactory_impl_14']?.() + __napiInstance.exports['__napi_register__ResolverFactory_struct_6']?.() + __napiInstance.exports['__napi_register__ResolverFactory_impl_13']?.() } module.exports.ResolverFactory = __napiModule.exports.ResolverFactory module.exports.EnforceExtension = __napiModule.exports.EnforceExtension diff --git a/napi/src/lib.rs b/napi/src/lib.rs index 8098d97f..2f595a7b 100644 --- a/napi/src/lib.rs +++ b/napi/src/lib.rs @@ -1,10 +1,10 @@ extern crate napi; extern crate napi_derive; -extern crate oxc_resolver; +extern crate rspack_resolver; use napi::tokio::runtime; use napi_derive::napi; -use oxc_resolver::{ResolveOptions, Resolver}; +use rspack_resolver::{ResolveOptions, Resolver}; use std::{ path::{Path, PathBuf}, sync::Arc, @@ -114,8 +114,8 @@ impl ResolverFactory { let v = v .into_iter() .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, + Some(path) => rspack_resolver::AliasValue::from(path), + None => rspack_resolver::AliasValue::Ignore, }) .collect(); (k, v) @@ -155,8 +155,8 @@ impl ResolverFactory { let v = v .into_iter() .map(|item| match item { - Some(path) => oxc_resolver::AliasValue::from(path), - None => oxc_resolver::AliasValue::Ignore, + Some(path) => rspack_resolver::AliasValue::from(path), + None => rspack_resolver::AliasValue::Ignore, }) .collect(); (k, v) @@ -189,6 +189,7 @@ impl ResolverFactory { .unwrap_or(default.roots), symlinks: op.symlinks.unwrap_or(default.symlinks), builtin_modules: op.builtin_modules.unwrap_or(default.builtin_modules), + enable_pnp: op.enable_pnp.unwrap_or_default(), } } } diff --git a/napi/src/options.rs b/napi/src/options.rs index ea35672f..92753362 100644 --- a/napi/src/options.rs +++ b/napi/src/options.rs @@ -2,7 +2,9 @@ use std::path::PathBuf; use napi::Either; use napi_derive::napi; +use regex::Regex; use std::collections::HashMap; +use std::sync::Arc; /// Module Resolution Options /// @@ -150,6 +152,11 @@ pub struct NapiResolveOptions { /// /// Default `false` pub builtin_modules: Option, + + /// Whether to enable yarn Plug'n'Play + /// + /// Default `false` + pub enable_pnp: Option, } #[napi] @@ -203,14 +210,20 @@ pub struct TsconfigOptions { pub references: Option>>, } -impl Into for Restriction { - fn into(self) -> oxc_resolver::Restriction { +impl Into for Restriction { + fn into(self) -> rspack_resolver::Restriction { match (self.path, self.regex) { (None, None) => { panic!("Should specify path or regex") } - (None, Some(regex)) => oxc_resolver::Restriction::RegExp(regex), - (Some(path), None) => oxc_resolver::Restriction::Path(PathBuf::from(path)), + (None, Some(regex)) => { + let re = Regex::new(®ex).unwrap(); + + rspack_resolver::Restriction::Fn(Arc::new(move |path| { + re.is_match(path.to_str().unwrap_or_default()) + })) + } + (Some(path), None) => rspack_resolver::Restriction::Path(PathBuf::from(path)), (Some(_), Some(_)) => { panic!("Restriction can't be path and regex at the same time") } @@ -218,31 +231,31 @@ impl Into for Restriction { } } -impl Into for EnforceExtension { - fn into(self) -> oxc_resolver::EnforceExtension { +impl Into for EnforceExtension { + fn into(self) -> rspack_resolver::EnforceExtension { match self { - EnforceExtension::Auto => oxc_resolver::EnforceExtension::Auto, - EnforceExtension::Enabled => oxc_resolver::EnforceExtension::Enabled, - EnforceExtension::Disabled => oxc_resolver::EnforceExtension::Disabled, + EnforceExtension::Auto => rspack_resolver::EnforceExtension::Auto, + EnforceExtension::Enabled => rspack_resolver::EnforceExtension::Enabled, + EnforceExtension::Disabled => rspack_resolver::EnforceExtension::Disabled, } } } -impl Into for TsconfigOptions { - fn into(self) -> oxc_resolver::TsconfigOptions { - oxc_resolver::TsconfigOptions { +impl Into for TsconfigOptions { + fn into(self) -> rspack_resolver::TsconfigOptions { + rspack_resolver::TsconfigOptions { config_file: PathBuf::from(self.config_file), references: match self.references { Some(Either::A(string)) if string.as_str() == "auto" => { - oxc_resolver::TsconfigReferences::Auto + rspack_resolver::TsconfigReferences::Auto } Some(Either::A(opt)) => { panic!("`{}` is not a valid option for tsconfig references", opt) } - Some(Either::B(paths)) => oxc_resolver::TsconfigReferences::Paths( + Some(Either::B(paths)) => rspack_resolver::TsconfigReferences::Paths( paths.into_iter().map(PathBuf::from).collect::>(), ), - None => oxc_resolver::TsconfigReferences::Disabled, + None => rspack_resolver::TsconfigReferences::Disabled, }, } } diff --git a/npm/package.json b/npm/package.json index 8d63b06d..5b93a42a 100644 --- a/npm/package.json +++ b/npm/package.json @@ -1,7 +1,7 @@ { - "name": "oxc-resolver", + "name": "@rspack/resolver", "version": "1.12.0", - "description": "Oxc Resolver Node API", + "description": "Rspack Resolver Node API", "main": "index.js", "browser": "browser.js", "files": [ @@ -10,10 +10,10 @@ "browser.js" ], "license": "MIT", - "homepage": "https://oxc.rs", + "homepage": "https://github.com/web-infra-dev/rspack-resolver", "repository": { "type": "git", - "url": "git+https://github.com/oxc-project/oxc-resolver.git" + "url": "git+https://github.com/web-infra-dev/rspack-resolver.git" }, "publishConfig": { "registry": "https://registry.npmjs.org/", @@ -21,27 +21,24 @@ }, "napi": { "binaryName": "resolver", - "packageName": "@oxc-resolver/binding", + "packageName": "@rspack/resolver-binding", "wasm": { "browser": { "fs": true } }, "targets": [ - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", - "armv7-unknown-linux-gnueabihf", + "aarch64-pc-windows-msvc", + "x86_64-pc-windows-msvc", + "i686-pc-windows-msvc", "x86_64-apple-darwin", - "aarch64-apple-darwin", - "wasm32-wasip1-threads" + "aarch64-apple-darwin" ] }, - "funding": { - "url": "https://github.com/sponsors/Boshen" + "optionalDependencies": { } } diff --git a/package.json b/package.json index cd4d6693..290594b2 100644 --- a/package.json +++ b/package.json @@ -1,20 +1,27 @@ { - "name": "@oxc-resolver/binding", + "name": "@rspack/resolver", "private": true, "version": "0.0.0", "scripts": { "build": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:binding:release": "napi build --platform --release --package-json-path npm/package.json --manifest-path napi/Cargo.toml", + "build:binding:profiling": "napi build --platform --profile profiling --package-json-path npm/package.json --manifest-path napi/Cargo.toml", "build:debug": "napi build --platform --package-json-path npm/package.json --manifest-path napi/Cargo.toml", - "prepublishOnly": "napi pre-publish -t npm", + "prepublishOnly": "napi pre-publish -t npm --package-json-path npm/package.json --npm-dir bindings", "test": "ava" }, "devDependencies": { + "@actions/core": "^1.11.1", + "@continuous-auth/client": "^2.3.2", "@napi-rs/cli": "3.0.0-alpha.62", "@napi-rs/wasm-runtime": "^0.2.4", "@types/node": "^22.0.0", "ava": "^6.1.3", + "commander": "^13.1.0", "emnapi": "^1.2.0", - "typescript": "^5.5.3" + "semver": "^7.7.1", + "typescript": "^5.5.3", + "zx": "^8.5.2" }, "ava": { "files": [ @@ -26,8 +33,5 @@ "repository": { "type": "git", "url": "git+https://github.com/oxc-project/oxc-resolver.git" - }, - "funding": { - "url": "https://github.com/sponsors/Boshen" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6cd02948..3e47a282 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,15 @@ importers: .: devDependencies: + '@actions/core': + specifier: ^1.11.1 + version: 1.11.1 + '@continuous-auth/client': + specifier: ^2.3.2 + version: 2.3.2 '@napi-rs/cli': specifier: 3.0.0-alpha.62 - version: 3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0) + version: 3.0.0-alpha.62(@emnapi/runtime@1.4.0)(emnapi@1.2.0) '@napi-rs/wasm-runtime': specifier: ^0.2.4 version: 0.2.4 @@ -20,12 +26,39 @@ importers: ava: specifier: ^6.1.3 version: 6.1.3 + commander: + specifier: ^13.1.0 + version: 13.1.0 emnapi: specifier: ^1.2.0 version: 1.2.0 + semver: + specifier: ^7.7.1 + version: 7.7.1 typescript: specifier: ^5.5.3 version: 5.6.2 + zx: + specifier: ^8.5.2 + version: 8.5.2 + + bindings/darwin-arm64: {} + + bindings/darwin-x64: {} + + bindings/linux-arm64-gnu: {} + + bindings/linux-arm64-musl: {} + + bindings/linux-x64-gnu: {} + + bindings/linux-x64-musl: {} + + bindings/win32-arm64-msvc: {} + + bindings/win32-ia32-msvc: {} + + bindings/win32-x64-msvc: {} fixtures/pnpm: devDependencies: @@ -46,7 +79,7 @@ importers: version: 8.4.33 styled-components: specifier: 6.1.1 - version: 6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 6.1.1(react-dom@19.1.0(react@18.3.1))(react@18.3.1) fixtures/pnpm-workspace: dependencies: @@ -55,7 +88,7 @@ importers: version: 5.17.1 oxc-resolver: specifier: latest - version: 1.12.0 + version: 5.2.0 fixtures/pnpm-workspace/packages/app: dependencies: @@ -73,28 +106,53 @@ importers: packages: - '@babel/runtime@7.25.7': - resolution: {integrity: sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==} + '@actions/core@1.11.1': + resolution: {integrity: sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==} + + '@actions/exec@1.1.1': + resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==} + + '@actions/http-client@2.2.3': + resolution: {integrity: sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==} + + '@actions/io@1.1.3': + resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==} + + '@babel/runtime@7.27.0': + resolution: {integrity: sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==} engines: {node: '>=6.9.0'} + '@continuous-auth/client@2.3.2': + resolution: {integrity: sha512-/QG87OYqFbNkM7fxEf53QN6KKvXQF4SyBp4eQk4uCM2O24dNj2fBfEUNS2NYgEoGCtu9YHGn3dcCLrgNAcBaGw==} + '@emnapi/core@1.2.0': resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} + '@emnapi/core@1.4.0': + resolution: {integrity: sha512-H+N/FqT07NmLmt6OFFtDfwe8PNygprzBikrEMyQfgqSmT0vzE515Pz7R8izwB9q/zsH/MA64AKoul3sA6/CzVg==} + '@emnapi/runtime@1.2.0': resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} + '@emnapi/runtime@1.4.0': + resolution: {integrity: sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==} + '@emnapi/wasi-threads@1.0.1': resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} - '@emotion/is-prop-valid@1.2.2': - resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} + '@emotion/is-prop-valid@1.3.1': + resolution: {integrity: sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==} - '@emotion/memoize@0.8.1': - resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} + '@emotion/memoize@0.9.0': + resolution: {integrity: sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==} '@emotion/unitless@0.8.1': resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} + '@fastify/busboy@2.1.1': + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + engines: {node: '>=14'} + '@inquirer/checkbox@2.3.10': resolution: {integrity: sha512-CTc864M2/523rKc9AglIzAcUCuPXDZENgc5S2KZFVRbnMzpXcYTsUWmbqSeL0XLvtlvEtNevkkVbfVhJpruOyQ==} engines: {node: '>=18'} @@ -364,6 +422,9 @@ packages: '@napi-rs/wasm-runtime@0.2.4': resolution: {integrity: sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ==} + '@napi-rs/wasm-runtime@0.2.8': + resolution: {integrity: sha512-OBlgKdX7gin7OIq4fadsjpg+cp2ZphvAIKucHsNfTdJiqdOmOEwQd/bHi0VwNrcw5xpBJyUw6cK/QilCqy1BSg==} + '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': resolution: {integrity: sha512-/b+UU3suXjW4P0DzHRNdrnebQtFKcQf/YMeZJH+xUlKgvwli5kbmWjx8Wqqz0VETVkUTuPqJMBDIVLyc+14FGw==} engines: {node: '>= 10'} @@ -509,58 +570,68 @@ packages: '@octokit/types@13.5.0': resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - '@oxc-resolver/binding-darwin-arm64@1.12.0': - resolution: {integrity: sha512-wYe+dlF8npM7cwopOOxbdNjtmJp17e/xF5c0K2WooQXy5VOh74icydM33+Uh/SZDgwyum09/U1FVCX5GdeQk+A==} + '@oxc-resolver/binding-darwin-arm64@5.2.0': + resolution: {integrity: sha512-3v2eS1swAUZ/OPrBpTB5Imn4Xhbz4zKPa/mugnYCAC4pVt/miBQLBNciBRZG8oyHiGmLtjw/qanZC36uB6MITQ==} cpu: [arm64] os: [darwin] - '@oxc-resolver/binding-darwin-x64@1.12.0': - resolution: {integrity: sha512-FZxxp99om+SlvBr1cjzF8A3TjYcS0BInCqjUlM+2f9m9bPTR2Bng9Zq5Q09ZQyrKJjfGKqlOEHs3akuVOnrx3Q==} + '@oxc-resolver/binding-darwin-x64@5.2.0': + resolution: {integrity: sha512-6uhnlZU+CBULQAjcwQ4nerA76xDEvPFtHpTzXhEoitr4a3Ks5H92X4uuLT0C0FW3RfhIVL8Lpp9pLYHN3oAvug==} cpu: [x64] os: [darwin] - '@oxc-resolver/binding-freebsd-x64@1.12.0': - resolution: {integrity: sha512-BZi0iU6IEOnXGSkqt1OjTTkN9wfyaK6kTpQwL/axl8eCcNDc7wbv1vloHgILf7ozAY1TP75nsLYlASYI4B5kGA==} + '@oxc-resolver/binding-freebsd-x64@5.2.0': + resolution: {integrity: sha512-6TCXw/rPnhBLlS/Rg7QHO9lBjwJSbUJMhd9POpVpQEK1S9viEAl8JPdxXuNCEDPJHSmpMrGt6+DTjQxQ5J1kpQ==} cpu: [x64] os: [freebsd] - '@oxc-resolver/binding-linux-arm-gnueabihf@1.12.0': - resolution: {integrity: sha512-L2qnMEnZAqxbG9b1J3di/w/THIm+1fMVfbbTMWIQNMMXdMeqqDN6ojnOLDtuP564rAh4TBFPdLyEfGhMz6ipNA==} + '@oxc-resolver/binding-linux-arm-gnueabihf@5.2.0': + resolution: {integrity: sha512-egjFYBKixAjekmiImCYkpwSo0bnZJOieJIc6cXePuCih2R5nFjkS1F8tSlJ18GdRZ1MmYveM6THmIHJCpnDqaQ==} cpu: [arm] os: [linux] - '@oxc-resolver/binding-linux-arm64-gnu@1.12.0': - resolution: {integrity: sha512-otVbS4zeo3n71zgGLBYRTriDzc0zpruC0WI3ICwjpIk454cLwGV0yzh4jlGYWQJYJk0BRAmXFd3ooKIF+bKBHw==} + '@oxc-resolver/binding-linux-arm64-gnu@5.2.0': + resolution: {integrity: sha512-Cizb3uHnEc2MYZeRnp+BxmDyAKo7szJxbTW4BgPvs+XicYZI0kc/qcZlHRoJImalBqvve+ZObasRqCS1zqub9A==} cpu: [arm64] os: [linux] - '@oxc-resolver/binding-linux-arm64-musl@1.12.0': - resolution: {integrity: sha512-IStQDjIT7Lzmqg1i9wXvPL/NsYsxF24WqaQFS8b8rxra+z0VG7saBOsEnOaa4jcEY8MVpLYabFhTV+fSsA2vnA==} + '@oxc-resolver/binding-linux-arm64-musl@5.2.0': + resolution: {integrity: sha512-rDiRuIvQXa9MI8oiEbCVnU7dBVDuo74456dN3Bf30/Joz6FVBhYrhoOTxtxH+WgC38qCUWWuBjhFaLRLDLaMRw==} cpu: [arm64] os: [linux] - '@oxc-resolver/binding-linux-x64-gnu@1.12.0': - resolution: {integrity: sha512-SipT7EVORz8pOQSFwemOm91TpSiBAGmOjG830/o+aLEsvQ4pEy223+SAnCfITh7+AahldYsJnVoIs519jmIlKQ==} + '@oxc-resolver/binding-linux-riscv64-gnu@5.2.0': + resolution: {integrity: sha512-QRdE2DOO9e4oYzYyf/iRnLiomvs3bRedRTvFHbTAcL0JJfsicLLK4T7J5BP76sVum0QUAVJm+JqgEUmk8ETGXw==} + cpu: [riscv64] + os: [linux] + + '@oxc-resolver/binding-linux-s390x-gnu@5.2.0': + resolution: {integrity: sha512-bD8HDjnEziw1+Y7uowIRI9JaJd6vldLoVXOZaSeBRjofWk8rQOOyxfNTVymIrcmPE8rZZJfkDdGyCnTJP0h9vA==} + cpu: [s390x] + os: [linux] + + '@oxc-resolver/binding-linux-x64-gnu@5.2.0': + resolution: {integrity: sha512-eWEHGjkrk4Dsul7Wyt6X9UMxZ+e2zKgpRG2kbSZOQQTXf6ZnU9+lRAyAgf2X1qdLjmH0GT54wIak7fhSsuNWLA==} cpu: [x64] os: [linux] - '@oxc-resolver/binding-linux-x64-musl@1.12.0': - resolution: {integrity: sha512-mGh0XfUzKdn+WFaqPacziNraCWL5znkHRfQVxG9avGS9zb2KC/N1EBbPzFqutDwixGDP54r2gx4q54YCJEZ4iQ==} + '@oxc-resolver/binding-linux-x64-musl@5.2.0': + resolution: {integrity: sha512-iojrjytDOdg4aWm25ak7qpTQwWj+D7O+duHBL2rQhDxIY1K4eysJwobWck0yzJ6VlONaQF6RLt+YeDpGoKV+ww==} cpu: [x64] os: [linux] - '@oxc-resolver/binding-wasm32-wasi@1.12.0': - resolution: {integrity: sha512-SZN6v7apKmQf/Vwiqb6e/s3Y2Oacw8uW8V2i1AlxtyaEFvnFE0UBn89zq6swEwE3OCajNWs0yPvgAXUMddYc7Q==} + '@oxc-resolver/binding-wasm32-wasi@5.2.0': + resolution: {integrity: sha512-Lgv3HjKUXRa/xMCgBAkwKQcPljAn5IRicjgoPBXGUhghzK/9yF2DTf7aXdVPvRxFKjvcyWtzpzPV2pzYCuBaBA==} engines: {node: '>=14.0.0'} cpu: [wasm32] - '@oxc-resolver/binding-win32-arm64-msvc@1.12.0': - resolution: {integrity: sha512-GRe4bqCfFsyghruEn5bv47s9w3EWBdO2q72xCz5kpQ0LWbw+enPHtTjw3qX5PUcFYpKykM55FaO0hFDs1yzatw==} + '@oxc-resolver/binding-win32-arm64-msvc@5.2.0': + resolution: {integrity: sha512-VK5yEOdGbIrb89gUtVIw2IVP4r0rEhiwVLQOD37vZhvrt5iY0FHOTtMz9ZsWI0anZ0swt26U2wRcJYT0/AsBfw==} cpu: [arm64] os: [win32] - '@oxc-resolver/binding-win32-x64-msvc@1.12.0': - resolution: {integrity: sha512-Z3llHH0jfJP4mlWq3DT7bK6qV+/vYe0+xzCgfc67+Tc/U3eYndujl880bexeGdGNPh87JeYznpZAOJ44N7QVVQ==} + '@oxc-resolver/binding-win32-x64-msvc@5.2.0': + resolution: {integrity: sha512-BhIcyjr/gTafUrdOhd1EC5H4LeUSKK9uQIG2RSyMMH0Cq1yBacTb1yvLowhP/6e4ncCGByXEkW7sWGowCfSY8A==} cpu: [x64] os: [win32] @@ -584,8 +655,8 @@ packages: '@types/node@22.7.4': resolution: {integrity: sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==} - '@types/stylis@4.2.6': - resolution: {integrity: sha512-4nebF2ZJGzQk0ka0O6+FZUWceyFv4vWq/0dXBMmrSeAwzOuOd/GxE5Pa64d/ndeNLG73dXoBsRzvtsVsYUv6Uw==} + '@types/stylis@4.2.7': + resolution: {integrity: sha512-VgDNokpBoKF+wrdvhAAfS55OMQpL6QRglwTwNC3kIgBrzZxA4WsFj+2eLfEA/uMUDzBcEhYmjSbwQakn/i3ajA==} '@types/wrap-ansi@3.0.0': resolution: {integrity: sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==} @@ -681,6 +752,9 @@ packages: axios@1.6.2: resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} + axios@1.8.4: + resolution: {integrity: sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -700,6 +774,10 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + callsites@4.2.0: resolution: {integrity: sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==} engines: {node: '>=12.20'} @@ -775,11 +853,15 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} + commander@13.1.0: + resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} + engines: {node: '>=18'} + common-path-prefix@3.0.0: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} - complex.js@2.3.0: - resolution: {integrity: sha512-wWHzifVdUPbPBhh+ObvpVGIzrAQjTvmnnEJKBfLW5YbyAB6OXQ0r+Q92fByMIrSSlxUuCujqxriJSR6R/kVxPA==} + complex.js@2.4.2: + resolution: {integrity: sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==} concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -836,6 +918,10 @@ packages: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + emittery@1.0.3: resolution: {integrity: sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==} engines: {node: '>=14.16'} @@ -858,6 +944,22 @@ packages: resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} engines: {node: '>=10.13.0'} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} @@ -914,8 +1016,8 @@ packages: resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} engines: {node: '>=18'} - follow-redirects@1.15.6: - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + follow-redirects@1.15.9: + resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -923,8 +1025,8 @@ packages: debug: optional: true - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + form-data@4.0.2: + resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} engines: {node: '>= 6'} fraction.js@4.3.7: @@ -937,6 +1039,9 @@ packages: fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} engines: {node: '>=10'} @@ -950,6 +1055,14 @@ packages: resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} engines: {node: '>=18'} + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -962,12 +1075,28 @@ packages: resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} engines: {node: '>=18'} + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + has-unicode@2.0.1: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -1082,6 +1211,10 @@ packages: resolution: {integrity: sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + mathjs@13.2.0: resolution: {integrity: sha512-P5PZoiUX2Tkghkv3tsSqlK0B9My/ErKapv1j6wdxd0MOrYQ30cnGE4LH/kzYB2gA5rN46Njqc4cFgJjaxgijoQ==} engines: {node: '>= 18'} @@ -1145,8 +1278,8 @@ packages: resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - nanoid@3.3.7: - resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -1187,8 +1320,8 @@ packages: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} - oxc-resolver@1.12.0: - resolution: {integrity: sha512-YlaCIArvWNKCWZFRrMjhh2l5jK80eXnpYP+bhRc1J/7cW3TiyEY0ngJo73o/5n8hA3+4yLdTmXLNTQ3Ncz50LQ==} + oxc-resolver@5.2.0: + resolution: {integrity: sha512-ce0rdG5Y0s1jhcvh2Zc6sD+fTw/WA4pUKWrPmjbniZjC/m6pPob2I2Pkz8T0YzdWsbAC98E00Bc7KNB1B6Tolg==} p-map@7.0.2: resolution: {integrity: sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==} @@ -1210,8 +1343,8 @@ packages: resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==} engines: {node: '>=12'} - picocolors@1.0.1: - resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -1242,10 +1375,10 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} + react-dom@19.1.0: + resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==} peerDependencies: - react: ^18.3.1 + react: ^19.1.0 react@18.3.1: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} @@ -1295,8 +1428,8 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} + scheduler@0.26.0: + resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==} seedrandom@3.0.5: resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} @@ -1305,8 +1438,8 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + semver@7.7.1: + resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} engines: {node: '>=10'} hasBin: true @@ -1335,8 +1468,8 @@ packages: resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} engines: {node: '>=12'} - source-map-js@1.2.0: - resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} sprintf-js@1.0.3: @@ -1372,8 +1505,8 @@ packages: react: '>= 16.8.0' react-dom: '>= 16.8.0' - stylis@4.3.2: - resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} + stylis@4.3.6: + resolution: {integrity: sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==} supertap@3.0.1: resolution: {integrity: sha512-u1ZpIBCawJnO+0QePsEiOknOfCRq0yERxiAchT0i4li0WHNUJbf0evXXSXOcCAR4M8iMDoajXYmstm/qO81Isw==} @@ -1415,6 +1548,10 @@ packages: tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + tunnel@0.0.6: + resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} + engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} + typanion@3.14.0: resolution: {integrity: sha512-ZW/lVMRabETuYCd9O9ZvMhAh8GslSqaUjxmK/JLPCh6l73CvLBiuXswj/+7LdnWOgYsQ130FqLzFz5aGT4I3Ug==} @@ -1438,6 +1575,10 @@ packages: undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici@5.29.0: + resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} + engines: {node: '>=14.0'} + unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} @@ -1498,33 +1639,73 @@ packages: resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} engines: {node: '>=18'} + zx@8.5.2: + resolution: {integrity: sha512-eIxjTkCtlzvDNRhw3RD1gGBPA4nxOTn6PafpKl+MW4eE2jR/u/R6mqq7oyUCXwarM5DSP96kWtq6XkrL2kSFrg==} + engines: {node: '>= 12.17.0'} + hasBin: true + snapshots: - '@babel/runtime@7.25.7': + '@actions/core@1.11.1': + dependencies: + '@actions/exec': 1.1.1 + '@actions/http-client': 2.2.3 + + '@actions/exec@1.1.1': + dependencies: + '@actions/io': 1.1.3 + + '@actions/http-client@2.2.3': + dependencies: + tunnel: 0.0.6 + undici: 5.29.0 + + '@actions/io@1.1.3': {} + + '@babel/runtime@7.27.0': dependencies: regenerator-runtime: 0.14.1 + '@continuous-auth/client@2.3.2': + dependencies: + axios: 1.8.4 + transitivePeerDependencies: + - debug + '@emnapi/core@1.2.0': dependencies: '@emnapi/wasi-threads': 1.0.1 tslib: 2.6.3 + '@emnapi/core@1.4.0': + dependencies: + '@emnapi/wasi-threads': 1.0.1 + tslib: 2.6.3 + optional: true + '@emnapi/runtime@1.2.0': dependencies: tslib: 2.6.3 + '@emnapi/runtime@1.4.0': + dependencies: + tslib: 2.6.3 + optional: true + '@emnapi/wasi-threads@1.0.1': dependencies: tslib: 2.6.3 - '@emotion/is-prop-valid@1.2.2': + '@emotion/is-prop-valid@1.3.1': dependencies: - '@emotion/memoize': 0.8.1 + '@emotion/memoize': 0.9.0 - '@emotion/memoize@0.8.1': {} + '@emotion/memoize@0.9.0': {} '@emotion/unitless@0.8.1': {} + '@fastify/busboy@2.1.1': {} + '@inquirer/checkbox@2.3.10': dependencies: '@inquirer/core': 9.0.2 @@ -1623,13 +1804,13 @@ snapshots: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.6.2 + semver: 7.7.1 tar: 6.2.1 transitivePeerDependencies: - encoding - supports-color - '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.2.0)(emnapi@1.2.0)': + '@napi-rs/cli@3.0.0-alpha.62(@emnapi/runtime@1.4.0)(emnapi@1.2.0)': dependencies: '@napi-rs/cross-toolchain': 0.0.16 '@napi-rs/wasm-tools': 0.0.2 @@ -1640,12 +1821,12 @@ snapshots: inquirer: 10.0.1 js-yaml: 4.1.0 lodash-es: 4.17.21 - semver: 7.6.2 + semver: 7.7.1 toml: 3.0.0 typanion: 3.14.0 wasm-sjlj: 1.0.5 optionalDependencies: - '@emnapi/runtime': 1.2.0 + '@emnapi/runtime': 1.4.0 emnapi: 1.2.0 transitivePeerDependencies: - '@napi-rs/cross-toolchain-arm64-target-aarch64' @@ -1792,6 +1973,13 @@ snapshots: '@emnapi/runtime': 1.2.0 '@tybys/wasm-util': 0.9.0 + '@napi-rs/wasm-runtime@0.2.8': + dependencies: + '@emnapi/core': 1.4.0 + '@emnapi/runtime': 1.4.0 + '@tybys/wasm-util': 0.9.0 + optional: true + '@napi-rs/wasm-tools-android-arm-eabi@0.0.2': optional: true @@ -1922,39 +2110,45 @@ snapshots: dependencies: '@octokit/openapi-types': 22.2.0 - '@oxc-resolver/binding-darwin-arm64@1.12.0': + '@oxc-resolver/binding-darwin-arm64@5.2.0': + optional: true + + '@oxc-resolver/binding-darwin-x64@5.2.0': optional: true - '@oxc-resolver/binding-darwin-x64@1.12.0': + '@oxc-resolver/binding-freebsd-x64@5.2.0': optional: true - '@oxc-resolver/binding-freebsd-x64@1.12.0': + '@oxc-resolver/binding-linux-arm-gnueabihf@5.2.0': optional: true - '@oxc-resolver/binding-linux-arm-gnueabihf@1.12.0': + '@oxc-resolver/binding-linux-arm64-gnu@5.2.0': optional: true - '@oxc-resolver/binding-linux-arm64-gnu@1.12.0': + '@oxc-resolver/binding-linux-arm64-musl@5.2.0': optional: true - '@oxc-resolver/binding-linux-arm64-musl@1.12.0': + '@oxc-resolver/binding-linux-riscv64-gnu@5.2.0': optional: true - '@oxc-resolver/binding-linux-x64-gnu@1.12.0': + '@oxc-resolver/binding-linux-s390x-gnu@5.2.0': optional: true - '@oxc-resolver/binding-linux-x64-musl@1.12.0': + '@oxc-resolver/binding-linux-x64-gnu@5.2.0': optional: true - '@oxc-resolver/binding-wasm32-wasi@1.12.0': + '@oxc-resolver/binding-linux-x64-musl@5.2.0': + optional: true + + '@oxc-resolver/binding-wasm32-wasi@5.2.0': dependencies: - '@napi-rs/wasm-runtime': 0.2.4 + '@napi-rs/wasm-runtime': 0.2.8 optional: true - '@oxc-resolver/binding-win32-arm64-msvc@1.12.0': + '@oxc-resolver/binding-win32-arm64-msvc@5.2.0': optional: true - '@oxc-resolver/binding-win32-x64-msvc@1.12.0': + '@oxc-resolver/binding-win32-x64-msvc@5.2.0': optional: true '@rollup/pluginutils@4.2.1': @@ -1980,7 +2174,7 @@ snapshots: dependencies: undici-types: 6.19.8 - '@types/stylis@4.2.6': {} + '@types/stylis@4.2.7': {} '@types/wrap-ansi@3.0.0': {} @@ -2105,8 +2299,16 @@ snapshots: axios@1.6.2: dependencies: - follow-redirects: 1.15.6 - form-data: 4.0.0 + follow-redirects: 1.15.9 + form-data: 4.0.2 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + + axios@1.8.4: + dependencies: + follow-redirects: 1.15.9 + form-data: 4.0.2 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug @@ -2130,6 +2332,11 @@ snapshots: dependencies: fill-range: 7.1.1 + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + callsites@4.2.0: {} camelize@1.0.1: {} @@ -2187,9 +2394,11 @@ snapshots: dependencies: delayed-stream: 1.0.0 + commander@13.1.0: {} + common-path-prefix@3.0.0: {} - complex.js@2.3.0: {} + complex.js@2.4.2: {} concat-map@0.0.1: {} @@ -2201,7 +2410,7 @@ snapshots: js-string-escape: 1.0.1 lodash: 4.17.21 md5-hex: 3.0.1 - semver: 7.6.2 + semver: 7.7.1 well-known-symbols: 2.0.0 console-control-strings@1.1.0: {} @@ -2238,6 +2447,12 @@ snapshots: detect-libc@2.0.3: {} + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + emittery@1.0.3: {} emnapi@1.2.0: {} @@ -2251,6 +2466,21 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.2.1 + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + escalade@3.1.2: {} escape-latex@1.2.0: {} @@ -2297,12 +2527,13 @@ snapshots: find-up-simple@1.0.0: {} - follow-redirects@1.15.6: {} + follow-redirects@1.15.9: {} - form-data@4.0.0: + form-data@4.0.2: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 mime-types: 2.1.35 fraction.js@4.3.7: {} @@ -2313,6 +2544,8 @@ snapshots: fs.realpath@1.0.0: {} + function-bind@1.1.2: {} + gauge@3.0.2: dependencies: aproba: 2.0.0 @@ -2329,6 +2562,24 @@ snapshots: get-east-asian-width@1.2.0: {} + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -2351,10 +2602,22 @@ snapshots: slash: 5.1.0 unicorn-magic: 0.1.0 + gopd@1.2.0: {} + graceful-fs@4.2.11: {} + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + has-unicode@2.0.1: {} + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 @@ -2446,10 +2709,12 @@ snapshots: dependencies: escape-string-regexp: 5.0.0 + math-intrinsics@1.1.0: {} + mathjs@13.2.0: dependencies: - '@babel/runtime': 7.25.7 - complex.js: 2.3.0 + '@babel/runtime': 7.27.0 + complex.js: 2.4.2 decimal.js: 10.4.3 escape-latex: 1.2.0 fraction.js: 4.3.7 @@ -2504,7 +2769,7 @@ snapshots: mute-stream@1.0.0: {} - nanoid@3.3.7: {} + nanoid@3.3.11: {} node-fetch@2.7.0: dependencies: @@ -2533,19 +2798,21 @@ snapshots: os-tmpdir@1.0.2: {} - oxc-resolver@1.12.0: + oxc-resolver@5.2.0: optionalDependencies: - '@oxc-resolver/binding-darwin-arm64': 1.12.0 - '@oxc-resolver/binding-darwin-x64': 1.12.0 - '@oxc-resolver/binding-freebsd-x64': 1.12.0 - '@oxc-resolver/binding-linux-arm-gnueabihf': 1.12.0 - '@oxc-resolver/binding-linux-arm64-gnu': 1.12.0 - '@oxc-resolver/binding-linux-arm64-musl': 1.12.0 - '@oxc-resolver/binding-linux-x64-gnu': 1.12.0 - '@oxc-resolver/binding-linux-x64-musl': 1.12.0 - '@oxc-resolver/binding-wasm32-wasi': 1.12.0 - '@oxc-resolver/binding-win32-arm64-msvc': 1.12.0 - '@oxc-resolver/binding-win32-x64-msvc': 1.12.0 + '@oxc-resolver/binding-darwin-arm64': 5.2.0 + '@oxc-resolver/binding-darwin-x64': 5.2.0 + '@oxc-resolver/binding-freebsd-x64': 5.2.0 + '@oxc-resolver/binding-linux-arm-gnueabihf': 5.2.0 + '@oxc-resolver/binding-linux-arm64-gnu': 5.2.0 + '@oxc-resolver/binding-linux-arm64-musl': 5.2.0 + '@oxc-resolver/binding-linux-riscv64-gnu': 5.2.0 + '@oxc-resolver/binding-linux-s390x-gnu': 5.2.0 + '@oxc-resolver/binding-linux-x64-gnu': 5.2.0 + '@oxc-resolver/binding-linux-x64-musl': 5.2.0 + '@oxc-resolver/binding-wasm32-wasi': 5.2.0 + '@oxc-resolver/binding-win32-arm64-msvc': 5.2.0 + '@oxc-resolver/binding-win32-x64-msvc': 5.2.0 p-map@7.0.2: {} @@ -2560,7 +2827,7 @@ snapshots: path-type@5.0.0: {} - picocolors@1.0.1: {} + picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -2574,9 +2841,9 @@ snapshots: postcss@8.4.33: dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 pretty-ms@9.0.0: dependencies: @@ -2586,11 +2853,10 @@ snapshots: queue-microtask@1.2.3: {} - react-dom@18.3.1(react@18.3.1): + react-dom@19.1.0(react@18.3.1): dependencies: - loose-envify: 1.4.0 react: 18.3.1 - scheduler: 0.23.2 + scheduler: 0.26.0 react@18.3.1: dependencies: @@ -2632,15 +2898,13 @@ snapshots: safer-buffer@2.1.2: {} - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 + scheduler@0.26.0: {} seedrandom@3.0.5: {} semver@6.3.1: {} - semver@7.6.2: {} + semver@7.7.1: {} serialize-error@7.0.1: dependencies: @@ -2661,7 +2925,7 @@ snapshots: ansi-styles: 6.2.1 is-fullwidth-code-point: 4.0.0 - source-map-js@1.2.0: {} + source-map-js@1.2.1: {} sprintf-js@1.0.3: {} @@ -2693,21 +2957,21 @@ snapshots: dependencies: ansi-regex: 6.0.1 - styled-components@6.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + styled-components@6.1.1(react-dom@19.1.0(react@18.3.1))(react@18.3.1): dependencies: - '@emotion/is-prop-valid': 1.2.2 + '@emotion/is-prop-valid': 1.3.1 '@emotion/unitless': 0.8.1 - '@types/stylis': 4.2.6 + '@types/stylis': 4.2.7 css-to-react-native: 3.2.0 csstype: 3.1.3 postcss: 8.4.33 react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) + react-dom: 19.1.0(react@18.3.1) shallowequal: 1.1.0 - stylis: 4.3.2 + stylis: 4.3.6 tslib: 2.6.3 - stylis@4.3.2: {} + stylis@4.3.6: {} supertap@3.0.1: dependencies: @@ -2747,6 +3011,8 @@ snapshots: tslib@2.6.3: {} + tunnel@0.0.6: {} + typanion@3.14.0: {} type-fest@0.13.1: {} @@ -2759,6 +3025,10 @@ snapshots: undici-types@6.19.8: {} + undici@5.29.0: + dependencies: + '@fastify/busboy': 2.1.1 + unicorn-magic@0.1.0: {} universal-user-agent@7.0.2: {} @@ -2816,3 +3086,5 @@ snapshots: yargs-parser: 21.1.1 yoctocolors-cjs@2.1.2: {} + + zx@8.5.2: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 33cde67d..4ff4a5c6 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,3 +3,4 @@ packages: - 'napi' - 'fixtures/pnpm' - 'fixtures/pnpm-workspace/**' + - 'bindings/**' diff --git a/scripts/publish.mjs b/scripts/publish.mjs new file mode 100644 index 00000000..55b1baeb --- /dev/null +++ b/scripts/publish.mjs @@ -0,0 +1,74 @@ +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; +import * as core from "@actions/core"; +import { getOtp } from "@continuous-auth/client"; + +import { getLastVersion } from "./version.mjs"; + +const __filename = path.resolve(fileURLToPath(import.meta.url)); + +export async function publish_handler(options) { + console.log("options:", options); + const npmrcPath = `${process.env.HOME}/.npmrc`; + const root = process.cwd(); + if (fs.existsSync(npmrcPath)) { + console.info("Found existing .npmrc file"); + } else { + console.info("No .npmrc file found, creating one"); + + fs.writeFileSync( + npmrcPath, + `//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}` + ); + } + + if (options.otp) { + await otpPublish(options); + } else { + await normalPublish(options); + } + + const version = await getLastVersion(root); + core.setOutput("version", version); + core.notice(`Version: ${version}`); + + /** + * @Todo test stable release later + */ + if (options.pushTags) { + console.info("git config user"); + await $`git config --global --add safe.directory /github/workspace`; + await $`git config --global user.name "github-actions[bot]"`; + await $`git config --global user.email "github-actions[bot]@users.noreply.github.com"`; + console.info("git commit all..."); + await $`git status`; + await $`git tag v${version}_npm -m v${version}_npm`; + await $`git push origin --follow-tags`; + } +} + +async function normalPublish(options) { + await $`pnpm publish -r ${options.dryRun ? "--dry-run" : ""} --tag ${ + options.tag + } --no-git-checks --provenance`; +} + +async function otpPublish(options) { + let tries = 4; + + while (tries > 0) { + try { + const otp = await getOtp(); + console.log("opt:", `${otp.slice(0, 2)}****`); + await $`pnpm publish -r ${options.dryRun ? "--dry-run" : ""} --tag ${ + options.tag + } --no-git-checks --provenance --otp ${otp}`; + return; + } catch (e) { + console.error(e); + tries--; + } + } + + throw new Error("Failed to publish with OTP"); +} diff --git a/scripts/version.mjs b/scripts/version.mjs new file mode 100644 index 00000000..5a75665f --- /dev/null +++ b/scripts/version.mjs @@ -0,0 +1,85 @@ +import path from "node:path"; +import semver from "semver"; + +async function getCommitId() { + const result = await $`git rev-parse --short HEAD`; + return result.stdout.replace("\n", ""); +} + +export async function getLastVersion(root) { + const pkgPath = path.resolve(root, "./npm/package.json"); + + try { + // Node >= 20 + const result = await import(pkgPath, { + with: { + type: "json" + } + }); + return result.default.version; + } catch (e) { + // Node < 20 + const result = await import(pkgPath, { + assert: { + type: "json" + } + }); + return result.default.version; + } +} + +export async function version_handler(version, options) { + const allowedVersion = ["major", "minor", "patch"]; + const allowPretags = ["alpha", "beta", "rc"]; + const {pre} = options; + if (!allowedVersion.includes(version)) { + throw new Error( + `version must be one of ${allowedVersion}, but you passed ${version}` + ); + } + + const hasPre = pre && pre !== "none"; + + if (hasPre && !allowPretags.includes(pre)) { + throw new Error( + `pre tag must be one of ${allowPretags}, but you passed ${pre}` + ); + } + const root = process.cwd(); + + const lastVersion = await getLastVersion(root); + let nextVersion; + if (hasPre) { + const existsPreTag = allowPretags.find(i => lastVersion.includes(i)); + if (existsPreTag) { + // has pre tag + if (existsPreTag === pre) { + // same pre tag + nextVersion = semver.inc(lastVersion, "prerelease", pre); + } else { + // different pre tag + nextVersion = `${lastVersion.split(existsPreTag)[0]}${pre}.0`; + } + } else { + nextVersion = semver.inc(lastVersion, `pre${version}`, pre); + } + } else { + nextVersion = semver.inc(lastVersion, version); + } + + let packageFile = path.resolve(root, "./npm/package.json"); + let packageJson = JSON.parse(await fs.readFile(packageFile)); + + let newPackageJson = { + ...packageJson, + version: nextVersion, + } + + await fs.writeFile( + packageFile, + `${JSON.stringify(newPackageJson, null, 2)}\n`, + "utf-8" + ); + + console.log(`Update ${newPackageJson.name}: ${newPackageJson.version}`); +} diff --git a/scripts/x.mjs b/scripts/x.mjs new file mode 100644 index 00000000..24aa060c --- /dev/null +++ b/scripts/x.mjs @@ -0,0 +1,50 @@ +#!/usr/bin/env zx + +import "zx/globals"; + +import { Command } from "commander"; + +import { publish_handler } from "./publish.mjs"; +import { version_handler } from "./version.mjs"; + +process.env.CARGO_TERM_COLOR = "always"; // Assume every terminal that using zx supports color +process.env.FORCE_COLOR = 3; // Fix zx losing color output in subprocesses + +const program = new Command(); + +program + .name("Rspack Resolve Utils CLI") + .description("CLI for development of Rspack Resolve") + .showHelpAfterError(true) + .showSuggestionAfterError(true); + +program + .command("publish") + .requiredOption("--tag ", "publish tag") + .option( + "--dry-run", + "Does everything a publish would do except actually publishing to the registry" + ) + .option("--no-dry-run", "negative dry-run") + .option("--push-tags", "push tags to github") + .option("--no-push-tags", "don't push tags to github") + .option("--otp", "use npm OTP auth") + .description("publish package after version bump") + .action(publish_handler); + +program + .command("version") + .argument("", "bump version to (major|minor|patch)") + .option("--pre ", "pre-release tag") + .description("bump version") + .action(version_handler); + +let argv = process.argv.slice(2); // remove the `node` and script call +if (argv[0] && /x.mjs/.test(argv[0])) { + // Called from `zx x.mjs` + argv = argv.slice(1); +} +program.parse(argv, { from: "user" }); + + + diff --git a/tests/resolve_test.rs b/tests/resolve_test.rs index 84a37b92..d638870d 100644 --- a/tests/resolve_test.rs +++ b/tests/resolve_test.rs @@ -21,12 +21,15 @@ async fn chinese() { async fn styled_components() { let dir = dir(); let path = dir.join("fixtures/pnpm"); - let module_path = dir.join("node_modules/.pnpm/styled-components@6.1.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components"); + let module_path = dir.join("fixtures/pnpm/node_modules/styled-components"); let specifier = "styled-components"; // cjs - let options = - ResolveOptions { alias_fields: vec![vec!["browser".into()]], ..ResolveOptions::default() }; + let options = ResolveOptions { + alias_fields: vec![vec!["browser".into()]], + symlinks: false, + ..ResolveOptions::default() + }; let resolution = Resolver::new(options).resolve(&path, specifier).await; assert_eq!( resolution.map(rspack_resolver::Resolution::into_path_buf), @@ -37,6 +40,7 @@ async fn styled_components() { let options = ResolveOptions { alias_fields: vec![vec!["browser".into()]], main_fields: vec!["module".into()], + symlinks: false, ..ResolveOptions::default() }; let resolution = Resolver::new(options).resolve(&path, specifier).await;