2449 Commits

Author SHA1 Message Date
Charles Lyding
7431d1c256 refactor(@angular-devkit/build-angular): assert catch clause variable type before usage
Prepares the `@angular-devkit/build-angular` package for the eventual change of enabling the
TypeScript `useUnknownInCatchVariables` option. This option provides additional
code safety by ensuring that the catch clause variable is the proper type before
attempting to access its properties. Similar changes will be needed in the other
packages in the repository prior to enabling `useUnknownInCatchVariables`.
2022-06-14 11:28:21 +02:00
Renovate Bot
aa5ff8d860 build: update dependency source-map-loader to v4 2022-06-13 09:43:29 +02:00
Alan Agius
1f66edebcc fix(@angular-devkit/build-angular): replace fallback locale for en-US
Pre version 14, the locale for `en-US` was `en-US-POSIX`. now in version 14, this has changed to `en-US`.

List of all available locales 7033ea9b03/cldr-json/cldr-core/availableLocales.json (L64)

Closes #23334
2022-06-09 10:41:27 -04:00
Alan Agius
f0a0b08457 fix(@angular-devkit/build-angular): log modified and removed files when using the verbose option
With this change we print out the modified and removed files when running a build in verbose mode. This can be useful to debug builds that rebuilds multiple times without an apparent file change.
2022-06-08 12:10:56 -04:00
Renovate Bot
45b6954174 build: update angular 2022-06-03 15:15:13 -04:00
Renovate Bot
450074ff69 build: update all non-major dependencies 2022-06-03 14:54:21 -04:00
Charles Lyding
08bc86706a refactor(@angular-devkit/build-angular): remove unneeded TypeScript transforms with esbuild
Only the `replaceBootstrap` TypeScript transform is needed with the `browser-esbuild` builder.
The `replaceBootstrap` transform converts the default generated JIT bootstrap call into an AOT
bootstrap call within an application. The other transforms were used to remove the development
and JIT related metadata from the AOT compiler generated code. However, with the esbuild based
build pipeline, these will be automatically removed without the need for additional transforms
via the earlier usage of the `ngJitMode` and `ngDevMode` defines.
2022-06-03 14:51:05 -04:00
Alan Agius
9301699f7a fix(@angular-devkit/build-angular): replace dev-server socket path from /ws to /ng-cli-ws
In some cases `/ws` caused conflicts with local websocket connections. Hence we change the dev-server web socket path to something more specific to the Angular CLI.

Closes #23260
2022-06-02 13:01:28 -07:00
Renovate Bot
807444897f build: update all non-major dependencies 2022-06-01 08:44:38 -07:00
Alan Agius
ee2e75610b fix(@angular-devkit/build-angular): detect tailwind.config.cjs as valid tailwindcss configuration
`tailwind.config.cjs` is a valid tailwindcss configuration file as it's listed in 8845d112fb/src/util/resolveConfigPath.js (L46-L52) as such we should also take this filename into consideration.

Closes #23236
2022-05-27 14:08:47 -04:00
Renovate Bot
fb6ba6748c build: update all non-major dependencies 2022-05-26 11:39:17 -07:00
Charles Lyding
cba5f6c1bb fix(@angular-devkit/build-angular): add es2015 exports package condition to browser-esbuild
The `es2015` exports package condition is used by `rxjs` to allow bundlers to use the ES2015-based
ESM code instead of the default of ES5-based ESM code. The ES5-based ESM code is larger in size
and harder to optimize due to the downlevelled classes. This change results in a ~5Kb size reduction
for the main bundle of a new application (129920 -> 124183).
2022-05-26 11:37:06 -07:00
Renovate Bot
10077bec2c build: update dependency sass-loader to v13 2022-05-24 12:33:45 -07:00
Alan Agius
cd2250fe23 fix(@angular-devkit/build-angular): downlevel libraries based on the browserslist configurations
There is no standard for library authors to ship their library in different ES versions, which can result in vendor libraries to ship ES features which are not supported by one or more browsers that the user's application supports.

With this change, we will be downlevelling libraries based on the list of supported browsers which is configured in the browserslist configuration. Previously, we only downlevelled libraries when targeting ES5.

The TypeScript target option will not effect how the libraries get downlevelled.

Closes #23126
2022-05-24 10:02:17 -07:00
Renovate Bot
790a1711bf build: update all non-major dependencies 2022-05-24 09:59:55 -07:00
Alan Agius
432599515d fix(@angular-devkit/build-angular): better handle Windows paths in esbuild experimental builder
With this change we handle several esbuild path issues in Windows.

