@schematics/angular 19.2.0-rc.0 → 19.2.1
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/config/files/karma.conf.js.template +3 -3
- package/config/index.js +5 -2
- package/environments/index.js +2 -1
- package/migrations/use-application-builder/migration.js +11 -3
- package/package.json +3 -3
- package/service-worker/index.js +2 -1
- package/utility/latest-versions.js +5 -5
- package/utility/workspace-models.d.ts +3 -0
- package/utility/workspace-models.js +3 -0
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
module.exports = function (config) {
|
|
5
5
|
config.set({
|
|
6
6
|
basePath: '',
|
|
7
|
-
frameworks: ['jasmine'
|
|
7
|
+
frameworks: ['jasmine'<% if (needDevkitPlugin) { %>, '@angular-devkit/build-angular'<% } %>],
|
|
8
8
|
plugins: [
|
|
9
9
|
require('karma-jasmine'),
|
|
10
10
|
require('karma-chrome-launcher'),
|
|
11
11
|
require('karma-jasmine-html-reporter'),
|
|
12
|
-
require('karma-coverage')
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma')
|
|
12
|
+
require('karma-coverage'),<% if (needDevkitPlugin) { %>
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')<% } %>
|
|
14
14
|
],
|
|
15
15
|
client: {
|
|
16
16
|
jasmine: {
|
package/config/index.js
CHANGED
|
@@ -48,8 +48,10 @@ function addKarmaConfig(options) {
|
|
|
48
48
|
throw new schematics_1.SchematicsException(`No "test" target found for project "${options.project}".` +
|
|
49
49
|
' A "test" target is required to generate a karma configuration.');
|
|
50
50
|
}
|
|
51
|
-
if (testTarget.builder !== utility_1.AngularBuilder.Karma
|
|
52
|
-
|
|
51
|
+
if (testTarget.builder !== utility_1.AngularBuilder.Karma &&
|
|
52
|
+
testTarget.builder !== utility_1.AngularBuilder.BuildKarma) {
|
|
53
|
+
throw new schematics_1.SchematicsException(`Cannot add a karma configuration as builder for "test" target in project does not` +
|
|
54
|
+
` use "${utility_1.AngularBuilder.Karma}" or "${utility_1.AngularBuilder.BuildKarma}".`);
|
|
53
55
|
}
|
|
54
56
|
testTarget.options ??= {};
|
|
55
57
|
testTarget.options.karmaConfig = node_path_1.posix.join(project.root, 'karma.conf.js');
|
|
@@ -63,6 +65,7 @@ function addKarmaConfig(options) {
|
|
|
63
65
|
(0, schematics_1.applyTemplates)({
|
|
64
66
|
relativePathToWorkspaceRoot: (0, paths_1.relativePathToWorkspaceRoot)(project.root),
|
|
65
67
|
folderName,
|
|
68
|
+
needDevkitPlugin: testTarget.builder === utility_1.AngularBuilder.Karma,
|
|
66
69
|
}),
|
|
67
70
|
(0, schematics_1.move)(project.root),
|
|
68
71
|
]));
|
package/environments/index.js
CHANGED
|
@@ -55,7 +55,8 @@ function log(type, text) {
|
|
|
55
55
|
function* generateConfigurationEnvironments(buildTarget, serverTarget, sourceRoot, projectName) {
|
|
56
56
|
if (buildTarget.builder !== utility_1.AngularBuilder.Browser &&
|
|
57
57
|
buildTarget.builder !== utility_1.AngularBuilder.BrowserEsbuild &&
|
|
58
|
-
buildTarget.builder !== utility_1.AngularBuilder.Application
|
|
58
|
+
buildTarget.builder !== utility_1.AngularBuilder.Application &&
|
|
59
|
+
buildTarget.builder !== utility_1.AngularBuilder.BuildApplication) {
|
|
59
60
|
yield log('warn', `"build" target found for project "${projectName}" has a third-party builder "${buildTarget.builder}".` +
|
|
60
61
|
' The generated project options may not be compatible with this builder.');
|
|
61
62
|
}
|
|
@@ -99,7 +99,10 @@ function* updateBuildTarget(projectName, buildTarget, serverTarget, tree, contex
|
|
|
99
99
|
// Update server file
|
|
100
100
|
const ssrMainFile = serverTarget?.options?.['main'];
|
|
101
101
|
if (typeof ssrMainFile === 'string') {
|
|
102
|
-
|
|
102
|
+
// Do not delete the server main file if it's the same as the browser file.
|
|
103
|
+
if (buildTarget.options?.browser !== ssrMainFile) {
|
|
104
|
+
yield deleteFile(ssrMainFile);
|
|
105
|
+
}
|
|
103
106
|
yield (0, schematics_1.externalSchematic)('@schematics/angular', 'ssr', {
|
|
104
107
|
project: projectName,
|
|
105
108
|
skipInstall: true,
|
|
@@ -346,8 +349,13 @@ function deleteFile(path) {
|
|
|
346
349
|
};
|
|
347
350
|
}
|
|
348
351
|
function updateJsonFile(path, updater) {
|
|
349
|
-
return (tree) => {
|
|
350
|
-
|
|
352
|
+
return (tree, ctx) => {
|
|
353
|
+
if (tree.exists(path)) {
|
|
354
|
+
updater(new json_file_1.JSONFile(tree, path));
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
ctx.logger.info(`Skipping updating '${path}' as it does not exist.`);
|
|
358
|
+
}
|
|
351
359
|
};
|
|
352
360
|
}
|
|
353
361
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "19.2.
|
|
3
|
+
"version": "19.2.1",
|
|
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": "19.2.
|
|
26
|
-
"@angular-devkit/schematics": "19.2.
|
|
25
|
+
"@angular-devkit/core": "19.2.1",
|
|
26
|
+
"@angular-devkit/schematics": "19.2.1",
|
|
27
27
|
"jsonc-parser": "3.3.1"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
package/service-worker/index.js
CHANGED
|
@@ -122,7 +122,8 @@ function default_1(options) {
|
|
|
122
122
|
const buildOptions = buildTarget.options;
|
|
123
123
|
let browserEntryPoint;
|
|
124
124
|
const ngswConfigPath = (0, core_1.join)((0, core_1.normalize)(project.root), 'ngsw-config.json');
|
|
125
|
-
if (buildTarget.builder === workspace_models_1.Builders.Application
|
|
125
|
+
if (buildTarget.builder === workspace_models_1.Builders.Application ||
|
|
126
|
+
buildTarget.builder === workspace_models_1.Builders.BuildApplication) {
|
|
126
127
|
browserEntryPoint = buildOptions.browser;
|
|
127
128
|
const productionConf = buildTarget.configurations?.production;
|
|
128
129
|
if (productionConf) {
|
|
@@ -14,9 +14,9 @@ const dependencies = require('./latest-versions/package.json')['dependencies'];
|
|
|
14
14
|
exports.latestVersions = {
|
|
15
15
|
...dependencies,
|
|
16
16
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
17
|
-
Angular: '^19.2.0
|
|
18
|
-
NgPackagr: '^19.2.0
|
|
19
|
-
DevkitBuildAngular: '^19.2.
|
|
20
|
-
AngularBuild: '^19.2.
|
|
21
|
-
AngularSSR: '^19.2.
|
|
17
|
+
Angular: '^19.2.0',
|
|
18
|
+
NgPackagr: '^19.2.0',
|
|
19
|
+
DevkitBuildAngular: '^19.2.1',
|
|
20
|
+
AngularBuild: '^19.2.1',
|
|
21
|
+
AngularSSR: '^19.2.1',
|
|
22
22
|
};
|
|
@@ -24,11 +24,14 @@ export declare enum Builders {
|
|
|
24
24
|
Prerender = "@angular-devkit/build-angular:prerender",
|
|
25
25
|
BrowserEsbuild = "@angular-devkit/build-angular:browser-esbuild",
|
|
26
26
|
Karma = "@angular-devkit/build-angular:karma",
|
|
27
|
+
BuildKarma = "@angular/build:karma",
|
|
27
28
|
TsLint = "@angular-devkit/build-angular:tslint",
|
|
28
29
|
NgPackagr = "@angular-devkit/build-angular:ng-packagr",
|
|
29
30
|
BuildNgPackagr = "@angular/build:ng-packagr",
|
|
30
31
|
DevServer = "@angular-devkit/build-angular:dev-server",
|
|
32
|
+
BuildDevServer = "@angular/build:dev-server",
|
|
31
33
|
ExtractI18n = "@angular-devkit/build-angular:extract-i18n",
|
|
34
|
+
BuildExtractI18n = "@angular/build:extract-i18n",
|
|
32
35
|
Protractor = "@angular-devkit/build-angular:private-protractor",
|
|
33
36
|
BuildApplication = "@angular/build:application"
|
|
34
37
|
}
|
|
@@ -29,11 +29,14 @@ var Builders;
|
|
|
29
29
|
Builders["Prerender"] = "@angular-devkit/build-angular:prerender";
|
|
30
30
|
Builders["BrowserEsbuild"] = "@angular-devkit/build-angular:browser-esbuild";
|
|
31
31
|
Builders["Karma"] = "@angular-devkit/build-angular:karma";
|
|
32
|
+
Builders["BuildKarma"] = "@angular/build:karma";
|
|
32
33
|
Builders["TsLint"] = "@angular-devkit/build-angular:tslint";
|
|
33
34
|
Builders["NgPackagr"] = "@angular-devkit/build-angular:ng-packagr";
|
|
34
35
|
Builders["BuildNgPackagr"] = "@angular/build:ng-packagr";
|
|
35
36
|
Builders["DevServer"] = "@angular-devkit/build-angular:dev-server";
|
|
37
|
+
Builders["BuildDevServer"] = "@angular/build:dev-server";
|
|
36
38
|
Builders["ExtractI18n"] = "@angular-devkit/build-angular:extract-i18n";
|
|
39
|
+
Builders["BuildExtractI18n"] = "@angular/build:extract-i18n";
|
|
37
40
|
Builders["Protractor"] = "@angular-devkit/build-angular:private-protractor";
|
|
38
41
|
Builders["BuildApplication"] = "@angular/build:application";
|
|
39
42
|
})(Builders || (exports.Builders = Builders = {}));
|