@schematics/angular 22.0.0-next.4 → 22.0.0-next.5
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/directive/files/__name@dasherize__.__type@dasherize__.ts.template +0 -3
- package/migrations/add-istanbul-instrumenter/migration.d.ts +9 -0
- package/migrations/add-istanbul-instrumenter/migration.js +49 -0
- package/migrations/add-istanbul-instrumenter/migration.js.map +1 -0
- package/migrations/migrate-karma-to-vitest/constants.d.ts +10 -0
- package/migrations/migrate-karma-to-vitest/constants.js +45 -0
- package/migrations/migrate-karma-to-vitest/constants.js.map +1 -0
- package/migrations/migrate-karma-to-vitest/karma-processor.d.ts +10 -0
- package/migrations/migrate-karma-to-vitest/karma-processor.js +133 -0
- package/migrations/migrate-karma-to-vitest/karma-processor.js.map +1 -0
- package/migrations/migrate-karma-to-vitest/migration.d.ts +9 -0
- package/migrations/migrate-karma-to-vitest/migration.js +221 -0
- package/migrations/migrate-karma-to-vitest/migration.js.map +1 -0
- package/migrations/migration-collection.json +11 -0
- package/package.json +3 -3
- package/utility/dependencies.js +1 -0
- package/utility/dependencies.js.map +1 -1
- package/utility/latest-versions/package.json +2 -0
- package/utility/latest-versions.js +3 -3
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
+
export default function (): Rule;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = default_1;
|
|
11
|
+
const dependency_1 = require("../../utility/dependency");
|
|
12
|
+
const latest_versions_1 = require("../../utility/latest-versions");
|
|
13
|
+
const workspace_1 = require("../../utility/workspace");
|
|
14
|
+
const workspace_models_1 = require("../../utility/workspace-models");
|
|
15
|
+
function default_1() {
|
|
16
|
+
return async (tree) => {
|
|
17
|
+
const workspace = await (0, workspace_1.getWorkspace)(tree);
|
|
18
|
+
let needInstrumenter = false;
|
|
19
|
+
for (const [, project] of workspace.projects) {
|
|
20
|
+
for (const [, target] of project.targets) {
|
|
21
|
+
if (target.builder === workspace_models_1.Builders.Karma || target.builder === workspace_models_1.Builders.BuildKarma) {
|
|
22
|
+
needInstrumenter = true;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
if (target.builder === workspace_models_1.Builders.BuildUnitTest) {
|
|
26
|
+
for (const [, options] of (0, workspace_1.allTargetOptions)(target)) {
|
|
27
|
+
if (options['runner'] === 'karma') {
|
|
28
|
+
needInstrumenter = true;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (needInstrumenter) {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (needInstrumenter) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (needInstrumenter) {
|
|
42
|
+
return (0, dependency_1.addDependency)('istanbul-lib-instrument', latest_versions_1.latestVersions['istanbul-lib-instrument'], {
|
|
43
|
+
type: dependency_1.DependencyType.Dev,
|
|
44
|
+
existing: dependency_1.ExistingBehavior.Skip,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["mig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CAAC,IAAI;aAChC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export declare const SUPPORTED_REPORTERS: Set<string>;
|
|
9
|
+
export declare const SUPPORTED_COVERAGE_REPORTERS: Set<string>;
|
|
10
|
+
export declare const BUILD_OPTIONS_KEYS: string[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.BUILD_OPTIONS_KEYS = exports.SUPPORTED_COVERAGE_REPORTERS = exports.SUPPORTED_REPORTERS = void 0;
|
|
11
|
+
exports.SUPPORTED_REPORTERS = new Set([
|
|
12
|
+
'default',
|
|
13
|
+
'verbose',
|
|
14
|
+
'dots',
|
|
15
|
+
'json',
|
|
16
|
+
'junit',
|
|
17
|
+
'tap',
|
|
18
|
+
'tap-flat',
|
|
19
|
+
'html',
|
|
20
|
+
]);
|
|
21
|
+
exports.SUPPORTED_COVERAGE_REPORTERS = new Set([
|
|
22
|
+
'html',
|
|
23
|
+
'lcov',
|
|
24
|
+
'lcovonly',
|
|
25
|
+
'text',
|
|
26
|
+
'text-summary',
|
|
27
|
+
'cobertura',
|
|
28
|
+
'json',
|
|
29
|
+
'json-summary',
|
|
30
|
+
]);
|
|
31
|
+
exports.BUILD_OPTIONS_KEYS = [
|
|
32
|
+
'assets',
|
|
33
|
+
'styles',
|
|
34
|
+
'scripts',
|
|
35
|
+
'polyfills',
|
|
36
|
+
'inlineStyleLanguage',
|
|
37
|
+
'stylePreprocessorOptions',
|
|
38
|
+
'externalDependencies',
|
|
39
|
+
'loader',
|
|
40
|
+
'define',
|
|
41
|
+
'fileReplacements',
|
|
42
|
+
'webWorkerTsConfig',
|
|
43
|
+
'aot',
|
|
44
|
+
];
|
|
45
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["constants.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,mBAAmB,GAAG,IAAI,GAAG,CAAC;IACzC,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,UAAU;IACV,MAAM;CACP,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAI,GAAG,CAAC;IAClD,MAAM;IACN,MAAM;IACN,UAAU;IACV,MAAM;IACN,cAAc;IACd,WAAW;IACX,MAAM;IACN,cAAc;CACf,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG;IAChC,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,qBAAqB;IACrB,0BAA0B;IAC1B,sBAAsB;IACtB,QAAQ;IACR,QAAQ;IACR,kBAAkB;IAClB,mBAAmB;IACnB,KAAK;CACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
import type { json } from '@angular-devkit/core';
|
|
9
|
+
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
10
|
+
export declare function processKarmaConfig(karmaConfig: string, options: Record<string, json.JsonValue | undefined>, projectName: string, context: SchematicContext, tree: Tree, removableKarmaConfigs: Map<string, boolean>, needDevkitPlugin: boolean, manualMigrationFiles: string[]): Promise<void>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.processKarmaConfig = processKarmaConfig;
|
|
11
|
+
const karma_config_analyzer_1 = require("../karma/karma-config-analyzer");
|
|
12
|
+
const karma_config_comparer_1 = require("../karma/karma-config-comparer");
|
|
13
|
+
const constants_1 = require("./constants");
|
|
14
|
+
function extractReporters(analysis, options, projectName, context) {
|
|
15
|
+
const reporters = analysis.settings.get('reporters');
|
|
16
|
+
if (Array.isArray(reporters)) {
|
|
17
|
+
const mappedReporters = [];
|
|
18
|
+
for (const r of reporters) {
|
|
19
|
+
if (typeof r === 'string') {
|
|
20
|
+
if (r === 'progress') {
|
|
21
|
+
mappedReporters.push('default');
|
|
22
|
+
}
|
|
23
|
+
else if (r === 'kjhtml') {
|
|
24
|
+
context.logger.warn(`Project "${projectName}" uses the "kjhtml" reporter. ` +
|
|
25
|
+
`This has not been automatically mapped. ` +
|
|
26
|
+
`For an interactive test UI in Vitest, consider setting the "ui" option to true in your test target options ` +
|
|
27
|
+
`and installing "@vitest/ui".`);
|
|
28
|
+
}
|
|
29
|
+
else if (constants_1.SUPPORTED_REPORTERS.has(r)) {
|
|
30
|
+
mappedReporters.push(r);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
context.logger.warn(`Project "${projectName}" uses a custom Karma reporter "${r}". ` +
|
|
34
|
+
`This reporter cannot be automatically mapped to Vitest. ` +
|
|
35
|
+
`Please check the Vitest documentation for equivalent reporters.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
context.logger.warn(`Project "${projectName}" has a non-string reporter in Karma config. ` +
|
|
40
|
+
`This cannot be automatically mapped to Vitest.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (mappedReporters.length > 0) {
|
|
44
|
+
options['reporters'] = [...new Set(mappedReporters)];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function extractCoverageSettings(analysis, options, projectName, context) {
|
|
49
|
+
const coverageReporter = analysis.settings.get('coverageReporter');
|
|
50
|
+
if (typeof coverageReporter !== 'object' || coverageReporter === null) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Extract coverage reporters
|
|
54
|
+
const covReporters = coverageReporter['reporters'];
|
|
55
|
+
if (Array.isArray(covReporters)) {
|
|
56
|
+
const mappedCovReporters = [];
|
|
57
|
+
for (const r of covReporters) {
|
|
58
|
+
let type;
|
|
59
|
+
if (typeof r === 'object' && r !== null && 'type' in r) {
|
|
60
|
+
if (typeof r['type'] === 'string') {
|
|
61
|
+
type = r['type'];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (typeof r === 'string') {
|
|
65
|
+
type = r;
|
|
66
|
+
}
|
|
67
|
+
if (type) {
|
|
68
|
+
if (constants_1.SUPPORTED_COVERAGE_REPORTERS.has(type)) {
|
|
69
|
+
mappedCovReporters.push(type);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
context.logger.warn(`Project "${projectName}" uses a custom coverage reporter "${type}". ` +
|
|
73
|
+
`This reporter cannot be automatically mapped to Vitest. ` +
|
|
74
|
+
`Please check the Vitest documentation for equivalent coverage reporters.`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (mappedCovReporters.length > 0) {
|
|
79
|
+
options['coverageReporters'] = [...new Set(mappedCovReporters)];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Extract coverage thresholds
|
|
83
|
+
const check = coverageReporter['check'];
|
|
84
|
+
if (typeof check === 'object' && check !== null) {
|
|
85
|
+
const global = check['global'];
|
|
86
|
+
if (typeof global === 'object' && global !== null) {
|
|
87
|
+
const thresholds = {};
|
|
88
|
+
const keys = ['statements', 'branches', 'functions', 'lines'];
|
|
89
|
+
for (const key of keys) {
|
|
90
|
+
const value = global[key];
|
|
91
|
+
if (typeof value === 'number') {
|
|
92
|
+
thresholds[key] = value;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (Object.keys(thresholds).length > 0) {
|
|
96
|
+
options['coverageThresholds'] = {
|
|
97
|
+
...thresholds,
|
|
98
|
+
perFile: false,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async function processKarmaConfig(karmaConfig, options, projectName, context, tree, removableKarmaConfigs, needDevkitPlugin, manualMigrationFiles) {
|
|
105
|
+
if (tree.exists(karmaConfig)) {
|
|
106
|
+
const content = tree.readText(karmaConfig);
|
|
107
|
+
const analysis = (0, karma_config_analyzer_1.analyzeKarmaConfig)(content);
|
|
108
|
+
extractReporters(analysis, options, projectName, context);
|
|
109
|
+
extractCoverageSettings(analysis, options, projectName, context);
|
|
110
|
+
let isRemovable = removableKarmaConfigs.get(karmaConfig);
|
|
111
|
+
if (isRemovable === undefined) {
|
|
112
|
+
if (analysis.hasUnsupportedValues) {
|
|
113
|
+
isRemovable = false;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const diff = await (0, karma_config_comparer_1.compareKarmaConfigToDefault)(analysis, projectName, karmaConfig, needDevkitPlugin);
|
|
117
|
+
isRemovable = !(0, karma_config_comparer_1.hasDifferences)(diff) && diff.isReliable;
|
|
118
|
+
}
|
|
119
|
+
removableKarmaConfigs.set(karmaConfig, isRemovable);
|
|
120
|
+
}
|
|
121
|
+
if (isRemovable) {
|
|
122
|
+
tree.delete(karmaConfig);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
context.logger.warn(`Project "${projectName}" uses a custom Karma configuration file "${karmaConfig}". ` +
|
|
126
|
+
`Tests have been migrated to use Vitest, but you may need to manually migrate custom settings ` +
|
|
127
|
+
`from this Karma config to a Vitest config (e.g. vitest.config.ts).`);
|
|
128
|
+
manualMigrationFiles.push(karmaConfig);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
delete options['karmaConfig'];
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=karma-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"karma-processor.js","sourceRoot":"","sources":["karma-processor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmHH,gDA6CC;AA5JD,0EAAyF;AACzF,0EAA6F;AAC7F,2CAAgF;AAEhF,SAAS,gBAAgB,CACvB,QAA6B,EAC7B,OAAmD,EACnD,WAAmB,EACnB,OAAyB;IAEzB,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACrD,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,MAAM,eAAe,GAAa,EAAE,CAAC;QACrC,KAAK,MAAM,CAAC,IAAI,SAAS,EAAE,CAAC;YAC1B,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBAC1B,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;oBACrB,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAClC,CAAC;qBAAM,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC;oBAC1B,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,YAAY,WAAW,gCAAgC;wBACrD,0CAA0C;wBAC1C,6GAA6G;wBAC7G,8BAA8B,CACjC,CAAC;gBACJ,CAAC;qBAAM,IAAI,+BAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,C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AC;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,YAAY,WAAW,6CAA6C,WAAW,KAAK;gBAClF,+FAA+F;gBAC/F,oEAAoE,CACvE,CAAC;YACF,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
9
|
+
export default function (): Rule;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = default_1;
|
|
11
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
|
+
const util_1 = require("util");
|
|
13
|
+
const dependency_1 = require("../../utility/dependency");
|
|
14
|
+
const latest_versions_1 = require("../../utility/latest-versions");
|
|
15
|
+
const workspace_1 = require("../../utility/workspace");
|
|
16
|
+
const workspace_models_1 = require("../../utility/workspace-models");
|
|
17
|
+
const constants_1 = require("./constants");
|
|
18
|
+
const karma_processor_1 = require("./karma-processor");
|
|
19
|
+
async function processTestTargetOptions(testTarget, projectName, context, tree, removableKarmaConfigs, customBuildOptions, needDevkitPlugin, manualMigrationFiles) {
|
|
20
|
+
let needsCoverage = false;
|
|
21
|
+
for (const [configName, options] of (0, workspace_1.allTargetOptions)(testTarget, false)) {
|
|
22
|
+
const configKey = configName || '';
|
|
23
|
+
if (!customBuildOptions[configKey]) {
|
|
24
|
+
// Match Karma behavior where AOT was disabled by default
|
|
25
|
+
customBuildOptions[configKey] = {
|
|
26
|
+
aot: false,
|
|
27
|
+
optimization: false,
|
|
28
|
+
extractLicenses: false,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Collect custom build options
|
|
32
|
+
for (const key of constants_1.BUILD_OPTIONS_KEYS) {
|
|
33
|
+
if (options[key] !== undefined) {
|
|
34
|
+
customBuildOptions[configKey][key] = options[key];
|
|
35
|
+
delete options[key];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Map Karma options to Unit-Test options
|
|
39
|
+
if (options['codeCoverage'] !== undefined) {
|
|
40
|
+
options['coverage'] = options['codeCoverage'];
|
|
41
|
+
delete options['codeCoverage'];
|
|
42
|
+
}
|
|
43
|
+
if (options['codeCoverageExclude'] !== undefined) {
|
|
44
|
+
options['coverageExclude'] = options['codeCoverageExclude'];
|
|
45
|
+
delete options['codeCoverageExclude'];
|
|
46
|
+
}
|
|
47
|
+
if (options['coverage'] === true || options['coverageExclude'] !== undefined) {
|
|
48
|
+
needsCoverage = true;
|
|
49
|
+
}
|
|
50
|
+
if (options['sourceMap'] !== undefined) {
|
|
51
|
+
context.logger.info(`Project "${projectName}" has "sourceMap" set for tests. ` +
|
|
52
|
+
`In unit-test builder with Vitest, source maps are always enabled. The option has been removed.`);
|
|
53
|
+
delete options['sourceMap'];
|
|
54
|
+
}
|
|
55
|
+
// Convert browser list to array format if it is a comma-separated string
|
|
56
|
+
const browsers = options['browsers'];
|
|
57
|
+
if (typeof browsers === 'string') {
|
|
58
|
+
options['browsers'] = browsers.split(',').map((b) => b.trim());
|
|
59
|
+
}
|
|
60
|
+
else if (browsers === false) {
|
|
61
|
+
options['browsers'] = [];
|
|
62
|
+
}
|
|
63
|
+
const updatedBrowsers = options['browsers'];
|
|
64
|
+
if (Array.isArray(updatedBrowsers) && updatedBrowsers.length > 0) {
|
|
65
|
+
context.logger.info(`Project "${projectName}" has browsers configured for tests. ` +
|
|
66
|
+
`To run tests in a browser with Vitest, you will need to install either ` +
|
|
67
|
+
`"@vitest/browser-playwright" or "@vitest/browser-webdriverio" depending on your preference.`);
|
|
68
|
+
}
|
|
69
|
+
// Check if the karma configuration file can be safely removed and extract settings
|
|
70
|
+
const karmaConfig = options['karmaConfig'];
|
|
71
|
+
if (typeof karmaConfig === 'string') {
|
|
72
|
+
await (0, karma_processor_1.processKarmaConfig)(karmaConfig, options, projectName, context, tree, removableKarmaConfigs, needDevkitPlugin, manualMigrationFiles);
|
|
73
|
+
}
|
|
74
|
+
// Map the main entry file to the setupFiles of the unit-test builder
|
|
75
|
+
const mainFile = options['main'];
|
|
76
|
+
if (typeof mainFile === 'string') {
|
|
77
|
+
options['setupFiles'] = [mainFile];
|
|
78
|
+
context.logger.info(`Project "${projectName}" uses a "main" entry file for tests: "${mainFile}". ` +
|
|
79
|
+
`This has been mapped to the unit-test builder "setupFiles" array. ` +
|
|
80
|
+
`Please ensure you remove any TestBed.initTestEnvironment calls from this file ` +
|
|
81
|
+
`as the builder now handles test environment initialization automatically.`);
|
|
82
|
+
}
|
|
83
|
+
delete options['main'];
|
|
84
|
+
}
|
|
85
|
+
return needsCoverage;
|
|
86
|
+
}
|
|
87
|
+
function updateProjects(tree, context) {
|
|
88
|
+
return (0, workspace_1.updateWorkspace)(async (workspace) => {
|
|
89
|
+
let needsCoverage = false;
|
|
90
|
+
const removableKarmaConfigs = new Map();
|
|
91
|
+
const migratedProjects = [];
|
|
92
|
+
const skippedNonApplications = [];
|
|
93
|
+
const skippedMissingAppBuilder = [];
|
|
94
|
+
const manualMigrationFiles = [];
|
|
95
|
+
for (const [projectName, project] of workspace.projects) {
|
|
96
|
+
// Restrict to application types for now
|
|
97
|
+
if (project.extensions.projectType !== 'application') {
|
|
98
|
+
skippedNonApplications.push(projectName);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
// Check if build target uses the new application builder
|
|
102
|
+
const buildTarget = project.targets.get('build');
|
|
103
|
+
if (!buildTarget || buildTarget.builder !== '@angular/build:application') {
|
|
104
|
+
context.logger.info(`Project "${projectName}" cannot be migrated to Vitest yet. ` +
|
|
105
|
+
`The project must first be migrated to use the "@angular/build:application" builder.`);
|
|
106
|
+
skippedMissingAppBuilder.push(projectName);
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
// Find the test target to migrate
|
|
110
|
+
const testTarget = project.targets.get('test');
|
|
111
|
+
if (!testTarget) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
let isKarma = false;
|
|
115
|
+
let needDevkitPlugin = false;
|
|
116
|
+
// Check if target uses Karma builders
|
|
117
|
+
switch (testTarget.builder) {
|
|
118
|
+
case workspace_models_1.Builders.Karma:
|
|
119
|
+
isKarma = true;
|
|
120
|
+
needDevkitPlugin = true;
|
|
121
|
+
break;
|
|
122
|
+
case workspace_models_1.Builders.BuildKarma:
|
|
123
|
+
isKarma = true;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
if (!isKarma) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
// Store custom build options to move to a new build configuration if needed
|
|
130
|
+
const customBuildOptions = {};
|
|
131
|
+
const projectNeedsCoverage = await processTestTargetOptions(testTarget, projectName, context, tree, removableKarmaConfigs, customBuildOptions, needDevkitPlugin, manualMigrationFiles);
|
|
132
|
+
if (projectNeedsCoverage) {
|
|
133
|
+
needsCoverage = true;
|
|
134
|
+
}
|
|
135
|
+
// If we have custom build options, create testing configurations
|
|
136
|
+
const baseOptions = buildTarget.options || {};
|
|
137
|
+
for (const [configKey, configOptions] of Object.entries(customBuildOptions)) {
|
|
138
|
+
const finalConfig = {};
|
|
139
|
+
// Omit options that already have the same value in the base build options.
|
|
140
|
+
// Using isDeepStrictEqual for a deep comparison of arrays and objects.
|
|
141
|
+
for (const [key, value] of Object.entries(configOptions)) {
|
|
142
|
+
if (!(0, util_1.isDeepStrictEqual)(value, baseOptions[key])) {
|
|
143
|
+
finalConfig[key] = value;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (Object.keys(finalConfig).length > 0) {
|
|
147
|
+
buildTarget.configurations ??= {};
|
|
148
|
+
const configurations = buildTarget.configurations;
|
|
149
|
+
let configName = configKey ? `testing-${configKey}` : 'testing';
|
|
150
|
+
if (configurations[configName]) {
|
|
151
|
+
let counter = 1;
|
|
152
|
+
while (configurations[`${configName}-${counter}`]) {
|
|
153
|
+
counter++;
|
|
154
|
+
}
|
|
155
|
+
configName = `${configName}-${counter}`;
|
|
156
|
+
}
|
|
157
|
+
configurations[configName] = finalConfig;
|
|
158
|
+
if (configKey === '') {
|
|
159
|
+
testTarget.options ??= {};
|
|
160
|
+
testTarget.options['buildTarget'] = `:build:${configName}`;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
testTarget.configurations ??= {};
|
|
164
|
+
testTarget.configurations[configKey] ??= {};
|
|
165
|
+
testTarget.configurations[configKey]['buildTarget'] = `:build:${configName}`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// Update builder
|
|
170
|
+
testTarget.builder = '@angular/build:unit-test';
|
|
171
|
+
testTarget.options ??= {};
|
|
172
|
+
testTarget.options['runner'] = 'vitest';
|
|
173
|
+
migratedProjects.push(projectName);
|
|
174
|
+
}
|
|
175
|
+
// Log summary
|
|
176
|
+
context.logger.info('\n--- Karma to Vitest Migration Summary ---');
|
|
177
|
+
context.logger.info(`Projects migrated: ${migratedProjects.length}`);
|
|
178
|
+
if (migratedProjects.length > 0) {
|
|
179
|
+
context.logger.info(` - ${migratedProjects.join(', ')}`);
|
|
180
|
+
}
|
|
181
|
+
context.logger.info(`Projects skipped (non-applications): ${skippedNonApplications.length}`);
|
|
182
|
+
if (skippedNonApplications.length > 0) {
|
|
183
|
+
context.logger.info(` - ${skippedNonApplications.join(', ')}`);
|
|
184
|
+
}
|
|
185
|
+
context.logger.info(`Projects skipped (missing application builder): ${skippedMissingAppBuilder.length}`);
|
|
186
|
+
if (skippedMissingAppBuilder.length > 0) {
|
|
187
|
+
context.logger.info(` - ${skippedMissingAppBuilder.join(', ')}`);
|
|
188
|
+
}
|
|
189
|
+
const uniqueManualFiles = [...new Set(manualMigrationFiles)];
|
|
190
|
+
if (uniqueManualFiles.length > 0) {
|
|
191
|
+
context.logger.warn(`\nThe following Karma configuration files require manual migration:`);
|
|
192
|
+
for (const file of uniqueManualFiles) {
|
|
193
|
+
context.logger.warn(` - ${file}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (migratedProjects.length > 0) {
|
|
197
|
+
context.logger.info(`\nNote: To refactor your test files from Jasmine to Vitest, consider running the following command:` +
|
|
198
|
+
`\n ng g @schematics/angular:refactor-jasmine-vitest <project_name>`);
|
|
199
|
+
}
|
|
200
|
+
context.logger.info('-----------------------------------------\n');
|
|
201
|
+
if (migratedProjects.length > 0) {
|
|
202
|
+
const rules = [
|
|
203
|
+
(0, dependency_1.addDependency)('vitest', latest_versions_1.latestVersions['vitest'], {
|
|
204
|
+
type: dependency_1.DependencyType.Dev,
|
|
205
|
+
existing: dependency_1.ExistingBehavior.Skip,
|
|
206
|
+
}),
|
|
207
|
+
];
|
|
208
|
+
if (needsCoverage) {
|
|
209
|
+
rules.push((0, dependency_1.addDependency)('@vitest/coverage-v8', latest_versions_1.latestVersions['@vitest/coverage-v8'], {
|
|
210
|
+
type: dependency_1.DependencyType.Dev,
|
|
211
|
+
existing: dependency_1.ExistingBehavior.Skip,
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
return (0, schematics_1.chain)(rules);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
function default_1() {
|
|
219
|
+
return updateProjects;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=migration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration.js","sourceRoot":"","sources":["migration.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA6RH,4BAEC;AA5RD,2DAAiF;AACjF,+BAAyC;AACzC,yDAA2F;AAC3F,mEAA+D;AAC/D,uDAA8F;AAC9F,qEAA0D;AAC1D,2CAAiD;AACjD,uDAAuD;AAEvD,KAAK,UAAU,wBAAwB,CACrC,UAA4B,EAC5B,WAAmB,EACnB,OAAyB,EACzB,IAAU,EACV,qBAA2C,EAC3C,kBAA8E,EAC9E,gBAAyB,EACzB,oBAA8B;IAE9B,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,KAAK,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,IAAA,4BAAgB,EAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,SAAS,GAAG,UAAU,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC;YACnC,yDAAyD;YACzD,kBAAkB,CAAC,SAAS,CAAC,GAAG;gBAC9B,GAAG,EAAE,KAAK;gBACV,YAAY,EAAE,KAAK;gBACnB,eAAe,EAAE,KAAK;aACvB,CAAC;QACJ,CAAC;QAED,+BAA+B;QAC/B,KAAK,MAAM,GAAG,IAAI,8BAAkB,EAAE,CAAC;YACrC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;gBAC/B,kBAAkB,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;gBAClD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QAED,yCAAyC;QACzC,IAAI,OAAO,CAAC,cAAc,CAAC,KAAK,SAAS,EAAE,CAAC;YAC1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AAgB,CAAC,IAAI;iBAChC,CAAC,CACH,CAAC;YACJ,CAAC;YAED,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;IACE,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"encapsulation": false,
|
|
3
3
|
"schematics": {
|
|
4
|
+
"add-istanbul-instrumenter": {
|
|
5
|
+
"version": "22.0.0",
|
|
6
|
+
"factory": "./add-istanbul-instrumenter/migration",
|
|
7
|
+
"description": "Add istanbul-lib-instrument to devDependencies if Karma unit testing is used."
|
|
8
|
+
},
|
|
4
9
|
"use-application-builder": {
|
|
5
10
|
"version": "22.0.0",
|
|
6
11
|
"factory": "./use-application-builder/migration",
|
|
@@ -14,6 +19,12 @@
|
|
|
14
19
|
"factory": "./karma/migration",
|
|
15
20
|
"description": "Remove any karma configuration files that only contain the default content. The default configuration is automatically available without a specific project file."
|
|
16
21
|
},
|
|
22
|
+
"migrate-karma-to-vitest": {
|
|
23
|
+
"version": "22.0.0",
|
|
24
|
+
"factory": "./migrate-karma-to-vitest/migration",
|
|
25
|
+
"description": "Migrate projects using legacy Karma unit-test builder to the new unit-test builder with Vitest.",
|
|
26
|
+
"optional": true
|
|
27
|
+
},
|
|
17
28
|
"update-workspace-config": {
|
|
18
29
|
"version": "22.0.0",
|
|
19
30
|
"factory": "./update-workspace-config/migration",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "22.0.0-next.
|
|
3
|
+
"version": "22.0.0-next.5",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"schematics": "./collection.json",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@angular-devkit/core": "22.0.0-next.
|
|
26
|
-
"@angular-devkit/schematics": "22.0.0-next.
|
|
25
|
+
"@angular-devkit/core": "22.0.0-next.5",
|
|
26
|
+
"@angular-devkit/schematics": "22.0.0-next.5",
|
|
27
27
|
"jsonc-parser": "3.3.1"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
package/utility/dependencies.js
CHANGED
|
@@ -69,6 +69,7 @@ function addTestRunnerDependencies(testRunner, skipInstall) {
|
|
|
69
69
|
'karma-jasmine-html-reporter',
|
|
70
70
|
'jasmine-core',
|
|
71
71
|
'@types/jasmine',
|
|
72
|
+
'istanbul-lib-instrument',
|
|
72
73
|
];
|
|
73
74
|
return dependencies.map((name) => (0, dependency_1.addDependency)(name, latest_versions_1.latestVersions[name], {
|
|
74
75
|
type: dependency_1.DependencyType.Dev,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["dependencies.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA8BH,4DAYC;AAED,kEAUC;AAED,4DAoBC;AAED,
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["dependencies.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA8BH,4DAYC;AAED,kEAUC;AAED,4DAoBC;AAED,8DAyBC;AApGD,6CAA8C;AAC9C,6CAAgG;AAChG,2CAAuC;AACvC,uDAAmD;AAEnD,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,8CAAwB,CAAA;IACxB,6CAAuB,CAAA;IACvB,+CAAyB,CAAA;IACzB,uDAAiC,CAAA;AACnC,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AASD,MAAM,mBAAmB,GAAG;IAC1B,kBAAkB,CAAC,OAAO;IAC1B,kBAAkB,CAAC,GAAG;IACtB,kBAAkB,CAAC,QAAQ;IAC3B,k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ACd,CAAC;AAED,SAAgB,yBAAyB,CACvC,UAAkC,EAClC,WAAoB;IAEpB,MAAM,YAAY,GAChB,UAAU,KAAK,mBAAU,CAAC,MAAM;QAC9B,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC;QACrB,CAAC,CAAC;YACE,OAAO;YACP,uBAAuB;YACvB,gBAAgB;YAChB,eAAe;YACf,6BAA6B;YAC7B,cAAc;YACd,gBAAgB;YAChB,yBAAyB;SAC1B,CAAC;IAER,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAC/B,IAAA,0BAAa,EAAC,IAAI,EAAE,gCAAc,CAAC,IAAI,CAAC,EAAE;QACxC,IAAI,EAAE,2BAAc,CAAC,GAAG;QACxB,QAAQ,EAAE,6BAAgB,CAAC,IAAI;QAC/B,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,4BAAe,CAAC,IAAI,CAAC,CAAC,CAAC,4BAAe,CAAC,IAAI;KACnE,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"@types/node": "^20.17.19",
|
|
9
9
|
"browser-sync": "^3.0.0",
|
|
10
10
|
"express": "^5.1.0",
|
|
11
|
+
"istanbul-lib-instrument": "^6.0.3",
|
|
11
12
|
"jasmine-core": "~6.1.0",
|
|
12
13
|
"jasmine-spec-reporter": "~7.0.0",
|
|
13
14
|
"karma-chrome-launcher": "~3.2.0",
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"tslib": "^2.3.0",
|
|
26
27
|
"typescript": "~6.0.2",
|
|
27
28
|
"vitest": "^4.0.8",
|
|
29
|
+
"@vitest/coverage-v8": "^4.0.8",
|
|
28
30
|
"@vitest/browser-playwright": "^4.0.8",
|
|
29
31
|
"@vitest/browser-webdriverio": "^4.0.8",
|
|
30
32
|
"@vitest/browser-preview": "^4.0.8",
|
|
@@ -16,8 +16,8 @@ exports.latestVersions = {
|
|
|
16
16
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
17
17
|
Angular: '^22.0.0-next.0',
|
|
18
18
|
NgPackagr: '^22.0.0-next.0',
|
|
19
|
-
DevkitBuildAngular: '^22.0.0-next.
|
|
20
|
-
AngularBuild: '^22.0.0-next.
|
|
21
|
-
AngularSSR: '^22.0.0-next.
|
|
19
|
+
DevkitBuildAngular: '^22.0.0-next.5',
|
|
20
|
+
AngularBuild: '^22.0.0-next.5',
|
|
21
|
+
AngularSSR: '^22.0.0-next.5',
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=latest-versions.js.map
|