Closes #23154
2022-05-24 09:57:43 -07:00
Renovate Bot
a7d97c2698 build: update dependency stylus-loader to v7 2022-05-23 10:12:07 -07:00
Alan Agius
076b601c23 fix(@angular-devkit/build-angular): close dev-server on error
When running protractor, previously we didn't close the dev-server correctly when there was an error which caused the process to keep running following https://github.com/angular/angular-cli/pull/23166
2022-05-23 10:09:39 -07:00
Alan Agius
6cbb9413d0 fix(@angular-devkit/build-angular): add debugging and timing information in JavaScript and CSS optimization plugins
This can be useful to debug slow builds.

Example of output
```
LOG from build-angular.JavaScriptOptimizerPlugin
<t> optimize asset: runtime.ad5c30339e926c89.js: 221.959564 ms
<t> optimize asset: polyfills.ec3ffae5bac27204.js: 1071.080092 ms
<t> optimize asset: main.aa8a15155ca2133f.js: 3391.588635 ms
<t> optimize js assets: 3483.799739 ms

LOG from build-angular.CssOptimizerPlugin
<t> optimize asset: styles.d251c5bf54715558.css: 26.569907 ms
<t> optimize css assets: 34.441737 ms
```

```
LOG from build-angular.JavaScriptOptimizerPlugin
<i> polyfills.ec3ffae5bac27204.js restored from cache.
<i> runtime.ad5c30339e926c89.js restored from cache.
<t> optimize asset: main.69fb55a243b46bfa.js: 2618.5191210000003 ms
<t> optimize js assets: 2721.226144 ms

LOG from build-angular.CssOptimizerPlugin
<i> styles.d251c5bf54715558.css restored from cache.
<t> optimize css assets: 12.149169 ms
```
2022-05-20 11:40:36 -07:00
Renovate Bot
1140d73e15 build: update dependency postcss-loader to v7 2022-05-20 11:20:58 -07:00
Renovate Bot
688e32cd3d build: update dependency sass to v1.52.0 2022-05-20 11:20:41 -07:00
Renovate Bot
469d9ec246 build: update dependency copy-webpack-plugin to v11 2022-05-20 11:20:27 -07:00
Renovate Bot
92d365b879 build: update dependency less-loader to v11 2022-05-19 15:02:39 -07:00
Renovate Bot
0fc1c33a7c build: update all non-major dependencies 2022-05-19 15:00:48 -07:00
Alan Agius
b71608195b fix(@angular-devkit/build-angular): close compiler on Karma exit
The webpack compiler was never closed which caused Webpack's shutdown hook c71832f3a9/packages/angular_devkit/build_angular/src/webpack/configs/styles.ts (L113-L114) to never be called and in turn caused the Sass workers never to be termined.
2022-05-18 12:46:05 -04:00
Charles Lyding
b867714c3d build: update peer dependencies to support unreleased 14.1.x prerelease snapshots 2022-05-18 09:36:39 -04:00
Renovate Bot
9fd042dcce build: update all non-major dependencies 2022-05-16 09:13:32 -04:00
Renovate Bot
4be7cdce82 build: update all non-major dependencies 2022-05-12 09:43:13 -04:00
Renovate Bot
73bda262c0 build: update all non-major dependencies 2022-05-10 12:14:33 -07:00
Renovate Bot
70e6c863f6 build: update all non-major dependencies 2022-05-09 10:43:47 -07:00
Kristiyan Kostadinov
0301cf6c10 build: prepare TypeScript 4.7
Expands the version range to allow TypeScript 4.7 and makes the necessary code changes in order to support it.
2022-05-06 15:51:02 -07:00
alkavats1
d52697047a refactor: refactored the code and removed the code smells
refactored the code and removed the code smells
2022-05-06 11:11:13 -07:00
Charles Lyding
5a6f621f86 build: update @angular/localize import to use non-private entry
The `ɵParsedTranslation` type is now exported from the root entry point and can be used without the `private` deep import.
2022-05-06 11:00:55 -07:00
Charles Lyding
0e4e490448 build(@angular-devkit/build-angular): add missing @babel/generator dep to BUILD file 2022-05-04 10:13:18 -07:00
Paul Gschwendtner
156f15e47f build: cleanup references to old master branch
Cleans up all referneces to the old `master` branch.
2022-05-04 09:55:54 -07:00
Renovate Bot
158424fbdc build: update all non-major dependencies 2022-04-29 09:31:05 -07:00
Charles Lyding
7abe212c65 fix(@angular-devkit/build-angular): correctly resolve custom service worker configuration file
Paths within the `angular.json` file should be relative to the location of the `angular.json` file.
The `ngswConfigPath` option was incorrectly using the current working directory for a base path when
a relative configuration path was specified. Most of the time this would work as a build command usually
is executed from the root of the workspace. However, this may not always be the case and for those cases
the actual workspace root is now used to resolve the full path for the service worker configuration file.
2022-04-27 13:45:42 -04:00
Charles Lyding
00186fb93f feat(@angular-devkit/build-angular): add initial experimental esbuild-based application browser builder
An experimental browser application builder (`browser-esbuild`) has been introduced that leverages esbuild as the bundler.
This new builder is compatible with options of the current browser application builder (`browser`) and can be enabled
for experimentation purposes by replacing the `builder` field of `@angular-devkit/build-angular:browser` from an existing
project to `@angular-devkit/build-angular:browser-esbuild`. The builder will generate an ESM-based application and
provides support for ES2015+ compatible output with ES2020 as the default.

