@angular-devkit/build-angular 18.0.0-next.1 → 18.0.0-next.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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "18.0.0-next.1",
3
+ "version": "18.0.0-next.2",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
7
7
  "builders": "builders.json",
8
8
  "dependencies": {
9
9
  "@ampproject/remapping": "2.3.0",
10
- "@angular-devkit/architect": "0.1800.0-next.1",
11
- "@angular-devkit/build-webpack": "0.1800.0-next.1",
12
- "@angular-devkit/core": "18.0.0-next.1",
10
+ "@angular-devkit/architect": "0.1800.0-next.2",
11
+ "@angular-devkit/build-webpack": "0.1800.0-next.2",
12
+ "@angular-devkit/core": "18.0.0-next.2",
13
13
  "@babel/core": "7.24.3",
14
14
  "@babel/generator": "7.24.1",
15
15
  "@babel/helper-annotate-as-pure": "7.22.5",
@@ -20,7 +20,7 @@
20
20
  "@babel/preset-env": "7.24.3",
21
21
  "@babel/runtime": "7.24.1",
22
22
  "@discoveryjs/json-ext": "0.5.7",
23
- "@ngtools/webpack": "18.0.0-next.1",
23
+ "@ngtools/webpack": "18.0.0-next.2",
24
24
  "@vitejs/plugin-basic-ssl": "1.1.0",
25
25
  "ansi-colors": "4.1.3",
26
26
  "autoprefixer": "10.4.19",
@@ -34,7 +34,7 @@
34
34
  "fast-glob": "3.3.2",
35
35
  "https-proxy-agent": "7.0.4",
36
36
  "http-proxy-middleware": "2.0.6",
37
- "inquirer": "9.2.16",
37
+ "inquirer": "9.2.17",
38
38
  "jsonc-parser": "3.2.1",
39
39
  "karma-source-map-support": "1.4.0",
40
40
  "less": "4.2.0",
@@ -47,7 +47,7 @@
47
47
  "open": "8.4.2",
48
48
  "ora": "5.4.1",
49
49
  "parse5-html-rewriting-stream": "7.0.0",
50
- "picomatch": "4.0.1",
50
+ "picomatch": "4.0.2",
51
51
  "piscina": "4.4.0",
52
52
  "postcss": "8.4.38",
53
53
  "postcss-loader": "8.1.1",
@@ -58,14 +58,14 @@
58
58
  "semver": "7.6.0",
59
59
  "source-map-loader": "5.0.0",
60
60
  "source-map-support": "0.5.21",
61
- "terser": "5.29.2",
61
+ "terser": "5.30.2",
62
62
  "tree-kill": "1.2.2",
63
63
  "tslib": "2.6.2",
64
- "undici": "6.10.1",
65
- "vite": "5.2.6",
64
+ "undici": "6.11.1",
65
+ "vite": "5.2.7",
66
66
  "watchpack": "2.4.1",
67
67
  "webpack": "5.91.0",
68
- "webpack-dev-middleware": "7.1.1",
68
+ "webpack-dev-middleware": "7.2.1",
69
69
  "webpack-dev-server": "5.0.4",
70
70
  "webpack-merge": "5.10.0",
71
71
  "webpack-subresource-integrity": "5.1.0"
@@ -21,7 +21,6 @@ const environment_options_1 = require("../../utils/environment-options");
21
21
  const i18n_options_1 = require("../../utils/i18n-options");
22
22
  const normalize_cache_1 = require("../../utils/normalize-cache");
23
23
  const postcss_configuration_1 = require("../../utils/postcss-configuration");
24
- const tailwind_1 = require("../../utils/tailwind");
25
24
  const schema_1 = require("./schema");
26
25
  /**
27
26
  * Normalize the user provided options by creating full paths for all path based options
@@ -108,11 +107,13 @@ async function normalizeOptions(context, projectName, options, extensions) {
108
107
  loaderExtensions[extension] = value;
109
108
  }
110
109
  }
111
- const postcssConfiguration = await (0, postcss_configuration_1.loadPostcssConfiguration)(workspaceRoot, projectRoot);
110
+ // A configuration file can exist in the project or workspace root
111
+ const searchDirectories = await (0, postcss_configuration_1.generateSearchDirectories)([projectRoot, workspaceRoot]);
112
+ const postcssConfiguration = await (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirectories);
112
113
  // Skip tailwind configuration if postcss is customized
113
114
  const tailwindConfiguration = postcssConfiguration
114
115
  ? undefined
115
- : await getTailwindConfig(workspaceRoot, projectRoot, context);
116
+ : await getTailwindConfig(searchDirectories, workspaceRoot, context);
116
117
  const globalStyles = normalizeGlobalEntries(options.styles, 'styles');
117
118
  const globalScripts = normalizeGlobalEntries(options.scripts, 'scripts');
118
119
  let indexHtmlOptions;
@@ -230,13 +231,13 @@ async function normalizeOptions(context, projectName, options, extensions) {
230
231
  };
231
232
  }
232
233
  exports.normalizeOptions = normalizeOptions;
233
- async function getTailwindConfig(workspaceRoot, projectRoot, context) {
234
- const tailwindConfigurationPath = await (0, tailwind_1.findTailwindConfigurationFile)(workspaceRoot, projectRoot);
234
+ async function getTailwindConfig(searchDirectories, workspaceRoot, context) {
235
+ const tailwindConfigurationPath = (0, postcss_configuration_1.findTailwindConfiguration)(searchDirectories);
235
236
  if (!tailwindConfigurationPath) {
236
237
  return undefined;
237
238
  }
238
- // Create a node resolver at the project root as a directory
239
- const resolver = (0, node_module_1.createRequire)(projectRoot + '/');
239
+ // Create a node resolver from the configuration file
240
+ const resolver = (0, node_module_1.createRequire)(tailwindConfigurationPath);
240
241
  try {
241
242
  return {
242
243
  file: tailwindConfigurationPath,
@@ -156,7 +156,7 @@ exports.log = log;
156
156
  function startNodeServer(serverOutput, port, logger, inspectMode = false) {
157
157
  const outputPath = serverOutput.outputPath;
158
158
  const path = (0, path_1.join)(outputPath, 'main.js');
159
- const env = { ...process.env, SSR_PORT: '' + port, PORT: '' + port };
159
+ const env = { ...process.env, PORT: '' + port };
160
160
  const args = ['--enable-source-maps', `"${path}"`];
161
161
  if (inspectMode) {
162
162
  args.unshift('--inspect-brk');
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.normalizeCacheOptions = void 0;
11
11
  const node_path_1 = require("node:path");
12
12
  /** Version placeholder is replaced during the build process with actual package version */
13
- const VERSION = '18.0.0-next.1';
13
+ const VERSION = '18.0.0-next.2';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&
@@ -8,4 +8,10 @@
8
8
  export interface PostcssConfiguration {
9
9
  plugins: [name: string, options?: object | string][];
10
10
  }
11
- export declare function loadPostcssConfiguration(workspaceRoot: string, projectRoot: string): Promise<PostcssConfiguration | undefined>;
11
+ export interface SearchDirectory {
12
+ root: string;
13
+ files: Set<string>;
14
+ }
15
+ export declare function generateSearchDirectories(roots: string[]): Promise<SearchDirectory[]>;
16
+ export declare function findTailwindConfiguration(searchDirectories: SearchDirectory[]): string | undefined;
17
+ export declare function loadPostcssConfiguration(searchDirectories: SearchDirectory[]): Promise<PostcssConfiguration | undefined>;
@@ -7,16 +7,23 @@
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.loadPostcssConfiguration = void 0;
10
+ exports.loadPostcssConfiguration = exports.findTailwindConfiguration = exports.generateSearchDirectories = void 0;
11
11
  const promises_1 = require("node:fs/promises");
12
12
  const node_path_1 = require("node:path");
13
13
  const postcssConfigurationFiles = ['postcss.config.json', '.postcssrc.json'];
14
+ const tailwindConfigFiles = [
15
+ 'tailwind.config.js',
16
+ 'tailwind.config.cjs',
17
+ 'tailwind.config.mjs',
18
+ 'tailwind.config.ts',
19
+ ];
14
20
  async function generateSearchDirectories(roots) {
15
21
  return await Promise.all(roots.map((root) => (0, promises_1.readdir)(root, { withFileTypes: true }).then((entries) => ({
16
22
  root,
17
23
  files: new Set(entries.filter((entry) => entry.isFile()).map((entry) => entry.name)),
18
24
  }))));
19
25
  }
26
+ exports.generateSearchDirectories = generateSearchDirectories;
20
27
  function findFile(searchDirectories, potentialFiles) {
21
28
  for (const { root, files } of searchDirectories) {
22
29
  for (const potential of potentialFiles) {
@@ -27,14 +34,16 @@ function findFile(searchDirectories, potentialFiles) {
27
34
  }
28
35
  return undefined;
29
36
  }
37
+ function findTailwindConfiguration(searchDirectories) {
38
+ return findFile(searchDirectories, tailwindConfigFiles);
39
+ }
40
+ exports.findTailwindConfiguration = findTailwindConfiguration;
30
41
  async function readPostcssConfiguration(configurationFile) {
31
42
  const data = await (0, promises_1.readFile)(configurationFile, 'utf-8');
32
43
  const config = JSON.parse(data);
33
44
  return config;
34
45
  }
35
- async function loadPostcssConfiguration(workspaceRoot, projectRoot) {
36
- // A configuration file can exist in the project or workspace root
37
- const searchDirectories = await generateSearchDirectories([projectRoot, workspaceRoot]);
46
+ async function loadPostcssConfiguration(searchDirectories) {
38
47
  const configPath = findFile(searchDirectories, postcssConfigurationFiles);
39
48
  if (!configPath) {
40
49
  return undefined;