@nx/angular 0.0.0-pr-30715-a5f5e3b → 0.0.0-pr-31313-387cdca
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/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/index.d.ts +1 -2
- package/mf/index.d.ts +1 -71
- package/mf/mf.d.ts +69 -0
- package/migrations.json +0 -98
- package/package.json +16 -25
- package/plugins/component-testing.js +3 -8
- package/src/builders/dev-server/dev-server.impl.js +7 -4
- package/src/builders/dev-server/lib/normalize-options.js +6 -0
- package/src/builders/dev-server/lib/validate-options.js +4 -0
- package/src/builders/dev-server/schema.d.ts +15 -3
- package/src/builders/dev-server/schema.json +9 -3
- package/src/builders/webpack-browser/webpack-browser.impl.js +0 -2
- package/src/builders/webpack-server/webpack-server.impl.d.ts +1 -3
- package/src/builders/webpack-server/webpack-server.impl.js +0 -2
- package/src/executors/application/application.impl.d.ts +2 -2
- package/src/executors/application/application.impl.js +6 -11
- package/src/executors/application/schema.d.ts +1 -1
- package/src/executors/application/schema.json +10 -21
- package/src/executors/application/utils/normalize-options.js +1 -8
- package/src/executors/application/utils/validate-options.js +40 -10
- package/src/executors/extract-i18n/extract-i18n.impl.js +14 -6
- package/src/executors/extract-i18n/schema.d.ts +6 -1
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +7 -1
- package/src/executors/module-federation-dev-server/schema.d.ts +15 -3
- package/src/executors/module-federation-dev-server/schema.json +15 -2
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +8 -10
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.d.ts +3 -6
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.js +8 -46
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.d.ts +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.js +3 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.d.ts +2 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +6 -22
- package/src/executors/ng-packagr-lite/schema.json +3 -2
- package/src/executors/package/package.impl.js +5 -1
- package/src/executors/package/schema.d.ts +1 -3
- package/src/executors/package/schema.json +3 -2
- package/src/executors/utilities/esbuild-extensions.d.ts +1 -2
- package/src/executors/utilities/ng-packagr/package-imports.d.ts +1 -3
- package/src/executors/utilities/ng-packagr/package-imports.js +2 -2
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts +24 -1
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.js +105 -12
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +8 -4
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts +1 -1
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.js +11 -18
- package/src/generators/add-linting/add-linting.js +0 -8
- package/src/generators/application/application.js +1 -21
- package/src/generators/application/files/base-pre18/src/favicon.ico +0 -0
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +29 -0
- package/src/generators/application/files/ng-module/src/app/{app__componentFileSuffix__.ts__tpl__ → app.component.ts__tpl__} +3 -3
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +17 -0
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +3 -11
- package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
- package/src/generators/application/files/standalone-components/src/app/app.component.__style__ +0 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +28 -0
- package/src/generators/application/files/standalone-components/src/app/{app__componentFileSuffix__.ts__tpl__ → app.component.ts__tpl__} +5 -5
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +2 -6
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +2 -2
- package/src/generators/application/lib/create-files.d.ts +1 -1
- package/src/generators/application/lib/create-files.js +14 -15
- package/src/generators/application/lib/create-project.d.ts +1 -1
- package/src/generators/application/lib/create-project.js +26 -119
- package/src/generators/application/lib/enable-strict-type-checking.js +0 -3
- package/src/generators/application/schema.json +1 -1
- package/src/generators/component/component.js +2 -13
- package/src/generators/component/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/component/lib/component.js +1 -11
- package/src/generators/component/lib/module.d.ts +2 -7
- package/src/generators/component/lib/module.js +5 -7
- package/src/generators/component/lib/normalize-options.js +3 -7
- package/src/generators/component/schema.d.ts +0 -1
- package/src/generators/component/schema.json +2 -6
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +22 -19
- package/src/generators/convert-to-rspack/convert-to-rspack.js +2 -6
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +1 -1
- package/src/generators/directive/directive.js +1 -1
- package/src/generators/directive/lib/normalize-options.js +2 -7
- package/src/generators/directive/schema.d.ts +0 -1
- package/src/generators/directive/schema.json +2 -10
- package/src/generators/host/host.js +21 -1
- package/src/generators/host/schema.d.ts +1 -0
- package/src/generators/host/schema.json +7 -1
- package/src/generators/init/init.js +1 -1
- package/src/generators/library/files/ng-module/src/index.ts__tpl__ +1 -1
- package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +2 -2
- package/src/generators/library/lib/add-standalone-component.js +0 -1
- package/src/generators/library/lib/create-files.js +1 -10
- package/src/generators/library/lib/enable-strict-type-checking.d.ts +1 -1
- package/src/generators/library/lib/enable-strict-type-checking.js +0 -3
- package/src/generators/library/lib/normalize-options.d.ts +3 -3
- package/src/generators/library/lib/normalize-options.js +1 -6
- package/src/generators/library/lib/normalized-schema.d.ts +0 -2
- package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +1 -1
- package/src/generators/library-secondary-entry-point/lib/add-files.js +1 -2
- package/src/generators/library-secondary-entry-point/lib/normalize-options.d.ts +2 -2
- package/src/generators/library-secondary-entry-point/lib/normalize-options.js +0 -3
- package/src/generators/library-secondary-entry-point/schema.d.ts +0 -1
- package/src/generators/move/lib/update-module-name.js +10 -17
- package/src/generators/move/lib/update-secondary-entry-points.js +3 -0
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +1 -1
- package/src/generators/ng-add/migrators/projects/app.migrator.js +8 -43
- package/src/generators/ngrx/schema.json +3 -3
- package/src/generators/ngrx-root-store/lib/normalize-options.js +2 -9
- package/src/generators/pipe/lib/normalize-options.js +0 -4
- package/src/generators/pipe/pipe.js +1 -1
- package/src/generators/pipe/schema.d.ts +0 -1
- package/src/generators/pipe/schema.json +2 -11
- package/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +4 -4
- package/src/generators/remote/lib/update-ssr-setup.js +0 -5
- package/src/generators/remote/remote.js +23 -0
- package/src/generators/remote/schema.d.ts +1 -0
- package/src/generators/remote/schema.json +7 -1
- package/src/generators/scam/lib/convert-component-to-scam.js +3 -1
- package/src/generators/scam/lib/normalize-options.js +3 -11
- package/src/generators/scam/schema.d.ts +0 -1
- package/src/generators/scam/schema.json +2 -1
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +3 -1
- package/src/generators/scam-directive/lib/normalize-options.js +2 -11
- package/src/generators/scam-directive/schema.d.ts +0 -2
- package/src/generators/scam-directive/schema.json +2 -10
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +3 -1
- package/src/generators/scam-pipe/lib/normalize-options.js +0 -8
- package/src/generators/scam-pipe/schema.d.ts +0 -2
- package/src/generators/scam-pipe/schema.json +0 -5
- package/src/generators/setup-mf/files/entry-module-files/{entry__componentFileSuffix__.ts__tmpl__ → entry.component.ts__tmpl__} +1 -1
- package/src/generators/setup-mf/files/entry-module-files/{__entryModuleFileName__.ts__tmpl__ → entry.module.ts__tmpl__} +4 -4
- package/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +47 -0
- package/src/generators/setup-mf/files/standalone-entry-component-files/{entry__componentFileSuffix__.ts__tmpl__ → entry.component.ts__tmpl__} +3 -3
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +1 -1
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.d.ts +2 -2
- package/src/generators/setup-mf/lib/add-remote-entry.js +3 -9
- package/src/generators/setup-mf/lib/add-remote-to-host.js +1 -11
- package/src/generators/setup-mf/lib/fix-bootstrap.d.ts +2 -2
- package/src/generators/setup-mf/lib/fix-bootstrap.js +4 -4
- package/src/generators/setup-mf/lib/generate-config.d.ts +2 -2
- package/src/generators/setup-mf/lib/generate-config.js +0 -1
- package/src/generators/setup-mf/lib/normalize-options.d.ts +1 -1
- package/src/generators/setup-mf/lib/normalize-options.js +0 -13
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +2 -2
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +14 -18
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +5 -1
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +2 -2
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.js +1 -1
- package/src/generators/setup-mf/lib/update-host-app-routes.d.ts +2 -2
- package/src/generators/setup-mf/lib/update-host-app-routes.js +9 -12
- package/src/generators/setup-mf/lib/update-tsconfig.d.ts +2 -2
- package/src/generators/setup-mf/lib/update-tsconfig.js +5 -5
- package/src/generators/setup-mf/schema.d.ts +0 -7
- package/src/generators/setup-ssr/lib/add-dependencies.js +7 -4
- package/src/generators/setup-ssr/lib/add-hydration.js +3 -10
- package/src/generators/setup-ssr/lib/add-server-file.js +2 -7
- package/src/generators/setup-ssr/lib/generate-files.js +4 -17
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +2 -5
- package/src/generators/setup-ssr/lib/normalize-options.js +2 -2
- package/src/generators/setup-ssr/lib/update-project-config.js +0 -5
- package/src/generators/setup-ssr/lib/validate-options.js +2 -2
- package/src/generators/setup-ssr/schema.json +1 -1
- package/src/generators/utils/add-jest.js +1 -6
- package/src/generators/utils/assert-mf-utils.d.ts +1 -0
- package/src/generators/utils/assert-mf-utils.js +11 -0
- package/src/generators/utils/ensure-angular-dependencies.js +3 -6
- package/src/generators/utils/export-scam.d.ts +0 -1
- package/src/generators/utils/export-scam.js +2 -1
- package/src/generators/utils/find-module.js +13 -18
- package/src/generators/utils/storybook-ast/component-info.js +24 -40
- package/src/generators/utils/storybook-ast/module-info.d.ts +1 -1
- package/src/generators/utils/storybook-ast/module-info.js +8 -3
- package/src/generators/utils/testing.js +28 -28
- package/src/generators/utils/version-utils.js +2 -2
- package/src/generators/web-worker/lib/add-snippet.js +3 -3
- package/src/plugins/plugin.js +13 -22
- package/src/utils/backward-compatible-versions.d.ts +2 -2
- package/src/utils/backward-compatible-versions.js +21 -20
- package/src/utils/nx-devkit/ast-utils.js +3 -17
- package/src/utils/nx-devkit/testing.js +9 -9
- package/src/utils/versions.d.ts +4 -3
- package/src/utils/versions.js +5 -4
- package/src/executors/utilities/builder-package.d.ts +0 -1
- package/src/executors/utilities/builder-package.js +0 -11
- package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +0 -28
- package/src/generators/application/files/ng-module/src/app/app__moduleTypeSeparator__module.ts__tpl__ +0 -17
- package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +0 -27
- package/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +0 -43
- package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/__main__ +0 -1
- package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/app/__rootModuleFileName__ +0 -12
- package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +0 -8
- package/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +0 -66
- package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/__main__ +0 -7
- package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +0 -12
- package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +0 -8
- package/src/generators/setup-ssr/files/v20+/server-builder/ngmodule-src/__main__ +0 -1
- package/src/generators/setup-ssr/files/v20+/server-builder/ngmodule-src/app/__rootModuleFileName__ +0 -14
- package/src/generators/setup-ssr/files/v20+/server-builder/root/tsconfig.server.json.template +0 -16
- package/src/generators/setup-ssr/files/v20+/server-builder/server/__serverFileName__ +0 -69
- package/src/generators/setup-ssr/files/v20+/server-builder/standalone-src/__main__ +0 -7
- package/src/generators/setup-ssr/files/v20+/server-builder/standalone-src/app/app.config.server.ts.template +0 -11
- package/src/generators/utils/app-components-info.d.ts +0 -9
- package/src/generators/utils/app-components-info.js +0 -39
- package/src/generators/utils/artifact-types.d.ts +0 -3
- package/src/generators/utils/artifact-types.js +0 -33
- package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.d.ts +0 -2
- package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.js +0 -110
- package/src/migrations/update-21-2-0/replace-provide-server-routing.d.ts +0 -2
- package/src/migrations/update-21-2-0/replace-provide-server-routing.js +0 -103
- package/src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide.d.ts +0 -2
- package/src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide.js +0 -47
- package/src/migrations/update-21-2-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-21-2-0/update-angular-cli.js +0 -23
- /package/src/generators/application/files/{base → base-18+}/public/favicon.ico +0 -0
- /package/src/generators/application/files/{ng-module/src/app/app__componentFileSuffix__.__style__ → base-pre18/src/assets/.gitkeep__tpl__} +0 -0
- /package/src/generators/application/files/{standalone-components/src/app/app__componentFileSuffix__.__style__ → ng-module/src/app/app.component.__style__} +0 -0
- /package/src/generators/application/files/ng-module/src/app/{app__componentFileSuffix__.html__tpl__ → app.component.html__tpl__} +0 -0
- /package/src/generators/application/files/standalone-components/src/app/{app__componentFileSuffix__.html__tpl__ → app.component.html__tpl__} +0 -0
- /package/src/generators/component/files/{__fileName____ngext__.html__tpl__ → __fileName__.html__tpl__} +0 -0
- /package/src/generators/library/files/ng-module/src/lib/{__libFileName____moduleTypeSeparator__module.ts__tpl__ → __libFileName__.module.ts__tpl__} +0 -0
- /package/src/generators/library-secondary-entry-point/files/src/lib/{__fileName____moduleTypeSeparator__module.ts__tmpl__ → __fileName__.module.ts__tmpl__} +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/ngmodule-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/ngmodule-src/app/__rootModuleFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/server/__serverFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/standalone-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/standalone-src/app/app.config.server.ts__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder-common-engine/server/__serverFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/ngmodule-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/ngmodule-src/app/__rootModuleFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/root/tsconfig.server.json.template +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/server/__serverFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/standalone-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/standalone-src/app/app.config.server.ts.template +0 -0
|
@@ -14,15 +14,15 @@ function getComponentsInfo(tree, entryPoint, moduleFilePaths, projectName) {
|
|
|
14
14
|
return moduleFilePaths
|
|
15
15
|
.flatMap((moduleFilePath) => {
|
|
16
16
|
const file = (0, ast_utils_1.getTsSourceFile)(tree, moduleFilePath);
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
17
|
+
const declaredComponents = (0, module_info_1.getModuleDeclaredComponents)(file, moduleFilePath, projectName);
|
|
18
|
+
if (declaredComponents.length === 0) {
|
|
19
19
|
return undefined;
|
|
20
20
|
}
|
|
21
21
|
if (!tsModule) {
|
|
22
22
|
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
23
23
|
}
|
|
24
24
|
const imports = file.statements.filter((statement) => statement.kind === tsModule.SyntaxKind.ImportDeclaration);
|
|
25
|
-
const componentsInfo =
|
|
25
|
+
const componentsInfo = declaredComponents.map((componentName) => getComponentInfo(tree, entryPoint, file, imports, moduleFilePath, componentName));
|
|
26
26
|
return componentsInfo;
|
|
27
27
|
})
|
|
28
28
|
.filter((f) => f !== undefined);
|
|
@@ -100,7 +100,7 @@ function getComponentImportPath(componentName, imports) {
|
|
|
100
100
|
.slice(1, -1);
|
|
101
101
|
return importPath;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function getComponentInfo(tree, entryPoint, sourceFile, imports, moduleFilePath, componentName) {
|
|
104
104
|
try {
|
|
105
105
|
if (!tsquery) {
|
|
106
106
|
(0, ensure_typescript_1.ensureTypescript)();
|
|
@@ -108,53 +108,38 @@ function tryGetComponentInfo(tree, entryPoint, sourceFile, imports, moduleFilePa
|
|
|
108
108
|
}
|
|
109
109
|
const moduleFolderPath = (0, path_1.dirname)(moduleFilePath);
|
|
110
110
|
// try to get the component from the same file (inline scam)
|
|
111
|
-
const node = tsquery(sourceFile, `ClassDeclaration:has(Decorator > CallExpression > Identifier[name=Component]):has(Identifier[name=${
|
|
111
|
+
const node = tsquery(sourceFile, `ClassDeclaration:has(Decorator > CallExpression > Identifier[name=Component]):has(Identifier[name=${componentName}])`, { visitAllChildren: true })[0];
|
|
112
112
|
if (node) {
|
|
113
113
|
return {
|
|
114
114
|
componentFileName: (0, path_1.basename)(moduleFilePath, '.ts'),
|
|
115
115
|
moduleFolderPath,
|
|
116
|
-
name:
|
|
116
|
+
name: componentName,
|
|
117
117
|
path: '.',
|
|
118
118
|
entryPointName: entryPoint.name,
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
// try to get the component from the imports
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
if (tree.exists(
|
|
125
|
-
return
|
|
122
|
+
const componentFilePathRelativeToModule = getComponentImportPath(componentName, imports);
|
|
123
|
+
const componentImportPath = getFullComponentFilePath(moduleFolderPath, componentFilePathRelativeToModule);
|
|
124
|
+
if (tree.exists(componentImportPath) && !tree.isFile(componentImportPath)) {
|
|
125
|
+
return getComponentInfoFromDir(tree, entryPoint, componentImportPath, componentName, moduleFolderPath);
|
|
126
126
|
}
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const content = tree.read(candidatePath, 'utf-8');
|
|
137
|
-
const classAndComponentRegex = new RegExp(`@Component[\\s\\S\n]*?\\bclass ${symbolName}\\b`, 'g');
|
|
138
|
-
if (content.match(classAndComponentRegex)) {
|
|
139
|
-
const path = (0, path_1.dirname)(symbolFilePathRelativeToModule);
|
|
140
|
-
const componentFileName = (0, path_1.basename)(symbolFilePathRelativeToModule);
|
|
141
|
-
return {
|
|
142
|
-
componentFileName,
|
|
143
|
-
moduleFolderPath,
|
|
144
|
-
name: symbolName,
|
|
145
|
-
path,
|
|
146
|
-
entryPointName: entryPoint.name,
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return undefined;
|
|
127
|
+
const path = (0, path_1.dirname)(componentFilePathRelativeToModule);
|
|
128
|
+
const componentFileName = (0, path_1.basename)(componentFilePathRelativeToModule);
|
|
129
|
+
return {
|
|
130
|
+
componentFileName,
|
|
131
|
+
moduleFolderPath,
|
|
132
|
+
name: componentName,
|
|
133
|
+
path,
|
|
134
|
+
entryPointName: entryPoint.name,
|
|
135
|
+
};
|
|
151
136
|
}
|
|
152
137
|
catch (ex) {
|
|
153
|
-
devkit_1.logger.warn(`Could not generate a story for ${
|
|
138
|
+
devkit_1.logger.warn(`Could not generate a story for ${componentName}. Error: ${ex}`);
|
|
154
139
|
return undefined;
|
|
155
140
|
}
|
|
156
141
|
}
|
|
157
|
-
function
|
|
142
|
+
function getComponentInfoFromDir(tree, entryPoint, dir, componentName, moduleFolderPath) {
|
|
158
143
|
let path = null;
|
|
159
144
|
let componentFileName = null;
|
|
160
145
|
const componentImportPathChildren = [];
|
|
@@ -164,7 +149,7 @@ function tryGetComponentInfoFromDir(tree, entryPoint, dir, symbolName, moduleFol
|
|
|
164
149
|
for (const candidateFile of componentImportPathChildren) {
|
|
165
150
|
if (candidateFile.endsWith('.ts')) {
|
|
166
151
|
const content = tree.read(candidateFile, 'utf-8');
|
|
167
|
-
const classAndComponentRegex = new RegExp(`@Component[\\s\\S\n]*?\\bclass ${
|
|
152
|
+
const classAndComponentRegex = new RegExp(`@Component[\\s\\S\n]*?\\bclass ${componentName}\\b`, 'g');
|
|
168
153
|
if (content.match(classAndComponentRegex)) {
|
|
169
154
|
path = candidateFile
|
|
170
155
|
.slice(0, candidateFile.lastIndexOf('/'))
|
|
@@ -175,13 +160,12 @@ function tryGetComponentInfoFromDir(tree, entryPoint, dir, symbolName, moduleFol
|
|
|
175
160
|
}
|
|
176
161
|
}
|
|
177
162
|
if (path === null) {
|
|
178
|
-
|
|
179
|
-
return undefined;
|
|
163
|
+
throw new Error(`Path to component ${componentName} couldn't be found. Please open an issue on https://github.com/nrwl/nx/issues.`);
|
|
180
164
|
}
|
|
181
165
|
return {
|
|
182
166
|
componentFileName,
|
|
183
167
|
moduleFolderPath,
|
|
184
|
-
name:
|
|
168
|
+
name: componentName,
|
|
185
169
|
path,
|
|
186
170
|
entryPointName: entryPoint.name,
|
|
187
171
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Tree } from '@nx/devkit';
|
|
2
2
|
import type { SourceFile } from 'typescript';
|
|
3
3
|
import type { EntryPoint } from './entry-point';
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function getModuleDeclaredComponents(file: SourceFile, moduleFilePath: string, projectName: string): string[];
|
|
5
5
|
export declare function getModuleFilePaths(tree: Tree, entryPoint: EntryPoint): string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getModuleDeclaredComponents = getModuleDeclaredComponents;
|
|
4
4
|
exports.getModuleFilePaths = getModuleFilePaths;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
@@ -8,7 +8,7 @@ const path_1 = require("path");
|
|
|
8
8
|
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
9
9
|
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
10
10
|
let tsModule;
|
|
11
|
-
function
|
|
11
|
+
function getModuleDeclaredComponents(file, moduleFilePath, projectName) {
|
|
12
12
|
const ngModuleDecorator = getNgModuleDecorator(file, moduleFilePath);
|
|
13
13
|
const declarationsPropertyAssignment = getNgModuleDeclarationsPropertyAssignment(ngModuleDecorator, moduleFilePath, projectName);
|
|
14
14
|
if (!declarationsPropertyAssignment) {
|
|
@@ -18,7 +18,7 @@ function getModuleDeclarations(file, moduleFilePath, projectName) {
|
|
|
18
18
|
if (!declarationsArray) {
|
|
19
19
|
return [];
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return getDeclaredComponentsInDeclarations(declarationsArray);
|
|
22
22
|
}
|
|
23
23
|
function getModuleFilePaths(tree, entryPoint) {
|
|
24
24
|
let moduleFilePaths = [];
|
|
@@ -43,6 +43,11 @@ function hasNgModule(tree, filePath) {
|
|
|
43
43
|
const ngModule = tsquery(ast, 'ClassDeclaration > Decorator > CallExpression > Identifier[name=NgModule]', { visitAllChildren: true });
|
|
44
44
|
return ngModule.length > 0;
|
|
45
45
|
}
|
|
46
|
+
function getDeclaredComponentsInDeclarations(declarationsArray) {
|
|
47
|
+
return getDeclaredComponentNodes(declarationsArray)
|
|
48
|
+
.map((node) => node.getText())
|
|
49
|
+
.filter((name) => name.endsWith('Component'));
|
|
50
|
+
}
|
|
46
51
|
function getDeclaredComponentNodes(declarationsArray) {
|
|
47
52
|
if (!tsModule) {
|
|
48
53
|
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
@@ -52,24 +52,24 @@ async function createStorybookTestWorkspaceForLib(libName) {
|
|
|
52
52
|
standalone: false,
|
|
53
53
|
skipFormat: true,
|
|
54
54
|
});
|
|
55
|
-
tree.write(`${libName}/src/lib/test-button/test-button.ts`, `import { Component, Input } from '@angular/core';
|
|
55
|
+
tree.write(`${libName}/src/lib/test-button/test-button.component.ts`, `import { Component, Input } from '@angular/core';
|
|
56
56
|
|
|
57
57
|
export type ButtonStyle = 'default' | 'primary' | 'accent';
|
|
58
58
|
|
|
59
59
|
@Component({
|
|
60
60
|
selector: 'proj-test-button',
|
|
61
|
-
templateUrl: './test-button.html',
|
|
62
|
-
styleUrls: ['./test-button.css']
|
|
61
|
+
templateUrl: './test-button.component.html',
|
|
62
|
+
styleUrls: ['./test-button.component.css']
|
|
63
63
|
})
|
|
64
|
-
export class
|
|
64
|
+
export class TestButtonComponent {
|
|
65
65
|
@Input('buttonType') type = 'button';
|
|
66
66
|
@Input() style: ButtonStyle = 'default';
|
|
67
67
|
@Input() age?: number;
|
|
68
68
|
@Input() isOn = false;
|
|
69
69
|
}`);
|
|
70
|
-
tree.write(`${libName}/src/lib/test-button/test-button.html`, `<button [attr.type]="type" [ngClass]="style"></button>`);
|
|
71
|
-
const modulePath = `${libName}/src/lib/${libName}
|
|
72
|
-
tree.write(modulePath, `import * as ButtonExports from './test-button/test-button';
|
|
70
|
+
tree.write(`${libName}/src/lib/test-button/test-button.component.html`, `<button [attr.type]="type" [ngClass]="style"></button>`);
|
|
71
|
+
const modulePath = `${libName}/src/lib/${libName}.module.ts`;
|
|
72
|
+
tree.write(modulePath, `import * as ButtonExports from './test-button/test-button.component';
|
|
73
73
|
${tree.read(modulePath)}`);
|
|
74
74
|
// create a module with component that gets exported in a barrel file
|
|
75
75
|
generateModule(tree, {
|
|
@@ -83,14 +83,14 @@ export class TestButton {
|
|
|
83
83
|
standalone: false,
|
|
84
84
|
skipFormat: true,
|
|
85
85
|
});
|
|
86
|
-
tree.write(`${libName}/src/lib/barrel/barrel-button/index.ts`, `export * from './barrel-button';`);
|
|
87
|
-
tree.write(`${libName}/src/lib/barrel/barrel
|
|
86
|
+
tree.write(`${libName}/src/lib/barrel/barrel-button/index.ts`, `export * from './barrel-button.component';`);
|
|
87
|
+
tree.write(`${libName}/src/lib/barrel/barrel.module.ts`, `import { NgModule } from '@angular/core';
|
|
88
88
|
import { CommonModule } from '@angular/common';
|
|
89
|
-
import {
|
|
89
|
+
import { BarrelButtonComponent } from './barrel-button';
|
|
90
90
|
|
|
91
91
|
@NgModule({
|
|
92
92
|
imports: [CommonModule],
|
|
93
|
-
declarations: [
|
|
93
|
+
declarations: [BarrelButtonComponent],
|
|
94
94
|
})
|
|
95
95
|
export class BarrelModule {}`);
|
|
96
96
|
// create a module with components that get Angular exported and declared by variable
|
|
@@ -112,14 +112,14 @@ export class BarrelModule {}`);
|
|
|
112
112
|
standalone: false,
|
|
113
113
|
skipFormat: true,
|
|
114
114
|
});
|
|
115
|
-
tree.write(`${libName}/src/lib/variable-declare/variable-declare
|
|
115
|
+
tree.write(`${libName}/src/lib/variable-declare/variable-declare.module.ts`, `import { NgModule } from '@angular/core';
|
|
116
116
|
import { CommonModule } from '@angular/common';
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
117
|
+
import { VariableDeclareButtonComponent } from './variable-declare-button/variable-declare-button.component';
|
|
118
|
+
import { VariableDeclareViewComponent } from './variable-declare-view/variable-declare-view.component';
|
|
119
119
|
|
|
120
120
|
const COMPONENTS = [
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
VariableDeclareButtonComponent,
|
|
122
|
+
VariableDeclareViewComponent
|
|
123
123
|
]
|
|
124
124
|
|
|
125
125
|
@NgModule({
|
|
@@ -154,20 +154,20 @@ export class VariableDeclareModule {}`);
|
|
|
154
154
|
standalone: false,
|
|
155
155
|
skipFormat: true,
|
|
156
156
|
});
|
|
157
|
-
tree.write(`${libName}/src/lib/variable-spread-declare/variable-spread-declare
|
|
157
|
+
tree.write(`${libName}/src/lib/variable-spread-declare/variable-spread-declare.module.ts`, `import { NgModule } from '@angular/core';
|
|
158
158
|
import { CommonModule } from '@angular/common';
|
|
159
|
-
import {
|
|
160
|
-
import {
|
|
161
|
-
import {
|
|
159
|
+
import { VariableSpreadDeclareButtonComponent } from './variable-spread-declare-button/variable-spread-declare-button.component';
|
|
160
|
+
import { VariableSpreadDeclareViewComponent } from './variable-spread-declare-view/variable-spread-declare-view.component';
|
|
161
|
+
import { VariableSpreadDeclareAnotherviewComponent } from './variable-spread-declare-anotherview/variable-spread-declare-anotherview.component';
|
|
162
162
|
|
|
163
163
|
const COMPONENTS = [
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
VariableSpreadDeclareButtonComponent,
|
|
165
|
+
VariableSpreadDeclareViewComponent
|
|
166
166
|
]
|
|
167
167
|
|
|
168
168
|
@NgModule({
|
|
169
169
|
imports: [CommonModule],
|
|
170
|
-
declarations: [...COMPONENTS,
|
|
170
|
+
declarations: [...COMPONENTS, VariableSpreadDeclareAnotherviewComponent],
|
|
171
171
|
})
|
|
172
172
|
export class VariableSpreadDeclareModule {}`);
|
|
173
173
|
// create a module where declared components are pulled from a static member of the module
|
|
@@ -189,10 +189,10 @@ export class VariableSpreadDeclareModule {}`);
|
|
|
189
189
|
standalone: false,
|
|
190
190
|
skipFormat: true,
|
|
191
191
|
});
|
|
192
|
-
tree.write(`${libName}/src/lib/static-member-declarations/static-member-declarations
|
|
192
|
+
tree.write(`${libName}/src/lib/static-member-declarations/static-member-declarations.module.ts`, `import { NgModule } from '@angular/core';
|
|
193
193
|
import { CommonModule } from '@angular/common';
|
|
194
|
-
import {
|
|
195
|
-
import {
|
|
194
|
+
import { Cmp1Component } from './cmp1/cmp1.component';
|
|
195
|
+
import { Cmp2Component } from './cmp2/cmp2.component';
|
|
196
196
|
|
|
197
197
|
@NgModule({
|
|
198
198
|
imports: [CommonModule],
|
|
@@ -200,7 +200,7 @@ import { Cmp2 } from './cmp2/cmp2';
|
|
|
200
200
|
exports: StaticMemberDeclarationsModule.COMPONENTS
|
|
201
201
|
})
|
|
202
202
|
export class StaticMemberDeclarationsModule {
|
|
203
|
-
static readonly COMPONENTS = [
|
|
203
|
+
static readonly COMPONENTS = [Cmp1Component, Cmp2Component];
|
|
204
204
|
}`);
|
|
205
205
|
// create another button in a nested subpath
|
|
206
206
|
generateModule(tree, {
|
|
@@ -231,7 +231,7 @@ function generateModule(tree, options) {
|
|
|
231
231
|
options.path = `${sourceRoot}/${projectDirName}`;
|
|
232
232
|
}
|
|
233
233
|
const moduleNames = (0, devkit_1.names)(options.name);
|
|
234
|
-
const moduleFilePath = `${options.path}/${moduleNames.fileName}/${moduleNames.fileName}
|
|
234
|
+
const moduleFilePath = `${options.path}/${moduleNames.fileName}/${moduleNames.fileName}.module.ts`;
|
|
235
235
|
tree.write(moduleFilePath, `import { NgModule } from '@angular/core';
|
|
236
236
|
import { CommonModule } from '@angular/common';
|
|
237
237
|
|
|
@@ -49,10 +49,10 @@ function getInstalledPackageVersionInfo(tree, pkgName) {
|
|
|
49
49
|
function versions(tree) {
|
|
50
50
|
const majorAngularVersion = getInstalledAngularMajorVersion(tree);
|
|
51
51
|
switch (majorAngularVersion) {
|
|
52
|
+
case 17:
|
|
53
|
+
return backward_compatible_versions_1.backwardCompatibleVersions.angularV17;
|
|
52
54
|
case 18:
|
|
53
55
|
return backward_compatible_versions_1.backwardCompatibleVersions.angularV18;
|
|
54
|
-
case 19:
|
|
55
|
-
return backward_compatible_versions_1.backwardCompatibleVersions.angularV19;
|
|
56
56
|
default:
|
|
57
57
|
return latestVersions;
|
|
58
58
|
}
|
|
@@ -4,9 +4,9 @@ exports.addSnippet = addSnippet;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function addSnippet(tree, name, path) {
|
|
6
6
|
const fileRegExp = new RegExp(`^${name}.*\\.ts`);
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
.filter((f) => fileRegExp.test(f) && !/(module|spec
|
|
7
|
+
const children = tree.children(path);
|
|
8
|
+
const siblingModules = children
|
|
9
|
+
.filter((f) => fileRegExp.test(f) && !/(module|spec)\.ts$/.test(f))
|
|
10
10
|
.sort();
|
|
11
11
|
if (siblingModules.length === 0) {
|
|
12
12
|
return;
|
package/src/plugins/plugin.js
CHANGED
|
@@ -21,14 +21,8 @@ const knownExecutors = {
|
|
|
21
21
|
'@angular-devkit/build-angular:ng-packagr',
|
|
22
22
|
'@angular/build:ng-packagr',
|
|
23
23
|
]),
|
|
24
|
-
devServer: new Set([
|
|
25
|
-
|
|
26
|
-
'@angular/build:dev-server',
|
|
27
|
-
]),
|
|
28
|
-
extractI18n: new Set([
|
|
29
|
-
'@angular-devkit/build-angular:extract-i18n',
|
|
30
|
-
'@angular/build:extract-i18n',
|
|
31
|
-
]),
|
|
24
|
+
devServer: new Set(['@angular-devkit/build-angular:dev-server']),
|
|
25
|
+
extractI18n: new Set(['@angular-devkit/build-angular:extract-i18n']),
|
|
32
26
|
prerender: new Set([
|
|
33
27
|
'@angular-devkit/build-angular:prerender',
|
|
34
28
|
'@nguniversal/builders:prerender',
|
|
@@ -38,10 +32,7 @@ const knownExecutors = {
|
|
|
38
32
|
'@angular-devkit/build-angular:ssr-dev-server',
|
|
39
33
|
'@nguniversal/builders:ssr-dev-server',
|
|
40
34
|
]),
|
|
41
|
-
test: new Set([
|
|
42
|
-
'@angular-devkit/build-angular:karma',
|
|
43
|
-
'@angular/build:karma',
|
|
44
|
-
]),
|
|
35
|
+
test: new Set(['@angular-devkit/build-angular:karma']),
|
|
45
36
|
};
|
|
46
37
|
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
47
38
|
function readProjectsCache(cachePath) {
|
|
@@ -120,7 +111,7 @@ async function buildAngularProjects(configFilePath, options, angularWorkspaceRoo
|
|
|
120
111
|
appShellTargets.push({ target: nxTargetName, project: projectName });
|
|
121
112
|
}
|
|
122
113
|
else if (knownExecutors.build.has(angularTarget.builder)) {
|
|
123
|
-
await updateBuildTarget(
|
|
114
|
+
await updateBuildTarget(nxTargetName, targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs);
|
|
124
115
|
}
|
|
125
116
|
else if (knownExecutors.devServer.has(angularTarget.builder)) {
|
|
126
117
|
targets[nxTargetName].continuous = true;
|
|
@@ -205,21 +196,21 @@ function updateAppShellTarget(projectName, targetName, projects, angularJson, an
|
|
|
205
196
|
target.inputs = inputs;
|
|
206
197
|
target.outputs = outputs;
|
|
207
198
|
}
|
|
208
|
-
async function updateBuildTarget(
|
|
199
|
+
async function updateBuildTarget(targetName, target, angularTarget, context, angularWorkspaceRoot, projectRoot, namedInputs) {
|
|
209
200
|
target.dependsOn = [`^${targetName}`];
|
|
210
|
-
if (angularTarget.
|
|
201
|
+
if (angularTarget.options?.outputPath) {
|
|
202
|
+
const fullOutputPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, angularTarget.options.outputPath);
|
|
203
|
+
target.outputs = [
|
|
204
|
+
getOutput(fullOutputPath, context.workspaceRoot, angularWorkspaceRoot, projectRoot),
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
else if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr' ||
|
|
211
208
|
angularTarget.builder === '@angular/build:ng-packagr') {
|
|
212
209
|
const outputs = await getNgPackagrOutputs(angularTarget, angularWorkspaceRoot, projectRoot, context);
|
|
213
210
|
if (outputs.length) {
|
|
214
211
|
target.outputs = outputs;
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
|
-
else {
|
|
218
|
-
const fullOutputPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, angularTarget.options?.outputPath ?? posix.join('dist', projectName));
|
|
219
|
-
target.outputs = [
|
|
220
|
-
getOutput(fullOutputPath, context.workspaceRoot, angularWorkspaceRoot, projectRoot),
|
|
221
|
-
];
|
|
222
|
-
}
|
|
223
214
|
if (target.outputs?.length) {
|
|
224
215
|
// make it cacheable if we were able to identify outputs
|
|
225
216
|
target.cache = true;
|
|
@@ -281,7 +272,7 @@ function updatePrerenderTarget(projectName, targetName, projects, angularJson) {
|
|
|
281
272
|
target.outputs = outputs;
|
|
282
273
|
}
|
|
283
274
|
async function getNgPackagrOutputs(target, angularWorkspaceRoot, projectRoot, context) {
|
|
284
|
-
let ngPackageJsonPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, target.options
|
|
275
|
+
let ngPackageJsonPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, target.options.project);
|
|
285
276
|
const readConfig = async (configPath) => {
|
|
286
277
|
if (!(0, node_fs_1.existsSync)(configPath)) {
|
|
287
278
|
return undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as latestVersions from './versions';
|
|
2
|
-
type SupportedVersions = '
|
|
2
|
+
type SupportedVersions = 'angularV17' | 'angularV18';
|
|
3
3
|
type LatestPackageVersionNames = Exclude<keyof typeof latestVersions, 'nxVersion'>;
|
|
4
4
|
type CompatPackageVersionNames = LatestPackageVersionNames;
|
|
5
5
|
export type PackageVersionNames = LatestPackageVersionNames | CompatPackageVersionNames;
|
|
6
6
|
export type VersionMap = {
|
|
7
|
+
angularV17: Record<Exclude<CompatPackageVersionNames, 'typescriptEslintVersion'>, string>;
|
|
7
8
|
angularV18: Record<CompatPackageVersionNames, string>;
|
|
8
|
-
angularV19: Record<CompatPackageVersionNames, string>;
|
|
9
9
|
};
|
|
10
10
|
export type PackageLatestVersions = Record<LatestPackageVersionNames, string>;
|
|
11
11
|
export type PackageCompatVersions = VersionMap[SupportedVersions];
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.backwardCompatibleVersions = void 0;
|
|
4
4
|
exports.backwardCompatibleVersions = {
|
|
5
|
-
|
|
6
|
-
angularVersion: '~
|
|
7
|
-
angularDevkitVersion: '~
|
|
8
|
-
ngPackagrVersion: '~
|
|
5
|
+
angularV17: {
|
|
6
|
+
angularVersion: '~17.3.0',
|
|
7
|
+
angularDevkitVersion: '~17.3.0',
|
|
8
|
+
ngPackagrVersion: '~17.3.0',
|
|
9
9
|
angularRspackVersion: '~20.6.1',
|
|
10
|
-
ngrxVersion: '~
|
|
10
|
+
ngrxVersion: '~17.0.0',
|
|
11
11
|
rxjsVersion: '~7.8.0',
|
|
12
12
|
zoneJsVersion: '~0.14.3',
|
|
13
13
|
angularJsVersion: '1.7.9',
|
|
@@ -17,28 +17,28 @@ exports.backwardCompatibleVersions = {
|
|
|
17
17
|
expressVersion: '^4.21.2',
|
|
18
18
|
typesExpressVersion: '^4.17.21',
|
|
19
19
|
browserSyncVersion: '^3.0.0',
|
|
20
|
-
moduleFederationNodeVersion: '~2.
|
|
21
|
-
moduleFederationEnhancedVersion: '0.
|
|
22
|
-
angularEslintVersion: '
|
|
23
|
-
typescriptEslintVersion: '^7.16.0',
|
|
20
|
+
moduleFederationNodeVersion: '~2.3.0',
|
|
21
|
+
moduleFederationEnhancedVersion: '~0.2.3',
|
|
22
|
+
angularEslintVersion: '~17.3.0',
|
|
24
23
|
tailwindVersion: '^3.0.2',
|
|
25
24
|
postcssVersion: '^8.4.5',
|
|
26
25
|
postcssUrlVersion: '~10.1.3',
|
|
27
26
|
autoprefixerVersion: '^10.4.0',
|
|
28
27
|
tsNodeVersion: '10.9.1',
|
|
29
|
-
jestPresetAngularVersion: '~14.
|
|
28
|
+
jestPresetAngularVersion: '~14.0.3',
|
|
30
29
|
typesNodeVersion: '18.16.9',
|
|
31
30
|
jasmineMarblesVersion: '^0.9.2',
|
|
32
31
|
jsoncEslintParserVersion: '^2.1.0',
|
|
32
|
+
webpackMergeVersion: '^5.8.0',
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
angularVersion: '~
|
|
36
|
-
angularDevkitVersion: '~
|
|
37
|
-
ngPackagrVersion: '~
|
|
34
|
+
angularV18: {
|
|
35
|
+
angularVersion: '~18.2.0',
|
|
36
|
+
angularDevkitVersion: '~18.2.0',
|
|
37
|
+
ngPackagrVersion: '~18.2.0',
|
|
38
38
|
angularRspackVersion: '~20.6.1',
|
|
39
|
-
ngrxVersion: '~
|
|
39
|
+
ngrxVersion: '~18.0.2',
|
|
40
40
|
rxjsVersion: '~7.8.0',
|
|
41
|
-
zoneJsVersion: '~0.
|
|
41
|
+
zoneJsVersion: '~0.14.3',
|
|
42
42
|
angularJsVersion: '1.7.9',
|
|
43
43
|
tsLibVersion: '^2.3.0',
|
|
44
44
|
corsVersion: '~2.8.5',
|
|
@@ -46,18 +46,19 @@ exports.backwardCompatibleVersions = {
|
|
|
46
46
|
expressVersion: '^4.21.2',
|
|
47
47
|
typesExpressVersion: '^4.17.21',
|
|
48
48
|
browserSyncVersion: '^3.0.0',
|
|
49
|
-
moduleFederationNodeVersion: '
|
|
50
|
-
moduleFederationEnhancedVersion: '
|
|
51
|
-
angularEslintVersion: '^
|
|
49
|
+
moduleFederationNodeVersion: '~2.5.0',
|
|
50
|
+
moduleFederationEnhancedVersion: '0.6.9',
|
|
51
|
+
angularEslintVersion: '^18.3.0',
|
|
52
52
|
typescriptEslintVersion: '^7.16.0',
|
|
53
53
|
tailwindVersion: '^3.0.2',
|
|
54
54
|
postcssVersion: '^8.4.5',
|
|
55
55
|
postcssUrlVersion: '~10.1.3',
|
|
56
56
|
autoprefixerVersion: '^10.4.0',
|
|
57
57
|
tsNodeVersion: '10.9.1',
|
|
58
|
-
jestPresetAngularVersion: '~14.
|
|
58
|
+
jestPresetAngularVersion: '~14.1.0',
|
|
59
59
|
typesNodeVersion: '18.16.9',
|
|
60
60
|
jasmineMarblesVersion: '^0.9.2',
|
|
61
61
|
jsoncEslintParserVersion: '^2.1.0',
|
|
62
|
+
webpackMergeVersion: '^5.8.0',
|
|
62
63
|
},
|
|
63
64
|
};
|
|
@@ -444,18 +444,9 @@ function getListOfRoutes(source) {
|
|
|
444
444
|
}
|
|
445
445
|
function isNgStandaloneApp(tree, projectName) {
|
|
446
446
|
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
447
|
-
|
|
447
|
+
const mainFile = project.targets?.build?.options?.main ??
|
|
448
448
|
project.targets?.build?.options?.browser;
|
|
449
|
-
|
|
450
|
-
if (mainFile) {
|
|
451
|
-
hasMainFile = true;
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
const sourceRoot = project.sourceRoot ?? (0, devkit_1.joinPathFragments)(project.root, 'src');
|
|
455
|
-
mainFile = (0, devkit_1.joinPathFragments)(sourceRoot, 'main.ts');
|
|
456
|
-
hasMainFile = tree.exists(mainFile);
|
|
457
|
-
}
|
|
458
|
-
if (project.projectType !== 'application' || !hasMainFile) {
|
|
449
|
+
if (project.projectType !== 'application' || !mainFile) {
|
|
459
450
|
return false;
|
|
460
451
|
}
|
|
461
452
|
(0, ensure_typescript_1.ensureTypescript)();
|
|
@@ -557,12 +548,7 @@ function readBootstrapInfo(host, app) {
|
|
|
557
548
|
let mainPath;
|
|
558
549
|
try {
|
|
559
550
|
mainPath =
|
|
560
|
-
config.targets.build.options
|
|
561
|
-
config.targets.build.options?.browser;
|
|
562
|
-
if (!mainPath) {
|
|
563
|
-
const sourceRoot = config.sourceRoot ?? (0, devkit_1.joinPathFragments)(config.root, 'src');
|
|
564
|
-
mainPath = (0, devkit_1.joinPathFragments)(sourceRoot, 'main.ts');
|
|
565
|
-
}
|
|
551
|
+
config.targets.build.options.main ?? config.targets.build.options.browser;
|
|
566
552
|
}
|
|
567
553
|
catch (e) {
|
|
568
554
|
throw new Error('Main file cannot be located');
|
|
@@ -18,24 +18,24 @@ function createApp(tree, appName, routing = true) {
|
|
|
18
18
|
// save for getAppDir() lookup by external *.spec.ts tests
|
|
19
19
|
appConfig = {
|
|
20
20
|
appName,
|
|
21
|
-
appModule: `${appName}/src/app/app
|
|
21
|
+
appModule: `${appName}/src/app/app.module.ts`,
|
|
22
22
|
};
|
|
23
23
|
tree.write(appConfig.appModule, `import { NgModule } from '@angular/core';
|
|
24
24
|
import { BrowserModule } from '@angular/platform-browser';
|
|
25
25
|
${routing ? "import { RouterModule } from '@angular/router'" : ''};
|
|
26
|
-
import {
|
|
26
|
+
import { AppComponent } from './app.component';
|
|
27
27
|
@NgModule({
|
|
28
28
|
imports: [BrowserModule, ${routing ? 'RouterModule.forRoot([])' : ''}],
|
|
29
|
-
declarations: [
|
|
30
|
-
bootstrap: [
|
|
29
|
+
declarations: [AppComponent],
|
|
30
|
+
bootstrap: [AppComponent]
|
|
31
31
|
})
|
|
32
32
|
export class AppModule {}
|
|
33
33
|
`);
|
|
34
|
-
tree.write(`${appName}/src/main.ts`, `import {
|
|
34
|
+
tree.write(`${appName}/src/main.ts`, `import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
35
35
|
|
|
36
|
-
import { AppModule } from './app/app
|
|
36
|
+
import { AppModule } from './app/app.module';
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
platformBrowserDynamic()
|
|
39
39
|
.bootstrapModule(AppModule)
|
|
40
40
|
.catch(err => console.log(err));
|
|
41
41
|
`);
|
|
@@ -65,7 +65,7 @@ function createLib(tree, libName) {
|
|
|
65
65
|
const { name, className, fileName, propertyName } = (0, devkit_1.names)(libName);
|
|
66
66
|
libConfig = {
|
|
67
67
|
name,
|
|
68
|
-
module: `${propertyName}/src/lib/${fileName}
|
|
68
|
+
module: `${propertyName}/src/lib/${fileName}.module.ts`,
|
|
69
69
|
barrel: `${propertyName}/src/index.ts`,
|
|
70
70
|
};
|
|
71
71
|
tree.write(libConfig.module, `import { NgModule } from '@angular/core';
|
|
@@ -78,6 +78,6 @@ import { CommonModule } from '@angular/common';
|
|
|
78
78
|
})
|
|
79
79
|
export class ${className}Module { }
|
|
80
80
|
`);
|
|
81
|
-
tree.write(libConfig.barrel, `export * from './lib/${fileName}
|
|
81
|
+
tree.write(libConfig.barrel, `export * from './lib/${fileName}.module';
|
|
82
82
|
`);
|
|
83
83
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const angularVersion = "
|
|
3
|
-
export declare const angularDevkitVersion = "
|
|
4
|
-
export declare const ngPackagrVersion = "
|
|
2
|
+
export declare const angularVersion = "~19.2.0";
|
|
3
|
+
export declare const angularDevkitVersion = "~19.2.0";
|
|
4
|
+
export declare const ngPackagrVersion = "~19.2.0";
|
|
5
5
|
export declare const angularRspackVersion = "^21.0.1";
|
|
6
6
|
export declare const ngrxVersion = "^19.0.0";
|
|
7
7
|
export declare const rxjsVersion = "~7.8.0";
|
|
@@ -15,6 +15,7 @@ export declare const typesExpressVersion = "^4.17.21";
|
|
|
15
15
|
export declare const browserSyncVersion = "^3.0.0";
|
|
16
16
|
export declare const moduleFederationNodeVersion = "^2.6.26";
|
|
17
17
|
export declare const moduleFederationEnhancedVersion = "^0.9.0";
|
|
18
|
+
export declare const webpackMergeVersion = "^5.8.0";
|
|
18
19
|
export declare const angularEslintVersion = "^19.2.0";
|
|
19
20
|
export declare const typescriptEslintVersion = "^7.16.0";
|
|
20
21
|
export declare const tailwindVersion = "^3.0.2";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularRspackVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
3
|
+
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularRspackVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.angularVersion = '
|
|
6
|
-
exports.angularDevkitVersion = '
|
|
7
|
-
exports.ngPackagrVersion = '
|
|
5
|
+
exports.angularVersion = '~19.2.0';
|
|
6
|
+
exports.angularDevkitVersion = '~19.2.0';
|
|
7
|
+
exports.ngPackagrVersion = '~19.2.0';
|
|
8
8
|
exports.angularRspackVersion = '^21.0.1';
|
|
9
9
|
exports.ngrxVersion = '^19.0.0';
|
|
10
10
|
exports.rxjsVersion = '~7.8.0';
|
|
@@ -18,6 +18,7 @@ exports.typesExpressVersion = '^4.17.21';
|
|
|
18
18
|
exports.browserSyncVersion = '^3.0.0';
|
|
19
19
|
exports.moduleFederationNodeVersion = '^2.6.26';
|
|
20
20
|
exports.moduleFederationEnhancedVersion = '^0.9.0';
|
|
21
|
+
exports.webpackMergeVersion = '^5.8.0';
|
|
21
22
|
exports.angularEslintVersion = '^19.2.0';
|
|
22
23
|
exports.typescriptEslintVersion = '^7.16.0';
|
|
23
24
|
exports.tailwindVersion = '^3.0.2';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function assertBuilderPackageIsInstalled(packageName: string): void;
|