diff --git a/packages/devtools/kit/package.json b/packages/devtools/kit/package.json index 95a915bfe8e8..87cfd973a797 100644 --- a/packages/devtools/kit/package.json +++ b/packages/devtools/kit/package.json @@ -69,7 +69,9 @@ "hookable": "^5.5.3", "ufo": "^1.3.0", "flatted": "^3.2.9", - "ws": "^8.13.0" + "ws": "^8.13.0", + "@rsdoctor/types": "^0.1.3", + "@rsdoctor/utils": "^0.1.3" }, "devDependencies": { "@babel/core": "^7.23.2", @@ -90,22 +92,10 @@ "nanoid": "3.3.4", "react": "~18.2.0", "type-fest": "^4.1.0", - "typescript": "^5", - "@rsdoctor/types": "^0.1.0", - "@rsdoctor/utils": "^0.1.0" + "typescript": "^5" }, "peerDependencies": { - "react": "~18.2.0", - "@rsdoctor/types": "^0.1.0", - "@rsdoctor/utils": "^0.1.0" - }, - "peerDependenciesMeta": { - "@rsdoctor/types": { - "optional": true - }, - "@rsdoctor/utils": { - "optional": true - } + "react": "~18.2.0" }, "sideEffects": false, "publishConfig": { diff --git a/packages/devtools/kit/src/rsdoctor.ts b/packages/devtools/kit/src/rsdoctor.ts index 58ec21befe37..9f66e373de21 100644 --- a/packages/devtools/kit/src/rsdoctor.ts +++ b/packages/devtools/kit/src/rsdoctor.ts @@ -1,4 +1,7 @@ +import path from 'path'; import type { Manifest } from '@rsdoctor/types'; +import fs from '@modern-js/utils/fs-extra'; +import * as utils from '@rsdoctor/utils/common'; export async function fetchShardingFile(url: string): Promise { const { Url } = await import('@rsdoctor/utils/common'); @@ -13,11 +16,6 @@ export async function fetchShardingFile(url: string): Promise { export async function parseManifest( json: Manifest.RsdoctorManifestWithShardingFiles, ): Promise { - const [utils, fs] = await Promise.all([ - import('@rsdoctor/utils/common'), - import('@modern-js/utils/fs-extra'), - ]); - // try to load cloud data first if ('cloudManifestUrl' in json && 'cloudData' in json) { try { @@ -49,8 +47,6 @@ export async function findManifest( dirname: string, silent = false, ): Promise { - const [fs, path] = await Promise.all([import('fs'), import('path')]); - for (const dir of MANIFEST_DIRS) { const manifestPath = path.resolve(dirname, dir, MANIFEST_NAME); if (fs.existsSync(manifestPath)) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7fe7dfe83ad1..4d15f6636f99 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -945,6 +945,12 @@ importers: '@modern-js/utils': specifier: workspace:* version: link:../../toolkit/utils + '@rsdoctor/types': + specifier: ^0.1.3 + version: 0.1.3(esbuild@0.17.19) + '@rsdoctor/utils': + specifier: ^0.1.3 + version: 0.1.3(esbuild@0.17.19) birpc: specifier: 0.2.13 version: 0.2.13 @@ -982,12 +988,6 @@ importers: '@modern-js/uni-builder': specifier: workspace:* version: link:../../cli/uni-builder - '@rsdoctor/types': - specifier: ^0.1.0 - version: 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) - '@rsdoctor/utils': - specifier: ^0.1.0 - version: 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) '@scripts/build': specifier: workspace:* version: link:../../../scripts/build @@ -7953,7 +7953,6 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.23.4 - dev: true /@babel/code-frame@7.23.5: resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} @@ -13806,9 +13805,9 @@ packages: dependencies: '@rsdoctor/graph': 0.1.0(esbuild@0.17.19) '@rsdoctor/sdk': 0.1.0(esbuild@0.17.19) - '@rsdoctor/types': 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) - '@rsdoctor/utils': 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) - '@rspack/core': 0.5.1(@swc/helpers@0.5.3) + '@rsdoctor/types': 0.1.0(esbuild@0.17.19) + '@rsdoctor/utils': 0.1.0(esbuild@0.17.19) + '@rspack/core': 0.5.1 axios: 1.6.7 bytes: 3.1.2 enhanced-resolve: 5.12.0 @@ -13834,8 +13833,8 @@ packages: /@rsdoctor/graph@0.1.0(esbuild@0.17.19): resolution: {integrity: sha512-BT4yM+yajBMA+rrD83OG6JK9nfMmR9B5XP8YgK/BbuPBOfflAwtmAsUnp2s0zwlz8z+E+16gFa++SwqoUgNPBA==} dependencies: - '@rsdoctor/types': 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) - '@rsdoctor/utils': 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) + '@rsdoctor/types': 0.1.0(esbuild@0.17.19) + '@rsdoctor/utils': 0.1.0(esbuild@0.17.19) lodash: 4.17.21 socket.io: 4.7.2 source-map: 0.7.4 @@ -13856,7 +13855,7 @@ packages: '@rsdoctor/core': 0.1.0(esbuild@0.17.19) '@rsdoctor/graph': 0.1.0(esbuild@0.17.19) '@rsdoctor/sdk': 0.1.0(esbuild@0.17.19) - '@rspack/core': 0.5.1(@swc/helpers@0.5.3) + '@rspack/core': 0.5.1 loader-utils: 2.0.4 lodash: 4.17.21 transitivePeerDependencies: @@ -13876,8 +13875,8 @@ packages: dependencies: '@rsdoctor/client': 0.1.0 '@rsdoctor/graph': 0.1.0(esbuild@0.17.19) - '@rsdoctor/types': 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) - '@rsdoctor/utils': 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) + '@rsdoctor/types': 0.1.0(esbuild@0.17.19) + '@rsdoctor/utils': 0.1.0(esbuild@0.17.19) body-parser: 1.20.1 cors: 2.8.5 dayjs: 1.11.6 @@ -13899,10 +13898,10 @@ packages: - webpack-cli dev: true - /@rsdoctor/types@0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19): + /@rsdoctor/types@0.1.0(esbuild@0.17.19): resolution: {integrity: sha512-1aFC75rjvWiK5C4jjYIyHrK7ynkm4Ks1SJByTt1ugIEgTmhku2Ywmzrk+jO67FiZTHbAO2oac1qCJRO9+zAsUw==} dependencies: - '@rspack/core': 0.5.1(@swc/helpers@0.5.3) + '@rspack/core': 0.5.1 '@types/connect': 3.4.35 '@types/estree': 1.0.0 '@types/tapable': 2.2.2 @@ -13916,11 +13915,31 @@ packages: - webpack-cli dev: true - /@rsdoctor/utils@0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19): + /@rsdoctor/types@0.1.3(esbuild@0.17.19): + resolution: {integrity: sha512-MWmSYtwz4qCf3ytcCcYt5ICVSgVFVxBt9O+OqB/D9HgKdCx56moJTIOgA7VeoKca8ax0Z4RQNnHB+v1IBxDkYQ==} + peerDependencies: + '@rspack/core': ^0.5.1 + peerDependenciesMeta: + '@rspack/core': + optional: true + dependencies: + '@types/connect': 3.4.35 + '@types/estree': 1.0.0 + '@types/tapable': 2.2.2 + '@types/webpack': 5.28.0(esbuild@0.17.19) + source-map: 0.7.4 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + - webpack-cli + dev: false + + /@rsdoctor/utils@0.1.0(esbuild@0.17.19): resolution: {integrity: sha512-5kjoQLojazUyKdwsNmISMD+VPKh75mFPBgT18xnV+rczI+RHMQz55enNJ9v3bgZ20cCHl7oJKpyJV/lROnEHTA==} dependencies: '@babel/code-frame': 7.18.6 - '@rsdoctor/types': 0.1.0(@swc/helpers@0.5.3)(esbuild@0.17.19) + '@rsdoctor/types': 0.1.0(esbuild@0.17.19) '@types/estree': 1.0.0 acorn: 8.11.2 acorn-import-assertions: 1.8.0(acorn@8.11.2) @@ -13945,6 +13964,36 @@ packages: - webpack-cli dev: true + /@rsdoctor/utils@0.1.3(esbuild@0.17.19): + resolution: {integrity: sha512-H0KBRopsldvTH4glxIje+7yCs2fxv6gJDR8SPqXwNpHiF1UHEc3m+KOmMTmxzIkb4mOIxmLzNBJlx1sw/UpsLg==} + dependencies: + '@babel/code-frame': 7.18.6 + '@rsdoctor/types': 0.1.3(esbuild@0.17.19) + '@types/estree': 1.0.0 + acorn: 8.11.2 + acorn-import-assertions: 1.8.0(acorn@8.11.2) + acorn-walk: 8.2.0 + bytes: 3.1.2 + chalk: 4.1.2 + connect: 3.7.0 + deep-eql: 4.1.0 + envinfo: 7.8.1 + fs-extra: 11.2.0 + get-port: 5.1.1 + json-stream-stringify: 3.0.1 + lines-and-columns: 2.0.4 + lodash: 4.17.21 + rslog: 1.2.1 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - '@rspack/core' + - '@swc/core' + - esbuild + - supports-color + - uglify-js + - webpack-cli + dev: false + /@rspack/binding-darwin-arm64@0.5.1: resolution: {integrity: sha512-Kc0b94ZN1ecUu2Gyj20kGLWzOrdJbeN1JUTMKZx6jlLa3m7uJ+FhRjnsqFmZ5kdK2zx722ejoKr7xkrl7hOkuw==} cpu: [arm64] @@ -14193,7 +14242,7 @@ packages: '@rspack/binding-win32-ia32-msvc': 0.5.4 '@rspack/binding-win32-x64-msvc': 0.5.4 - /@rspack/core@0.5.1(@swc/helpers@0.5.3): + /@rspack/core@0.5.1: resolution: {integrity: sha512-fsUKPhnBCV7UOE31W03GBfqp7lSRZBcRuvLwrUt1bmTAvl9SRrR0HuWhJAs4O8LvrjKgxRzXPM8Fpysqerfo4w==} engines: {node: '>=16.0.0'} peerDependencies: @@ -14204,7 +14253,6 @@ packages: dependencies: '@module-federation/runtime-tools': 0.0.8 '@rspack/binding': 0.5.1 - '@swc/helpers': 0.5.3 browserslist: 4.22.2 enhanced-resolve: 5.12.0 graceful-fs: 4.2.10 @@ -16390,7 +16438,6 @@ packages: resolution: {integrity: sha512-ujqOVJEeLcwpDVJPnp/k3u1UXmTKq5urJq9fO8aUKg8Vlel5RNOFbVKEfqfh6wGfF/M+HiTJlBJMLC1aDfyf0Q==} dependencies: tapable: 2.2.1 - dev: true /@types/testing-library__jest-dom@5.14.5: resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} @@ -16477,7 +16524,6 @@ packages: - esbuild - uglify-js - webpack-cli - dev: true /@types/ws@8.5.5: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} @@ -17008,7 +17054,6 @@ packages: acorn: ^8 dependencies: acorn: 8.11.2 - dev: true /acorn-import-assertions@1.9.0(acorn@8.11.2): resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} @@ -17048,7 +17093,6 @@ packages: /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} - dev: true /acorn-walk@8.3.1: resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==} @@ -19437,7 +19481,6 @@ packages: engines: {node: '>=6'} dependencies: type-detect: 4.0.8 - dev: true /deep-eql@4.1.3: resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} @@ -19959,7 +20002,6 @@ packages: resolution: {integrity: sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==} engines: {node: '>=4'} hasBin: true - dev: true /eol@0.9.1: resolution: {integrity: sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==} @@ -24081,7 +24123,6 @@ packages: /json-stream-stringify@3.0.1: resolution: {integrity: sha512-vuxs3G1ocFDiAQ/SX0okcZbtqXwgj1g71qE9+vrjJ2EkjKQlEFDAcUNRxRU8O+GekV4v5cM2qXP0Wyt/EMDBiQ==} - dev: true /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} @@ -24325,7 +24366,6 @@ packages: /lines-and-columns@2.0.4: resolution: {integrity: sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true /lint-staged@13.1.4: resolution: {integrity: sha512-pJRmnRA4I4Rcc1k9GZIh9LQJlolCVDHqtJpIgPY7t99XY3uXXmUeDfhRLELYLgUFJPmEsWevTqarex9acSfx2A==} @@ -29444,6 +29484,11 @@ packages: resolution: {integrity: sha512-wtTijPuwUhyVG7YvnIVzlefhlto4qJ9vm42ewwJtqrOBP/vKdZCIyfiYm0odVCR3ajR1CIUqaloIzbqhlbyaZA==} engines: {node: '>=14.17.6'} + /rslog@1.2.1: + resolution: {integrity: sha512-XDMoa858LLZnf4i2kUwyjBQGplXaoSoIfMQf9iji2ano5t1OfSiJsSYpHeOH26DJEc5hdje/4K3wiT6TWL3cRA==} + engines: {node: '>=14.17.6'} + dev: false + /rspack-manifest-plugin@5.0.0-alpha0(webpack@5.89.0): resolution: {integrity: sha512-a84H6P/lK0x3kb0I8Qdiwxrnjt1oNW0j+7kwPMWcODJu8eYFBrTXa1t+14n18Jvg9RKIR6llCH16mYxf2d0s8A==} engines: {node: '>=14'} @@ -30759,8 +30804,8 @@ packages: webpack: 5.89.0(esbuild@0.17.19) dev: false - /terser-webpack-plugin@5.3.9(esbuild@0.17.19)(webpack@5.89.0): - resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} + /terser-webpack-plugin@5.3.10(esbuild@0.18.20)(webpack@5.89.0): + resolution: {integrity: sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==} engines: {node: '>= 10.13.0'} peerDependencies: '@swc/core': '*' @@ -30776,14 +30821,14 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.20 - esbuild: 0.17.19 + esbuild: 0.18.20 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.1 - terser: 5.19.2 - webpack: 5.89.0(esbuild@0.17.19) + terser: 5.27.0 + webpack: 5.89.0(esbuild@0.18.20) - /terser-webpack-plugin@5.3.9(esbuild@0.18.20)(webpack@5.89.0): + /terser-webpack-plugin@5.3.9(esbuild@0.17.19)(webpack@5.89.0): resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -30800,12 +30845,12 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.20 - esbuild: 0.18.20 + esbuild: 0.17.19 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.1 terser: 5.19.2 - webpack: 5.89.0(esbuild@0.18.20) + webpack: 5.89.0(esbuild@0.17.19) /terser@5.19.2: resolution: {integrity: sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==} @@ -30826,7 +30871,6 @@ packages: acorn: 8.11.2 commander: 2.20.3 source-map-support: 0.5.21 - dev: false /terser@5.27.2: resolution: {integrity: sha512-sHXmLSkImesJ4p5apTeT63DsV4Obe1s37qT8qvwHRmVxKTBH7Rv9Wr26VcAMmLbmk9UliiwK8z+657NyJHHy/w==} @@ -32332,7 +32376,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.9(esbuild@0.18.20)(webpack@5.89.0) + terser-webpack-plugin: 5.3.10(esbuild@0.18.20)(webpack@5.89.0) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: