@nrwl/angular 13.0.0-beta.8 → 13.0.0-rc.2

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.
Files changed (46) hide show
  1. package/migrations.json +32 -4
  2. package/package.json +6 -6
  3. package/src/builders/webpack-browser/webpack-browser.impl.js +1 -1
  4. package/src/builders/webpack-browser/webpack-browser.impl.js.map +1 -1
  5. package/src/executors/delegate-build/delegate-build.impl.js +1 -1
  6. package/src/executors/delegate-build/delegate-build.impl.js.map +1 -1
  7. package/src/executors/package/package.impl.js +23 -4
  8. package/src/executors/package/package.impl.js.map +1 -1
  9. package/src/generators/application/application.d.ts +1 -1
  10. package/src/generators/application/application.js.map +1 -1
  11. package/src/generators/application/lib/add-protractor.js +9 -1
  12. package/src/generators/application/lib/add-protractor.js.map +1 -1
  13. package/src/generators/application/lib/normalize-options.js +3 -3
  14. package/src/generators/application/lib/normalize-options.js.map +1 -1
  15. package/src/generators/application/lib/update-config-files.js +3 -0
  16. package/src/generators/application/lib/update-config-files.js.map +1 -1
  17. package/src/generators/application/schema.json +1 -2
  18. package/src/generators/library/lib/normalize-options.js +3 -3
  19. package/src/generators/library/lib/normalize-options.js.map +1 -1
  20. package/src/generators/library/library.js +7 -2
  21. package/src/generators/library/library.js.map +1 -1
  22. package/src/generators/library/schema.json +1 -2
  23. package/src/generators/ngrx/lib/add-imports-to-module.js +1 -1
  24. package/src/generators/ngrx/lib/add-imports-to-module.js.map +1 -1
  25. package/src/generators/ngrx/lib/normalize-options.js +1 -8
  26. package/src/generators/ngrx/lib/normalize-options.js.map +1 -1
  27. package/src/generators/ngrx/ngrx.js +2 -3
  28. package/src/generators/ngrx/ngrx.js.map +1 -1
  29. package/src/generators/ngrx/schema.d.ts +0 -10
  30. package/src/generators/ngrx/schema.json +0 -12
  31. package/src/generators/setup-mfe/lib/add-entry-module.js +6 -1
  32. package/src/generators/setup-mfe/lib/add-entry-module.js.map +1 -1
  33. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js +2 -2
  34. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js.map +1 -1
  35. package/src/migrations/update-13-0-0/{add-postcss-import.d.ts → add-postcss-packages.d.ts} +0 -0
  36. package/src/migrations/update-13-0-0/{add-postcss-import.js → add-postcss-packages.js} +7 -2
  37. package/src/migrations/update-13-0-0/add-postcss-packages.js.map +1 -0
  38. package/src/utils/testing.d.ts +0 -8
  39. package/src/utils/testing.js +1 -17
  40. package/src/utils/testing.js.map +1 -1
  41. package/src/utils/versions.d.ts +1 -1
  42. package/src/utils/versions.js +2 -2
  43. package/src/migrations/update-13-0-0/add-postcss-import.js.map +0 -1
  44. package/src/utils/ast-utils.d.ts +0 -59
  45. package/src/utils/ast-utils.js +0 -438
  46. package/src/utils/ast-utils.js.map +0 -1
@@ -1,11 +1,3 @@
1
1
  import { Rule, Tree } from '@angular-devkit/schematics';
2
- /**
3
- * @deprecated will be removed in v13.
4
- */
5
- export declare function runSchematic<SchemaOptions = any>(schematicName: string, options: SchemaOptions, tree: Tree): Promise<import("@angular-devkit/schematics/testing").UnitTestTree>;
6
2
  export declare function runMigration<SchemaOptions = any>(schematicName: string, options: SchemaOptions, tree: Tree): Promise<import("@angular-devkit/schematics/testing").UnitTestTree>;
