@schematics/angular 9.0.0-rc.6 → 9.0.0
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/application/files/src/test.ts.template +6 -1
- package/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template +1 -1
- package/e2e/files/src/app.po.ts.template +3 -3
- package/library/files/src/test.ts.template +6 -1
- package/library/index.js +4 -3
- package/migrations/update-9/index.js +2 -0
- package/migrations/update-9/ivy-libraries.js +9 -1
- package/migrations/update-9/update-app-tsconfigs.js +3 -2
- package/migrations/update-9/update-dependencies.js +10 -1
- package/migrations/update-9/update-i18n.d.ts +2 -0
- package/migrations/update-9/update-i18n.js +224 -0
- package/migrations/update-9/update-workspace-config.js +0 -167
- package/migrations/update-9/utils.d.ts +1 -0
- package/migrations/update-9/utils.js +6 -0
- package/package.json +3 -4
- package/pipe/files/__name@dasherize@if-flat__/__name@dasherize__.pipe.ts.template +1 -1
- package/service-worker/index.js +8 -3
- package/third_party/github.com/Microsoft/TypeScript/BUILD.bazel +2 -2
- package/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +695 -596
- package/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +17719 -12353
- package/utility/ast-utils.d.ts +6 -0
- package/utility/ast-utils.js +36 -0
- package/utility/latest-versions.js +7 -7
- package/workspace/files/package.json.template +1 -1
- package/workspace/files/tsconfig.json.template +1 -1
package/utility/ast-utils.d.ts
CHANGED
|
@@ -89,6 +89,12 @@ export declare function addEntryComponentToModule(source: ts.SourceFile, moduleP
|
|
|
89
89
|
* Determine if an import already exists.
|
|
90
90
|
*/
|
|
91
91
|
export declare function isImported(source: ts.SourceFile, classifiedName: string, importPath: string): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* This function returns the name of the environment export
|
|
94
|
+
* whether this export is aliased or not. If the environment file
|
|
95
|
+
* is not imported, then it will return `null`.
|
|
96
|
+
*/
|
|
97
|
+
export declare function getEnvironmentExportName(source: ts.SourceFile): string | null;
|
|
92
98
|
/**
|
|
93
99
|
* Returns the RouterModule declaration from NgModule metadata, if any.
|
|
94
100
|
*/
|
package/utility/ast-utils.js
CHANGED
|
@@ -487,6 +487,42 @@ function isImported(source, classifiedName, importPath) {
|
|
|
487
487
|
return matchingNodes.length > 0;
|
|
488
488
|
}
|
|
489
489
|
exports.isImported = isImported;
|
|
490
|
+
/**
|
|
491
|
+
* This function returns the name of the environment export
|
|
492
|
+
* whether this export is aliased or not. If the environment file
|
|
493
|
+
* is not imported, then it will return `null`.
|
|
494
|
+
*/
|
|
495
|
+
function getEnvironmentExportName(source) {
|
|
496
|
+
// Initial value is `null` as we don't know yet if the user
|
|
497
|
+
// has imported `environment` into the root module or not.
|
|
498
|
+
let environmentExportName = null;
|
|
499
|
+
const allNodes = getSourceNodes(source);
|
|
500
|
+
allNodes
|
|
501
|
+
.filter(node => node.kind === ts.SyntaxKind.ImportDeclaration)
|
|
502
|
+
.filter((declaration) => declaration.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral &&
|
|
503
|
+
declaration.importClause !== undefined)
|
|
504
|
+
.map((declaration) =>
|
|
505
|
+
// If `importClause` property is defined then the first
|
|
506
|
+
// child will be `NamedImports` object (or `namedBindings`).
|
|
507
|
+
declaration.importClause.getChildAt(0))
|
|
508
|
+
// Find those `NamedImports` object that contains `environment` keyword
|
|
509
|
+
// in its text. E.g. `{ environment as env }`.
|
|
510
|
+
.filter((namedImports) => namedImports.getText().includes('environment'))
|
|
511
|
+
.forEach((namedImports) => {
|
|
512
|
+
for (const specifier of namedImports.elements) {
|
|
513
|
+
// `propertyName` is defined if the specifier
|
|
514
|
+
// has an aliased import.
|
|
515
|
+
const name = specifier.propertyName || specifier.name;
|
|
516
|
+
// Find specifier that contains `environment` keyword in its text.
|
|
517
|
+
// Whether it's `environment` or `environment as env`.
|
|
518
|
+
if (name.text.includes('environment')) {
|
|
519
|
+
environmentExportName = specifier.name.text;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
});
|
|
523
|
+
return environmentExportName;
|
|
524
|
+
}
|
|
525
|
+
exports.getEnvironmentExportName = getEnvironmentExportName;
|
|
490
526
|
/**
|
|
491
527
|
* Returns the RouterModule declaration from NgModule metadata, if any.
|
|
492
528
|
*/
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.latestVersions = {
|
|
11
11
|
// These versions should be kept up to date with latest Angular peer dependencies.
|
|
12
|
-
Angular: '~9.0.0
|
|
13
|
-
RxJs: '~6.5.
|
|
12
|
+
Angular: '~9.0.0',
|
|
13
|
+
RxJs: '~6.5.4',
|
|
14
14
|
ZoneJs: '~0.10.2',
|
|
15
|
-
TypeScript: '~3.
|
|
15
|
+
TypeScript: '~3.7.5',
|
|
16
16
|
TsLib: '^1.10.0',
|
|
17
17
|
// The versions below must be manually updated when making a new devkit release.
|
|
18
|
-
DevkitBuildAngular: '~0.900.0
|
|
19
|
-
DevkitBuildNgPackagr: '~0.900.0
|
|
20
|
-
DevkitBuildWebpack: '~0.900.0
|
|
21
|
-
ngPackagr: '^9.0.0
|
|
18
|
+
DevkitBuildAngular: '~0.900.0',
|
|
19
|
+
DevkitBuildNgPackagr: '~0.900.0',
|
|
20
|
+
DevkitBuildWebpack: '~0.900.0',
|
|
21
|
+
ngPackagr: '^9.0.0',
|
|
22
22
|
};
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"karma-coverage-istanbul-reporter": "~2.1.0",
|
|
39
39
|
"karma-jasmine": "~2.0.1",
|
|
40
40
|
"karma-jasmine-html-reporter": "^1.4.2",
|
|
41
|
-
"protractor": "~5.4.
|
|
41
|
+
"protractor": "~5.4.3",<% } %>
|
|
42
42
|
"ts-node": "~8.3.0",
|
|
43
43
|
"tslint": "~5.18.0",
|
|
44
44
|
"typescript": "<%= latestVersions.TypeScript %>"
|