diff --git a/.changeset/rotten-badgers-peel.md b/.changeset/rotten-badgers-peel.md new file mode 100644 index 000000000000..6a79bebb9bd9 --- /dev/null +++ b/.changeset/rotten-badgers-peel.md @@ -0,0 +1,9 @@ +--- +'@modern-js/devtools-client': minor +'@modern-js/plugin-devtools': minor +'@modern-js/devtools-kit': minor +--- + +build(devtools): reduce package size by remove radix-ui from dependencies + +build(devtools): 移出 radix-ui 依赖以减小包体积 diff --git a/packages/devtools/client/package.json b/packages/devtools/client/package.json index 7b53b8b354aa..7b0ee05cec7d 100644 --- a/packages/devtools/client/package.json +++ b/packages/devtools/client/package.json @@ -17,6 +17,7 @@ "files": [ "dist" ], + "dependencies": {}, "devDependencies": { "@modern-js-app/eslint-config": "workspace:*", "@modern-js/app-tools": "workspace:*", @@ -56,6 +57,5 @@ "typescript": "~5.0.4", "ufo": "^1.2.0", "valtio": "^1.11.1" - }, - "dependencies": {} + } } diff --git a/packages/devtools/kit/package.json b/packages/devtools/kit/package.json index 5aed9741b0e8..7a50c1e54108 100644 --- a/packages/devtools/kit/package.json +++ b/packages/devtools/kit/package.json @@ -54,9 +54,8 @@ "dependencies": { "@modern-js/types": "workspace:*", "@modern-js/utils": "workspace:*", - "@radix-ui/themes": "^2.0.0", "ufo": "^1.2.0", - "ws": "8.13.0" + "ws": "^8.13.0" }, "devDependencies": { "@modern-js/app-tools": "workspace:*", diff --git a/packages/devtools/plugin/package.json b/packages/devtools/plugin/package.json index f6b099596085..85da0c1cbd3a 100644 --- a/packages/devtools/plugin/package.json +++ b/packages/devtools/plugin/package.json @@ -54,7 +54,7 @@ "@modern-js/utils": "workspace:*", "serve-static": "^1.14.1", "p-defer": "^3.0.0", - "ws": "8.13.0", + "ws": "^8.13.0", "ufo": "^1.3.0" }, "devDependencies": { diff --git a/packages/devtools/plugin/src/index.ts b/packages/devtools/plugin/src/index.ts index d14858945181..27d7e7f2e141 100644 --- a/packages/devtools/plugin/src/index.ts +++ b/packages/devtools/plugin/src/index.ts @@ -1,2 +1,2 @@ export { devtoolsPlugin, default } from './cli'; -export type { DevtoolsPluginOptions } from './cli'; +export type { DevtoolsPluginOptions, DevtoolsPluginInlineOptions } from './cli'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4cb9bce4e6bf..92ea65fac00d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1400,14 +1400,11 @@ importers: '@modern-js/utils': specifier: workspace:* version: link:../../toolkit/utils - '@radix-ui/themes': - specifier: ^2.0.0 - version: 2.0.0(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0) ufo: specifier: ^1.2.0 version: 1.3.0 ws: - specifier: 8.13.0 + specifier: ^8.13.0 version: 8.13.0 devDependencies: '@modern-js/app-tools': @@ -1555,7 +1552,7 @@ importers: specifier: ^1.3.0 version: 1.3.0 ws: - specifier: 8.13.0 + specifier: ^8.13.0 version: 8.13.0 devDependencies: '@modern-js/app-tools': @@ -7154,6 +7151,8 @@ importers: tests/integration/module/fixtures/build/resolve/false: {} + tests/integration/module/fixtures/build/resolve/false/browser-false: {} + tests/integration/module/fixtures/build/resolve/node-protocol: {} tests/integration/module/fixtures/build/resolve/with-condition-exports: {} @@ -13092,6 +13091,7 @@ packages: /@radix-ui/colors@3.0.0: resolution: {integrity: sha512-FUOsGBkHrYJwCSEtWRCIfQbZG7q1e6DgxCIOe1SUQzDe/7rXXeA47s8yCn6fuTNQAj1Zq4oTFi9Yjp3wzElcxg==} + dev: true /@radix-ui/number@1.0.1: resolution: {integrity: sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg==} @@ -13122,6 +13122,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-alert-dialog@1.0.5(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-OrVIOcZL0tl6xibeuGt5/+UxoT2N27KCFOPjFyfXMnchxSHZ/OW7cCX2nGlIYJrbHK/fczPcFzAwvNBB6XBNMA==} @@ -13147,6 +13148,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-arrow@1.0.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==} @@ -13187,6 +13189,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-avatar@1.0.4(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-kVK2K7ZD3wwj3qhle0ElXhOjbezIgyl2hVvgwfIdexL3rN6zJmy5AqqIf+D31lxVppdzV8CjAfZ6PklkmInZLw==} @@ -13210,6 +13213,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-checkbox@1.0.4(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-CBuGQa52aAYnADZVt/KBQzXrwx6TqnlwtcIPGtVt5JkkzQwMOLJjPukimhfKEr4GQNd43C+djUh5Ikopj8pSLg==} @@ -13237,6 +13241,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-collapsible@1.0.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-UBmVDkmR6IvDsloHVN+3rtx4Mi5TFvylYXpluuv0f37dtaz3H99bp8No0LGXRigVpl3UAT4l9j6bIchh42S/Gg==} @@ -13326,6 +13331,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-context@1.0.1(@types/react@18.0.21)(react@18.2.0): resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} @@ -13372,6 +13378,7 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-remove-scroll: 2.5.5(@types/react@18.0.21)(react@18.2.0) + dev: true /@radix-ui/react-direction@1.0.1(@types/react@18.0.21)(react@18.2.0): resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==} @@ -13433,6 +13440,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-dropdown-menu@2.0.6(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-i6TuFOoWmLWq+M/eCLGd/bQ2HfAX1RJgvrBQ6AQLmzfvsLdefxbWu8G9zczcPFfcSPehz9GcpF6K9QYreFV8hA==} @@ -13459,6 +13467,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-focus-guards@1.0.1(@types/react@18.0.21)(react@18.2.0): resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==} @@ -13516,6 +13525,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-form@0.0.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-kgE+Z/haV6fxE5WqIXj05KkaXa3OkZASoTDy25yX2EIp/x0c54rOH/vFr5nOZTg7n7T1z8bSyXmiVIFP9bbhPQ==} @@ -13541,6 +13551,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-hover-card@1.0.7(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-OcUN2FU0YpmajD/qkph3XzMcK/NmSk9hGWnjV68p6QiZMgILugusgQwnLSDs3oFSJYGKf3Y49zgFedhGh04k9A==} @@ -13569,6 +13580,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-icons@1.3.0(react@18.2.0): resolution: {integrity: sha512-jQxj/0LKgp+j9BiTXz3O3sgs26RNet2iLWmsPyRz2SIcR4q/4SbazXfnYwbAr+vLYKSfc7qxzyGQA1HLlYiuNw==} @@ -13611,6 +13623,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-menu@2.0.6(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-BVkFLS+bUC8HcImkRKPSiVumA1VPOOEC5WBMiT+QAVsPzW1FJzI9KnqgGxVDPBcql5xXrHkD3JOVoXWEXD8SYA==} @@ -13648,6 +13661,7 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-remove-scroll: 2.5.5(@types/react@18.0.21)(react@18.2.0) + dev: true /@radix-ui/react-popover@1.0.7(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==} @@ -13682,6 +13696,7 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-remove-scroll: 2.5.5(@types/react@18.0.21)(react@18.2.0) + dev: true /@radix-ui/react-popper@1.1.2(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-1CnGGfFi/bbqtJZZ0P/NQY20xdG3E0LALJaLUEoKwPLwl6PPPfbeiCqMVQnhoFRAxjJj4RpBRJzDmUgsex2tSg==} @@ -13740,6 +13755,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-portal@1.0.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-xLYZeHrWoPmA5mEKEfZZevoVRK/Q43GfzRXkWV6qawIWWK8t6ifIiLQdd7rmQ4Vk1bmI21XhqF9BN3jWf+phpA==} @@ -13780,6 +13796,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-presence@1.0.1(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} @@ -13801,6 +13818,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-primitive@1.0.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} @@ -13850,6 +13868,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-roving-focus@1.0.4(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==} @@ -13906,6 +13925,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-select@1.2.2(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-zI7McXr8fNaSrUY9mZe4x/HC0jTLY9fWNhO1oLWYMQGDXuV4UCivIGTxwioSzO0ZCYX9iSLyWmAh/1TOmX3Cnw==} @@ -13986,6 +14006,7 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-remove-scroll: 2.5.5(@types/react@18.0.21)(react@18.2.0) + dev: true /@radix-ui/react-separator@1.0.3(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==} @@ -14036,6 +14057,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-slot@1.0.2(@types/react@18.0.21)(react@18.2.0): resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} @@ -14076,6 +14098,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-tabs@1.0.4(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog==} @@ -14103,6 +14126,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-toggle-group@1.0.4(@types/react-dom@18.0.6)(@types/react@18.0.21)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-Uaj/M/cMyiyT9Bx6fOZO0SAG4Cls0GptBWiBmBxofmDbNVnYYoyRWj/2M/6VCi/7qcXFWnHhRUfdfZFvvkuu8A==} @@ -14208,6 +14232,7 @@ packages: '@types/react-dom': 18.0.6 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.0.21)(react@18.2.0): resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} @@ -14373,6 +14398,7 @@ packages: classnames: 2.3.2 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: true /@rc-component/context@1.3.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-6QdaCJ7Wn5UZLJs15IEfqy4Ru3OaL5ctqpQYWd5rlfV9wwzrzdt6+kgAQZV/qdB0MUPN4nhyBfRembQCIvBf+w==} @@ -27354,7 +27380,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.21 - ts-node: 10.9.1(@types/node@18.11.17)(typescript@5.0.4) + ts-node: 10.9.1(@types/node@16.11.68)(typescript@5.0.4) yaml: 1.10.2 dev: true