@angular-devkit/build-angular 14.0.0-rc.3 → 14.0.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": "14.0.0-rc.3",
3
+ "version": "14.0.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.2.0",
10
- "@angular-devkit/architect": "0.1400.0-rc.3",
11
- "@angular-devkit/build-webpack": "0.1400.0-rc.3",
12
- "@angular-devkit/core": "14.0.0-rc.3",
10
+ "@angular-devkit/architect": "0.1400.2",
11
+ "@angular-devkit/build-webpack": "0.1400.2",
12
+ "@angular-devkit/core": "14.0.2",
13
13
  "@babel/core": "7.17.10",
14
14
  "@babel/generator": "7.17.10",
15
15
  "@babel/helper-annotate-as-pure": "7.16.7",
@@ -20,7 +20,7 @@
20
20
  "@babel/runtime": "7.17.9",
21
21
  "@babel/template": "7.16.7",
22
22
  "@discoveryjs/json-ext": "0.5.7",
23
- "@ngtools/webpack": "14.0.0-rc.3",
23
+ "@ngtools/webpack": "14.0.2",
24
24
  "ansi-colors": "4.1.1",
25
25
  "babel-loader": "8.2.5",
26
26
  "babel-plugin-istanbul": "6.1.1",
@@ -73,11 +73,11 @@
73
73
  "esbuild": "0.14.38"
74
74
  },
75
75
  "peerDependencies": {
76
- "@angular/compiler-cli": "^14.0.0 || ^14.0.0-rc",
77
- "@angular/localize": "^14.0.0 || ^14.0.0-rc",
78
- "@angular/service-worker": "^14.0.0 || ^14.0.0-rc",
76
+ "@angular/compiler-cli": "^14.0.0",
77
+ "@angular/localize": "^14.0.0",
78
+ "@angular/service-worker": "^14.0.0",
79
79
  "karma": "^6.3.0",
80
- "ng-packagr": "^14.0.0 || ^14.0.0-next",
80
+ "ng-packagr": "^14.0.0",
81
81
  "protractor": "^7.0.0",
82
82
  "tailwindcss": "^2.0.0 || ^3.0.0",
83
83
  "typescript": ">=4.6.2 <4.8"
@@ -119,7 +119,7 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
119
119
  // Once TypeScript provides support for retaining dynamic imports this workaround can be dropped.
120
120
  const compilerCli = await (0, load_esm_1.loadEsmModule)('@angular/compiler-cli');
121
121
  // Temporary deep import for transformer support
122
- const { createAotTransformers, mergeTransformers, } = require('@ngtools/webpack/src/ivy/transformation');
122
+ const { mergeTransformers, replaceBootstrap, } = require('@ngtools/webpack/src/ivy/transformation');
123
123
  // Setup defines based on the values provided by the Angular compiler-cli
124
124
  (_a = (_b = build.initialOptions).define) !== null && _a !== void 0 ? _a : (_b.define = {});
125
125
  for (const [key, value] of Object.entries(compilerCli.GLOBAL_DEFS_FOR_TERSER_WITH_AOT)) {
@@ -226,7 +226,9 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
226
226
  ((_b = result.warnings) !== null && _b !== void 0 ? _b : (result.warnings = [])).push(message);
227
227
  }
228
228
  }
229
- fileEmitter = createFileEmitter(builder, mergeTransformers(angularCompiler.prepareEmit().transformers, createAotTransformers(builder, {})), () => []);
229
+ fileEmitter = createFileEmitter(builder, mergeTransformers(angularCompiler.prepareEmit().transformers, {
230
+ before: [replaceBootstrap(() => builder.getProgram().getTypeChecker())],
231
+ }), () => []);
230
232
  return result;
231
233
  });
