@schematics/angular 18.0.0-rc.0 → 18.0.0-rc.2
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/index.js +8 -8
- package/migrations/migration-collection.json +1 -1
- package/migrations/use-application-builder/migration.js +28 -0
- package/package.json +3 -3
- package/utility/latest-versions/package.json +1 -0
- package/utility/latest-versions.js +2 -2
- package/workspace/files/__dot__gitignore.template +1 -1
package/application/index.js
CHANGED
|
@@ -159,13 +159,13 @@ function addAppToWorkspaceFile(options, appDir, folderName) {
|
|
|
159
159
|
budgets = [
|
|
160
160
|
{
|
|
161
161
|
type: 'initial',
|
|
162
|
-
maximumWarning: '
|
|
163
|
-
maximumError: '
|
|
162
|
+
maximumWarning: '500kB',
|
|
163
|
+
maximumError: '1MB',
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
type: 'anyComponentStyle',
|
|
167
|
-
maximumWarning: '
|
|
168
|
-
maximumError: '
|
|
167
|
+
maximumWarning: '2kB',
|
|
168
|
+
maximumError: '4kB',
|
|
169
169
|
},
|
|
170
170
|
];
|
|
171
171
|
}
|
|
@@ -173,13 +173,13 @@ function addAppToWorkspaceFile(options, appDir, folderName) {
|
|
|
173
173
|
budgets = [
|
|
174
174
|
{
|
|
175
175
|
type: 'initial',
|
|
176
|
-
maximumWarning: '
|
|
177
|
-
maximumError: '
|
|
176
|
+
maximumWarning: '2MB',
|
|
177
|
+
maximumError: '5MB',
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
type: 'anyComponentStyle',
|
|
181
|
-
maximumWarning: '
|
|
182
|
-
maximumError: '
|
|
181
|
+
maximumWarning: '6kB',
|
|
182
|
+
maximumError: '10kB',
|
|
183
183
|
},
|
|
184
184
|
];
|
|
185
185
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"use-application-builder": {
|
|
4
4
|
"version": "18.0.0",
|
|
5
5
|
"factory": "./use-application-builder/migration",
|
|
6
|
-
"description": "Migrate application projects using '@angular-devkit/build-angular
|
|
6
|
+
"description": "Migrate application projects using the '@angular-devkit/build-angular' package's 'browser' and/or 'browser-esbuild' builders to the 'application' builder. Read more about this here: https://angular.dev/tools/cli/esbuild#using-the-application-builder",
|
|
7
7
|
"optional": true
|
|
8
8
|
}
|
|
9
9
|
}
|
|
@@ -190,6 +190,15 @@ function updateProjects(tree, context) {
|
|
|
190
190
|
existing: dependency_1.ExistingBehavior.Skip,
|
|
191
191
|
}));
|
|
192
192
|
}
|
|
193
|
+
// Add postcss dependency if any projects have a custom postcss configuration file.
|
|
194
|
+
// The build system only supports files in a project root or workspace root with
|
|
195
|
+
// names of either 'postcss.config.json' or '.postcssrc.json'.
|
|
196
|
+
if (hasPostcssConfiguration(tree, workspace)) {
|
|
197
|
+
rules.push((0, dependency_1.addDependency)('postcss', latest_versions_1.latestVersions['postcss'], {
|
|
198
|
+
type: dependency_1.DependencyType.Dev,
|
|
199
|
+
existing: dependency_1.ExistingBehavior.Replace,
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
193
202
|
}
|
|
194
203
|
return (0, schematics_1.chain)(rules);
|
|
195
204
|
});
|
|
@@ -217,6 +226,25 @@ function hasLessStylesheets(tree) {
|
|
|
217
226
|
}
|
|
218
227
|
}
|
|
219
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Searches for a Postcss configuration file within the workspace root
|
|
231
|
+
* or any of the project roots.
|
|
232
|
+
*
|
|
233
|
+
* @param tree A Schematics tree instance to search
|
|
234
|
+
* @param workspace A Workspace to check for projects
|
|
235
|
+
* @returns true, if a Postcss configuration file is found; otherwise, false
|
|
236
|
+
*/
|
|
237
|
+
function hasPostcssConfiguration(tree, workspace) {
|
|
238
|
+
// Add workspace root
|
|
239
|
+
const searchDirectories = [''];
|
|
240
|
+
// Add each project root
|
|
241
|
+
for (const { root } of workspace.projects.values()) {
|
|
242
|
+
if (root) {
|
|
243
|
+
searchDirectories.push(root);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return searchDirectories.some((dir) => tree.exists((0, posix_1.join)(dir, 'postcss.config.json')) || tree.exists((0, posix_1.join)(dir, '.postcssrc.json')));
|
|
247
|
+
}
|
|
220
248
|
function* visit(directory) {
|
|
221
249
|
for (const path of directory.subfiles) {
|
|
222
250
|
const sass = path.endsWith('.scss');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "18.0.0-rc.
|
|
3
|
+
"version": "18.0.0-rc.2",
|
|
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": "18.0.0-rc.
|
|
26
|
-
"@angular-devkit/schematics": "18.0.0-rc.
|
|
25
|
+
"@angular-devkit/core": "18.0.0-rc.2",
|
|
26
|
+
"@angular-devkit/schematics": "18.0.0-rc.2",
|
|
27
27
|
"jsonc-parser": "3.2.1"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
@@ -15,6 +15,6 @@ 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
17
|
Angular: dependencies['@angular/core'],
|
|
18
|
-
DevkitBuildAngular: '^18.0.0-rc.
|
|
19
|
-
AngularSSR: '^18.0.0-rc.
|
|
18
|
+
DevkitBuildAngular: '^18.0.0-rc.2',
|
|
19
|
+
AngularSSR: '^18.0.0-rc.2',
|
|
20
20
|
};
|