Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/core/schematics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ bundle_entrypoints = [
"add-bootstrap-context-to-server-main",
"packages/core/schematics/migrations/add-bootstrap-context-to-server-main/index.js",
],
[
"bootstrap-options-migration",
"packages/core/schematics/migrations/bootstrap-options-migration/index.js",
],
]

rollup.rollup(
Expand All @@ -136,6 +140,7 @@ rollup.rollup(
"//packages/core/schematics:tsconfig_build",
"//packages/core/schematics/migrations/add-bootstrap-context-to-server-main",
"//packages/core/schematics/migrations/application-config-core",
"//packages/core/schematics/migrations/bootstrap-options-migration",
"//packages/core/schematics/migrations/control-flow-migration",
"//packages/core/schematics/migrations/ngclass-to-class-migration",
"//packages/core/schematics/migrations/ngstyle-to-style-migration",
Expand Down
5 changes: 5 additions & 0 deletions packages/core/schematics/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"version": "21.0.0",
"description": "Adds `BootstrapContext` to `bootstrapApplication` calls in `main.server.ts` to support server rendering.",
"factory": "./bundles/add-bootstrap-context-to-server-main.cjs#migrate"
},
"bootstrap-options-migration": {
"version": "21.0.0",
"description": "Migrates deprecated bootstrap options to providers.",
"factory": "./bundles/bootstrap-options-migration.cjs#migrate"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
load("//tools:defaults.bzl", "jasmine_test", "ts_project")

package(
default_visibility = [
"//packages/core/schematics:__pkg__",
"//packages/core/schematics/test:__pkg__",
],
)

ts_project(
name = "bootstrap-options-migration",
srcs = glob(
["**/*.ts"],
exclude = ["*.spec.ts"],
),
deps = [
"//:node_modules/@angular-devkit/schematics",
"//:node_modules/typescript",
"//packages/compiler-cli/private",
"//packages/compiler-cli/src/ngtsc/file_system",
"//packages/core/schematics/utils",
"//packages/core/schematics/utils/tsurge",
"//packages/core/schematics/utils/tsurge/helpers/angular_devkit",
],
)

ts_project(
name = "test_lib",
testonly = True,
srcs = glob(["*.spec.ts"]),
deps = [
":bootstrap-options-migration",
"//:node_modules/typescript",
"//packages/compiler-cli",
"//packages/compiler-cli/src/ngtsc/file_system/testing",
"//packages/core/schematics/utils/tsurge",
],
)

jasmine_test(
name = "test",
data = [":test_lib"],
env = {"FORCE_COLOR": "3"},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import {Rule} from '@angular-devkit/schematics';
import {runMigrationInDevkit} from '../../utils/tsurge/helpers/angular_devkit';
import {BootstrapOptionsMigration} from './migration';

export function migrate(): Rule {
return async (tree) => {
await runMigrationInDevkit({
tree,
getMigration: () => new BootstrapOptionsMigration(),
});
};
}
Loading