@nx/rspack 23.0.0-beta.23 → 23.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{app-plugin.d.ts → dist/app-plugin.d.ts} +0 -1
- package/{module-federation.d.ts → dist/module-federation.d.ts} +0 -1
- package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
- package/{react-plugin.d.ts → dist/react-plugin.d.ts} +0 -1
- package/dist/readme-template.md +18 -0
- package/{src → dist/src}/executors/dev-server/dev-server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/dev-server/lib/get-dev-server-config.d.ts +0 -1
- package/{src → dist/src}/executors/dev-server/lib/serve-path.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-dev-server/lib/index.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-dev-server/lib/start-remotes.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-dev-server/module-federation-dev-server.impl.js +5 -6
- package/{src → dist/src}/executors/module-federation-ssr-dev-server/lib/index.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -1
- package/{src → dist/src}/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +4 -4
- package/{src → dist/src}/executors/module-federation-ssr-dev-server/schema.d.ts +1 -1
- package/{src → dist/src}/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +1 -2
- package/{src → dist/src}/executors/module-federation-static-server/module-federation-static-server.impl.js +9 -12
- package/{src → dist/src}/executors/rspack/lib/config.d.ts +0 -1
- package/{src → dist/src}/executors/rspack/lib/config.js +5 -2
- package/{src → dist/src}/executors/rspack/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/executors/rspack/rspack.impl.d.ts +0 -1
- package/{src → dist/src}/executors/ssr-dev-server/lib/wait-until-server-is-listening.d.ts +0 -1
- package/{src → dist/src}/executors/ssr-dev-server/ssr-dev-server.impl.d.ts +0 -1
- package/{src → dist/src}/generators/configuration/configuration.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/extract-rspack-options.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/normalize-path-options.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/utils.d.ts +0 -1
- package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/validate-project.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/ast.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/build-post-target-transformer.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/index.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/utils/types.d.ts +0 -1
- package/{src → dist/src}/generators/convert-webpack/convert-webpack.d.ts +0 -1
- package/{src → dist/src}/generators/convert-webpack/lib/transform-cjs.d.ts +0 -1
- package/{src → dist/src}/generators/convert-webpack/lib/transform-esm.d.ts +0 -1
- package/{src → dist/src}/generators/convert-webpack/lib/transform-plugin-config.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.js +2 -3
- package/{src → dist/src}/index.d.ts +0 -1
- package/{src → dist/src}/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts +0 -1
- package/{src → dist/src}/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts +0 -1
- package/{src → dist/src}/migrations/update-22-0-0/remove-deprecated-options.d.ts +0 -1
- package/{src → dist/src}/migrations/update-23-0-0/add-svgr-to-rspack-config.d.ts +0 -1
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +134 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
- package/{src → dist/src}/plugins/generate-package-json-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/nx-react-rspack-plugin/nx-react-rspack-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/apply-base-config.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/apply-react-config.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/apply-web-config.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/get-css-module-local-ident.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/get-non-buildable-libs.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/get-terser-ecma-version.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/get-transitive-deps.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/hash-format.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/instantiate-script-plugins.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/is-lib-buildable.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/loaders/stylesheet-loaders.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/models.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/normalize-entry.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/plugins/generate-package-json-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/plugins/normalize-options.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/plugins/nx-tsconfig-paths-rspack-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/plugins/postcss-cli-resources.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/plugins/rspack-nx-build-coordination-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/plugins/scripts-rspack-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/utils/plugins/stats-json-plugin.d.ts +0 -1
- package/{src → dist/src}/plugins/write-index-html-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/assert-supported-rspack-version.d.ts +0 -1
- package/{src → dist/src}/utils/config.d.ts +14 -1
- package/{src → dist/src}/utils/config.js +17 -0
- package/{src → dist/src}/utils/create-compiler.d.ts +0 -1
- package/{src → dist/src}/utils/deprecation.d.ts +3 -1
- package/dist/src/utils/deprecation.js +50 -0
- package/{src → dist/src}/utils/e2e-web-server-info-utils.d.ts +0 -1
- package/{src → dist/src}/utils/generator-utils.d.ts +0 -1
- package/{src → dist/src}/utils/get-copy-patterns.d.ts +0 -1
- package/{src → dist/src}/utils/has-plugin.d.ts +0 -1
- package/{src → dist/src}/utils/jest-utils.d.ts +0 -1
- package/{src → dist/src}/utils/mode-utils.d.ts +0 -1
- package/{src → dist/src}/utils/model.d.ts +0 -1
- package/{src → dist/src}/utils/module-federation-deprecation.d.ts +0 -1
- package/{src → dist/src}/utils/normalize-assets.d.ts +0 -1
- package/{src → dist/src}/utils/read-rspack-options.d.ts +0 -1
- package/{src → dist/src}/utils/resolve-user-defined-rspack-config.d.ts +0 -1
- package/{src → dist/src}/utils/version-utils.d.ts +0 -1
- package/{src → dist/src}/utils/versions.d.ts +0 -1
- package/{src → dist/src}/utils/versions.js +2 -1
- package/{src → dist/src}/utils/webpack/interpolate-env-variables-to-index.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/normalize-entry.d.ts +0 -1
- package/{src → dist/src}/utils/webpack/package-chunk-sort.d.ts +0 -1
- package/{src → dist/src}/utils/with-nx.d.ts +4 -1
- package/{src → dist/src}/utils/with-nx.js +6 -0
- package/{src → dist/src}/utils/with-react.d.ts +6 -1
- package/{src → dist/src}/utils/with-react.js +8 -0
- package/{src → dist/src}/utils/with-web.d.ts +6 -1
- package/{src → dist/src}/utils/with-web.js +8 -0
- package/executors.json +12 -12
- package/generators.json +10 -10
- package/migrations.json +13 -7
- package/package.json +113 -9
- package/app-plugin.d.ts.map +0 -1
- package/module-federation.d.ts.map +0 -1
- package/plugin.d.ts.map +0 -1
- package/react-plugin.d.ts.map +0 -1
- package/src/executors/dev-server/dev-server.impl.d.ts.map +0 -1
- package/src/executors/dev-server/lib/get-dev-server-config.d.ts.map +0 -1
- package/src/executors/dev-server/lib/serve-path.d.ts.map +0 -1
- package/src/executors/module-federation-dev-server/lib/index.d.ts.map +0 -1
- package/src/executors/module-federation-dev-server/lib/normalize-options.d.ts.map +0 -1
- package/src/executors/module-federation-dev-server/lib/start-remotes.d.ts.map +0 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts.map +0 -1
- package/src/executors/module-federation-ssr-dev-server/lib/index.d.ts.map +0 -1
- package/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts.map +0 -1
- package/src/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts.map +0 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts.map +0 -1
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts.map +0 -1
- package/src/executors/rspack/lib/config.d.ts.map +0 -1
- package/src/executors/rspack/lib/normalize-options.d.ts.map +0 -1
- package/src/executors/rspack/rspack.impl.d.ts.map +0 -1
- package/src/executors/ssr-dev-server/lib/wait-until-server-is-listening.d.ts.map +0 -1
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.d.ts.map +0 -1
- package/src/generators/configuration/configuration.d.ts.map +0 -1
- package/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.d.ts.map +0 -1
- package/src/generators/convert-config-to-rspack-plugin/lib/extract-rspack-options.d.ts.map +0 -1
- package/src/generators/convert-config-to-rspack-plugin/lib/normalize-path-options.d.ts.map +0 -1
- package/src/generators/convert-config-to-rspack-plugin/lib/utils.d.ts.map +0 -1
- package/src/generators/convert-config-to-rspack-plugin/lib/validate-project.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/ast.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/build-post-target-transformer.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/index.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/utils/types.d.ts.map +0 -1
- package/src/generators/convert-webpack/convert-webpack.d.ts.map +0 -1
- package/src/generators/convert-webpack/lib/transform-cjs.d.ts.map +0 -1
- package/src/generators/convert-webpack/lib/transform-esm.d.ts.map +0 -1
- package/src/generators/convert-webpack/lib/transform-plugin-config.d.ts.map +0 -1
- package/src/generators/init/init.d.ts.map +0 -1
- package/src/index.d.ts.map +0 -1
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts.map +0 -1
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts.map +0 -1
- package/src/migrations/update-22-0-0/remove-deprecated-options.d.ts.map +0 -1
- package/src/migrations/update-23-0-0/add-svgr-to-rspack-config.d.ts.map +0 -1
- package/src/plugins/generate-package-json-plugin.d.ts.map +0 -1
- package/src/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.d.ts.map +0 -1
- package/src/plugins/nx-react-rspack-plugin/nx-react-rspack-plugin.d.ts.map +0 -1
- package/src/plugins/plugin.d.ts.map +0 -1
- package/src/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.d.ts.map +0 -1
- package/src/plugins/utils/apply-base-config.d.ts.map +0 -1
- package/src/plugins/utils/apply-react-config.d.ts.map +0 -1
- package/src/plugins/utils/apply-web-config.d.ts.map +0 -1
- package/src/plugins/utils/get-css-module-local-ident.d.ts.map +0 -1
- package/src/plugins/utils/get-non-buildable-libs.d.ts.map +0 -1
- package/src/plugins/utils/get-terser-ecma-version.d.ts.map +0 -1
- package/src/plugins/utils/get-transitive-deps.d.ts.map +0 -1
- package/src/plugins/utils/hash-format.d.ts.map +0 -1
- package/src/plugins/utils/instantiate-script-plugins.d.ts.map +0 -1
- package/src/plugins/utils/is-lib-buildable.d.ts.map +0 -1
- package/src/plugins/utils/loaders/stylesheet-loaders.d.ts.map +0 -1
- package/src/plugins/utils/models.d.ts.map +0 -1
- package/src/plugins/utils/normalize-entry.d.ts.map +0 -1
- package/src/plugins/utils/plugins/generate-package-json-plugin.d.ts.map +0 -1
- package/src/plugins/utils/plugins/normalize-options.d.ts.map +0 -1
- package/src/plugins/utils/plugins/nx-tsconfig-paths-rspack-plugin.d.ts.map +0 -1
- package/src/plugins/utils/plugins/postcss-cli-resources.d.ts.map +0 -1
- package/src/plugins/utils/plugins/rspack-nx-build-coordination-plugin.d.ts.map +0 -1
- package/src/plugins/utils/plugins/scripts-rspack-plugin.d.ts.map +0 -1
- package/src/plugins/utils/plugins/stats-json-plugin.d.ts.map +0 -1
- package/src/plugins/write-index-html-plugin.d.ts.map +0 -1
- package/src/utils/assert-supported-rspack-version.d.ts.map +0 -1
- package/src/utils/config.d.ts.map +0 -1
- package/src/utils/create-compiler.d.ts.map +0 -1
- package/src/utils/deprecation.d.ts.map +0 -1
- package/src/utils/deprecation.js +0 -21
- package/src/utils/e2e-web-server-info-utils.d.ts.map +0 -1
- package/src/utils/generator-utils.d.ts.map +0 -1
- package/src/utils/get-copy-patterns.d.ts.map +0 -1
- package/src/utils/has-plugin.d.ts.map +0 -1
- package/src/utils/jest-utils.d.ts.map +0 -1
- package/src/utils/mode-utils.d.ts.map +0 -1
- package/src/utils/model.d.ts.map +0 -1
- package/src/utils/module-federation-deprecation.d.ts.map +0 -1
- package/src/utils/normalize-assets.d.ts.map +0 -1
- package/src/utils/read-rspack-options.d.ts.map +0 -1
- package/src/utils/resolve-user-defined-rspack-config.d.ts.map +0 -1
- package/src/utils/version-utils.d.ts.map +0 -1
- package/src/utils/versions.d.ts.map +0 -1
- package/src/utils/webpack/interpolate-env-variables-to-index.d.ts.map +0 -1
- package/src/utils/webpack/normalize-entry.d.ts.map +0 -1
- package/src/utils/webpack/package-chunk-sort.d.ts.map +0 -1
- package/src/utils/with-nx.d.ts.map +0 -1
- package/src/utils/with-react.d.ts.map +0 -1
- package/src/utils/with-web.d.ts.map +0 -1
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{app-plugin.js → dist/app-plugin.js} +0 -0
- /package/{module-federation.js → dist/module-federation.js} +0 -0
- /package/{plugin.js → dist/plugin.js} +0 -0
- /package/{react-plugin.js → dist/react-plugin.js} +0 -0
- /package/{src → dist/src}/executors/dev-server/dev-server.impl.js +0 -0
- /package/{src → dist/src}/executors/dev-server/lib/get-dev-server-config.js +0 -0
- /package/{src → dist/src}/executors/dev-server/lib/serve-path.js +0 -0
- /package/{src → dist/src}/executors/dev-server/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/dev-server/schema.json +0 -0
- /package/{src → dist/src}/executors/module-federation-dev-server/lib/index.js +0 -0
- /package/{src → dist/src}/executors/module-federation-dev-server/lib/normalize-options.js +0 -0
- /package/{src → dist/src}/executors/module-federation-dev-server/lib/start-remotes.js +0 -0
- /package/{src → dist/src}/executors/module-federation-dev-server/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/module-federation-dev-server/schema.json +0 -0
- /package/{src → dist/src}/executors/module-federation-ssr-dev-server/lib/index.js +0 -0
- /package/{src → dist/src}/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -0
- /package/{src → dist/src}/executors/module-federation-ssr-dev-server/lib/start-remotes.js +0 -0
- /package/{src → dist/src}/executors/module-federation-ssr-dev-server/schema.json +0 -0
- /package/{src → dist/src}/executors/module-federation-static-server/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/module-federation-static-server/schema.json +0 -0
- /package/{src → dist/src}/executors/rspack/lib/normalize-options.js +0 -0
- /package/{src → dist/src}/executors/rspack/rspack.impl.js +0 -0
- /package/{src → dist/src}/executors/rspack/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/rspack/schema.json +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/lib/wait-until-server-is-listening.js +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/schema.json +0 -0
- /package/{src → dist/src}/executors/ssr-dev-server/ssr-dev-server.impl.js +0 -0
- /package/{src → dist/src}/generators/configuration/configuration.js +0 -0
- /package/{src → dist/src}/generators/configuration/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/configuration/schema.json +0 -0
- /package/{src → dist/src}/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/extract-rspack-options.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/normalize-path-options.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/utils.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-rspack-plugin/lib/validate-project.js +0 -0
- /package/{src → dist/src}/generators/convert-config-to-rspack-plugin/schema.json +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/ast.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/build-post-target-transformer.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/index.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/serve-post-target-transformer.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/utils/types.js +0 -0
- /package/{src → dist/src}/generators/convert-webpack/convert-webpack.js +0 -0
- /package/{src → dist/src}/generators/convert-webpack/lib/transform-cjs.js +0 -0
- /package/{src → dist/src}/generators/convert-webpack/lib/transform-esm.js +0 -0
- /package/{src → dist/src}/generators/convert-webpack/lib/transform-plugin-config.js +0 -0
- /package/{src → dist/src}/generators/convert-webpack/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/convert-webpack/schema.json +0 -0
- /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/init/schema.json +0 -0
- /package/{src → dist/src}/index.js +0 -0
- /package/{src → dist/src}/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +0 -0
- /package/{src → dist/src}/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.md +0 -0
- /package/{src → dist/src}/migrations/update-20-3-0/ensure-nx-module-federation-package.js +0 -0
- /package/{src → dist/src}/migrations/update-20-3-0/ensure-nx-module-federation-package.md +0 -0
- /package/{src → dist/src}/migrations/update-22-0-0/remove-deprecated-options.js +0 -0
- /package/{src → dist/src}/migrations/update-23-0-0/add-svgr-to-rspack-config.js +0 -0
- /package/{src → dist/src}/migrations/update-23-0-0/add-svgr-to-rspack-config.md +0 -0
- /package/{src → dist/src}/plugins/generate-package-json-plugin.js +0 -0
- /package/{src → dist/src}/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.js +0 -0
- /package/{src → dist/src}/plugins/nx-react-rspack-plugin/nx-react-rspack-plugin.js +0 -0
- /package/{src → dist/src}/plugins/plugin.js +0 -0
- /package/{src → dist/src}/plugins/use-legacy-nx-plugin/use-legacy-nx-plugin.js +0 -0
- /package/{src → dist/src}/plugins/utils/apply-base-config.js +0 -0
- /package/{src → dist/src}/plugins/utils/apply-react-config.js +0 -0
- /package/{src → dist/src}/plugins/utils/apply-web-config.js +0 -0
- /package/{src → dist/src}/plugins/utils/get-css-module-local-ident.js +0 -0
- /package/{src → dist/src}/plugins/utils/get-non-buildable-libs.js +0 -0
- /package/{src → dist/src}/plugins/utils/get-terser-ecma-version.js +0 -0
- /package/{src → dist/src}/plugins/utils/get-transitive-deps.js +0 -0
- /package/{src → dist/src}/plugins/utils/hash-format.js +0 -0
- /package/{src → dist/src}/plugins/utils/instantiate-script-plugins.js +0 -0
- /package/{src → dist/src}/plugins/utils/is-lib-buildable.js +0 -0
- /package/{src → dist/src}/plugins/utils/loaders/deprecated-less-loader.js +0 -0
- /package/{src → dist/src}/plugins/utils/loaders/stylesheet-loaders.js +0 -0
- /package/{src → dist/src}/plugins/utils/models.js +0 -0
- /package/{src → dist/src}/plugins/utils/normalize-entry.js +0 -0
- /package/{src → dist/src}/plugins/utils/plugins/generate-package-json-plugin.js +0 -0
- /package/{src → dist/src}/plugins/utils/plugins/normalize-options.js +0 -0
- /package/{src → dist/src}/plugins/utils/plugins/nx-tsconfig-paths-rspack-plugin.js +0 -0
- /package/{src → dist/src}/plugins/utils/plugins/postcss-cli-resources.js +0 -0
- /package/{src → dist/src}/plugins/utils/plugins/rspack-nx-build-coordination-plugin.js +0 -0
- /package/{src → dist/src}/plugins/utils/plugins/scripts-rspack-plugin.js +0 -0
- /package/{src → dist/src}/plugins/utils/plugins/stats-json-plugin.js +0 -0
- /package/{src → dist/src}/plugins/write-index-html-plugin.js +0 -0
- /package/{src → dist/src}/utils/assert-supported-rspack-version.js +0 -0
- /package/{src → dist/src}/utils/create-compiler.js +0 -0
- /package/{src → dist/src}/utils/e2e-web-server-info-utils.js +0 -0
- /package/{src → dist/src}/utils/generator-utils.js +0 -0
- /package/{src → dist/src}/utils/get-copy-patterns.js +0 -0
- /package/{src → dist/src}/utils/has-plugin.js +0 -0
- /package/{src → dist/src}/utils/jest-utils.js +0 -0
- /package/{src → dist/src}/utils/mode-utils.js +0 -0
- /package/{src → dist/src}/utils/model.js +0 -0
- /package/{src → dist/src}/utils/module-federation-deprecation.js +0 -0
- /package/{src → dist/src}/utils/normalize-assets.js +0 -0
- /package/{src → dist/src}/utils/read-rspack-options.js +0 -0
- /package/{src → dist/src}/utils/resolve-user-defined-rspack-config.js +0 -0
- /package/{src → dist/src}/utils/version-utils.js +0 -0
- /package/{src → dist/src}/utils/webpack/interpolate-env-variables-to-index.js +0 -0
- /package/{src → dist/src}/utils/webpack/normalize-entry.js +0 -0
- /package/{src → dist/src}/utils/webpack/package-chunk-sort.js +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<p style="text-align: center;">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
|
|
4
|
+
<img alt="Nx - Smart Monorepos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
{{links}}
|
|
9
|
+
|
|
10
|
+
<hr>
|
|
11
|
+
|
|
12
|
+
# Nx: Smart Monorepos · Fast Builds
|
|
13
|
+
|
|
14
|
+
Get to green PRs in half the time. Nx optimizes your builds, scales your CI, and fixes failed PRs. Built for developers and AI agents.
|
|
15
|
+
|
|
16
|
+
This package is a [Rspack plugin for Nx](https://nx.dev/nx-api/rspack).
|
|
17
|
+
|
|
18
|
+
{{content}}
|
|
@@ -2,4 +2,3 @@ import type { Configuration as RspackDevServerConfiguration } from '@rspack/dev-
|
|
|
2
2
|
import { RspackExecutorSchema } from '../../rspack/schema';
|
|
3
3
|
import { DevServerExecutorSchema } from '../schema';
|
|
4
4
|
export declare function getDevServerOptions(root: string, serveOptions: DevServerExecutorSchema, buildOptions: RspackExecutorSchema): RspackDevServerConfiguration;
|
|
5
|
-
//# sourceMappingURL=get-dev-server-config.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { RspackExecutorSchema } from '../../rspack/schema';
|
|
2
2
|
export declare function buildServePath(browserOptions: RspackExecutorSchema): string;
|
|
3
3
|
export declare function _findDefaultServePath(baseHref?: string, deployUrl?: string): string | null;
|
|
4
|
-
//# sourceMappingURL=serve-path.d.ts.map
|
|
@@ -2,4 +2,3 @@ import { ExecutorContext } from '@nx/devkit';
|
|
|
2
2
|
import { ModuleFederationDevServerOptions, NormalizedModuleFederationDevServerOptions } from '../schema';
|
|
3
3
|
export declare function getBuildOptions(buildTarget: string, context: ExecutorContext): any;
|
|
4
4
|
export declare function normalizeOptions(options: ModuleFederationDevServerOptions): NormalizedModuleFederationDevServerOptions;
|
|
5
|
-
//# sourceMappingURL=normalize-options.d.ts.map
|
|
@@ -3,4 +3,3 @@ import { ProjectConfiguration, ExecutorContext } from '@nx/devkit';
|
|
|
3
3
|
export declare function startRemotes(remotes: string[], workspaceProjects: Record<string, ProjectConfiguration>, options: Partial<Pick<ModuleFederationDevServerOptions, 'devRemotes' | 'host' | 'ssl' | 'sslCert' | 'sslKey' | 'verbose'>>, context: ExecutorContext, target?: 'serve' | 'serve-static'): Promise<AsyncIterable<{
|
|
4
4
|
success: boolean;
|
|
5
5
|
}>[]>;
|
|
6
|
-
//# sourceMappingURL=start-remotes.d.ts.map
|
package/{src → dist/src}/executors/module-federation-dev-server/module-federation-dev-server.impl.js
RENAMED
|
@@ -5,9 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const internal_2 = require("@nx/js/internal");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
8
|
+
const internal_3 = require("@nx/module-federation/internal");
|
|
9
|
+
const internal_4 = require("@nx/web/internal");
|
|
11
10
|
const fs_1 = require("fs");
|
|
12
11
|
const path_1 = require("path");
|
|
13
12
|
const dev_server_impl_1 = tslib_1.__importDefault(require("../dev-server/dev-server.impl"));
|
|
@@ -17,7 +16,7 @@ async function* moduleFederationDevServer(schema, context) {
|
|
|
17
16
|
(0, module_federation_deprecation_1.warnRspackMfDevServerExecutorDeprecation)();
|
|
18
17
|
const options = (0, lib_1.normalizeOptions)(schema);
|
|
19
18
|
const currIter = options.static
|
|
20
|
-
? (0,
|
|
19
|
+
? (0, internal_4.fileServerExecutor)({
|
|
21
20
|
...options,
|
|
22
21
|
parallel: false,
|
|
23
22
|
withDeps: false,
|
|
@@ -41,7 +40,7 @@ async function* moduleFederationDevServer(schema, context) {
|
|
|
41
40
|
if (!options.isInitialHost) {
|
|
42
41
|
return yield* currIter;
|
|
43
42
|
}
|
|
44
|
-
const { staticRemotesIter, devRemoteIters, remotes } = await (0,
|
|
43
|
+
const { staticRemotesIter, devRemoteIters, remotes } = await (0, internal_3.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'react');
|
|
45
44
|
return yield* (0, internal_1.combineAsyncIterables)(currIter, ...devRemoteIters, ...(staticRemotesIter ? [staticRemotesIter] : []), (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
46
45
|
if (!options.isInitialHost) {
|
|
47
46
|
done();
|
|
@@ -57,7 +56,7 @@ async function* moduleFederationDevServer(schema, context) {
|
|
|
57
56
|
const portsToWaitFor = staticRemotesIter && options.staticRemotesPort
|
|
58
57
|
? [options.staticRemotesPort, ...remotes.remotePorts]
|
|
59
58
|
: [...remotes.remotePorts];
|
|
60
|
-
await Promise.all(portsToWaitFor.map((port) => (0,
|
|
59
|
+
await Promise.all(portsToWaitFor.map((port) => (0, internal_4.waitForPortOpen)(port, {
|
|
61
60
|
retries: 480,
|
|
62
61
|
retryDelay: 2500,
|
|
63
62
|
host: host,
|
package/{src → dist/src}/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts
RENAMED
|
@@ -2,4 +2,3 @@ import { ModuleFederationSsrDevServerOptions, NormalizedModuleFederationSsrDevSe
|
|
|
2
2
|
import { ExecutorContext } from '@nx/devkit';
|
|
3
3
|
export declare function normalizeOptions(options: ModuleFederationSsrDevServerOptions): NormalizedModuleFederationSsrDevServerOptions;
|
|
4
4
|
export declare function getBuildOptions(buildTarget: string, context: ExecutorContext): any;
|
|
5
|
-
//# sourceMappingURL=normalize-options.d.ts.map
|
|
@@ -3,4 +3,3 @@ import { ExecutorContext, ProjectConfiguration } from '@nx/devkit';
|
|
|
3
3
|
export declare function startRemotes(remotes: string[], workspaceProjects: Record<string, ProjectConfiguration>, options: Partial<Pick<ModuleFederationSsrDevServerOptions, 'devRemotes' | 'host' | 'ssl' | 'sslCert' | 'sslKey' | 'verbose'>>, context: ExecutorContext): Promise<AsyncIterable<{
|
|
4
4
|
success: boolean;
|
|
5
5
|
}>[]>;
|
|
6
|
-
//# sourceMappingURL=start-remotes.d.ts.map
|
|
@@ -3,4 +3,3 @@ import { ModuleFederationSsrDevServerOptions } from './schema';
|
|
|
3
3
|
export default function moduleFederationSsrDevServer(ssrDevServerOptions: ModuleFederationSsrDevServerOptions, context: ExecutorContext): AsyncGenerator<{
|
|
4
4
|
success: boolean;
|
|
5
5
|
}, any, any>;
|
|
6
|
-
//# sourceMappingURL=module-federation-ssr-dev-server.impl.d.ts.map
|
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const internal_2 = require("@nx/js/internal");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const internal_3 = require("@nx/module-federation/internal");
|
|
9
|
+
const internal_4 = require("@nx/web/internal");
|
|
10
10
|
const fs_1 = require("fs");
|
|
11
11
|
const path_1 = require("path");
|
|
12
12
|
const ssr_dev_server_impl_1 = tslib_1.__importDefault(require("../ssr-dev-server/ssr-dev-server.impl"));
|
|
@@ -31,7 +31,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
31
31
|
if (!options.isInitialHost) {
|
|
32
32
|
return yield* iter;
|
|
33
33
|
}
|
|
34
|
-
const { staticRemotesIter, devRemoteIters, remotes } = await (0,
|
|
34
|
+
const { staticRemotesIter, devRemoteIters, remotes } = await (0, internal_3.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'react', true);
|
|
35
35
|
return yield* (0, internal_1.combineAsyncIterables)(iter, ...devRemoteIters, ...(staticRemotesIter ? [staticRemotesIter] : []), (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
36
36
|
if (!options.isInitialHost) {
|
|
37
37
|
done();
|
|
@@ -47,7 +47,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
47
47
|
const portsToWaitFor = staticRemotesIter && options.staticRemotesPort
|
|
48
48
|
? [options.staticRemotesPort, ...remotes.remotePorts]
|
|
49
49
|
: [...remotes.remotePorts];
|
|
50
|
-
await Promise.all(portsToWaitFor.map((port) => (0,
|
|
50
|
+
await Promise.all(portsToWaitFor.map((port) => (0, internal_4.waitForPortOpen)(port, {
|
|
51
51
|
retries: 480,
|
|
52
52
|
retryDelay: 2500,
|
|
53
53
|
host,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DevRemoteDefinition } from '@nx/module-federation/
|
|
1
|
+
import { DevRemoteDefinition } from '@nx/module-federation/internal';
|
|
2
2
|
import { RspackSsrDevServerOptions } from '../ssr-dev-server/schema';
|
|
3
3
|
|
|
4
4
|
export type ModuleFederationSsrDevServerOptions = RspackSsrDevServerOptions & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StaticRemotesConfig } from '@nx/module-federation/
|
|
1
|
+
import { StaticRemotesConfig } from '@nx/module-federation/internal';
|
|
2
2
|
import { ExecutorContext } from 'nx/src/config/misc-interfaces';
|
|
3
3
|
import { ModuleFederationDevServerOptions } from '../module-federation-dev-server/schema';
|
|
4
4
|
import { ModuleFederationStaticServerSchema } from './schema';
|
|
@@ -10,4 +10,3 @@ export default function moduleFederationStaticServer(schema: ModuleFederationSta
|
|
|
10
10
|
success: boolean;
|
|
11
11
|
baseUrl: string;
|
|
12
12
|
}, any, any>;
|
|
13
|
-
//# sourceMappingURL=module-federation-static-server.impl.d.ts.map
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startProxies = startProxies;
|
|
4
4
|
exports.default = moduleFederationStaticServer;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
6
|
const devkit_1 = require("@nx/devkit");
|
|
8
7
|
const internal_2 = require("@nx/js/internal");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
|
12
|
-
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
8
|
+
const internal_3 = require("@nx/module-federation/internal");
|
|
9
|
+
const internal_4 = require("@nx/web/internal");
|
|
13
10
|
const child_process_1 = require("child_process");
|
|
14
11
|
const fs_1 = require("fs");
|
|
15
12
|
const path_1 = require("path");
|
|
@@ -166,15 +163,15 @@ async function* moduleFederationStaticServer(schema, context) {
|
|
|
166
163
|
// Get the remotes from the module federation config
|
|
167
164
|
const p = context.projectsConfigurations.projects[context.projectName];
|
|
168
165
|
const options = getBuildAndServeOptionsFromServeTarget(schema.serveTarget, context);
|
|
169
|
-
const moduleFederationConfig = (0,
|
|
170
|
-
const remotes = (0,
|
|
166
|
+
const moduleFederationConfig = (0, internal_3.getModuleFederationConfig)(options.buildOptions.tsConfig, context.root, p.root, 'react');
|
|
167
|
+
const remotes = (0, internal_3.getRemotes)([], options.serveOptions.skipRemotes, moduleFederationConfig, {
|
|
171
168
|
projectName: context.projectName,
|
|
172
169
|
projectGraph: context.projectGraph,
|
|
173
170
|
root: context.root,
|
|
174
171
|
}, options.pathToManifestFile);
|
|
175
|
-
const staticRemotesConfig = (0,
|
|
172
|
+
const staticRemotesConfig = (0, internal_3.parseStaticRemotesConfig)([...remotes.staticRemotes, ...remotes.dynamicRemotes], context);
|
|
176
173
|
options.serveOptions.staticRemotesPort ??= remotes.staticRemotePort;
|
|
177
|
-
const mappedLocationsOfStaticRemotes = await (0,
|
|
174
|
+
const mappedLocationsOfStaticRemotes = await (0, internal_3.buildStaticRemotes)(staticRemotesConfig, nxBin, context, options.serveOptions);
|
|
178
175
|
// Build the host
|
|
179
176
|
const hostUrlSegment = (0, path_1.basename)(options.buildOptions.outputPath);
|
|
180
177
|
const mappedLocationOfHost = `http${options.serveOptions.ssl ? 's' : ''}://${options.serveOptions.host}:${options.serveOptions.staticRemotesPort}/${hostUrlSegment}`;
|
|
@@ -182,7 +179,7 @@ async function* moduleFederationStaticServer(schema, context) {
|
|
|
182
179
|
// Move to a temporary directory
|
|
183
180
|
const commonOutputDirectory = moveToTmpDirectory(staticRemotesConfig, options.buildOptions.outputPath, hostUrlSegment);
|
|
184
181
|
// File Serve the temporary directory
|
|
185
|
-
const staticFileServerIter = (0,
|
|
182
|
+
const staticFileServerIter = (0, internal_4.fileServerExecutor)({
|
|
186
183
|
cors: true,
|
|
187
184
|
watch: false,
|
|
188
185
|
staticFilePath: commonOutputDirectory,
|
|
@@ -208,7 +205,7 @@ async function* moduleFederationStaticServer(schema, context) {
|
|
|
208
205
|
const baseUrl = `http${options.serveOptions.ssl ? 's' : ''}://${host}:${options.serveOptions.port}`;
|
|
209
206
|
if (remotes.remotePorts.length === 0) {
|
|
210
207
|
const portsToWaitFor = [options.serveOptions.staticRemotesPort];
|
|
211
|
-
await Promise.all(portsToWaitFor.map((port) => (0,
|
|
208
|
+
await Promise.all(portsToWaitFor.map((port) => (0, internal_4.waitForPortOpen)(port, {
|
|
212
209
|
retries: 480,
|
|
213
210
|
retryDelay: 2500,
|
|
214
211
|
host: host,
|
|
@@ -222,7 +219,7 @@ async function* moduleFederationStaticServer(schema, context) {
|
|
|
222
219
|
const portsToWaitFor = staticFileServerIter && options.serveOptions.staticRemotesPort
|
|
223
220
|
? [options.serveOptions.staticRemotesPort, ...remotes.remotePorts]
|
|
224
221
|
: [...remotes.remotePorts];
|
|
225
|
-
await Promise.all(portsToWaitFor.map((port) => (0,
|
|
222
|
+
await Promise.all(portsToWaitFor.map((port) => (0, internal_4.waitForPortOpen)(port, {
|
|
226
223
|
retries: 480,
|
|
227
224
|
retryDelay: 2500,
|
|
228
225
|
host: host,
|
|
@@ -4,4 +4,3 @@ import { type NormalizedRspackExecutorSchema } from '../schema';
|
|
|
4
4
|
export declare function getRspackConfigs(options: NormalizedRspackExecutorSchema & {
|
|
5
5
|
devServer?: any;
|
|
6
6
|
}, context: ExecutorContext): Promise<Configuration | Configuration[]>;
|
|
7
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRspackConfigs = getRspackConfigs;
|
|
4
4
|
const config_1 = require("../../../utils/config");
|
|
5
|
+
const deprecation_1 = require("../../../utils/deprecation");
|
|
5
6
|
const resolve_user_defined_rspack_config_1 = require("../../../utils/resolve-user-defined-rspack-config");
|
|
6
7
|
const with_nx_1 = require("../../../utils/with-nx");
|
|
7
8
|
const with_web_1 = require("../../../utils/with-web");
|
|
@@ -15,9 +16,11 @@ async function getRspackConfigs(options, context) {
|
|
|
15
16
|
if (typeof userDefinedConfig.then === 'function') {
|
|
16
17
|
userDefinedConfig = await userDefinedConfig;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
// Nx composes these helpers internally to build the default config; suppress
|
|
20
|
+
// their deprecation warning so it fires only for user-authored configs.
|
|
21
|
+
const config = (0, deprecation_1.suppressRspackComposeHelperWarnings)(() => (options.target === 'web'
|
|
19
22
|
? (0, config_1.composePluginsSync)((0, with_nx_1.withNx)(options), (0, with_web_1.withWeb)(options))
|
|
20
|
-
: (0, with_nx_1.withNx)(options))({}, { options, context });
|
|
23
|
+
: (0, with_nx_1.withNx)(options))({}, { options, context }));
|
|
21
24
|
if (typeof userDefinedConfig === 'function' &&
|
|
22
25
|
((0, config_1.isNxRspackComposablePlugin)(userDefinedConfig) ||
|
|
23
26
|
!options.standardRspackConfigFunction)) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { RspackExecutorSchema, NormalizedRspackExecutorSchema } from '../schema';
|
|
2
2
|
export declare function normalizeOptions(options: RspackExecutorSchema, root: string, projectRoot: string, sourceRoot: string): NormalizedRspackExecutorSchema;
|
|
3
3
|
export declare function normalizePluginPath(pluginPath: void | string, root: string): string;
|
|
4
|
-
//# sourceMappingURL=normalize-options.d.ts.map
|
|
@@ -2,4 +2,3 @@ import { Tree } from '@nx/devkit';
|
|
|
2
2
|
import { ConfigurationSchema } from './schema';
|
|
3
3
|
export declare function configurationGenerator(tree: Tree, options: ConfigurationSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
4
|
export default configurationGenerator;
|
|
5
|
-
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -3,4 +3,3 @@ import { InitGeneratorSchema } from './schema';
|
|
|
3
3
|
export declare function rspackInitGenerator(tree: Tree, schema: InitGeneratorSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export default rspackInitGenerator;
|
|
5
5
|
export declare const rspackInitSchematic: (generatorOptions: InitGeneratorSchema) => (tree: any, context: any) => Promise<any>;
|
|
6
|
-
//# sourceMappingURL=init.d.ts.map
|
|
@@ -75,10 +75,9 @@ async function rspackInitGenerator(tree, schema) {
|
|
|
75
75
|
}
|
|
76
76
|
: {}),
|
|
77
77
|
};
|
|
78
|
-
|
|
79
|
-
if (version !== '0.0.1') {
|
|
78
|
+
if (versions_1.nxVersion !== '0.0.1') {
|
|
80
79
|
// Ignored for local dev / e2e tests.
|
|
81
|
-
devDependencies['@nx/rspack'] =
|
|
80
|
+
devDependencies['@nx/rspack'] = versions_1.nxVersion;
|
|
82
81
|
}
|
|
83
82
|
if (schema.style === 'less') {
|
|
84
83
|
devDependencies['less-loader'] = versions_1.lessLoaderVersion;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
export default function migrateCreateNodesV2ToCreateNodes(tree: Tree): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
5
|
+
* when they come from one of the given module specifiers. Only the named
|
|
6
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
7
|
+
* any `type` modifier, and any default import are left untouched.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rewriteCreateNodesV2Imports(source: string, specifiers: ReadonlySet<string>): string;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateCreateNodesV2ToCreateNodes;
|
|
4
|
+
exports.rewriteCreateNodesV2Imports = rewriteCreateNodesV2Imports;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const TS_EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts'];
|
|
7
|
+
const DEPRECATED_NAME = 'createNodesV2';
|
|
8
|
+
const CANONICAL_NAME = 'createNodes';
|
|
9
|
+
// Module specifiers from which `@nx/rspack` publicly exposes `createNodesV2`.
|
|
10
|
+
// A named import or re-export of `createNodesV2` from one of these is rewritten
|
|
11
|
+
// to the canonical `createNodes` export.
|
|
12
|
+
const TARGET_SPECIFIERS = new Set(['@nx/rspack/plugin']);
|
|
13
|
+
let ts;
|
|
14
|
+
async function migrateCreateNodesV2ToCreateNodes(tree) {
|
|
15
|
+
let touchedCount = 0;
|
|
16
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
17
|
+
if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const original = tree.read(filePath, 'utf-8');
|
|
21
|
+
if (!original || !original.includes(DEPRECATED_NAME)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const updated = rewriteCreateNodesV2Imports(original, TARGET_SPECIFIERS);
|
|
25
|
+
if (updated !== original) {
|
|
26
|
+
tree.write(filePath, updated);
|
|
27
|
+
touchedCount += 1;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
if (touchedCount > 0) {
|
|
31
|
+
devkit_1.logger.info(`Renamed \`${DEPRECATED_NAME}\` imports to \`${CANONICAL_NAME}\` in ${touchedCount} file(s).`);
|
|
32
|
+
}
|
|
33
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
37
|
+
* when they come from one of the given module specifiers. Only the named
|
|
38
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
39
|
+
* any `type` modifier, and any default import are left untouched.
|
|
40
|
+
*/
|
|
41
|
+
function rewriteCreateNodesV2Imports(source, specifiers) {
|
|
42
|
+
ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
|
|
43
|
+
const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
|
|
44
|
+
/* setParentNodes */ true, ts.ScriptKind.TSX);
|
|
45
|
+
const changes = [];
|
|
46
|
+
for (const stmt of sourceFile.statements) {
|
|
47
|
+
if (ts.isImportDeclaration(stmt)) {
|
|
48
|
+
collectImportRewrite(sourceFile, stmt, specifiers, changes);
|
|
49
|
+
}
|
|
50
|
+
else if (ts.isExportDeclaration(stmt)) {
|
|
51
|
+
collectExportRewrite(sourceFile, stmt, specifiers, changes);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
|
|
55
|
+
}
|
|
56
|
+
function isTargetSpecifier(node, specifiers) {
|
|
57
|
+
return ts.isStringLiteral(node) && specifiers.has(node.text);
|
|
58
|
+
}
|
|
59
|
+
function collectImportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
60
|
+
if (!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const namedBindings = stmt.importClause?.namedBindings;
|
|
64
|
+
// Only `import { ... }` carries renameable named bindings. `import x`,
|
|
65
|
+
// `import * as ns`, and side-effect imports reference the module wholesale
|
|
66
|
+
// and keep working through the `createNodesV2` runtime alias, so we leave
|
|
67
|
+
// them be. A mixed `import def, { createNodesV2 }` still has its named
|
|
68
|
+
// bindings rewritten below — the default binding is untouched.
|
|
69
|
+
if (!namedBindings || !ts.isNamedImports(namedBindings)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
rewriteNamedBindings(sourceFile, namedBindings, changes);
|
|
73
|
+
}
|
|
74
|
+
function collectExportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
75
|
+
if (!stmt.moduleSpecifier ||
|
|
76
|
+
!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// `export { ... } from '...'` can be rewritten; `export * from '...'` has no
|
|
80
|
+
// named bindings to rename.
|
|
81
|
+
if (!stmt.exportClause || !ts.isNamedExports(stmt.exportClause)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
rewriteNamedBindings(sourceFile, stmt.exportClause, changes);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Re-renders the `{ ... }` of a named import/export, renaming any
|
|
88
|
+
* `createNodesV2` specifier to `createNodes`. If renaming would collide with a
|
|
89
|
+
* `createNodes` that is already present (e.g. `{ createNodes, createNodesV2 }`),
|
|
90
|
+
* the duplicate is dropped. Returns without recording a change when the binding
|
|
91
|
+
* list contains no `createNodesV2`.
|
|
92
|
+
*/
|
|
93
|
+
function rewriteNamedBindings(sourceFile, namedBindings, changes) {
|
|
94
|
+
const elements = namedBindings.elements;
|
|
95
|
+
const hasDeprecated = elements.some((el) => (el.propertyName ?? el.name).text === DEPRECATED_NAME);
|
|
96
|
+
if (!hasDeprecated) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const seen = new Set();
|
|
100
|
+
const rendered = [];
|
|
101
|
+
for (const el of elements) {
|
|
102
|
+
const text = renderSpecifier(el);
|
|
103
|
+
if (!seen.has(text)) {
|
|
104
|
+
seen.add(text);
|
|
105
|
+
rendered.push(text);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const start = namedBindings.getStart(sourceFile);
|
|
109
|
+
changes.push({
|
|
110
|
+
type: devkit_1.ChangeType.Delete,
|
|
111
|
+
start,
|
|
112
|
+
length: namedBindings.getEnd() - start,
|
|
113
|
+
}, {
|
|
114
|
+
type: devkit_1.ChangeType.Insert,
|
|
115
|
+
index: start,
|
|
116
|
+
text: `{ ${rendered.join(', ')} }`,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function renderSpecifier(el) {
|
|
120
|
+
const typePrefix = el.isTypeOnly ? 'type ' : '';
|
|
121
|
+
const rename = (name) => name === DEPRECATED_NAME ? CANONICAL_NAME : name;
|
|
122
|
+
// `{ name }` — no alias, so the local binding follows the rename.
|
|
123
|
+
if (!el.propertyName) {
|
|
124
|
+
return `${typePrefix}${rename(el.name.text)}`;
|
|
125
|
+
}
|
|
126
|
+
// `{ propertyName as name }` — only the imported (left) side is renamed; the
|
|
127
|
+
// local alias is preserved. A now-redundant alias such as
|
|
128
|
+
// `createNodesV2 as createNodes` collapses to `createNodes`.
|
|
129
|
+
const canonicalImported = rename(el.propertyName.text);
|
|
130
|
+
const localName = el.name.text;
|
|
131
|
+
return canonicalImported === localName
|
|
132
|
+
? `${typePrefix}${localName}`
|
|
133
|
+
: `${typePrefix}${canonicalImported} as ${localName}`;
|
|
134
|
+
}
|