From 7ca4d00c587ca9de10d3a1c7eb50b8e466c13905 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Mon, 28 Oct 2024 16:57:59 -0700 Subject: [PATCH] feat: upgrade default swc version to 1.7.40 --- .prettierignore | 3 +- MODULE.bazel | 2 +- examples/plugins/BUILD.bazel | 1 - examples/plugins/package.json | 2 +- examples/pnpm-lock.yaml | 79 +++++++++++++---------------------- swc/repositories.bzl | 4 +- 6 files changed, 34 insertions(+), 57 deletions(-) diff --git a/.prettierignore b/.prettierignore index 0580e93..f3e5016 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ docs/*.md +examples/pnpm-lock.yaml **/expected.js **/expected.cjs -**/expected_tsc \ No newline at end of file +**/expected_tsc diff --git a/MODULE.bazel b/MODULE.bazel index 312515b..06e3c8d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -15,7 +15,7 @@ bazel_dep(name = "platforms", version = "0.0.7") swc = use_extension("@aspect_rules_swc//swc:extensions.bzl", "swc") swc.toolchain( name = "swc", - swc_version = "v1.6.6", + swc_version = "v1.7.40", ) use_repo(swc, "swc_toolchains") diff --git a/examples/plugins/BUILD.bazel b/examples/plugins/BUILD.bazel index 08aa7f5..dc023b1 100644 --- a/examples/plugins/BUILD.bazel +++ b/examples/plugins/BUILD.bazel @@ -18,7 +18,6 @@ swc_plugin( name = "npm_plugin", srcs = [ # reference the location where the "@swc/plugin-transform-imports" npm package was linked in our root Bazel package. - ":node_modules/@swc/plugin-transform-imports", ":node_modules/@swc/plugin-transform-imports/dir", ], # optional plugin config, the JSON object for the plugin passed into jsc.experimental.plugins diff --git a/examples/plugins/package.json b/examples/plugins/package.json index 037b789..c21f4ee 100644 --- a/examples/plugins/package.json +++ b/examples/plugins/package.json @@ -1,6 +1,6 @@ { "private": true, "devDependencies": { - "@swc/plugin-transform-imports": "1.5.70" + "@swc/plugin-transform-imports": "^3.0.0" } } diff --git a/examples/pnpm-lock.yaml b/examples/pnpm-lock.yaml index cad2480..f9ec2ff 100644 --- a/examples/pnpm-lock.yaml +++ b/examples/pnpm-lock.yaml @@ -1,10 +1,11 @@ -lockfileVersion: "6.1" +lockfileVersion: '6.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false importers: + .: dependencies: source-map-support: @@ -13,7 +14,7 @@ importers: devDependencies: typescript: specifier: 5.2.2 - version: registry.npmjs.org/typescript@5.2.2 + version: 5.2.2 generate_swcrc: devDependencies: @@ -23,86 +24,62 @@ importers: plugins: devDependencies: - "@swc/plugin-transform-imports": - specifier: 1.5.70 - version: 1.5.70 + '@swc/plugin-transform-imports': + specifier: ^3.0.0 + version: 3.0.4 packages: + /@fastify/deepmerge@1.3.0: - resolution: - { - integrity: sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==, - } + resolution: {integrity: sha512-J8TOSBq3SoZbDhM9+R/u77hP93gz/rajSA+K2kGyijPpORPWUXHUpTaleoj+92As0S9uPRP7Oi8IqMf0u+ro6A==} dev: true - /@swc/plugin-transform-imports@1.5.70: - resolution: - { - integrity: sha512-cERR7gMvqiLMWyS7wWGBPWW77Mz23ss/8iAfLj5V+6CdBGYfabpAmBmqR18mvJ2qGc1Dg1GHLPN8JcMXcX95JA==, - } + /@swc/counter@0.1.3: + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + dev: true + + /@swc/plugin-transform-imports@3.0.4: + resolution: {integrity: sha512-ubmNyCgaXtRNstdU/rv33QGFt6i4YZM9mL1IrrMkVbCVC+2xFNN6SKaJUdcNHkzgLWumK8H29Xman3CAOtR1Jw==} + dependencies: + '@swc/counter': 0.1.3 dev: true /buffer-from@1.1.2: - resolution: - { - integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==, - } + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: false /joycon@3.1.1: - resolution: - { - integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==, - } - engines: { node: ">=10" } + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} dev: true /jsonc-parser@3.2.0: - resolution: - { - integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==, - } + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} dev: true /source-map-support@0.5.21: - resolution: - { - integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==, - } + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: buffer-from: 1.1.2 source-map: 0.6.1 dev: false /source-map@0.6.1: - resolution: - { - integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, - } - engines: { node: ">=0.10.0" } + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} dev: false /tsconfig-to-swcconfig@2.4.0: - resolution: - { - integrity: sha512-vT1hUG06TC3XCRQoina91VGH5HKfxYgA4hN2Ly0uNxHKNeCds++7aBE2Je62FUTKvvdkTpLjmynF8bzgYcDymA==, - } + resolution: {integrity: sha512-vT1hUG06TC3XCRQoina91VGH5HKfxYgA4hN2Ly0uNxHKNeCds++7aBE2Je62FUTKvvdkTpLjmynF8bzgYcDymA==} hasBin: true dependencies: - "@fastify/deepmerge": 1.3.0 + '@fastify/deepmerge': 1.3.0 joycon: 3.1.1 jsonc-parser: 3.2.0 dev: true - registry.npmjs.org/typescript@5.2.2: - resolution: - { - integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==, - registry: https://registry.npmjs.com/, - tarball: https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz, - } - name: typescript - version: 5.2.2 - engines: { node: ">=14.17" } + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} hasBin: true dev: true diff --git a/swc/repositories.bzl b/swc/repositories.bzl index 8030ece..1481fd8 100644 --- a/swc/repositories.bzl +++ b/swc/repositories.bzl @@ -38,10 +38,10 @@ load("//swc/private:versions.bzl", "TOOL_VERSIONS") # NB: we don't use the "most recent release" since swc has a history of often breaking Bazel usage # with subtle changes that get through their tests. # So instead, this reflects the latest version that is "known good" according to our test suite. -LATEST_SWC_VERSION = "v1.6.6" +LATEST_SWC_VERSION = TOOL_VERSIONS.keys()[0] # TODO(2.0): remove this alias -LATEST_VERSION = LATEST_SWC_VERSION +LATEST_VERSION = "v1.6.6" _DOC = "Fetch external dependencies needed to run the SWC cli" _ATTRS = {