232
234
  build.onLoad({ filter: compilerOptions.allowJs ? /\.[cm]?[jt]sx?$/ : /\.[cm]?tsx?$/ }, async (args) => {
@@ -146,12 +146,12 @@ async function configureI18nBuild(context, options) {
146
146
  if (first) {
147
147
  localeDataPath = findLocaleDataPath(first.toLowerCase(), localeResolver);
148
148
  if (localeDataPath) {
149
- context.logger.warn(`Locale data for '${locale}' cannot be found. Using locale data for '${first}'.`);
149
+ context.logger.warn(`Locale data for '${locale}' cannot be found. Using locale data for '${first}'.`);
150
150
  }
151
151
  }
152
152
  }
153
153
  if (!localeDataPath) {
154
- context.logger.warn(`Locale data for '${locale}' cannot be found. No locale data will be included for this locale.`);
154
+ context.logger.warn(`Locale data for '${locale}' cannot be found. No locale data will be included for this locale.`);
155
155
  }
156
156
  else {
157
157
  desc.dataPath = localeDataPath;
@@ -194,11 +194,8 @@ function findLocaleDataPath(locale, resolver) {
194
194
  return resolver(scrubbedLocale);
195
195
  }
196
196
  catch {
197
- if (scrubbedLocale === 'en-US') {
198
- // fallback to known existing en-US locale data as of 9.0
199
- return findLocaleDataPath('en-US-POSIX', resolver);
200
- }
201
- return null;
197
+ // fallback to known existing en-US locale data as of 14.0
198
+ return scrubbedLocale === 'en-US' ? findLocaleDataPath('en', resolver) : null;
202
199
  }
203
200
  }
204
201
  /** Remove temporary directory used for i18n processing. */
@@ -47,6 +47,7 @@ const named_chunks_plugin_1 = require("../plugins/named-chunks-plugin");
47
47
  const progress_plugin_1 = require("../plugins/progress-plugin");
48
48
  const transfer_size_plugin_1 = require("../plugins/transfer-size-plugin");
49
49
  const typescript_2 = require("../plugins/typescript");
50
+ const watch_files_logs_plugin_1 = require("../plugins/watch-files-logs-plugin");
50
51
  const helpers_1 = require("../utils/helpers");
51
52
  // eslint-disable-next-line max-lines-per-function
52
53
  async function getCommonConfig(wco) {
@@ -143,6 +144,9 @@ async function getCommonConfig(wco) {
143
144
  append: hiddenSourceMap ? false : undefined,
144
145
  }));
145
146
  }
147
+ if (verbose) {
148
+ extraPlugins.push(new watch_files_logs_plugin_1.WatchFilesLogsPlugin());
149
+ }
146
150
  if (buildOptions.statsJson) {
147
151
  extraPlugins.push(new plugins_1.JsonStatsPlugin(path.resolve(root, buildOptions.outputPath, 'stats.json')));
148
152
  }
@@ -270,7 +270,7 @@ function getWebSocketSettings(options, servePath) {
270
270
  client: undefined,
271
271
  };
272
272
  }
273
- const webSocketPath = path_1.posix.join(servePath, 'ws');
273
+ const webSocketPath = path_1.posix.join(servePath, 'ng-cli-ws');
274
274
  return {
275
275
  webSocketServer: {
276
276
  options: {
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import type { Compiler } from 'webpack';
9
+ export declare class WatchFilesLogsPlugin {
10
+ apply(compiler: Compiler): void;
11
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.WatchFilesLogsPlugin = void 0;
11
+ const PLUGIN_NAME = 'angular.watch-files-logs-plugin';
12
+ class WatchFilesLogsPlugin {
13
+ apply(compiler) {
14
+ compiler.hooks.watchRun.tap(PLUGIN_NAME, ({ modifiedFiles, removedFiles }) => {
15
+ compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
16
+ const logger = compilation.getLogger(PLUGIN_NAME);
17
+ if (modifiedFiles === null || modifiedFiles === void 0 ? void 0 : modifiedFiles.size) {
18
+ logger.log(`Modified files:\n${[...modifiedFiles].join('\n')}\n`);
19
+ }
20
+ if (removedFiles === null || removedFiles === void 0 ? void 0 : removedFiles.size) {
21
+ logger.log(`Removed files:\n${[...removedFiles].join('\n')}\n`);
22
+ }
23
+ });
24
+ });
25
+ }
26
+ }
27
+ exports.WatchFilesLogsPlugin = WatchFilesLogsPlugin;