@schematics/angular 20.0.0-next.6 → 20.0.0-next.8
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/common-files/tsconfig.app.json.template +0 -1
- package/application/files/common-files/tsconfig.spec.json.template +0 -1
- package/application/files/module-files/src/app/app-module.ts.template +5 -2
- package/application/files/standalone-files/src/app/app.config.ts.template +6 -2
- package/application/index.js +2 -2
- package/config/.browserslistrc +7 -0
- package/config/files/.browserslistrc.template +2 -8
- package/config/index.js +4 -1
- package/library/files/tsconfig.lib.json.template +3 -0
- package/library/files/tsconfig.spec.json.template +1 -2
- package/library/index.js +15 -0
- package/package.json +3 -3
- package/utility/latest-versions.js +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NgModule<% if(experimentalZoneless) { %>, provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';
|
|
1
|
+
import { NgModule, provideBrowserGlobalErrorListeners<% if(experimentalZoneless) { %>, provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';
|
|
2
2
|
import { BrowserModule } from '@angular/platform-browser';
|
|
3
3
|
<% if (routing) { %>
|
|
4
4
|
import { AppRoutingModule } from './app-routing-module';<% } %>
|
|
@@ -12,7 +12,10 @@ import { App } from './app';
|
|
|
12
12
|
BrowserModule<% if (routing) { %>,
|
|
13
13
|
AppRoutingModule<% } %>
|
|
14
14
|
],
|
|
15
|
-
providers: [
|
|
15
|
+
providers: [
|
|
16
|
+
provideBrowserGlobalErrorListeners()<% if (experimentalZoneless) { %>,
|
|
17
|
+
provideExperimentalZonelessChangeDetection()<% } %>
|
|
18
|
+
],
|
|
16
19
|
bootstrap: [App]
|
|
17
20
|
})
|
|
18
21
|
export class AppModule { }
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { ApplicationConfig, <% if(!experimentalZoneless) { %>provideZoneChangeDetection<% } else { %>provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
|
|
1
|
+
import { ApplicationConfig, provideBrowserGlobalErrorListeners, <% if(!experimentalZoneless) { %>provideZoneChangeDetection<% } else { %>provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
|
|
2
2
|
import { provideRouter } from '@angular/router';
|
|
3
3
|
|
|
4
4
|
import { routes } from './app.routes';<% } %>
|
|
5
5
|
|
|
6
6
|
export const appConfig: ApplicationConfig = {
|
|
7
|
-
providers: [
|
|
7
|
+
providers: [
|
|
8
|
+
provideBrowserGlobalErrorListeners(),
|
|
9
|
+
<% if(experimentalZoneless) { %>provideExperimentalZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %>,
|
|
10
|
+
<% if (routing) {%>provideRouter(routes)<% } %>
|
|
11
|
+
]
|
|
8
12
|
};
|
package/application/index.js
CHANGED
|
@@ -35,10 +35,10 @@ function default_1(options) {
|
|
|
35
35
|
const { appDir, appRootSelector, componentOptions, folderName, sourceDir } = await getAppOptions(host, options);
|
|
36
36
|
return (0, schematics_1.chain)([
|
|
37
37
|
addAppToWorkspaceFile(options, appDir, folderName),
|
|
38
|
-
addTsProjectReference((0, core_1.join)((0, core_1.normalize)(appDir), 'tsconfig.app.json')),
|
|
38
|
+
addTsProjectReference('./' + (0, core_1.join)((0, core_1.normalize)(appDir), 'tsconfig.app.json')),
|
|
39
39
|
options.skipTests
|
|
40
40
|
? (0, schematics_1.noop)()
|
|
41
|
-
: addTsProjectReference((0, core_1.join)((0, core_1.normalize)(appDir), 'tsconfig.spec.json')),
|
|
41
|
+
: addTsProjectReference('./' + (0, core_1.join)((0, core_1.normalize)(appDir), 'tsconfig.spec.json')),
|
|
42
42
|
options.standalone
|
|
43
43
|
? (0, schematics_1.noop)()
|
|
44
44
|
: (0, schematics_1.schematic)('module', {
|
|
@@ -2,16 +2,10 @@
|
|
|
2
2
|
# For additional information regarding the format and rule options, please see:
|
|
3
3
|
# https://github.com/browserslist/browserslist#queries
|
|
4
4
|
|
|
5
|
-
# For
|
|
5
|
+
# For Angular's browser support policy, please see:
|
|
6
6
|
# https://angular.dev/reference/versions#browser-support
|
|
7
7
|
|
|
8
8
|
# You can see what browsers were selected by your queries by running:
|
|
9
9
|
# npx browserslist
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
last 1 Firefox version
|
|
13
|
-
last 2 Edge major versions
|
|
14
|
-
last 2 Safari major versions
|
|
15
|
-
last 2 iOS major versions
|
|
16
|
-
last 2 Android major versions
|
|
17
|
-
Firefox ESR
|
|
11
|
+
<%= config %>
|
package/config/index.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.default = default_1;
|
|
11
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
|
+
const promises_1 = require("node:fs/promises");
|
|
12
13
|
const node_path_1 = require("node:path");
|
|
13
14
|
const paths_1 = require("../utility/paths");
|
|
14
15
|
const workspace_1 = require("../utility/workspace");
|
|
@@ -31,9 +32,11 @@ function addBrowserslistConfig(options) {
|
|
|
31
32
|
if (!project) {
|
|
32
33
|
throw new schematics_1.SchematicsException(`Project name "${options.project}" doesn't not exist.`);
|
|
33
34
|
}
|
|
35
|
+
// Read Angular's default vendored `.browserslistrc` file.
|
|
36
|
+
const config = await (0, promises_1.readFile)(node_path_1.posix.join(__dirname, '.browserslistrc'), 'utf8');
|
|
34
37
|
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
35
38
|
(0, schematics_1.filter)((p) => p.endsWith('.browserslistrc.template')),
|
|
36
|
-
(0, schematics_1.applyTemplates)({}),
|
|
39
|
+
(0, schematics_1.applyTemplates)({ config }),
|
|
37
40
|
(0, schematics_1.move)(project.root),
|
|
38
41
|
]));
|
|
39
42
|
};
|
package/library/index.js
CHANGED
|
@@ -28,6 +28,18 @@ function updateTsConfig(packageName, ...paths) {
|
|
|
28
28
|
file.modify(jsonPath, Array.isArray(value) ? [...value, ...paths] : paths);
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
function addTsProjectReference(...paths) {
|
|
32
|
+
return (host) => {
|
|
33
|
+
if (!host.exists('tsconfig.json')) {
|
|
34
|
+
return host;
|
|
35
|
+
}
|
|
36
|
+
const newReferences = paths.map((path) => ({ path }));
|
|
37
|
+
const file = new json_file_1.JSONFile(host, 'tsconfig.json');
|
|
38
|
+
const jsonPath = ['references'];
|
|
39
|
+
const value = file.get(jsonPath);
|
|
40
|
+
file.modify(jsonPath, Array.isArray(value) ? [...value, ...newReferences] : newReferences);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
31
43
|
function addDependenciesToPackageJson() {
|
|
32
44
|
return (host) => {
|
|
33
45
|
[
|
|
@@ -132,6 +144,9 @@ function default_1(options) {
|
|
|
132
144
|
addLibToWorkspaceFile(options, libDir, packageName),
|
|
133
145
|
options.skipPackageJson ? (0, schematics_1.noop)() : addDependenciesToPackageJson(),
|
|
134
146
|
options.skipTsConfig ? (0, schematics_1.noop)() : updateTsConfig(packageName, './' + distRoot),
|
|
147
|
+
options.skipTsConfig
|
|
148
|
+
? (0, schematics_1.noop)()
|
|
149
|
+
: addTsProjectReference('./' + (0, posix_1.join)(libDir, 'tsconfig.lib.json'), './' + (0, posix_1.join)(libDir, 'tsconfig.spec.json')),
|
|
135
150
|
options.standalone
|
|
136
151
|
? (0, schematics_1.noop)()
|
|
137
152
|
: (0, schematics_1.schematic)('module', {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "20.0.0-next.
|
|
3
|
+
"version": "20.0.0-next.8",
|
|
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": "20.0.0-next.
|
|
26
|
-
"@angular-devkit/schematics": "20.0.0-next.
|
|
25
|
+
"@angular-devkit/core": "20.0.0-next.8",
|
|
26
|
+
"@angular-devkit/schematics": "20.0.0-next.8",
|
|
27
27
|
"jsonc-parser": "3.3.1"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
@@ -16,7 +16,7 @@ exports.latestVersions = {
|
|
|
16
16
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
17
17
|
Angular: '^20.0.0-next.0',
|
|
18
18
|
NgPackagr: '^20.0.0-next.0',
|
|
19
|
-
DevkitBuildAngular: '^20.0.0-next.
|
|
20
|
-
AngularBuild: '^20.0.0-next.
|
|
21
|
-
AngularSSR: '^20.0.0-next.
|
|
19
|
+
DevkitBuildAngular: '^20.0.0-next.8',
|
|
20
|
+
AngularBuild: '^20.0.0-next.8',
|
|
21
|
+
AngularSSR: '^20.0.0-next.8',
|
|
22
22
|
};
|