From 10fb645552131d48c99789b346e6c31ed3a969cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 30 Sep 2022 16:57:15 +0900 Subject: [PATCH] chore(ci): Merge CI scripts (#5999) **Description:** This PR merges CI scripts, and make integration tests use patched crates. **Related issue:** - Closes https://github.com/swc-project/swc/issues/5540. --- .github/workflows/{cargo.yml => CI.yml} | 286 ++++++++++++++++-- .github/workflows/cancel.yml | 2 +- .github/workflows/cargo-lints.yml | 53 ---- .github/workflows/crev.yml | 39 --- .github/workflows/docs.yml | 42 --- .github/workflows/integration.yml | 149 --------- .github/workflows/wasm.yml | 54 ---- Cargo.lock | 8 +- Cargo.toml | 3 - bindings/Cargo.toml | 4 - bindings/binding_core_node/Cargo.toml | 4 +- bindings/binding_core_wasm/Cargo.toml | 2 +- bindings/swc_cli/Cargo.toml | 4 +- crates/dbg-swc/Cargo.toml | 2 +- crates/jsdoc/Cargo.toml | 2 +- crates/preset_env_base/Cargo.toml | 2 +- crates/string_enum/Cargo.toml | 2 +- crates/swc/Cargo.toml | 2 +- crates/swc_atoms/Cargo.toml | 2 +- crates/swc_cached/Cargo.toml | 2 +- crates/swc_common/Cargo.toml | 2 +- crates/swc_config/Cargo.toml | 2 +- crates/swc_css_ast/Cargo.toml | 2 +- crates/swc_css_codegen/Cargo.toml | 2 +- crates/swc_css_lints/Cargo.toml | 2 +- crates/swc_css_minifier/Cargo.toml | 2 +- crates/swc_css_parser/Cargo.toml | 2 +- crates/swc_css_prefixer/Cargo.toml | 2 +- crates/swc_css_utils/Cargo.toml | 2 +- crates/swc_css_visit/Cargo.toml | 2 +- crates/swc_ecma_ast/Cargo.toml | 2 +- crates/swc_ecma_codegen/Cargo.toml | 2 +- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_loader/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 2 +- .../src/compress/util/mod.rs | 14 +- crates/swc_ecma_minifier/src/util/size.rs | 2 +- crates/swc_ecma_parser/Cargo.toml | 2 +- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 2 +- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- .../swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- .../swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_visit/Cargo.toml | 2 +- crates/swc_estree_ast/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_html_ast/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_html_parser/Cargo.toml | 2 +- crates/swc_html_utils/Cargo.toml | 2 +- crates/swc_html_visit/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- crates/swc_nodejs_common/Cargo.toml | 2 +- crates/swc_plugin_runner/Cargo.toml | 2 +- .../fixture/swc_internal_plugin/Cargo.toml | 2 +- .../tests/fixture/swc_noop_plugin/Cargo.toml | 2 +- crates/swc_xml_ast/Cargo.toml | 2 +- crates/swc_xml_parser/Cargo.toml | 2 +- crates/swc_xml_visit/Cargo.toml | 2 +- cspell.json | 1 + .../plugin_transform_schema_v1/Cargo.toml | 2 +- .../plugin_transform_schema_vtest/Cargo.toml | 2 +- rust-toolchain | 2 +- 66 files changed, 341 insertions(+), 426 deletions(-) rename .github/workflows/{cargo.yml => CI.yml} (72%) delete mode 100644 .github/workflows/cargo-lints.yml delete mode 100644 .github/workflows/crev.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/integration.yml delete mode 100644 .github/workflows/wasm.yml diff --git a/.github/workflows/cargo.yml b/.github/workflows/CI.yml similarity index 72% rename from .github/workflows/cargo.yml rename to .github/workflows/CI.yml index 77b35139e9b..0de72254e3d 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/CI.yml @@ -1,29 +1,90 @@ -name: Cargo +name: CI -on: [push, pull_request] -#on: -# push: -# # Ignore commits created by bors -# branches-ignore: -# - 'staging' -# - 'trying' -# pull_request: -# branches-ignore: -# - 'staging' -# - 'trying' +on: + - push + - pull_request env: + CI: 1 CARGO_INCREMENTAL: 0 - RUST_LOG: "debug" + CARGO_TERM_COLOR: "always" DIFF: 0 + # For faster CI + RUST_LOG: "off" # https://github.com/swc-project/swc/pull/3742 RUST_MIN_STACK: 4194304 - CI: 1 - CARGO_TERM_COLOR: "always" jobs: - check-license: - name: Check license + cargo-fmt: + name: Cargo fmt + runs-on: ubuntu-latest + env: + RUST_LOG: "0" + steps: + - uses: actions/checkout@v3 + + # We explicitly do this to cache properly. + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + components: rustfmt + + - run: cargo fmt --all -- --check + + cargo-clippy: + name: Cargo clippy + if: >- + ${{ !contains(github.event.head_commit.message, 'chore: ') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + components: clippy + + - run: cargo clippy --all + + cargo-crev: + name: Cargo crev + if: >- + ${{ !contains(github.event.head_commit.message, 'chore: ') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + + - name: Remove unrelated + run: | + rm -rf packages + rm -rf tests + ls -al + + - name: Install cargo-crev + uses: baptiste0928/cargo-install@v1.1.0 + with: + crate: cargo-crev + version: "0.23.1" + + - name: Configure cargo-crev + run: | + git config --global user.name 'SWC bot' + git config --global user.email 'bot@swc.rs' + + cargo crev trust --level high https://github.com/kdy1/crev-proofs + cargo crev repo fetch all + + - name: Check dependencies + run: | + ./scripts/crev/verify.sh + + cargo-deny: + name: Check license of dependencies runs-on: ubuntu-latest if: >- ${{ !contains(github.event.head_commit.message, 'chore: ') }} @@ -45,7 +106,7 @@ jobs: run: | cargo deny check - check: + cargo-check: name: Check runs-on: ${{ matrix.os }} if: >- @@ -84,7 +145,43 @@ jobs: # Ensure that all components are compilable. - name: Run cargo check for all targets run: cargo check --all --all-targets - test: + + test-wasm: + name: Test wasm + if: >- + ${{ !contains(github.event.head_commit.message, 'chore: ') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + # We explicitly do this to cache properly. + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + + - uses: actions/setup-node@v3 + with: + node-version: "16" + cache: "yarn" + + - name: Install node dependencies + shell: bash + run: | + yarn + + - name: Build + run: | + (cd bindings/binding_core_wasm && yarn) + (cd bindings/binding_core_wasm && ./scripts/build.sh --features plugin) + + - name: Test + run: | + (cd bindings/binding_core_wasm && ./scripts/test.sh) + + cargo-test: name: Test - ${{ matrix.settings.crate }} - ${{ matrix.settings.os }} runs-on: ${{ matrix.settings.runner }} if: >- @@ -582,3 +679,154 @@ jobs: if: matrix.settings.check working-directory: "crates/${{ matrix.settings.crate }}" run: "${{ matrix.settings.check }}" + + node-test: + name: Test node bindings - ${{ matrix.os }} + if: >- + ${{ !contains(github.event.head_commit.message, 'chore: ') }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + - macos-latest + steps: + - uses: actions/checkout@v3 + + # We explicitly do this to cache properly. + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + + - uses: actions/setup-node@v3 + with: + node-version: 16 + cache: "yarn" + + - name: Patch + run: | + echo '[patch.crates-io]' >> bindings/Cargo.toml + ./scripts/cargo/patch-section.sh >> bindings/Cargo.toml + + - name: Cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/ + **/target/ + key: ${{ runner.os }}-node-api-test + + - name: Set platform name + run: | + export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())") + echo "PLATFORM_NAME=$NODE_PLATFORM_NAME" >> $GITHUB_ENV + shell: bash + + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + + - name: Prepare + run: | + rustup target add wasm32-wasi + yarn + + yarn build:dev + yarn test + + integration-test: + name: "Test with @swc/cli" + if: >- + ${{ !contains(github.event.head_commit.message, 'chore: ') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 14 + cache: "yarn" + + - name: Cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/ + **/target/ + key: ${{ runner.os }}-cargo-integration + + - name: Set platform name + run: | + export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())") + echo "PLATFORM_NAME=$NODE_PLATFORM_NAME" >> $GITHUB_ENV + shell: bash + + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + + - name: Patch + run: | + echo '[patch.crates-io]' >> bindings/Cargo.toml + ./scripts/cargo/patch-section.sh >> bindings/Cargo.toml + + - name: Prepare + run: | + rustup target add wasm32-wasi + yarn + + yarn build:dev + + # Avoid no space left on device, copyfile + cargo clean + cargo clean --manifest-path ./bindings/binding_core_node/Cargo.toml + cargo clean --manifest-path ./bindings/binding_core_wasm/Cargo.toml + cargo clean --manifest-path ./bindings/swc_cli/Cargo.toml + + yarn global add @swc/cli@0.1.56 + yarn link + yarn global add file:$PWD + + - name: Print info + run: | + yarn global list + + - name: (swc) three.js + run: | + mkdir -p tests/integration/three-js + yarn global add qunit failonlyreporter + + # Download three.js + git clone --depth 1 https://github.com/mrdoob/three.js.git -b r117 tests/integration/three-js/repo + + # TODO + # swc -C isModule=unknown -C test=\".*.js$\" -C module.type=commonjs --sync tests/integration/three-js/repo/ -d tests/integration/three-js/build/ + + # TODO + # (cd tests/integration/three-js/build/test && qunit -r failonlyreporter unit/three.source.unit.js) + + # terser: contains with statement in test + # Rome.js: I forgot the cause, but it didn't work. + # jQuery: browser only (window.document is required) + - name: (swc) redux + run: | + mkdir -p tests/integration/redux + yarn global add qunit failonlyreporter + + # Download + # git clone --depth 1 https://github.com/reduxjs/redux.git -b v4.1.0 tests/integration/redux/repo + # TODO + # swc --sync tests/integration/redux/repo/src/ -d tests/integration/redux/repo/lib/ + # echo "module.exports=require('./index')" > tests/integration/redux/repo/lib/redux.js + # TODO + # swc --sync tests/integration/redux/repo/src/ -d tests/integration/redux/repo/test/ + # TODO + # swc --sync tests/integration/redux/repo/test/ -d tests/integration/redux/repo/test/ + + # TODO + # (cd tests/integration/redux/repo && yarn) + # TODO + # (cd tests/integration/redux/repo && npx jest '.*.js' --modulePathIgnorePatterns 'typescript') + - name: (swcpack) example react app + run: | + (cd crates/swc_node_bundler/tests/integration/react && yarn && npx spack) diff --git a/.github/workflows/cancel.yml b/.github/workflows/cancel.yml index fbca76b13c0..57cc05c2140 100644 --- a/.github/workflows/cancel.yml +++ b/.github/workflows/cancel.yml @@ -13,5 +13,5 @@ jobs: steps: - uses: styfle/cancel-workflow-action@0.9.1 with: - workflow_id: 120748, 1407871, 2022092, 8653985 + workflow_id: 120748, 1407871, 2022092, 8653985, 36194918 access_token: ${{ github.token }} diff --git a/.github/workflows/cargo-lints.yml b/.github/workflows/cargo-lints.yml deleted file mode 100644 index 8c777bd935d..00000000000 --- a/.github/workflows/cargo-lints.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Cargo lint - -on: [push, pull_request] - -env: - CARGO_INCREMENTAL: 0 - -jobs: - fmt: - name: fmt - runs-on: ubuntu-latest - env: - RUST_LOG: "0" - steps: - - uses: actions/checkout@v3 - - # We explicitly do this to cache properly. - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - components: rustfmt - - - name: Run cargo fmt - run: cargo fmt --all -- --check - - clippy: - name: Clippy - if: >- - ${{ !contains(github.event.head_commit.message, 'chore: ') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - components: clippy - - - uses: actions/setup-node@v3 - with: - node-version: "16" - cache: "yarn" - - - name: Install node dependencies - shell: bash - run: | - yarn - - - name: Check - run: | - cargo clippy --all diff --git a/.github/workflows/crev.yml b/.github/workflows/crev.yml deleted file mode 100644 index 10fe62b1e5f..00000000000 --- a/.github/workflows/crev.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: "crev: Dependencies" - -on: [push, pull_request] - -jobs: - check-deps: - name: Check dependencies - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - - name: Remove unrelated - run: | - rm -rf packages - rm -rf tests - ls -al - - - name: Install cargo-crev - uses: baptiste0928/cargo-install@v1.1.0 - with: - crate: cargo-crev - version: "0.23.1" - - - name: Configure cargo-crev - run: | - git config --global user.name 'SWC bot' - git config --global user.email 'bot@swc.rs' - - cargo crev trust --level high https://github.com/kdy1/crev-proofs - cargo crev repo fetch all - - - name: Check dependencies - run: | - ./scripts/crev/verify.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 1bba5740ec0..00000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Docs - -on: - push: - branches: - - "main" - -jobs: - rustdoc: - name: Rustdoc - concurrency: swc-docs-rustdoc - runs-on: macos-latest - if: >- - ${{ !contains(github.event.head_commit.message, 'chore: ') }} - - steps: - - uses: actions/checkout@v3 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - - name: Create rustdoc - run: cargo doc --all --features plugin_transform --features ecma_loader --features ecma_utils --features ecma_quote --features ecma_visit --features ecma_transforms --features __testing_transform - - - name: Create CNAME - run: | - echo 'rustdoc.swc.rs' > target/doc/CNAME - - - name: Deploy - if: github.ref == 'refs/heads/main' - uses: JamesIves/github-pages-deploy-action@4.1.8 - with: - token: ${{ secrets.GH_TOKEN }} - branch: gh-pages - folder: target/doc - clean: true - git-config-email: github-bot@swc.rs - repository-name: swc-project/rustdoc - commit-message: "Update" - single-commit: true diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index d364e2d5944..00000000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,149 +0,0 @@ -name: Integration tests - -on: [push, pull_request] - -env: - CARGO_INCREMENTAL: 0 - CARGO_TERM_COLOR: "always" - -jobs: - publish-test: - name: node-api - ${{ matrix.os }} - if: >- - ${{ !contains(github.event.head_commit.message, 'chore: ') }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest - steps: - - uses: actions/checkout@v3 - - # We explicitly do this to cache properly. - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: "yarn" - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/ - **/target/ - key: ${{ runner.os }}-node-api-test - - - name: Set platform name - run: | - export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())") - echo "PLATFORM_NAME=$NODE_PLATFORM_NAME" >> $GITHUB_ENV - shell: bash - - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - - name: Prepare - run: | - rustup target add wasm32-wasi - yarn - - yarn build:dev - yarn test - - integration-test: - name: swc-cli - if: >- - ${{ !contains(github.event.head_commit.message, 'chore: ') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 14 - cache: "yarn" - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/ - **/target/ - key: ${{ runner.os }}-cargo-integration - - - name: Set platform name - run: | - export NODE_PLATFORM_NAME=$(node -e "console.log(require('os').platform())") - echo "PLATFORM_NAME=$NODE_PLATFORM_NAME" >> $GITHUB_ENV - shell: bash - - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - - name: Prepare - run: | - rustup target add wasm32-wasi - yarn - - yarn build:dev - - # Avoid no space left on device, copyfile - cargo clean - cargo clean --manifest-path ./bindings/binding_core_node/Cargo.toml - cargo clean --manifest-path ./bindings/binding_core_wasm/Cargo.toml - cargo clean --manifest-path ./bindings/swc_cli/Cargo.toml - - yarn global add @swc/cli@0.1.56 - yarn link - yarn global add file:$PWD - - - name: Print info - run: | - yarn global list - - - name: (swc) three.js - run: | - mkdir -p tests/integration/three-js - yarn global add qunit failonlyreporter - - # Download three.js - git clone --depth 1 https://github.com/mrdoob/three.js.git -b r117 tests/integration/three-js/repo - - # TODO - # swc -C isModule=unknown -C test=\".*.js$\" -C module.type=commonjs --sync tests/integration/three-js/repo/ -d tests/integration/three-js/build/ - - # TODO - # (cd tests/integration/three-js/build/test && qunit -r failonlyreporter unit/three.source.unit.js) - - # terser: contains with statement in test - # Rome.js: I forgot the cause, but it didn't work. - # jQuery: browser only (window.document is required) - - name: (swc) redux - run: | - mkdir -p tests/integration/redux - yarn global add qunit failonlyreporter - - # Download - # git clone --depth 1 https://github.com/reduxjs/redux.git -b v4.1.0 tests/integration/redux/repo - # TODO - # swc --sync tests/integration/redux/repo/src/ -d tests/integration/redux/repo/lib/ - # echo "module.exports=require('./index')" > tests/integration/redux/repo/lib/redux.js - # TODO - # swc --sync tests/integration/redux/repo/src/ -d tests/integration/redux/repo/test/ - # TODO - # swc --sync tests/integration/redux/repo/test/ -d tests/integration/redux/repo/test/ - - # TODO - # (cd tests/integration/redux/repo && yarn) - # TODO - # (cd tests/integration/redux/repo && npx jest '.*.js' --modulePathIgnorePatterns 'typescript') - - name: (swcpack) example react app - run: | - (cd crates/swc_node_bundler/tests/integration/react && yarn && npx spack) diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml deleted file mode 100644 index 00a36924f05..00000000000 --- a/.github/workflows/wasm.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Wasm - -on: [push, pull_request] -#on: -# push: -# # Ignore commits created by bors -# branches-ignore: -# - 'staging' -# - 'trying' -# pull_request: -# branches-ignore: -# - 'staging' -# - 'trying' - -env: - CI: 1 - CARGO_INCREMENTAL: 0 - -jobs: - test: - name: Test - if: >- - ${{ !contains(github.event.head_commit.message, 'chore: ') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - # We explicitly do this to cache properly. - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - - uses: actions/setup-node@v3 - with: - node-version: "16" - cache: "yarn" - - - name: Install node dependencies - shell: bash - run: | - yarn - - - name: Build - run: | - (cd bindings/binding_core_wasm && yarn) - (cd bindings/binding_core_wasm && ./scripts/build.sh --features plugin) - - - name: Test - run: | - (cd bindings/binding_core_wasm && ./scripts/test.sh) diff --git a/Cargo.lock b/Cargo.lock index ee68870c3bd..b3abaae34f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2627,9 +2627,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.145" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" dependencies = [ "serde_derive", ] @@ -2666,9 +2666,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 33535a5634c..8fb74282a56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,6 +41,3 @@ opt-level = 3 [profile.test.package.pretty_assertions] opt-level = 3 - -[workspace.dependencies] -serde = "1.0.145" \ No newline at end of file diff --git a/bindings/Cargo.toml b/bindings/Cargo.toml index 4c227683949..18463968dcb 100644 --- a/bindings/Cargo.toml +++ b/bindings/Cargo.toml @@ -16,7 +16,3 @@ strip = "symbols" [profile.dev.package."*"] debug-assertions = false - -[workspace.dependencies] -swc_core = "0.28.10" -serde = "1.0.145" \ No newline at end of file diff --git a/bindings/binding_core_node/Cargo.toml b/bindings/binding_core_node/Cargo.toml index f1adf4f4147..49369056fa7 100644 --- a/bindings/binding_core_node/Cargo.toml +++ b/bindings/binding_core_node/Cargo.toml @@ -49,14 +49,14 @@ napi-derive = { version = "2", default-features = false, features = [ ] } node_macro_deps = { path = "../node_macro_deps" } path-clean = "0.1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["unbounded_depth"] } tracing = { version = "0.1.32", features = ["release_max_level_info"] } tracing-chrome = "0.5.0" tracing-futures = "0.2.5" tracing-subscriber = { version = "0.3.9", features = ["env-filter"] } -swc_core = { workspace = true, features = [ +swc_core = { version = "0.28.10", features = [ "ecma_ast", "common_concurrent", "bundler", diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index 6f09436c0b5..16aa4348990 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -21,7 +21,7 @@ plugin = ["swc_core/plugin_transform_host_js"] [dependencies] anyhow = "1" -swc_core = { workspace = true, features = [ +swc_core = { version = "0.28.10", features = [ "common_perf", "binding_macro_wasm", ] } diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index 99ca6553354..d724646438b 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -24,9 +24,9 @@ clap = { version = "3.1.0", features = ["derive", "wrap_help"] } glob = "0.3.0" rayon = "1" relative-path = "1.6.1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["unbounded_depth"] } -swc_core = { workspace = true, features = [ +swc_core = { version = "0.28.10", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index 1256cf1c82c..395ce5fbb96 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -17,7 +17,7 @@ clap = { version = "3", features = ["derive"] } dialoguer = "0.10.2" flate2 = "1.0" rayon = "1.5.2" -serde = { workspace = true } +serde = "1" serde_json = "1" sha1 = "0.10.1" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } diff --git a/crates/jsdoc/Cargo.toml b/crates/jsdoc/Cargo.toml index 6cbbb751556..7b19b7a9085 100644 --- a/crates/jsdoc/Cargo.toml +++ b/crates/jsdoc/Cargo.toml @@ -13,7 +13,7 @@ bench = false [dependencies] nom = "7.1.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/preset_env_base/Cargo.toml b/crates/preset_env_base/Cargo.toml index 58d7ccc64fa..5c1c0424239 100644 --- a/crates/preset_env_base/Cargo.toml +++ b/crates/preset_env_base/Cargo.toml @@ -18,6 +18,6 @@ dashmap = "5.1.0" from_variant = { version = "0.1.3", path = "../from_variant" } once_cell = "1.12.0" semver = { version = "1.0.4", features = ["serde"] } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } st-map = "0.1.2" tracing = { version = "0.1.32" } diff --git a/crates/string_enum/Cargo.toml b/crates/string_enum/Cargo.toml index 28f50415394..375db920087 100644 --- a/crates/string_enum/Cargo.toml +++ b/crates/string_enum/Cargo.toml @@ -23,4 +23,4 @@ features = ["full", "parsing", "printing", "extra-traits"] version = "1" [dev-dependencies] -serde = {workspace = true} +serde = "1" diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index a038e8f6b4a..26a5ae9bd8d 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -56,7 +56,7 @@ parking_lot = "0.12.0" pathdiff = "0.2.0" regex = "1" rustc-hash = "1.1.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = "1" sourcemap = "6" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } diff --git a/crates/swc_atoms/Cargo.toml b/crates/swc_atoms/Cargo.toml index 53eb7ff28b8..0074285f9e5 100644 --- a/crates/swc_atoms/Cargo.toml +++ b/crates/swc_atoms/Cargo.toml @@ -27,7 +27,7 @@ rkyv = { package = "rkyv", version = "=0.7.37", optional = true } # cannot be merged. rkyv-latest = { package = "rkyv-test", version = "=0.7.38-test.2", optional = true } rustc-hash = "1.1.0" -serde = {workspace = true} +serde = "1" string_cache = "0.8.4" triomphe = "0.1.8" diff --git a/crates/swc_cached/Cargo.toml b/crates/swc_cached/Cargo.toml index c810f9588d3..cb2d35f4f74 100644 --- a/crates/swc_cached/Cargo.toml +++ b/crates/swc_cached/Cargo.toml @@ -18,5 +18,5 @@ anyhow = "1.0.55" dashmap = "5.1.0" once_cell = "1.10.0" regex = "1.5.4" -serde = {workspace = true} +serde = "1.0.136" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 4b059e46560..99456ed668d 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -68,7 +68,7 @@ rkyv = { version = "=0.7.37", optional = true } # cannot be merged. rkyv-latest = { package = "rkyv-test", version = "=0.7.38-test.2", optional = true } rustc-hash = "1.1.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.119", features = ["derive"] } siphasher = "0.3.9" sourcemap = { version = "6", optional = true } string_cache = "0.8.4" diff --git a/crates/swc_config/Cargo.toml b/crates/swc_config/Cargo.toml index 1c3a85c6f4f..20190ceedf2 100644 --- a/crates/swc_config/Cargo.toml +++ b/crates/swc_config/Cargo.toml @@ -11,6 +11,6 @@ version = "0.1.2" [dependencies] anyhow = "1" indexmap = "1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = "1" swc_config_macro = { version = "0.1.0", path = "../swc_config_macro" } diff --git a/crates/swc_css_ast/Cargo.toml b/crates/swc_css_ast/Cargo.toml index dd9e6564bc1..10f1b7b9431 100644 --- a/crates/swc_css_ast/Cargo.toml +++ b/crates/swc_css_ast/Cargo.toml @@ -22,7 +22,7 @@ rkyv-impl = ["__rkyv", "rkyv", "swc_atoms/rkyv-impl", "swc_common/rkyv bytecheck = { version = "0.6.9", optional = true } is-macro = "0.2.0" rkyv = { version = "=0.7.37", optional = true } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.127", features = ["derive"] } string_enum = { version = "0.3.1", path = "../string_enum/" } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_css_codegen/Cargo.toml b/crates/swc_css_codegen/Cargo.toml index f78a268278a..1a2a5ac0719 100644 --- a/crates/swc_css_codegen/Cargo.toml +++ b/crates/swc_css_codegen/Cargo.toml @@ -16,7 +16,7 @@ bench = false auto_impl = "0.5.0" bitflags = "1.3.2" rustc-hash = "1.1.0" -serde = {workspace = true} +serde = "1.0.127" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_css_ast = { version = "0.114.4", path = "../swc_css_ast" } diff --git a/crates/swc_css_lints/Cargo.toml b/crates/swc_css_lints/Cargo.toml index 985a0baec78..8a81bc60273 100644 --- a/crates/swc_css_lints/Cargo.toml +++ b/crates/swc_css_lints/Cargo.toml @@ -16,7 +16,7 @@ bench = false auto_impl = "0.5.0" parking_lot = "0.12.0" rayon = "1.5.1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.133", features = ["derive"] } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_cached = { version = "0.3.14", path = "../swc_cached" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_css_minifier/Cargo.toml b/crates/swc_css_minifier/Cargo.toml index b21b0affc7c..fef36e58480 100644 --- a/crates/swc_css_minifier/Cargo.toml +++ b/crates/swc_css_minifier/Cargo.toml @@ -13,7 +13,7 @@ version = "0.89.5" bench = false [dependencies] -serde = {workspace = true} +serde = "1.0.118" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_css_ast = { version = "0.114.4", path = "../swc_css_ast" } diff --git a/crates/swc_css_parser/Cargo.toml b/crates/swc_css_parser/Cargo.toml index ea38100a040..6212a06edf8 100644 --- a/crates/swc_css_parser/Cargo.toml +++ b/crates/swc_css_parser/Cargo.toml @@ -18,7 +18,7 @@ debug = [] [dependencies] bitflags = "1.2.1" lexical = "6.1.0" -serde = {workspace = true} +serde = "1.0.127" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_css_ast = { version = "0.114.4", path = "../swc_css_ast" } diff --git a/crates/swc_css_prefixer/Cargo.toml b/crates/swc_css_prefixer/Cargo.toml index 096fe29ef09..1f6811b45dc 100644 --- a/crates/swc_css_prefixer/Cargo.toml +++ b/crates/swc_css_prefixer/Cargo.toml @@ -15,7 +15,7 @@ bench = false [dependencies] once_cell = "1.10.0" preset_env_base = { version = "0.3.2", path = "../preset_env_base" } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } serde_json = "1.0.61" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_css_utils/Cargo.toml b/crates/swc_css_utils/Cargo.toml index b2423e30fa9..41b286f30dc 100644 --- a/crates/swc_css_utils/Cargo.toml +++ b/crates/swc_css_utils/Cargo.toml @@ -14,7 +14,7 @@ bench = false [dependencies] once_cell = "1.10.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } serde_json = "1.0.61" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_css_visit/Cargo.toml b/crates/swc_css_visit/Cargo.toml index 7b62e826b66..09b91bd759a 100644 --- a/crates/swc_css_visit/Cargo.toml +++ b/crates/swc_css_visit/Cargo.toml @@ -20,7 +20,7 @@ default = ["serde"] path = [] [dependencies] -serde = { workspace = true, optional = true } +serde = { version = "1", optional = true } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_css_ast = { version = "0.114.4", path = "../swc_css_ast" } diff --git a/crates/swc_ecma_ast/Cargo.toml b/crates/swc_ecma_ast/Cargo.toml index f2418d7e629..cd143b31535 100644 --- a/crates/swc_ecma_ast/Cargo.toml +++ b/crates/swc_ecma_ast/Cargo.toml @@ -40,7 +40,7 @@ rkyv = { package = "rkyv", version = "=0.7.37", optional = true } # cannot be merged. rkyv-latest = { package = "rkyv-test", version = "=0.7.38-test.2", optional = true } scoped-tls = "1.0.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.133", features = ["derive"] } string_enum = { version = "0.3.1", path = "../string_enum" } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index 9593721c658..efb0cf99c02 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -17,7 +17,7 @@ memchr = "2.4.1" num-bigint = { version = "0.4", features = ["serde"] } once_cell = "1.10.0" rustc-hash = "1.1.0" -serde = {workspace = true} +serde = "1.0.127" sourcemap = "6" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index e14835727bf..c6f9a86fb06 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -19,7 +19,7 @@ dashmap = "5.1.0" parking_lot = "0.12.0" rayon = "1.5.1" regex = "1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.133", features = ["derive"] } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common", features = [ "concurrent", diff --git a/crates/swc_ecma_loader/Cargo.toml b/crates/swc_ecma_loader/Cargo.toml index 7f68042f955..9fc39da6012 100644 --- a/crates/swc_ecma_loader/Cargo.toml +++ b/crates/swc_ecma_loader/Cargo.toml @@ -33,7 +33,7 @@ once_cell = { version = "1.9.0", optional = true } parking_lot = { version = "0.12.0", optional = true } path-clean = { version = "=0.1.0", optional = true } pathdiff = "0.2.1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = { version = "1.0.64", optional = true } swc_cached = { version = "0.3.14", optional = true, path = "../swc_cached" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 981107764cb..b6bd5490976 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -42,7 +42,7 @@ rayon = { version = "1.5.1", optional = true } regex = "1.5.3" retain_mut = "0.1.2" rustc-hash = "1.1.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } serde_json = "1.0.61" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_cached = { version = "0.3.14", path = "../swc_cached" } diff --git a/crates/swc_ecma_minifier/src/compress/util/mod.rs b/crates/swc_ecma_minifier/src/compress/util/mod.rs index 736016b61a5..74074fd2be8 100644 --- a/crates/swc_ecma_minifier/src/compress/util/mod.rs +++ b/crates/swc_ecma_minifier/src/compress/util/mod.rs @@ -347,10 +347,20 @@ pub(crate) fn negate_cost( return cost(expr_ctx, last, in_bool_ctx, bin_op, is_ret_val_ignored); } - isize::from(!is_ret_val_ignored) + if is_ret_val_ignored { + 0 + } else { + 1 + } } - _ => isize::from(!is_ret_val_ignored), + _ => { + if is_ret_val_ignored { + 0 + } else { + 1 + } + } } })(); diff --git a/crates/swc_ecma_minifier/src/util/size.rs b/crates/swc_ecma_minifier/src/util/size.rs index 475a0f7a137..4f131c61ebc 100644 --- a/crates/swc_ecma_minifier/src/util/size.rs +++ b/crates/swc_ecma_minifier/src/util/size.rs @@ -162,7 +162,7 @@ impl SizeWithCtxt for Expr { _ => 2 + params.size(unresolved), }; let a = if *is_async { - 5 + usize::from(params.len() != 1) + 5 + if params.len() == 1 { 0 } else { 1 } } else { 0 }; diff --git a/crates/swc_ecma_parser/Cargo.toml b/crates/swc_ecma_parser/Cargo.toml index 1a3136ebe05..72be7f7fdf0 100644 --- a/crates/swc_ecma_parser/Cargo.toml +++ b/crates/swc_ecma_parser/Cargo.toml @@ -28,7 +28,7 @@ either = { version = "1.4" } enum_kind = { version = "0.2.1", path = "../enum_kind" } lexical = { version = "6.1.0", features = ["power-of-two"] } num-bigint = "0.4" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } smallvec = "1.8.0" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index cdb2d361a7b..03d31deddf8 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -19,7 +19,7 @@ indexmap = "1.6.2" once_cell = "1.10.0" preset_env_base = { version = "0.3.2", path = "../preset_env_base" } semver = { version = "1.0.4", features = ["serde"] } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = "1" st-map = "0.1.2" string_enum = { version = "0.3.1", path = "../string_enum" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 356958b878f..3002900bae9 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -23,7 +23,7 @@ once_cell = "1.10.0" phf = {version = "0.10", features = ["macros"]} rayon = {version = "1", optional = true} rustc-hash = "1.1.0" -serde = {workspace = true, features = ["derive"]} +serde = {version = "1", features = ["derive"]} smallvec = "1.8.0" swc_atoms = {version = "0.4.18", path = "../swc_atoms"} swc_common = {version = "0.29.3", path = "../swc_common"} diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 710f57b8a49..6b388709773 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -27,7 +27,7 @@ is-macro = "0.2.0" num-bigint = "0.4" ordered-float = "2.0.1" rayon = { version = "1.5.1", optional = true } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } smallvec = "1.8.0" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 25625a43bc0..54cfff22c26 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -22,7 +22,7 @@ is-macro = "0.2.0" path-clean = "0.1.0" pathdiff = "0.2.0" regex = "1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_cached = { version = "0.3.14", path = "../swc_cached" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index 6277f475eda..0e11add420e 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -18,7 +18,7 @@ multi-module = ["swc_ecma_loader"] [dependencies] either = "1.6.1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } smallvec = "1.8.0" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 2c70db4e8eb..70544746741 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -23,7 +23,7 @@ indexmap = "1.6.1" once_cell = "1.10.0" rayon = { version = "1.5.1", optional = true } regex = "1.4.2" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } sha-1 = "0.10.0" string_enum = { version = "0.3.1", path = "../string_enum" } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 228cb08700a..4a4151cdf93 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -15,7 +15,7 @@ bench = false ansi_term = "0.12.1" anyhow = "1" hex = "0.4.3" -serde = {workspace = true} +serde = "1" serde_json = "1" sha-1 = "0.10" swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 981ab6cf23e..b4e15b4dca8 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -13,7 +13,7 @@ version = "0.157.11" bench = false [dependencies] -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_ecma_ast = { version = "0.94.3", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_visit/Cargo.toml b/crates/swc_ecma_visit/Cargo.toml index 9eb66b416b7..fd60b9abbda 100644 --- a/crates/swc_ecma_visit/Cargo.toml +++ b/crates/swc_ecma_visit/Cargo.toml @@ -22,7 +22,7 @@ path = [] [dependencies] num-bigint = { version = "0.4", features = ["serde"] } -serde = { workspace = true, optional = true } +serde = { version = "1", optional = true } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_ecma_ast = { version = "0.94.3", path = "../swc_ecma_ast" } diff --git a/crates/swc_estree_ast/Cargo.toml b/crates/swc_estree_ast/Cargo.toml index cdc3b88090d..d018cec9418 100644 --- a/crates/swc_estree_ast/Cargo.toml +++ b/crates/swc_estree_ast/Cargo.toml @@ -19,7 +19,7 @@ bench = false [dependencies] better_scoped_tls = { version = "0.1.0", path = "../better_scoped_tls" } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = "1" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index c5e2577ad2b..ca2f72c3f6a 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -20,7 +20,7 @@ ahash = { version = "0.7.0", features = ["compile-time-rng"] } anyhow = "1" copyless = "0.1.5" rayon = "1.5.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = "1.0.62" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common", features = [ diff --git a/crates/swc_html_ast/Cargo.toml b/crates/swc_html_ast/Cargo.toml index 1bbc84dd0fe..d8be4aacc7f 100644 --- a/crates/swc_html_ast/Cargo.toml +++ b/crates/swc_html_ast/Cargo.toml @@ -23,7 +23,7 @@ rkyv-impl = ["__rkyv", "rkyv", "swc_atoms/rkyv-impl", "swc_common/rkyv-impl"] bytecheck = { version = "0.6.9", optional = true } is-macro = "0.2.0" rkyv = { version = "=0.7.37", optional = true } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.127", features = ["derive"] } string_enum = { version = "0.3.1", path = "../string_enum/" } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index 4c644ddbaba..66158a8c5da 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -17,7 +17,7 @@ bench = false [dependencies] once_cell = "1.10.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } serde_json = "1.0.61" swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_cached = { version = "0.3.14", path = "../swc_cached" } diff --git a/crates/swc_html_parser/Cargo.toml b/crates/swc_html_parser/Cargo.toml index e8f432ad165..2e5a1d1e21f 100644 --- a/crates/swc_html_parser/Cargo.toml +++ b/crates/swc_html_parser/Cargo.toml @@ -26,7 +26,7 @@ swc_html_utils = { version = "0.14.4", path = "../swc_html_utils" } [dev-dependencies] criterion = "0.3" -serde = {workspace = true} +serde = "1.0.127" serde_json = "1.0.66" swc_html_visit = { version = "0.26.4", path = "../swc_html_visit" } swc_node_base = { version = "0.5.0", path = "../swc_node_base" } diff --git a/crates/swc_html_utils/Cargo.toml b/crates/swc_html_utils/Cargo.toml index e99c87c88b6..df5f0971841 100644 --- a/crates/swc_html_utils/Cargo.toml +++ b/crates/swc_html_utils/Cargo.toml @@ -17,7 +17,7 @@ bench = false [dependencies] once_cell = "1.10.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.118", features = ["derive"] } serde_json = "1.0.61" swc_atoms = { version = "0.4.17", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_html_visit/Cargo.toml b/crates/swc_html_visit/Cargo.toml index 1af66d80971..a9f38bbc268 100644 --- a/crates/swc_html_visit/Cargo.toml +++ b/crates/swc_html_visit/Cargo.toml @@ -23,7 +23,7 @@ default = ["serde"] path = [] [dependencies] -serde = { workspace = true, optional = true } +serde = { version = "1", optional = true } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_html_ast = { version = "0.26.4", path = "../swc_html_ast" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index f6d5381633c..891d5bbff9d 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -23,7 +23,7 @@ dashmap = "5.1.0" is-macro = "0.2.0" once_cell = "1.10.0" regex = "1" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = "1" string_enum = { version = "0.3", path = "../string_enum" } swc = { version = "0.230.10", path = "../swc" } diff --git a/crates/swc_nodejs_common/Cargo.toml b/crates/swc_nodejs_common/Cargo.toml index 46c51a185a5..56631769d46 100644 --- a/crates/swc_nodejs_common/Cargo.toml +++ b/crates/swc_nodejs_common/Cargo.toml @@ -17,7 +17,7 @@ napi = { version = "2", default-features = false, features = [ "napi3", "serde-json", ] } -serde = { workspace = true, features = ["derive"] } +serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["unbounded_depth"] } swc_node_base = { version = "0.5.5", path = "../swc_node_base" } tracing = { version = "0.1.32", features = ["release_max_level_info"] } diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 7dedde09031..de0784fec67 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -40,7 +40,7 @@ rkyv-impl = [ anyhow = "1.0.42" once_cell = "1.10.0" parking_lot = "0.12.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.126", features = ["derive"] } serde_json = "1.0.64" swc_common = { version = "0.29.3", path = "../swc_common", features = [ "concurrent", diff --git a/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.toml b/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.toml index a14a9d0ec72..21a78a52bd1 100644 --- a/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.toml +++ b/crates/swc_plugin_runner/tests/fixture/swc_internal_plugin/Cargo.toml @@ -10,7 +10,7 @@ version = "0.1.0" crate-type = ["cdylib"] [dependencies] -serde = "1.0.145" +serde = "1" swc_core = { path = "../../../../swc_core", features = [ "plugin_transform", "ecma_quote", diff --git a/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.toml b/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.toml index cc4467e93a5..1d4e151f1d8 100644 --- a/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.toml +++ b/crates/swc_plugin_runner/tests/fixture/swc_noop_plugin/Cargo.toml @@ -10,5 +10,5 @@ version = "0.1.0" crate-type = ["cdylib"] [dependencies] -serde = "1.0.145" +serde = "1" swc_core = { path = "../../../../swc_core", features = ["plugin_transform"] } diff --git a/crates/swc_xml_ast/Cargo.toml b/crates/swc_xml_ast/Cargo.toml index c72aad8b20d..0eb98f31ee5 100644 --- a/crates/swc_xml_ast/Cargo.toml +++ b/crates/swc_xml_ast/Cargo.toml @@ -16,7 +16,7 @@ bench = false [dependencies] is-macro = "0.2.0" -serde = { workspace = true, features = ["derive"] } +serde = { version = "1.0.127", features = ["derive"] } string_enum = { version = "0.3.1", path = "../string_enum/" } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } diff --git a/crates/swc_xml_parser/Cargo.toml b/crates/swc_xml_parser/Cargo.toml index d45176d54bf..479223bf20b 100644 --- a/crates/swc_xml_parser/Cargo.toml +++ b/crates/swc_xml_parser/Cargo.toml @@ -25,7 +25,7 @@ swc_xml_ast = { version = "0.4.3", path = "../swc_xml_ast" } [dev-dependencies] criterion = "0.3" -serde = {workspace = true} +serde = "1.0.127" serde_json = "1.0.66" swc_node_base = { version = "0.5.0", path = "../swc_node_base" } swc_xml_visit = { version = "0.4.3", path = "../swc_xml_visit" } diff --git a/crates/swc_xml_visit/Cargo.toml b/crates/swc_xml_visit/Cargo.toml index 1ea56758371..f2586c1732e 100644 --- a/crates/swc_xml_visit/Cargo.toml +++ b/crates/swc_xml_visit/Cargo.toml @@ -23,7 +23,7 @@ default = ["serde"] path = [] [dependencies] -serde = { workspace = true, optional = true } +serde = { version = "1", optional = true } swc_atoms = { version = "0.4.18", path = "../swc_atoms" } swc_common = { version = "0.29.3", path = "../swc_common" } swc_visit = { version = "0.5.3", path = "../swc_visit" } diff --git a/cspell.json b/cspell.json index 3b4c458fcb1..4ac4e499ecb 100644 --- a/cspell.json +++ b/cspell.json @@ -36,6 +36,7 @@ "consts", "corejs", "creduce", + "crev", "ctxt", "ctxts", "declarators", diff --git a/node-swc/e2e/fixtures/plugin_transform_schema_v1/Cargo.toml b/node-swc/e2e/fixtures/plugin_transform_schema_v1/Cargo.toml index 058aa4414b5..c114d313493 100644 --- a/node-swc/e2e/fixtures/plugin_transform_schema_v1/Cargo.toml +++ b/node-swc/e2e/fixtures/plugin_transform_schema_v1/Cargo.toml @@ -10,7 +10,7 @@ version = "0.1.0" crate-type = ["cdylib"] [dependencies] -serde = {workspace = true} +serde = "1.0.140" # Intentionally referencing published version, known to not contain new AST struct changes. # Be careful to change this dependency version. Unless there isn't explicit reason to do so, # do not change. diff --git a/node-swc/e2e/fixtures/plugin_transform_schema_vtest/Cargo.toml b/node-swc/e2e/fixtures/plugin_transform_schema_vtest/Cargo.toml index 0e7b8ab8dd7..86030b010bb 100644 --- a/node-swc/e2e/fixtures/plugin_transform_schema_vtest/Cargo.toml +++ b/node-swc/e2e/fixtures/plugin_transform_schema_vtest/Cargo.toml @@ -10,5 +10,5 @@ version = "0.1.0" crate-type = ["cdylib"] [dependencies] -serde = {workspace = true} +serde = "1.0.140" swc_core = { path = "../../../../crates/swc_core", features = ["__plugin_transform_schema_test"] } diff --git a/rust-toolchain b/rust-toolchain index 0f65080bf5f..4f93cb25623 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-09-23 +nightly-2022-09-23 \ No newline at end of file