This builder is considered experimental and is not recommended for production applications.

Currently not all `browser` builder options and capabilities are supported with this experimental builder.
Additional support for these options may be added in the future.
The following options and capabilities are not currently supported:
* Stylesheet Preprocessors (only CSS styles are supported)
* Angular JIT mode (only AOT is supported)
* Localization [`localize`]
* Watch and dev-server modes [`watch`, `poll`, etc.]
* File replacements [`fileReplacements`]
* License text extraction [`extractLicenses`]
* Bundle budgets [`budgets`]
* Global scripts [`scripts`]
* Build stats JSON output [`statsJson`]
* Deploy URL [`deployURL`]
* CommonJS module warnings (no warnings will be generated for CommonJS package usage)
* Web Workers
* Service workers [`serviceWorker`, `ngswConfigPath`]
2022-04-22 20:45:54 -04:00
Renovate Bot
d6ecb66f32 build: update all non-major dependencies 2022-04-20 11:19:24 -04:00
Charles Lyding
1a160dac00 fix(@angular-devkit/build-angular): ensure karma sourcemap support on Windows
The `glob`-based check when adding the sourcemap support packages to the karma setup was incorrectly
skipping the files due to Windows pathing issues. The `glob`-based check, however, is unneeded due
to the already present `require.resolve` checks for the sourcemap support packages which will
throw if the packages are not present.
2022-04-16 07:42:20 +02:00
Renovate Bot
41982aa286 build: update all non-major dependencies 2022-04-15 09:42:16 +02:00
Alan Agius
d270258dcd build: update dependency glob to v8 2022-04-14 16:50:08 +02:00
Renovate Bot
95954bba04 build: update all non-major dependencies 2022-04-12 10:37:05 -07:00
Alan Agius
be2b268c36 fix(@angular-devkit/build-angular): display debug logs when using the --verbose option
Webpack doesn't display debug logs when setting the log level to verbose.

See: https://webpack.js.org/configuration/other-options/#debug and https://webpack.js.org/configuration/other-options/#level
2022-04-11 11:47:09 -07:00
Renovate Bot
78b3537731 build: update all non-major dependencies 2022-04-08 10:10:14 -07:00
Renovate Bot
4b05c44d4f build: update all non-major dependencies 2022-04-06 13:00:39 -04:00
Renovate Bot
5ebfe805ae build: update all non-major dependencies 2022-04-04 10:04:28 -04:00
Charles Lyding
b8e9e09a51 refactor(@angular-devkit/build-angular): replace most custom path normalize usage with Node.js builtins
During the build initialization phase, many paths are converted back and forth between multiple normalized forms. These conversions involve potentially expensive string operations. The majority of the custom path `normalize` function from `@angular-devkit/core` usages have now been removed in favor of the Node.js builtin path functions. This change reduces the need to perform additional string manipulation where possible.
2022-03-31 17:00:58 -04:00
Renovate Bot
dcc00f4e22 build: update all non-major dependencies 2022-03-31 16:32:49 -04:00
Alan Agius
5922649380 refactor(@angular-devkit/build-angular): replace try/catch block with catch
Since this is a promise the try/catch block will not catch promise rejections which was the reason for the try/catch block.
2022-03-30 20:45:35 +02:00