@schematics/angular 18.0.0-rc.0 → 18.0.0-rc.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.
@@ -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.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": "18.0.0-rc.0",
26
- "@angular-devkit/schematics": "18.0.0-rc.0",
25
+ "@angular-devkit/core": "18.0.0-rc.1",
26
+ "@angular-devkit/schematics": "18.0.0-rc.1",
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.1',
19
+ AngularSSR: '^18.0.0-rc.1',
20
20
  };