@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/service-worker/index.js
CHANGED
|
@@ -53,10 +53,15 @@ function updateAppModule(mainPath) {
|
|
|
53
53
|
// add import for environments
|
|
54
54
|
// import { environment } from '../environments/environment';
|
|
55
55
|
moduleSource = getTsSourceFile(host, modulePath);
|
|
56
|
-
|
|
56
|
+
const environmentExportName = ast_utils_1.getEnvironmentExportName(moduleSource);
|
|
57
|
+
// if environemnt import already exists then use the found one
|
|
58
|
+
// otherwise use the default name
|
|
59
|
+
importModule = environmentExportName || 'environment';
|
|
57
60
|
// TODO: dynamically find environments relative path
|
|
58
61
|
importPath = '../environments/environment';
|
|
59
|
-
if (!
|
|
62
|
+
if (!environmentExportName) {
|
|
63
|
+
// if environment import was not found then insert the new one
|
|
64
|
+
// with default path and default export name
|
|
60
65
|
const change = ast_utils_1.insertImport(moduleSource, modulePath, importModule, importPath);
|
|
61
66
|
if (change) {
|
|
62
67
|
const recorder = host.beginUpdate(modulePath);
|
|
@@ -65,7 +70,7 @@ function updateAppModule(mainPath) {
|
|
|
65
70
|
}
|
|
66
71
|
}
|
|
67
72
|
// register SW in app module
|
|
68
|
-
const importText = `ServiceWorkerModule.register('ngsw-worker.js', { enabled:
|
|
73
|
+
const importText = `ServiceWorkerModule.register('ngsw-worker.js', { enabled: ${importModule}.production })`;
|
|
69
74
|
moduleSource = getTsSourceFile(host, modulePath);
|
|
70
75
|
const metadataChanges = ast_utils_1.addSymbolToNgModuleMetadata(moduleSource, modulePath, 'imports', importText);
|
|
71
76
|
if (metadataChanges) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
load("@npm_bazel_typescript//:index.bzl", "ts_library")
|
|
2
2
|
|
|
3
|
-
# files fetched on
|
|
4
|
-
# https://github.com/Microsoft/TypeScript/tree/v3.
|
|
3
|
+
# files fetched on 2020-01-09 from
|
|
4
|
+
# https://github.com/Microsoft/TypeScript/tree/v3.7.4
|
|
5
5
|
licenses(["notice"]) # Apache 2.0
|
|
6
6
|
|
|
7
7
|
ts_library(
|