diff --git a/package.json b/package.json index df440a7f9..a8ad685ad 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ "@nx/vite": "19.5.7", "@nx/workspace": "19.5.7", "@phenomnomnominal/tsquery": "^5.0.1", - "@rspack/core": "^1.0.0", - "@rspack/dev-server": "^1.0.0", + "@rspack/core": "^1.0.2", + "@rspack/dev-server": "^1.0.2", "@rspack/plugin-minify": "^0.7.5", "@rspack/plugin-react-refresh": "^1.0.0", "@swc-node/register": "1.8.0", diff --git a/packages/rspack/package.json b/packages/rspack/package.json index 5c29a5a3f..f46fe65ae 100644 --- a/packages/rspack/package.json +++ b/packages/rspack/package.json @@ -28,8 +28,8 @@ "stylus-loader": "^7.1.0", "postcss-loader": "^8.1.1", "@nx/eslint": "^19.5.7", - "@rspack/core": "^1.0.0", - "@rspack/plugin-react-refresh": "^1.0.0", + "@rspack/core": "^1.0.2", + "@rspack/plugin-react-refresh": "^1.0.2", "@rspack/plugin-minify": "^0.7.5", "chalk": "~4.1.0" }, diff --git a/packages/rspack/src/utils/versions.ts b/packages/rspack/src/utils/versions.ts index 601d7b410..6805a48e2 100644 --- a/packages/rspack/src/utils/versions.ts +++ b/packages/rspack/src/utils/versions.ts @@ -1,5 +1,5 @@ -export const rspackCoreVersion = '^1.0.0'; -export const rspackDevServerVersion = '^1.0.0'; +export const rspackCoreVersion = '^1.0.2'; +export const rspackDevServerVersion = '^1.0.2'; export const rspackPluginMinifyVersion = '^0.7.5'; export const rspackPluginReactRefreshVersion = '^1.0.0'; diff --git a/packages/rspack/src/utils/with-nx.ts b/packages/rspack/src/utils/with-nx.ts index 3a2ce3f27..ff3cbd3fa 100644 --- a/packages/rspack/src/utils/with-nx.ts +++ b/packages/rspack/src/utils/with-nx.ts @@ -5,6 +5,7 @@ import { RspackPluginInstance, rspack, } from '@rspack/core'; +import { existsSync, readFileSync } from 'fs'; import { LicenseWebpackPlugin } from 'license-webpack-plugin'; import * as path from 'path'; import { join } from 'path'; @@ -34,6 +35,22 @@ export function withNx(_opts = {}) { const plugins = config.plugins ?? []; if (options.extractLicenses) { + /** + * Needed to prevent an issue with Rspack and Workspaces where the + * workspace's root package.json file is added to the dependency tree + */ + let rootPackageJsonName; + const pathToRootPackageJson = join(context.root, 'package.json'); + if (existsSync(pathToRootPackageJson)) { + try { + const rootPackageJson = JSON.parse( + readFileSync(pathToRootPackageJson, 'utf-8') + ); + rootPackageJsonName = rootPackageJson.name; + } catch { + // do nothing + } + } plugins.push( new LicenseWebpackPlugin({ stats: { @@ -41,6 +58,16 @@ export function withNx(_opts = {}) { errors: false, }, outputFilename: `3rdpartylicenses.txt`, + /** + * Needed to prevent an issue with Rspack and Workspaces where the + * workspace's root package.json file is added to the dependency tree + */ + excludedPackageTest: (packageName) => { + if (!rootPackageJsonName) { + return false; + } + return packageName === rootPackageJsonName; + }, }) as unknown as RspackPluginInstance ); } diff --git a/yarn.lock b/yarn.lock index b6315e675..5485c338d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3461,80 +3461,80 @@ "@pnpm/network.ca-file" "^1.0.1" config-chain "^1.1.11" -"@rspack/binding-darwin-arm64@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0.tgz#9878929d1d86a59340495adb6d81ec814f8623ea" - integrity sha512-ZHQk9YK+swlTG48kJTgzFUW9T26KjhLXRok5la7t2AMoiuHyhGHHgC5iQfPJLZ62XzcJ/rfqs2rwakl97151jQ== +"@rspack/binding-darwin-arm64@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-1.0.2.tgz#f25aa507bbb35cf66d9c6d1fb354fc64c74f9efe" + integrity sha512-akRTzBjErSY2+med5AUidBkeVsZ5d+5x7d1MK1ZuirQY/OEOeM9qSASnF43jFY1BDmAl2kgrwGvizPWqPtVjYw== -"@rspack/binding-darwin-x64@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-darwin-x64/-/binding-darwin-x64-1.0.0.tgz#b4b070d50d6591b72eb29f4ab576c063b8779b09" - integrity sha512-qhTXm9wUhv2lBjsqqfCu59RchH1/2jursdPAmTqGc7zMReZdZvtJs2Ri6Ma1M48BLLu+7fS4fbL8Rw1g78TOOQ== +"@rspack/binding-darwin-x64@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-darwin-x64/-/binding-darwin-x64-1.0.2.tgz#f4ab221cff4e220363c9304e385aaa4f11ee46c6" + integrity sha512-qnBRkmqslBoLHIv/gKlzKk6iLkC2G5Qg+O+zUQgTZ6Qepnn+CV0lwevfMlyaLbAE7g3X+525cVx4hHFGjj0wOA== -"@rspack/binding-linux-arm64-gnu@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0.tgz#b88954b6688fbe9d25575ff5c50be17899f6f6ca" - integrity sha512-yKnlsWgvydJRxDBGGKC+cyDeoSzIvOzuVqCloy5oAFAGOMXMY6bznxrkE6/olGZncdeLEpnJzZmXSuF1dYc8ow== +"@rspack/binding-linux-arm64-gnu@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.2.tgz#2c5429ab087b411e64c223221a8bdd268dd35e39" + integrity sha512-EH/RA5FQN4PpqNJWYYemaaIgVTv2R7b/nmxKUIjLGTAT4jYOpJW8pYmBDpwHgjkOsTMIbgdwIYw0fw/vdWATrQ== -"@rspack/binding-linux-arm64-musl@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0.tgz#5726109e6fc4599a0b99c5ca1ca451e23c711b1a" - integrity sha512-dKFmlqlF4FELT/AX02hSwX8aRawjH5zAliQzYnvgrqcEyCKE60vKacGJQ3ZeRyru6dh5MlbUNW4H1+TDT+cDVA== +"@rspack/binding-linux-arm64-musl@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.2.tgz#5ef9b6228b756dc6a1fa0b61932f249a5de0cd2c" + integrity sha512-jO/uemUF7ObUr2gUFYKEhuZtpc5fd400YEHAWHgcM0yUQi4+rWvyvMXQ+Hsy37nbWz5tsxiL9m/vuZr3r7NLCA== -"@rspack/binding-linux-x64-gnu@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0.tgz#28007329b3c9314b0bc6ca58007eb0b9be72b02f" - integrity sha512-fRk9i8aE4FiwW7+LkNyw+5vfFzJ8BZ2seAL9V5U2iwYwYibzFJsukg3h3Uh+IsGm30/7+ZRENtGwybQiMruL4g== +"@rspack/binding-linux-x64-gnu@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.2.tgz#c9de1ded686f0828bf0c7d9ebce3215b6ed784ac" + integrity sha512-8/5zImJcz2K1ayja8982PUffdemkvIKP2LLnF7gsourhUV4GAUwCugR5c5prQ1o9wtt5p6er1c+M39AdzamFdA== -"@rspack/binding-linux-x64-musl@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0.tgz#948a06efb45df6ef5bf940544944c0adfaef8e9f" - integrity sha512-qcTJC8o3KvLwsnrJJcuBjfzSrjEbACMiCB4RtbFNecXDtI+Nputx1CO1SlUrINC25/44ILketf0/hsdBQHk60g== +"@rspack/binding-linux-x64-musl@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.2.tgz#52b2273af31da89023a0e6f29212bcb80a7aadb7" + integrity sha512-HoRHhM5uiqIOH+xB7Xktzjlf2RgpaTzJ29ul/m2sP/7OeWS2xnKe0uOLqI1CsftfsAZtPhS2AMqEiVFSE9WsPg== -"@rspack/binding-win32-arm64-msvc@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0.tgz#78c217280f4cdf3d1751ab77fcbc0dbc4139e4c2" - integrity sha512-gqtakP0Yl2aj+Q/Giwgt31hz8eOZpo2s+sJlkMJGVdIF4dejB31a8vbj/VNGeSN1tDRiLI4cyqa5eQU//t26aQ== +"@rspack/binding-win32-arm64-msvc@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.2.tgz#eba1f3e072ebd6881b0c6a7c9aba514496e21919" + integrity sha512-mIB5McOrRVdBoE7mcGeA8VUzWfr5hSAP8s31IjCevKXxQDLy8bKwB02Gf/cE/R9DR/ngseEJbEDvAXXeBx7quw== -"@rspack/binding-win32-ia32-msvc@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.0.0.tgz#062f6a72d496f2bb18b0a28c81649a6f1603dc44" - integrity sha512-nLfGu5DjdzwawzZ7zK69vZX5aL1Gt9+Ovfz4RlngDq/D5ZzqCnNWw93cqKADgFRWS4qK9vOD9RXNNnkyWB2SEw== +"@rspack/binding-win32-ia32-msvc@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.0.2.tgz#e4e387b0c111d01a987e7ec9823c25f9c271e763" + integrity sha512-3nFTUoN+6OmZ5W816t85+r3OgRrs27iF7RWRw9rqttXMpdAZuh78GSKIY/fDw7PJbt06GDi43QuJDw3KMG+ekQ== -"@rspack/binding-win32-x64-msvc@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0.tgz#cdd6a1f5015f657022ec50b9bd012b3bfb3a3239" - integrity sha512-H9PqjgtZMw5aP+eXdFo7bgSP/Ycwn3oW81uI9qFqOOQ90W+o3T9ItghHBf2/ksc5GHibd208EwOBNxbKwjZDSQ== +"@rspack/binding-win32-x64-msvc@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.2.tgz#d2f5156c8fd39a08402b25db068fd32de98e5861" + integrity sha512-6phTrDps31Z2ZghcpUZFPiRuKj5N/yKxuZzZbbBCHYx47a5dlkKkDJhwgS2mMapg4qwnW5yW444dQ8rY2GPazw== -"@rspack/binding@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/binding/-/binding-1.0.0.tgz#ee696282de6b04c054118bf4b4bfe00ef6317fb1" - integrity sha512-eLyqSEM1h/exJYn98k+9MRktP8AYDB13x5oVn8hoxVucuhk0TubFqQSX8h9SQcZp1O3j/Z8eWWwOaNPe3JU40Q== +"@rspack/binding@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/binding/-/binding-1.0.2.tgz#1e087a07514a656f719abc2be016a9f3498ce4d2" + integrity sha512-ZqYCCaG2mDaFotV1p2bFYS5o+xQrlEg57mm7jBKCiG7AQqOPl57z6B2tLOFNsJ+J0tYvmU8pFONWPvA6PINjDA== optionalDependencies: - "@rspack/binding-darwin-arm64" "1.0.0" - "@rspack/binding-darwin-x64" "1.0.0" - "@rspack/binding-linux-arm64-gnu" "1.0.0" - "@rspack/binding-linux-arm64-musl" "1.0.0" - "@rspack/binding-linux-x64-gnu" "1.0.0" - "@rspack/binding-linux-x64-musl" "1.0.0" - "@rspack/binding-win32-arm64-msvc" "1.0.0" - "@rspack/binding-win32-ia32-msvc" "1.0.0" - "@rspack/binding-win32-x64-msvc" "1.0.0" - -"@rspack/core@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/core/-/core-1.0.0.tgz#01e7b6c543e58d6b411d05b8cc2425d5aba79a6a" - integrity sha512-F4RA9uOLLvD1oTKa96Gcly+Sro1qaqPNENadFyiPwepa7DrwexQa/ym6CQKbvKMOYGKlVSFDPUmgFAirz35ETg== + "@rspack/binding-darwin-arm64" "1.0.2" + "@rspack/binding-darwin-x64" "1.0.2" + "@rspack/binding-linux-arm64-gnu" "1.0.2" + "@rspack/binding-linux-arm64-musl" "1.0.2" + "@rspack/binding-linux-x64-gnu" "1.0.2" + "@rspack/binding-linux-x64-musl" "1.0.2" + "@rspack/binding-win32-arm64-msvc" "1.0.2" + "@rspack/binding-win32-ia32-msvc" "1.0.2" + "@rspack/binding-win32-x64-msvc" "1.0.2" + +"@rspack/core@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/core/-/core-1.0.2.tgz#19968f0203f22cd15d25e08dfeca0261435877cb" + integrity sha512-6HkXdBSNCMhtxxjTVslANEbqbdU5RtablbD/Ll5Th1lEAfKauXwEu7VHpwWJ+r9E3gOect+7T5zjECDMf4FdmQ== dependencies: "@module-federation/runtime-tools" "0.5.1" - "@rspack/binding" "1.0.0" + "@rspack/binding" "1.0.2" "@rspack/lite-tapable" "1.0.0" caniuse-lite "^1.0.30001616" -"@rspack/dev-server@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@rspack/dev-server/-/dev-server-1.0.0.tgz#48f19c345bdd541ac547f51ec486ce02ea5ceb7c" - integrity sha512-ORrF+p31/jLS7tmXp7VLAX654NVpO0jNc9VM9ueG5LAyvf4d+Bo6zhFQTWsoW30uh/Xd1EZjfu+9zu4jn8Zv4Q== +"@rspack/dev-server@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@rspack/dev-server/-/dev-server-1.0.2.tgz#386091d9f13947927a21c041fe5fc73924976dd8" + integrity sha512-fRhnDlTLsghjlp+fG4fBbWLGCiMeWTYGyd6Hf9tYAxFXhQEaYFBpaLJOwFrQgtu1AWUWThY0K0Fk5So1hhxrQA== dependencies: chokidar "^3.6.0" connect-history-api-fallback "^2.0.0" @@ -3542,7 +3542,7 @@ http-proxy-middleware "^2.0.6" mime-types "^2.1.35" webpack-dev-middleware "^7.4.2" - webpack-dev-server "^5.0.4" + webpack-dev-server "5.0.4" ws "^8.16.0" "@rspack/lite-tapable@1.0.0": @@ -12258,7 +12258,7 @@ webpack-dev-middleware@^7.1.0, webpack-dev-middleware@^7.4.2: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@^5.0.4: +webpack-dev-server@5.0.4: version "5.0.4" resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-5.0.4.tgz#cb6ea47ff796b9251ec49a94f24a425e12e3c9b8" integrity sha512-dljXhUgx3HqKP2d8J/fUMvhxGhzjeNVarDLcbO/EWMSgRizDkxHQDZQaLFL5VJY9tRBj2Gz+rvCEYYvhbqPHNA==