@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.
@@ -159,13 +159,13 @@ function addAppToWorkspaceFile(options, appDir, folderName) {
159
159
  budgets = [
160
160
  {
161
161
  type: 'initial',
162
- maximumWarning: '500kb',
163
- maximumError: '1mb',
162
+ maximumWarning: '500kB',
163
+ maximumError: '1MB',
164
164
  },
165
165
  {
166
166
  type: 'anyComponentStyle',
167
- maximumWarning: '2kb',
168
- maximumError: '4kb',
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: '2mb',
177
- maximumError: '5mb',
176
+ maximumWarning: '2MB',
177
+ maximumError: '5MB',
178
178
  },
179
179
  {
180
180
  type: 'anyComponentStyle',
181
- maximumWarning: '6kb',
182
- maximumError: '10kb',
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:browser' and '@angular-devkit/build-angular:browser-esbuild' to use the '@angular-devkit/build-angular:application' builder. Read more about this here: https://angular.dev/tools/cli/esbuild#using-the-application-builder",
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.0",
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.0",
26
- "@angular-devkit/schematics": "18.0.0-rc.0",
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": {
@@ -18,6 +18,7 @@
18
18
  "karma": "~6.4.0",
19
19
  "less": "^4.2.0",
20
20
  "ng-packagr": "^18.0.0-next.0",
21
+ "postcss": "^8.4.38",
21
22
  "protractor": "~7.0.0",
22
23
  "rxjs": "~7.8.0",
23
24
  "tslib": "^2.3.0",
@@ -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.0',
19
- AngularSSR: '^18.0.0-rc.0',
18
+ DevkitBuildAngular: '^18.0.0-rc.2',
19
+ AngularSSR: '^18.0.0-rc.2',
20
20
  };
@@ -1,4 +1,4 @@
1
- # See http://help.github.com/ignore-files/ for more about ignoring files.
1
+ # See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2
2
 
3
3
  # Compiled output
4
4
  /dist