7
- /**
8
- * @deprecated will be removed in v13.
9
- */
10
- export declare function runExternalSchematic<SchemaOptions = any>(collectionName: string, schematicName: string, options: SchemaOptions, tree: Tree): Promise<import("@angular-devkit/schematics/testing").UnitTestTree>;
11
3
  export declare function callRule(rule: Rule, tree: Tree): Promise<import("@angular-devkit/schematics/src/tree/interface").Tree>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.callRule = exports.runExternalSchematic = exports.runMigration = exports.runSchematic = void 0;
3
+ exports.callRule = exports.runMigration = void 0;
4
4
  const path_1 = require("path");
5
5
  const testing_1 = require("@angular-devkit/schematics/testing");
6
6
  const testRunner = new testing_1.SchematicTestRunner('@nrwl/angular', path_1.join(__dirname, '../../generators.json'));
@@ -9,28 +9,12 @@ testRunner.registerCollection('@nrwl/workspace', path_1.join(__dirname, '../../.
9
9
  testRunner.registerCollection('@nrwl/cypress', path_1.join(__dirname, '../../../cypress/generators.json'));
10
10
  testRunner.registerCollection('@nrwl/storybook', path_1.join(__dirname, '../../../storybook/generators.json'));
11
11
  const migrationTestRunner = new testing_1.SchematicTestRunner('@nrwl/workspace', path_1.join(__dirname, '../../migrations.json'));
12
- /**
13
- * @deprecated will be removed in v13.
14
- */
15
- function runSchematic(schematicName, options, tree) {
16
- return testRunner.runSchematicAsync(schematicName, options, tree).toPromise();
17
- }
18
- exports.runSchematic = runSchematic;
19
12
  function runMigration(schematicName, options, tree) {
20
13
  return migrationTestRunner
21
14
  .runSchematicAsync(schematicName, options, tree)
22
15
  .toPromise();
23
16
  }
24
17
  exports.runMigration = runMigration;
25
- /**
26
- * @deprecated will be removed in v13.
27
- */
28
- function runExternalSchematic(collectionName, schematicName, options, tree) {
29
- return testRunner
30
- .runExternalSchematicAsync(collectionName, schematicName, options, tree)
31
- .toPromise();
32
- }
33
- exports.runExternalSchematic = runExternalSchematic;
34
18
  function callRule(rule, tree) {
35
19
  return testRunner.callRule(rule, tree).toPromise();
36
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/testing.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,gEAAyE;AAGzE,MAAM,UAAU,GAAG,IAAI,6BAAmB,CACxC,eAAe,EACf,WAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CACzC,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,YAAY,EACZ,WAAI,CAAC,SAAS,EAAE,+BAA+B,CAAC,CACjD,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,iBAAiB,EACjB,WAAI,CAAC,SAAS,EAAE,oCAAoC,CAAC,CACtD,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,eAAe,EACf,WAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CACpD,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,iBAAiB,EACjB,WAAI,CAAC,SAAS,EAAE,oCAAoC,CAAC,CACtD,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAAI,6BAAmB,CACjD,iBAAiB,EACjB,WAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CACzC,CAAC;AAEF;;GAEG;AACH,SAAgB,YAAY,CAC1B,aAAqB,EACrB,OAAsB,EACtB,IAAU;IAEV,OAAO,UAAU,CAAC,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAChF,CAAC;AAND,oCAMC;AAED,SAAgB,YAAY,CAC1B,aAAqB,EACrB,OAAsB,EACtB,IAAU;IAEV,OAAO,mBAAmB;SACvB,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;SAC/C,SAAS,EAAE,CAAC;AACjB,CAAC;AARD,oCAQC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,cAAsB,EACtB,aAAqB,EACrB,OAAsB,EACtB,IAAU;IAEV,OAAO,UAAU;SACd,yBAAyB,CAAC,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;SACvE,SAAS,EAAE,CAAC;AACjB,CAAC;AATD,oDASC;AAED,SAAgB,QAAQ,CAAC,IAAU,EAAE,IAAU;IAC7C,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AACrD,CAAC;AAFD,4BAEC"}
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/testing.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,gEAAyE;AAGzE,MAAM,UAAU,GAAG,IAAI,6BAAmB,CACxC,eAAe,EACf,WAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CACzC,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,YAAY,EACZ,WAAI,CAAC,SAAS,EAAE,+BAA+B,CAAC,CACjD,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,iBAAiB,EACjB,WAAI,CAAC,SAAS,EAAE,oCAAoC,CAAC,CACtD,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,eAAe,EACf,WAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CACpD,CAAC;AAEF,UAAU,CAAC,kBAAkB,CAC3B,iBAAiB,EACjB,WAAI,CAAC,SAAS,EAAE,oCAAoC,CAAC,CACtD,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAAI,6BAAmB,CACjD,iBAAiB,EACjB,WAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CACzC,CAAC;AAEF,SAAgB,YAAY,CAC1B,aAAqB,EACrB,OAAsB,EACtB,IAAU;IAEV,OAAO,mBAAmB;SACvB,iBAAiB,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;SAC/C,SAAS,EAAE,CAAC;AACjB,CAAC;AARD,oCAQC;AAED,SAAgB,QAAQ,CAAC,IAAU,EAAE,IAAU;IAC7C,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AACrD,CAAC;AAFD,4BAEC"}
@@ -2,7 +2,7 @@ export declare const nxVersion = "*";
2
2
  export declare const angularVersion = "^12.2.0";
3
3
  export declare const angularDevkitVersion = "~12.2.0";
4
4
  export declare const angularJsVersion = "1.7.9";
5
- export declare const ngrxVersion = "~12.4.0";
5
+ export declare const ngrxVersion = "~12.5.0";
6
6
  export declare const rxjsVersion = "~6.6.0";
7
7
  export declare const jestPresetAngularVersion = "10.0.1";
8
8
  export declare const angularEslintVersion = "~12.3.0";
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.webpackVersion = exports.angularEslintVersion = exports.jestPresetAngularVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularJsVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
4
- exports.nxVersion = '13.0.0-beta.8';
4
+ exports.nxVersion = '13.0.0-rc.2';
5
5
  exports.angularVersion = '^12.2.0';
6
6
  exports.angularDevkitVersion = '~12.2.0';
7
7
  exports.angularJsVersion = '1.7.9';
8
- exports.ngrxVersion = '~12.4.0';
8
+ exports.ngrxVersion = '~12.5.0';
9
9
  exports.rxjsVersion = '~6.6.0';
10
10
  exports.jestPresetAngularVersion = '10.0.1';
11
11
  exports.angularEslintVersion = '~12.3.0';
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-postcss-import.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-13-0-0/add-postcss-import.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AAEtB,mBAA+B,IAAU;;QACvC,MAAM,EAAE,eAAe,EAAE,GAAG,iBAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAE3D,2CAA2C;QAC3C,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE;YAClC,OAAO;SACR;QAED,MAAM,IAAI,GAAG,qCAA4B,CACvC,IAAI,EACJ,EAAE,EACF,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAChC,CAAC;QAEF,MAAM,oBAAW,CAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AAjBD,4BAiBC"}
@@ -1,59 +0,0 @@
1
- import * as ts from 'typescript';
2
- import { Change } from '@nrwl/workspace/src/utils/ast-utils';
3
- import { Tree } from '@angular-devkit/schematics';
4
- /**
5
- * @deprecated will be removed in v13.
6
- */
7
- export declare function getDecoratorMetadata(source: ts.SourceFile, identifier: string, module: string): ts.Node[];
8
- /**
9
- * @deprecated will be removed in v13.
10
- */
11
- export declare function removeFromNgModule(source: ts.SourceFile, modulePath: string, property: string): Change[];
12
- /**
13
- * @deprecated will be removed in v13.
14
- */
15
- export declare function addImportToModule(source: ts.SourceFile, modulePath: string, symbolName: string): Change[];
16
- /**
17
- * @deprecated will be removed in v13.
18
- */
19
- export declare function addImportToTestBed(source: ts.SourceFile, specPath: string, symbolName: string): Change[];
20
- /**
21
- * @deprecated will be removed in v13.
22
- */
23
- export declare function getBootstrapComponent(source: ts.SourceFile, moduleClassName: string): string;
24
- /**
25
- * @deprecated will be removed in v13.
26
- */
27
- export declare function addRoute(ngModulePath: string, source: ts.SourceFile, route: string): Change[];
28
- /**
29
- * @deprecated will be removed in v13.
30
- */
31
- export declare function addProviderToModule(source: ts.SourceFile, modulePath: string, symbolName: string): Change[];
32
- /**
33
- * @deprecated will be removed in v13.
34
- */
35
- export declare function addDeclarationToModule(source: ts.SourceFile, modulePath: string, symbolName: string): Change[];
36
- /**
37
- * @deprecated will be removed in v13.
38
- */
39
- export declare function addEntryComponents(source: ts.SourceFile, modulePath: string, symbolName: string): Change[];
40
- /**
41
- * @deprecated will be removed in v13.
42
- */
43
- export declare function readBootstrapInfo(host: Tree, app: string): {
44
- moduleSpec: string;
45
- modulePath: string;
46
- mainPath: string;
47
- moduleClassName: string;
48
- moduleSource: ts.SourceFile;
49
- bootstrapComponentClassName: string;
50
- bootstrapComponentFileName: string;
51
- };
52
- /**
53
- * @deprecated will be removed in v13.
54
- */
55
- export declare function getDecoratorPropertyValueNode(host: Tree, modulePath: string, identifier: string, property: string, module: string): ts.Node;
56
- /**
57
- * @deprecated will be removed in v13.
58
- */
59
- export declare function getTsSourceFile(host: Tree, path: string): ts.SourceFile;
@@ -1,438 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTsSourceFile = exports.getDecoratorPropertyValueNode = exports.readBootstrapInfo = exports.addEntryComponents = exports.addDeclarationToModule = exports.addProviderToModule = exports.addRoute = exports.getBootstrapComponent = exports.addImportToTestBed = exports.addImportToModule = exports.removeFromNgModule = exports.getDecoratorMetadata = void 0;
4
- const ts = require("typescript");
5
- const ast_utils_1 = require("@nrwl/workspace/src/utils/ast-utils");
6
- const schematics_1 = require("@angular-devkit/schematics");
7
- const path = require("path");
8
- const devkit_1 = require("@nrwl/devkit");
9
- /**
10
- * @deprecated will be removed in v13.
11
- */
12
- function getDecoratorMetadata(source, identifier, module) {
13
- const angularImports = ast_utils_1.findNodes(source, ts.SyntaxKind.ImportDeclaration)
14
- .map((node) => _angularImportsFromNode(node, source))
15
- .reduce((acc, current) => {
16
- for (const key of Object.keys(current)) {
17
- acc[key] = current[key];
18
- }
19
- return acc;
20
- }, {});
21
- return ast_utils_1.getSourceNodes(source)
22
- .filter((node) => {
23
- return (node.kind == ts.SyntaxKind.Decorator &&
24
- node.expression.kind == ts.SyntaxKind.CallExpression);
25
- })
26
- .map((node) => node.expression)
27
- .filter((expr) => {
28
- if (expr.expression.kind == ts.SyntaxKind.Identifier) {
29
- const id = expr.expression;
30
- return (id.getFullText(source) == identifier &&
31
- angularImports[id.getFullText(source)] === module);
32
- }
33
- else if (expr.expression.kind == ts.SyntaxKind.PropertyAccessExpression) {
34
- // This covers foo.NgModule when importing * as foo.
35
- const paExpr = expr.expression;
36
- // If the left expression is not an identifier, just give up at that point.
37
- if (paExpr.expression.kind !== ts.SyntaxKind.Identifier) {
38
- return false;
39
- }
40
- const id = paExpr.name.text;
41
- const moduleId = paExpr.expression.getText(source);
42
- return id === identifier && angularImports[`${moduleId}.`] === module;
43
- }
44
- return false;
45
- })
46
- .filter((expr) => expr.arguments[0] &&
47
- expr.arguments[0].kind == ts.SyntaxKind.ObjectLiteralExpression)
48
- .map((expr) => expr.arguments[0]);
49
- }
50
- exports.getDecoratorMetadata = getDecoratorMetadata;
51
- /**
52
- * @deprecated will be removed in v13.
53
- */
54
- function removeFromNgModule(source, modulePath, property) {
55
- const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core');
56
- let node = nodes[0]; // tslint:disable-line:no-any
57
- // Find the decorator declaration.
58
- if (!node) {
59
- return [];
60
- }
61
- // Get all the children property assignment of object literals.
62
- const matchingProperty = getMatchingProperty(source, property, 'NgModule', '@angular/core');
63
- if (matchingProperty) {
64
- return [
65
- new ast_utils_1.RemoveChange(modulePath, matchingProperty.getStart(source), matchingProperty.getFullText(source)),
66
- ];
67
- }
68
- else {
69
- return [];
70
- }
71
- }
72
- exports.removeFromNgModule = removeFromNgModule;
73
- /**
74
- * @deprecated will be removed in v13.
75
- */
76
- function addImportToModule(source, modulePath, symbolName) {
77
- return _addSymbolToNgModuleMetadata(source, modulePath, 'imports', symbolName);
78
- }
79
- exports.addImportToModule = addImportToModule;
80
- /**
81
- * @deprecated will be removed in v13.
82
- */
83
- function addImportToTestBed(source, specPath, symbolName) {
84
- const allCalls = (ast_utils_1.findNodes(source, ts.SyntaxKind.CallExpression));
85
- const configureTestingModuleObjectLiterals = allCalls
86
- .filter((c) => c.expression.kind === ts.SyntaxKind.PropertyAccessExpression)
87
- .filter((c) => c.expression.name.getText(source) === 'configureTestingModule')
88
- .map((c) => c.arguments[0].kind === ts.SyntaxKind.ObjectLiteralExpression
89
- ? c.arguments[0]
90
- : null);
91
- if (configureTestingModuleObjectLiterals.length > 0) {
92
- const startPosition = configureTestingModuleObjectLiterals[0]
93
- .getFirstToken(source)
94
- .getEnd();
95
- return [
96
- new ast_utils_1.InsertChange(specPath, startPosition, `imports: [${symbolName}], `),
97
- ];
98
- }
99
- else {
100
- return [];
101
- }
102
- }
103
- exports.addImportToTestBed = addImportToTestBed;
104
- /**
105
- * @deprecated will be removed in v13.
106
- */
107
- function getBootstrapComponent(source, moduleClassName) {
108
- const bootstrap = getMatchingProperty(source, 'bootstrap', 'NgModule', '@angular/core');
109
- if (!bootstrap) {
110
- throw new Error(`Cannot find bootstrap components in '${moduleClassName}'`);
111
- }
112
- const c = bootstrap.getChildren();
113
- const nodes = c[c.length - 1].getChildren();
114
- const bootstrapComponent = nodes.slice(1, nodes.length - 1)[0];
115
- if (!bootstrapComponent) {
116
- throw new Error(`Cannot find bootstrap components in '${moduleClassName}'`);
117
- }
118
- return bootstrapComponent.getText();
119
- }
120
- exports.getBootstrapComponent = getBootstrapComponent;
121
- /**
122
- * @deprecated will be removed in v13.
123
- */
124
- function addRoute(ngModulePath, source, route) {
125
- const routes = getListOfRoutes(source);
126
- if (!routes)
127
- return [];
128
- if (routes.hasTrailingComma || routes.length === 0) {
129
- return [new ast_utils_1.InsertChange(ngModulePath, routes.end, route)];
130
- }
131
- else {
132
- return [new ast_utils_1.InsertChange(ngModulePath, routes.end, `, ${route}`)];
133
- }
134
- }
135
- exports.addRoute = addRoute;
136
- /**
137
- * @deprecated will be removed in v13.
138
- */
139
- function addProviderToModule(source, modulePath, symbolName) {
140
- return _addSymbolToNgModuleMetadata(source, modulePath, 'providers', symbolName);
141
- }
142
- exports.addProviderToModule = addProviderToModule;
143
- /**
144
- * @deprecated will be removed in v13.
145
- */
146
- function addDeclarationToModule(source, modulePath, symbolName) {
147
- return _addSymbolToNgModuleMetadata(source, modulePath, 'declarations', symbolName);
148
- }
149
- exports.addDeclarationToModule = addDeclarationToModule;
150
- /**
151
- * @deprecated will be removed in v13.
152
- */
153
- function addEntryComponents(source, modulePath, symbolName) {
154
- return _addSymbolToNgModuleMetadata(source, modulePath, 'entryComponents', symbolName);
155
- }
156
- exports.addEntryComponents = addEntryComponents;
157
- /**
158
- * @deprecated will be removed in v13.
159
- */
160
- function readBootstrapInfo(host, app) {
161
- const config = ast_utils_1.getProjectConfig(host, app);
162
- let mainPath;
163
- try {
164
- mainPath = config.architect.build.options.main;
165
- }
166
- catch (e) {
167
- throw new Error('Main file cannot be located');
168
- }
169
- if (!host.exists(mainPath)) {
170
- throw new Error('Main file cannot be located');
171
- }
172
- const mainSource = host.read(mainPath).toString('utf-8');
173
- const main = ts.createSourceFile(mainPath, mainSource, ts.ScriptTarget.Latest, true);
174
- const moduleImports = ast_utils_1.getImport(main, (s) => s.indexOf('.module') > -1);
175
- if (moduleImports.length !== 1) {
176
- throw new Error(`main.ts can only import a single module`);
177
- }
178
- const moduleImport = moduleImports[0];
179
- const moduleClassName = moduleImport.bindings.filter((b) => b.endsWith('Module'))[0];
180
- const modulePath = `${path.join(path.dirname(mainPath), moduleImport.moduleSpec)}.ts`;
181
- if (!host.exists(modulePath)) {
182
- throw new Error(`Cannot find '${modulePath}'`);
183
- }
184
- const moduleSourceText = host.read(modulePath).toString('utf-8');
185
- const moduleSource = ts.createSourceFile(modulePath, moduleSourceText, ts.ScriptTarget.Latest, true);
186
- const bootstrapComponentClassName = getBootstrapComponent(moduleSource, moduleClassName);
187
- const bootstrapComponentFileName = `./${path.join(path.dirname(moduleImport.moduleSpec), `${devkit_1.names(bootstrapComponentClassName.substring(0, bootstrapComponentClassName.length - 9)).fileName}.component`)}`;
188
- return {
189
- moduleSpec: moduleImport.moduleSpec,
190
- mainPath,
191
- modulePath,
192
- moduleSource,
193
- moduleClassName,
194
- bootstrapComponentClassName,
195
- bootstrapComponentFileName,
196
- };
197
- }
198
- exports.readBootstrapInfo = readBootstrapInfo;
199
- /**
200
- * @deprecated will be removed in v13.
201
- */
202
- function getDecoratorPropertyValueNode(host, modulePath, identifier, property, module) {
203
- const moduleSourceText = host.read(modulePath).toString('utf-8');
204
- const moduleSource = ts.createSourceFile(modulePath, moduleSourceText, ts.ScriptTarget.Latest, true);
205
- const templateNode = getMatchingProperty(moduleSource, property, identifier, module);
206
- return templateNode.getChildAt(templateNode.getChildCount() - 1);
207
- }
208
- exports.getDecoratorPropertyValueNode = getDecoratorPropertyValueNode;
209
- /**
210
- * @deprecated will be removed in v13.
211
- */
212
- function getTsSourceFile(host, path) {
213
- const buffer = host.read(path);
214
- if (!buffer) {
215
- throw new schematics_1.SchematicsException(`Could not read TS file (${path}).`);
216
- }
217
- const content = buffer.toString();
218
- const source = ts.createSourceFile(path, content, ts.ScriptTarget.Latest, true);
219
- return source;
220
- }
221
- exports.getTsSourceFile = getTsSourceFile;
222
- function _angularImportsFromNode(node, _sourceFile) {
223
- const ms = node.moduleSpecifier;
224
- let modulePath;
225
- switch (ms.kind) {
226
- case ts.SyntaxKind.StringLiteral:
227
- modulePath = ms.text;
228
- break;
229
- default:
230
- return {};
231
- }
232
- if (!modulePath.startsWith('@angular/')) {
233
- return {};
234
- }
235
- if (node.importClause) {
236
- if (node.importClause.name) {
237
- // This is of the form `import Name from 'path'`. Ignore.
238
- return {};
239
- }
240
- else if (node.importClause.namedBindings) {
241
- const nb = node.importClause.namedBindings;
242
- if (nb.kind == ts.SyntaxKind.NamespaceImport) {
243
- // This is of the form `import * as name from 'path'`. Return `name.`.
244
- return {
245
- [`${nb.name.text}.`]: modulePath,
246
- };
247
- }
248
- else {
249
- // This is of the form `import {a,b,c} from 'path'`
250
- const namedImports = nb;
251
- return namedImports.elements
252
- .map((is) => is.propertyName ? is.propertyName.text : is.name.text)
253
- .reduce((acc, curr) => {
254
- acc[curr] = modulePath;
255
- return acc;
256
- }, {});
257
- }
258
- }
259
- return {};
260
- }
261
- else {
262
- // This is of the form `import 'path';`. Nothing to do.
263
- return {};
264
- }
265
- }
266
- function _addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, expression) {
267
- const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core');
268
- let node = nodes[0]; // tslint:disable-line:no-any
269
- // Find the decorator declaration.
270
- if (!node) {
271
- return [];
272
- }
273
- // Get all the children property assignment of object literals.
274
- const matchingProperties = node.properties
275
- .filter((prop) => prop.kind == ts.SyntaxKind.PropertyAssignment)
276
- // Filter out every fields that's not "metadataField". Also handles string literals
277
- // (but not expressions).
278
- .filter((prop) => {
279
- const name = prop.name;
280
- switch (name.kind) {
281
- case ts.SyntaxKind.Identifier:
282
- return name.getText(source) == metadataField;
283
- case ts.SyntaxKind.StringLiteral:
284
- return name.text == metadataField;
285
- }
286
- return false;
287
- });
288
- // Get the last node of the array literal.
289
- if (!matchingProperties) {
290
- return [];
291
- }
292
- if (matchingProperties.length == 0) {
293
- // We haven't found the field in the metadata declaration. Insert a new field.
294
- const expr = node;
295
- let position;
296
- let toInsert;
297
- if (expr.properties.length == 0) {
298
- position = expr.getEnd() - 1;
299
- toInsert = ` ${metadataField}: [${expression}]\n`;
300
- }
301
- else {
302
- node = expr.properties[expr.properties.length - 1];
303
- position = node.getEnd();
304
- // Get the indentation of the last element, if any.
305
- const text = node.getFullText(source);
306
- if (text.match('^\r?\r?\n')) {
307
- toInsert = `,${text.match(/^\r?\n\s+/)[0]}${metadataField}: [${expression}]`;
308
- }
309
- else {
310
- toInsert = `, ${metadataField}: [${expression}]`;
311
- }
312
- }
313
- const newMetadataProperty = new ast_utils_1.InsertChange(ngModulePath, position, toInsert);
314
- return [newMetadataProperty];
315
- }
316
- const assignment = matchingProperties[0];
317
- // If it's not an array, nothing we can do really.
318
- if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {
319
- return [];
320
- }
321
- const arrLiteral = assignment.initializer;
322
- if (arrLiteral.elements.length == 0) {
323
- // Forward the property.
324
- node = arrLiteral;
325
- }
326
- else {
327
- node = arrLiteral.elements;
328
- }
329
- if (!node) {
330
- console.log('No app module found. Please add your new class to your component.');
331
- return [];
332
- }
333
- const isArray = Array.isArray(node);
334
- if (isArray) {
335
- const nodeArray = node;
336
- const symbolsArray = nodeArray.map((node) => node.getText());
337
- if (symbolsArray.includes(expression)) {
338
- return [];
339
- }
340
- node = node[node.length - 1];
341
- }
342
- let toInsert;
343
- let position = node.getEnd();
344
- if (!isArray && node.kind == ts.SyntaxKind.ObjectLiteralExpression) {
345
- // We haven't found the field in the metadata declaration. Insert a new
346
- // field.
347
- const expr = node;
348
- if (expr.properties.length == 0) {
349
- position = expr.getEnd() - 1;
350
- toInsert = ` ${metadataField}: [${expression}]\n`;
351
- }
352
- else {
353
- node = expr.properties[expr.properties.length - 1];
354
- position = node.getEnd();
355
- // Get the indentation of the last element, if any.
356
- const text = node.getFullText(source);
357
- if (text.match('^\r?\r?\n')) {
358
- toInsert = `,${text.match(/^\r?\n\s+/)[0]}${metadataField}: [${expression}]`;
359
- }
360
- else {
361
- toInsert = `, ${metadataField}: [${expression}]`;
362
- }
363
- }
364
- }
365
- else if (!isArray && node.kind == ts.SyntaxKind.ArrayLiteralExpression) {
366
- // We found the field but it's empty. Insert it just before the `]`.
367
- position--;
368
- toInsert = `${expression}`;
369
- }
370
- else {
371
- // Get the indentation of the last element, if any.
372
- const text = node.getFullText(source);
373
- if (text.match(/^\r?\n/)) {
374
- toInsert = `,${text.match(/^\r?\n(\r?)\s+/)[0]}${expression}`;
375
- }
376
- else {
377
- toInsert = `, ${expression}`;
378
- }
379
- }
380
- const insert = new ast_utils_1.InsertChange(ngModulePath, position, toInsert);
381
- return [insert];
382
- }
383
- function getMatchingProperty(source, property, identifier, module) {
384
- const nodes = getDecoratorMetadata(source, identifier, module);
385
- let node = nodes[0]; // tslint:disable-line:no-any
386
- if (!node)
387
- return null;
388
- // Get all the children property assignment of object literals.
389
- return getMatchingObjectLiteralElement(node, source, property);
390
- }
391
- function getListOfRoutes(source) {
392
- const imports = getMatchingProperty(source, 'imports', 'NgModule', '@angular/core');
393
- if (imports.initializer.kind === ts.SyntaxKind.ArrayLiteralExpression) {
394
- const a = imports.initializer;
395
- for (const e of a.elements) {
396
- if (e.kind === ts.SyntaxKind.CallExpression) {
397
- const ee = e;
398
- const text = ee.expression.getText(source);
399
- if ((text === 'RouterModule.forRoot' ||
400
- text === 'RouterModule.forChild') &&
401
- ee.arguments.length > 0) {
402
- const routes = ee.arguments[0];
403
- if (routes.kind === ts.SyntaxKind.ArrayLiteralExpression) {
404
- return routes.elements;
405
- }
406
- else if (routes.kind === ts.SyntaxKind.Identifier) {
407
- // find the array expression
408
- const variableDeclarations = ast_utils_1.findNodes(source, ts.SyntaxKind.VariableDeclaration);
409
- const routesDeclaration = variableDeclarations.find((x) => {
410
- return x.name.getText() === routes.getText();
411
- });
412
- if (routesDeclaration) {
413
- return routesDeclaration.initializer.elements;
414
- }
415
- }
416
- }
417
- }
418
- }
419
- }
420
- return null;
421
- }
422
- function getMatchingObjectLiteralElement(node, source, property) {
423
- return (node.properties
424
- .filter((prop) => prop.kind == ts.SyntaxKind.PropertyAssignment)
425
- // Filter out every fields that's not "metadataField". Also handles string literals
426
- // (but not expressions).
427
- .filter((prop) => {
428
- const name = prop.name;
429
- switch (name.kind) {
430
- case ts.SyntaxKind.Identifier:
431
- return name.getText(source) === property;
432
- case ts.SyntaxKind.StringLiteral:
433
- return name.text === property;
434
- }
435
- return false;
436
- })[0]);
437
- }
438
- //# sourceMappingURL=ast-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ast-utils.js","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/ast-utils.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,mEAQ6C;AAC7C,2DAAuE;AACvE,6BAA6B;AAC7B,yCAAqC;AAErC;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAqB,EACrB,UAAkB,EAClB,MAAc;IAEd,MAAM,cAAc,GAA+B,qBAAS,CAC1D,MAAM,EACN,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAChC;SACE,GAAG,CAAC,CAAC,IAA0B,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC1E,MAAM,CACL,CACE,GAA+B,EAC/B,OAAmC,EACnC,EAAE;QACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YACtC,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;SACzB;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACH,CAAC;IAEJ,OAAO,0BAAc,CAAC,MAAM,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QACf,OAAO,CACL,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS;YACnC,IAAqB,CAAC,UAAU,CAAC,IAAI,IAAI,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