@nx/angular 23.0.0-beta.12 → 23.0.0-beta.13
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/package.json +8 -8
- package/plugins/component-testing.js +2 -2
- package/src/builders/utilities/buildable-libs.d.ts +1 -1
- package/src/builders/utilities/buildable-libs.d.ts.map +1 -1
- package/src/builders/utilities/buildable-libs.js +3 -3
- package/src/builders/utilities/module-federation.d.ts.map +1 -1
- package/src/builders/utilities/module-federation.js +2 -3
- package/src/builders/utilities/webpack.js +1 -1
- package/src/executors/delegate-build/delegate-build.impl.js +3 -3
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +2 -2
- package/src/executors/package/package.impl.d.ts +1 -1
- package/src/executors/package/package.impl.d.ts.map +1 -1
- package/src/executors/package/package.impl.js +3 -3
- package/src/executors/utilities/buildable-libs.d.ts +1 -1
- package/src/executors/utilities/buildable-libs.d.ts.map +1 -1
- package/src/executors/utilities/buildable-libs.js +3 -3
- package/src/executors/utilities/esbuild-extensions.js +1 -1
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +4 -6
- package/src/generators/application/lib/update-tsconfig-files.js +3 -3
- package/src/generators/component/lib/component.js +2 -2
- package/src/generators/convert-to-with-mf/lib/check-name-matches.js +2 -2
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +2 -2
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +4 -4
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +2 -2
- package/src/generators/federate-module/lib/add-path-to-exposes.js +6 -6
- package/src/generators/host/lib/update-ssr-setup.js +2 -2
- package/src/generators/library/lib/add-children.js +2 -2
- package/src/generators/library/lib/add-load-children.js +2 -2
- package/src/generators/library/lib/add-project.js +2 -2
- package/src/generators/library/lib/create-files.js +2 -2
- package/src/generators/library/lib/update-tsconfig-files.js +3 -3
- package/src/generators/library/library.js +2 -2
- package/src/generators/move/lib/update-module-name.js +2 -2
- package/src/generators/ng-add/migrators/migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/migrator.js +10 -5
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +6 -6
- package/src/generators/ng-add/utilities/workspace.js +6 -6
- package/src/generators/ngrx-feature-store/lib/add-exports-barrel.js +2 -2
- package/src/generators/ngrx-feature-store/lib/add-imports.js +2 -2
- package/src/generators/ngrx-root-store/lib/add-imports.js +2 -2
- package/src/generators/ngrx-root-store/lib/normalize-options.js +2 -2
- package/src/generators/remote/lib/update-ssr-setup.js +2 -2
- package/src/generators/remote/remote.js +2 -2
- package/src/generators/scam/lib/convert-component-to-scam.js +2 -2
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +2 -2
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +2 -2
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +2 -2
- package/src/generators/setup-mf/lib/add-remote-to-host.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/add-remote-to-host.js +5 -6
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +2 -2
- package/src/generators/setup-ssr/lib/add-hydration.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/add-hydration.js +3 -4
- package/src/generators/setup-ssr/lib/add-server-file.js +2 -2
- package/src/generators/setup-ssr/lib/generate-files.js +2 -2
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +2 -2
- package/src/generators/setup-ssr/lib/update-project-config.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +19 -7
- package/src/generators/utils/add-mf-env-to-inputs.d.ts.map +1 -1
- package/src/generators/utils/add-mf-env-to-inputs.js +16 -9
- package/src/generators/utils/add-vitest.d.ts.map +1 -1
- package/src/generators/utils/add-vitest.js +16 -9
- package/src/generators/utils/app-components-info.js +2 -2
- package/src/generators/utils/find-module.js +2 -2
- package/src/generators/utils/insert-ngmodule-import.js +6 -6
- package/src/generators/utils/storybook-ast/component-info.js +5 -5
- package/src/generators/utils/storybook-ast/module-info.js +9 -9
- package/src/generators/utils/storybook-ast/storybook-inputs.js +4 -4
- package/src/generators/utils/testing.js +2 -2
- package/src/generators/utils/tsconfig-utils.js +2 -2
- package/src/generators/utils/validations.js +2 -2
- package/src/migrations/update-19-6-1/ensure-depends-on-for-mf.d.ts.map +1 -1
- package/src/migrations/update-19-6-1/ensure-depends-on-for-mf.js +25 -18
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.js +43 -10
- package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +2 -2
- package/src/migrations/update-21-5-0/utils/karma-config-analyzer.js +2 -2
- package/src/migrations/update-22-3-0/update-module-resolution.js +2 -2
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.js +2 -2
- package/src/utils/nx-devkit/ast-utils.d.ts.map +1 -1
- package/src/utils/nx-devkit/ast-utils.js +17 -18
- package/src/utils/nx-devkit/route-utils.js +3 -3
- package/tailwind.js +2 -2
|
@@ -25,13 +25,12 @@ exports.getDecoratorPropertyValueNode = getDecoratorPropertyValueNode;
|
|
|
25
25
|
exports.getTsSourceFile = getTsSourceFile;
|
|
26
26
|
const devkit_1 = require("@nx/devkit");
|
|
27
27
|
const js_1 = require("@nx/js");
|
|
28
|
-
const
|
|
29
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
28
|
+
const internal_1 = require("@nx/js/internal");
|
|
30
29
|
const path_1 = require("path");
|
|
31
30
|
let tsModule;
|
|
32
31
|
function _angularImportsFromNode(node, _sourceFile) {
|
|
33
32
|
if (!tsModule) {
|
|
34
|
-
tsModule = (0,
|
|
33
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
35
34
|
}
|
|
36
35
|
const ms = node.moduleSpecifier;
|
|
37
36
|
let modulePath;
|
|
@@ -94,7 +93,7 @@ function isStandalone(tree, sourceFile, decoratorName) {
|
|
|
94
93
|
}
|
|
95
94
|
function getDecoratorMetadata(source, identifier, module) {
|
|
96
95
|
if (!tsModule) {
|
|
97
|
-
tsModule = (0,
|
|
96
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
98
97
|
}
|
|
99
98
|
const angularImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration)
|
|
100
99
|
.map((node) => _angularImportsFromNode(node, source))
|
|
@@ -142,7 +141,7 @@ function _addSymbolToDecoratorMetadata(host, source, filePath, metadataField, ex
|
|
|
142
141
|
return source;
|
|
143
142
|
}
|
|
144
143
|
if (!tsModule) {
|
|
145
|
-
tsModule = (0,
|
|
144
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
146
145
|
}
|
|
147
146
|
// Get all the children property assignment of object literals.
|
|
148
147
|
const matchingProperties = node.properties
|
|
@@ -311,7 +310,7 @@ function addImportToModule(host, source, modulePath, symbolName) {
|
|
|
311
310
|
}
|
|
312
311
|
function addImportToTestBed(host, source, specPath, symbolName) {
|
|
313
312
|
if (!tsModule) {
|
|
314
|
-
tsModule = (0,
|
|
313
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
315
314
|
}
|
|
316
315
|
const allCalls = ((0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression));
|
|
317
316
|
const configureTestingModuleObjectLiterals = allCalls
|
|
@@ -330,7 +329,7 @@ function addImportToTestBed(host, source, specPath, symbolName) {
|
|
|
330
329
|
}
|
|
331
330
|
function addDeclarationsToTestBed(host, source, specPath, symbolName) {
|
|
332
331
|
if (!tsModule) {
|
|
333
|
-
tsModule = (0,
|
|
332
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
334
333
|
}
|
|
335
334
|
const allCalls = ((0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression));
|
|
336
335
|
const configureTestingModuleObjectLiterals = allCalls
|
|
@@ -349,7 +348,7 @@ function addDeclarationsToTestBed(host, source, specPath, symbolName) {
|
|
|
349
348
|
}
|
|
350
349
|
function replaceIntoToTestBed(host, source, specPath, newSymbol, previousSymbol) {
|
|
351
350
|
if (!tsModule) {
|
|
352
|
-
tsModule = (0,
|
|
351
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
353
352
|
}
|
|
354
353
|
const allCalls = ((0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression));
|
|
355
354
|
const configureTestingModuleObjectLiterals = allCalls
|
|
@@ -400,7 +399,7 @@ function addRouteToNgModule(host, ngModulePath, source, route) {
|
|
|
400
399
|
}
|
|
401
400
|
function getListOfRoutes(source) {
|
|
402
401
|
if (!tsModule) {
|
|
403
|
-
tsModule = (0,
|
|
402
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
404
403
|
}
|
|
405
404
|
const imports = getMatchingProperty(source, 'imports', 'NgModule', '@angular/core');
|
|
406
405
|
if (imports?.initializer.kind === tsModule.SyntaxKind.ArrayLiteralExpression) {
|
|
@@ -441,14 +440,14 @@ function isNgStandaloneApp(tree, projectName) {
|
|
|
441
440
|
hasMainFile = true;
|
|
442
441
|
}
|
|
443
442
|
else {
|
|
444
|
-
const sourceRoot = (0,
|
|
443
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
|
|
445
444
|
mainFile = (0, devkit_1.joinPathFragments)(sourceRoot, 'main.ts');
|
|
446
445
|
hasMainFile = tree.exists(mainFile);
|
|
447
446
|
}
|
|
448
447
|
if (project.projectType !== 'application' || !hasMainFile) {
|
|
449
448
|
return false;
|
|
450
449
|
}
|
|
451
|
-
(0,
|
|
450
|
+
(0, internal_1.ensureTypescript)();
|
|
452
451
|
const { ast, query } = require('@phenomnomnominal/tsquery');
|
|
453
452
|
const mainFileContents = tree.read(mainFile, 'utf-8');
|
|
454
453
|
const BOOTSTRAP_APPLICATION_SELECTOR = 'CallExpression:has(Identifier[name=bootstrapApplication])';
|
|
@@ -463,7 +462,7 @@ function isNgStandaloneApp(tree, projectName) {
|
|
|
463
462
|
* @param providerToAdd Provider to add
|
|
464
463
|
*/
|
|
465
464
|
function addProviderToBootstrapApplication(tree, filePath, providerToAdd) {
|
|
466
|
-
(0,
|
|
465
|
+
(0, internal_1.ensureTypescript)();
|
|
467
466
|
const { ast, query } = require('@phenomnomnominal/tsquery');
|
|
468
467
|
const PROVIDERS_ARRAY_SELECTOR = 'CallExpression:has(Identifier[name=bootstrapApplication]) ObjectLiteralExpression > PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression';
|
|
469
468
|
const fileContents = tree.read(filePath, 'utf-8');
|
|
@@ -484,7 +483,7 @@ function addProviderToBootstrapApplication(tree, filePath, providerToAdd) {
|
|
|
484
483
|
* @param providerToAdd Provider to add
|
|
485
484
|
*/
|
|
486
485
|
function addProviderToAppConfig(tree, filePath, providerToAdd) {
|
|
487
|
-
(0,
|
|
486
|
+
(0, internal_1.ensureTypescript)();
|
|
488
487
|
const { ast, query } = require('@phenomnomnominal/tsquery');
|
|
489
488
|
const PROVIDERS_ARRAY_SELECTOR = 'VariableDeclaration:has(TypeReference > Identifier[name=ApplicationConfig]) > ObjectLiteralExpression PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression';
|
|
490
489
|
const fileContents = tree.read(filePath, 'utf-8');
|
|
@@ -535,7 +534,7 @@ function addEntryComponents(host, source, modulePath, symbolName) {
|
|
|
535
534
|
}
|
|
536
535
|
function readBootstrapInfo(host, app) {
|
|
537
536
|
if (!tsModule) {
|
|
538
|
-
tsModule = (0,
|
|
537
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
539
538
|
}
|
|
540
539
|
const config = (0, devkit_1.readProjectConfiguration)(host, app);
|
|
541
540
|
let mainPath;
|
|
@@ -544,7 +543,7 @@ function readBootstrapInfo(host, app) {
|
|
|
544
543
|
config.targets.build.options?.main ??
|
|
545
544
|
config.targets.build.options?.browser;
|
|
546
545
|
if (!mainPath) {
|
|
547
|
-
const sourceRoot = (0,
|
|
546
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(config, host);
|
|
548
547
|
mainPath = (0, devkit_1.joinPathFragments)(sourceRoot, 'main.ts');
|
|
549
548
|
}
|
|
550
549
|
}
|
|
@@ -582,7 +581,7 @@ function readBootstrapInfo(host, app) {
|
|
|
582
581
|
}
|
|
583
582
|
function getDecoratorPropertyValueNode(host, modulePath, identifier, property, module) {
|
|
584
583
|
if (!tsModule) {
|
|
585
|
-
tsModule = (0,
|
|
584
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
586
585
|
}
|
|
587
586
|
const moduleSourceText = host.read(modulePath).toString('utf-8');
|
|
588
587
|
const moduleSource = tsModule.createSourceFile(modulePath, moduleSourceText, tsModule.ScriptTarget.Latest, true);
|
|
@@ -591,7 +590,7 @@ function getDecoratorPropertyValueNode(host, modulePath, identifier, property, m
|
|
|
591
590
|
}
|
|
592
591
|
function getMatchingObjectLiteralElement(node, source, property) {
|
|
593
592
|
if (!tsModule) {
|
|
594
|
-
tsModule = (0,
|
|
593
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
595
594
|
}
|
|
596
595
|
return (node.properties
|
|
597
596
|
.filter((prop) => prop.kind == tsModule.SyntaxKind.PropertyAssignment)
|
|
@@ -610,7 +609,7 @@ function getMatchingObjectLiteralElement(node, source, property) {
|
|
|
610
609
|
}
|
|
611
610
|
function getTsSourceFile(host, path) {
|
|
612
611
|
if (!tsModule) {
|
|
613
|
-
tsModule = (0,
|
|
612
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
614
613
|
}
|
|
615
614
|
const buffer = host.read(path);
|
|
616
615
|
if (!buffer) {
|
|
@@ -4,7 +4,7 @@ exports.addRoute = addRoute;
|
|
|
4
4
|
exports.addProviderToRoute = addProviderToRoute;
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
6
|
const ast_utils_1 = require("./ast-utils");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
let tsModule;
|
|
9
9
|
/**
|
|
10
10
|
* Add a new route to a routes definition
|
|
@@ -20,7 +20,7 @@ function addRoute(tree, routesFile, route, lazy = true, routesConst, importPath)
|
|
|
20
20
|
throw new Error(`Path to parent routing declaration (${routesFile}) does not exist. Please ensure path is correct.`);
|
|
21
21
|
}
|
|
22
22
|
if (!tsModule) {
|
|
23
|
-
tsModule = (0,
|
|
23
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
24
24
|
}
|
|
25
25
|
const { ast, query } = require('@phenomnomnominal/tsquery');
|
|
26
26
|
let routesFileContents = tree.read(routesFile, 'utf-8');
|
|
@@ -58,7 +58,7 @@ function addProviderToRoute(tree, routesFile, routeToAddProviderTo, providerToAd
|
|
|
58
58
|
if (!tree.exists(routesFile)) {
|
|
59
59
|
throw new Error(`Path to parent routing declaration (${routesFile}) does not exist. Please ensure path is correct.`);
|
|
60
60
|
}
|
|
61
|
-
(0,
|
|
61
|
+
(0, internal_1.ensureTypescript)();
|
|
62
62
|
const { ast, query } = require('@phenomnomnominal/tsquery');
|
|
63
63
|
let routesFileContents = tree.read(routesFile, 'utf-8');
|
|
64
64
|
const sourceFile = ast(routesFileContents);
|
package/tailwind.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createGlobPatternsForDependencies = createGlobPatternsForDependencies;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/js/internal");
|
|
5
5
|
let hasWarned = false;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated `@nx/angular/tailwind` will be removed in Nx 24. Migrate to Tailwind CSS v4 which no longer needs glob patterns.
|
|
@@ -15,7 +15,7 @@ function createGlobPatternsForDependencies(dirPath, fileGlobPattern = '/**/!(*.s
|
|
|
15
15
|
`See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular\n`);
|
|
16
16
|
}
|
|
17
17
|
try {
|
|
18
|
-
return (0,
|
|
18
|
+
return (0, internal_1.createGlobPatternsForDependencies)(dirPath, fileGlobPattern);
|
|
19
19
|
}
|
|
20
20
|
catch (e) {
|
|
21
21
|
/**
|