Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7cfaf7e

Browse files
committed
feat(core): Add migration for moving zone configuration from bootstrapModule to providers
This adds a migration for moving the ZoneJS configuration from`bootstrapModule` to the providers of the module being bootstrapped.
1 parentc72e9df commit7cfaf7e

File tree

7 files changed

+941
-0
lines changed

7 files changed

+941
-0
lines changed

‎packages/core/schematics/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ bundle_entrypoints = [
114114
"control-flow-migration",
115115
"packages/core/schematics/migrations/control-flow-migration/index.js",
116116
],
117+
[
118+
"bootstrap-options-migration",
119+
"packages/core/schematics/migrations/bootstrap-options-migration/index.js",
120+
],
117121
]
118122

119123
rollup.rollup(
@@ -125,6 +129,7 @@ rollup.rollup(
125129
"//:node_modules/magic-string",
126130
"//:node_modules/semver",
127131
"//packages/core/schematics:tsconfig_build",
132+
"//packages/core/schematics/migrations/bootstrap-options-migration:bootstrap-options-migration_rjs",
128133
"//packages/core/schematics/migrations/control-flow-migration:control-flow-migration_rjs",
129134
"//packages/core/schematics/migrations/document-core:document-core_rjs",
130135
"//packages/core/schematics/migrations/inject-flags:inject-flags_rjs",

‎packages/core/schematics/migrations.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
"version":"20.0.0",
2121
"description":"Moves imports of `DOCUMENT` from `@angular/common` to `@angular/core`",
2222
"factory":"./bundles/document-core.cjs#migrate"
23+
},
24+
"bootstrap-options-migration": {
25+
"version":"20.2.0",
26+
"description":"Migrates deprecated bootstrap options to providers.",
27+
"factory":"./bundles/bootstrap-options-migration.cjs#migrate"
2328
}
2429
}
2530
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
load("//tools:defaults2.bzl","jasmine_test","ts_project")
2+
3+
package(
4+
default_visibility= [
5+
"//packages/core/schematics:__pkg__",
6+
],
7+
)
8+
9+
ts_project(
10+
name="bootstrap-options-migration",
11+
srcs=glob(
12+
["**/*.ts"],
13+
exclude= ["*.spec.ts"],
14+
),
15+
interop_deps= [
16+
"//packages/compiler-cli/private",
17+
"//packages/compiler-cli/src/ngtsc/file_system",
18+
"//packages/core/schematics/utils",
19+
"//packages/core/schematics/utils/tsurge",
20+
"//packages/core/schematics/utils/tsurge/helpers/angular_devkit",
21+
],
22+
deps= [
23+
"//:node_modules/@angular-devkit/schematics",
24+
"//:node_modules/typescript",
25+
],
26+
)
27+
28+
ts_project(
29+
name="test_lib",
30+
testonly=True,
31+
srcs=glob(["*.spec.ts"]),
32+
deps= [
33+
":bootstrap-options-migration_rjs",
34+
"//:node_modules/typescript",
35+
"//packages/compiler-cli:compiler-cli_rjs",
36+
"//packages/compiler-cli/src/ngtsc/file_system/testing:testing_rjs",
37+
"//packages/core/schematics/utils/tsurge:tsurge_rjs",
38+
],
39+
)
40+
41+
jasmine_test(
42+
name="test",
43+
data= [":test_lib_rjs"],
44+
env= {"FORCE_COLOR":"3"},
45+
)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
*@license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
import{Rule}from'@angular-devkit/schematics';
10+
import{runMigrationInDevkit}from'../../utils/tsurge/helpers/angular_devkit';
11+
import{BootstrapOptionsMigration}from'./migration';
12+
13+
exportfunctionmigrate():Rule{
14+
returnasync(tree)=>{
15+
awaitrunMigrationInDevkit({
16+
tree,
17+
getMigration:()=>newBootstrapOptionsMigration(),
18+
});
19+
};
20+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp