Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/violet-pants-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@hyperse/inspector-babel-plugin": patch
"@hyperse/inspector-middleware": patch
"@hyperse/inspector-component": patch
"@hyperse/inspector-swc-plugin": patch
"@hyperse/inspector-common": patch
"@hyperse/next-inspector": patch
"@hyperse/inspector": patch
---

chore: update package versions and configurations for improved compatibility and performance; includes dependency upgrades and adjustments to TypeScript configurations
77 changes: 38 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@ serde_json = { version = "1.0.145", default-features = false, features =
tracing = { version = "0.1.41", features = ["max_level_trace", "release_max_level_trace"] }

# Must be pinned with the same swc versions
swc = { version = "52.0.0", default-features = false }
swc_common = { version = "18.0.1", default-features = false }
swc_config = { version = "3.1.2" , default-features = false}
swc_core = { version = "54.0.0", default-features = false, features = ["parallel_rayon"] }
swc_ecma_minifier = { version = "42.0.0", default-features = false }
swc_error_reporters = { version = "20.0.0", default-features = false }
swc_html = { version = "30.0.0", default-features = false}
swc_html_minifier = { version = "42.0.0", default-features = false }
swc_node_comments = { version = "18.0.0", default-features = false}
swc = { version = "62.0.0", default-features = false }
swc_common = { version = "21.0.1", default-features = false }
swc_config = { version = "4.0.0" , default-features = false}
swc_core = { version = "64.0.0", default-features = false, features = ["parallel_rayon"] }
swc_ecma_minifier = { version = "52.0.0", default-features = false }
swc_error_reporters = { version = "23.0.0", default-features = false }
swc_html = { version = "33.0.0", default-features = false}
swc_html_minifier = { version = "52.0.0", default-features = false }
swc_node_comments = { version = "21.0.0", default-features = false}
swc_parallel = { version = "1.3.0", default-features = false, features = ["rayon"] }
swc_ecma_ast = { version = "19.0.0", default-features = false}
swc_ecma_utils = { version = "25.0.0", default-features = false}
swc_ecma_visit = { version = "19.0.0", default-features = false}
swc_ecma_ast = { version = "23.0.0", default-features = false}
swc_ecma_utils = { version = "29.1.0", default-features = false}
swc_ecma_visit = { version = "23.0.0", default-features = false}
swc_plugin_macro = { version = "1.1.0", default-features = false }
swc_atoms = { version = "9.0.0", default-features = false}
swc_cached = { version = "2.0.0", default-features = false}
swc_ecma_transforms_react = { version = "38.0.0", default-features = false}
swc_ecma_transforms_testing = { version = "38.0.0", default-features = false}
swc_ecma_transforms_react = { version = "46.0.0", default-features = false}
swc_ecma_transforms_testing = { version = "46.0.0", default-features = false}
swc_trace_macro = { version = "2.0.0", default-features = false}
testing = { version = "19.0.0", default-features = false}
convert_case = { version = "0.10.0", default-features = false}
testing = { version = "22.0.0", default-features = false}
convert_case = { version = "0.11.0", default-features = false}
Comment on lines +25 to +45

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 1. Confirm cargo resolves without duplicated swc_* crates and plugin builds.
#    (build may fail in sandbox if it can't fetch — focus on resolution / tree.)
cargo tree -p swc_core --edges=no-dev 2>&1 | head -80
cargo tree 2>&1 | rg -n '^\S*swc_' | sort -u

# 2. Confirm swc_core 64.0.0 actually requires the pinned sibling versions.
curl -s https://crates.io/api/v1/crates/swc_core/64.0.0/dependencies | \
  jq '.dependencies[] | select(.crate_id|startswith("swc_")) | {crate_id, req}'

# 3. Sanity-check that swc_ecma_utils 29.1.0 exists and isn't a typo.
curl -s https://crates.io/api/v1/crates/swc_ecma_utils | \
  jq '.versions[0:6] | .[] | {num, created_at}'

# 4. Find which host-runtime versions the plugin will be loaded by (README/docs).
rg -nP '(`@swc/core`|next|rspack)\b.*\b\d+\.\d+' -g '!**/node_modules/**' -g '*.md' -g 'package.json' | head -40

Repository: hyperse-io/code-inspector

Length of output: 5051


🌐 Web query:

What swc_plugin_runner / host runtime versions are compatible with swc_core 64.0.0 WASM plugins per plugins.swc.rs?

💡 Result:

No specific compatibility information found for swc_core 64.0.0 WASM plugins on plugins.swc.rs or official docs. swc_core latest released version is 63.1.3 (as of 2026-04-14). Compatibility is determined by matching swc_core versions between plugins (built with specific swc_core) and host runtimes (@swc/core, Next.js, Rspack). Use https://plugins.swc.rs/ to select runtime/framework version and find compatible plugin swc_core versions. For plugins built with swc_core >=47, enable swc_ast_unknown cfg for partial backward compatibility across @swc/core versions.

Citations:


🏁 Script executed:

# 1. Check what swc_core version `@swc/core` 1.15.30 bundles
curl -s https://registry.npmjs.org/@swc/core/1.15.30 | \
  jq '.dependencies, .optionalDependencies' 2>/dev/null || echo "Package not found"

# 2. Check if `@swc/core` 1.15 or 2.x exists to understand versioning
curl -s https://registry.npmjs.org/@swc/core | \
  jq '.versions | keys[-20:]' 2>/dev/null

# 3. Check Next.js 16.2.4 and Rspack 2.0.0 bundled/peer dependencies for `@swc/core`
curl -s https://registry.npmjs.org/next/16.2.4 | \
  jq '.dependencies["@swc/core"] // .peerDependencies["@swc/core"] // "not found"'
  
curl -s https://registry.npmjs.org/@rspack/core/2.0.0 | \
  jq '.dependencies["@swc/core"] // .peerDependencies["@swc/core"] // "not found"'

Repository: hyperse-io/code-inspector

Length of output: 1121


🌐 Web query:

@swc/core 1.15.30 swc_core version bundled 64.0.0

💡 Result:

@swc/core version 1.15.30 bundles swc_core version 64.0.0. This is a nightly release (e.g., 1.15.30-nightly-20260418.1 for the linux-x64-gnu platform), as evidenced by Snyk indexing the package published around 2026-04-19. Multiple GitHub releases from April 19, 18, and earlier explicitly tag "swc_core v64.0.0", aligning with the pattern seen in stable releases like 1.15.24 bundling v62.0.0 and 1.15.21 with v59.0.1. The swc_core crate's latest stable is v63.1.3 (crates.io, updated 2026-04-14), confirming v64.0.0 is from a recent nightly build used in @swc/core's platform-specific binaries.

Citations:


🏁 Script executed:

# Check Next.js 16.2.4 bundled swc by looking at package tarball contents or release info
curl -s https://registry.npmjs.org/next/16.2.4 | jq '.dist' | head -20

# Try checking the published changelog or release info
curl -s 'https://api.github.com/repos/vercel/next.js/releases' | \
  jq '.[] | select(.tag_name=="v16.2.4") | {tag_name, body}' | head -100

# Check Rspack 2.0.0 similarly
curl -s 'https://api.github.com/repos/web-infra-dev/rspack/releases' | \
  jq '.[] | select(.tag_name | contains("2.0.0")) | {tag_name, body}' | head -100

Repository: hyperse-io/code-inspector

Length of output: 50468


🌐 Web query:

Next.js 16.2.4 bundled @swc/core version SWC compiler

💡 Result:

Next.js 16.2.4 bundles the SWC compiler via its internal @next/swc package, which uses swc_core version likely around 56.0.0 or later (based on recent updates in the repository). The exact version is specified in the Cargo.toml file of the next.js monorepo at the v16.2.4 tag, typically swc_core = { version = "56.x.x", features = [...] }. No npm @swc/core package is directly bundled; Next.js uses native Rust-based SWC binaries compiled from swc_core. To check the precise version in a project, inspect node_modules/.pnpm/next-swc@16.2.4/node_modules/next-swc/native/* or the Cargo.lock file in the source.

Citations:


🌐 Web query:

Rspack 2.0.0 @swc/core bundled version

💡 Result:

Rspack 2.0.0 bundles @swc/core version 62.x (exact patch version not explicitly stated in sources, but the final pre-release bump was to swc_core 62 in PR #13602, merged before the 2.0.0 release on 2026-04-22).

Citations:


Critical: swc_core 64.0.0 is incompatible with Next.js 16.2.4 and Rspack 2.0.0 bundled WASM plugin hosts.

The README documents Next.js >=16.1.1 and Rspack >=1.6.0 support, and examples show Next.js 16.2.4 and Rspack 2.0.0. However:

  • Next.js 16.2.4 bundles swc_core ~56.x via @next/swc
  • Rspack 2.0.0 bundles @swc/core 62.x (swc_core 62)

Neither version is compatible with WASM plugins built against swc_core 64.0.0. This mismatch will cause failed to run Wasm plugin transform errors at runtime. Verify the actual swc_core versions shipped by your targeted Next.js and Rspack versions before merging. If this is an intentional toolchain jump, update the version constraints in the README and examples accordingly.

The internal Cargo.toml pins are consistent: all match swc_core 64.0.0's exact dependency requirements (swc_ecma_utils 29.1.0 is correct, not a typo). Cargo will resolve without duplication if dependencies fetch successfully.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cargo.toml` around lines 25 - 45, The Cargo.toml pins swc_core = "64.0.0"
which is incompatible with the swc versions bundled by the targeted Next.js
(≈56.x) and Rspack (≈62.x) releases; to fix, change the swc_core dependency (and
any tightly coupled swc_* entries that require exact swc_core compatibility such
as swc_ecma_utils, swc_core, swc, swc_parallel) to a version that matches the
bundled runtime (e.g., align to 62.x for Rspack 2.0.0 or to the specific
`@next/swc` version for Next.js 16.2.4) OR explicitly document and bump the
README/examples to require the newer toolchain if you intentionally want 64.0.0;
update the swc_core declaration and any sibling swc_* pins in Cargo.toml (and
adjust README/example version constraints) so runtime WASM plugin ABI matches
the shipped swc.

handlebars = { version = "6.3.2", default-features = false}

[profile.release]
Expand Down
21 changes: 10 additions & 11 deletions crates/inspector-swc-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,18 @@
"typecheck": "tsc --project ./tsconfig.json --noEmit"
},
"devDependencies": {
"@hyperse/eslint-config-hyperse": "^1.5.0",
"@hyperse/eslint-config-hyperse": "^1.7.2",
"@hyperse/inspector-common": "workspace:*",
"@swc/core": "~1.15.8",
"@swc/wasm-web": "^1.15.8",
"@types/node": "^25.0.3",
"@vitest/coverage-istanbul": "^4.0.16",
"@vitest/ui": "^4.0.16",
"eslint": "^9.39.2",
"@swc/core": "~1.15.30",
"@swc/wasm-web": "^1.15.30",
"@types/node": "^25.6.0",
"@vitest/coverage-istanbul": "^4.1.5",
"@vitest/ui": "^4.1.5",
"eslint": "^10.2.1",
"npm-run-all": "^4.1.5",
"rimraf": "^6.1.2",
"typescript": "^5.9.3",
"vite-tsconfig-paths": "^6.0.3",
"vitest": "^4.0.16"
"rimraf": "^6.1.3",
"typescript": "^6.0.3",
"vitest": "^4.1.5"
Comment on lines +55 to +57

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd crates/inspector-swc-plugin && cat -n package.json | grep -A 10 -B 10 "engines"

Repository: hyperse-io/code-inspector

Length of output: 592


🌐 Web query:

vitest 4.1.5 node version requirements

💡 Result:

Vitest 4.1.5 requires Node.js >= 20.0.0.

Citations:


Align the development engine with Vitest 4 Node requirements.

vitest@^4.1.5 requires Node 20+, but this package advertises Node >=18.0.0. This mismatch can cause installation or runtime failures in Node 18-19 environments. Update the engines declaration:

   "engines": {
-    "node": ">=18.0.0"
+    "node": ">=20.0.0"
   },

This applies to lines 59-60.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/inspector-swc-plugin/package.json` around lines 55 - 57, The package
advertises Node ">=18.0.0" but depends on vitest@^4.1.5 which requires Node 20+,
so update the engines field in package.json to require Node >=20.0.0; open the
package.json entry for "engines" and change the Node version constraint
(reference: the vitest dependency and the "engines" field) so the declared Node
range matches Vitest's requirements and avoids install/runtime failures on Node
18/19.

},
"engines": {
"node": ">=18.0.0"
Expand Down
1 change: 0 additions & 1 deletion crates/inspector-swc-plugin/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"sourceMap": false,
"outDir": "./dist",
"rootDir": "./src",
"baseUrl": "./",
"paths": {}
},
"include": ["./src/index.ts"],
Expand Down
1 change: 0 additions & 1 deletion crates/inspector-swc-plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./",
"noImplicitAny": false,
"allowJs": false,
"noEmit": false,
Expand Down
9 changes: 7 additions & 2 deletions crates/inspector-swc-plugin/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import tsconfigPaths from 'vite-tsconfig-paths';
import { configDefaults, defineConfig } from 'vitest/config';

export default defineConfig({
plugins: [tsconfigPaths()],
plugins: [],
resolve: {
tsconfigPaths: true,
},
test: {
globals: true,
testTimeout: 5000 * 10000,
hookTimeout: 5000 * 10000,
reporters: [['verbose', { summary: true }]],
exclude: [...configDefaults.exclude],
include: ['**/?(*.){test,spec}.?(c|m)[jt]s?(x)'],
},
Expand Down
2 changes: 2 additions & 0 deletions examples/example-nextjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ Before running the demo, you need to build the library first
```bash
yarn g:build
```


Loading
Loading