14675 Commits

Author SHA1 Message Date
Alan Agius
8d5af1d5c7 fix(@angular-devkit/build-angular): ensure correct .html served with Vite dev-server
Prior to this commit, the Vite html fallback middleware failed to handle the in-memory assets generated by Angular CLI, resulting in incorrect fallback behavior. For instance, when an `index.html` existed as an asset under a specific path, the generated `index.html` would be served instead.

This fix addresses the issue, ensuring that the appropriate `.html` is served when using the Vite dev-server.

Closes #27044
2024-02-07 13:53:25 +01:00
Charles Lyding
b59f663e57 feat(@angular-devkit/build-angular): allow control of Vite-based development server prebundling
Previously, the Vite-based development server that is automatically used with the `application`
and `browser-esbuild` builders would always use prebundling if the Angular CLI caching was enabled.
The development server now has a specific `prebundle` option to allow more control over prebundling
while still allowing other forms of caching within the Angular CLI. The `prebundle` option
can be a boolean value of `true` or `false` that will enable or disable prebundling, respectively.
Additionally, the option also has an object long-form. This long-form enables prebundling and
currently contains one property named `exclude`. The `exclude` property supports cases where a
package should not be prebundled and rather should be bundled directly into the application code.
These cases are not common but can happen based on project specific requirements.
If the `prebundle` option is enabled when using the `browser` builder or any other Webpack-based
builder, it will be ignored as the Webpack-based development server does not contain such
functionality.
2024-02-06 10:45:50 -05:00
Alan Agius
5e6f1a9f43 fix(@angular-devkit/build-angular): avoid preloading server chunks
41ea985f93 (diff-239ad7beb7d8a76046cdc7b4d2263b2e05c300e3e0510916cb907e93efec5af0) introduced a regression which causes server enter-points
2024-02-06 15:55:54 +01:00
Angular Robot
ccdaed4e49 build: update all non-major dependencies 2024-02-06 08:42:54 -05:00
Angular Robot
af090b3354 build: update actions/upload-artifact action to v4.3.1 2024-02-06 08:42:26 -05:00
Angular Robot
e8ef0b122a build: lock file maintenance 2024-02-05 16:31:03 -05:00
Angular Robot
13a7d59279 build: update github/codeql-action action to v3.24.0 2024-02-05 09:25:31 -05:00
Angular Robot
34dc6a1f6e build: update angular 2024-02-02 10:28:50 -08:00
Alan Agius
7a12074dc9 feat(@angular-devkit/build-angular): provide option to allow automatically cleaning the terminal screen during rebuilds
When setting `"clearScreen": true` to the appliction builder during rebuilds the terminimal screen will be cleaned.

```json
{
  "projects": {
    "my-app": {
      "projectType": "application",
      "root": "",
      "sourceRoot": "src",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:application",
          "options": {
            "clearScreen": true
          }
        }
      }
    }
  }
}
```

Closes #25699
2024-02-02 18:00:10 +01:00
Alan Agius
1011f3185d build: update all non-major dependencies 2024-02-02 09:56:02 -05:00
Alan Agius
b654956008 test: update webpack tests filenames and size checks to pass with latest webpack
Fix CI
2024-02-02 09:14:22 +01:00
Angular Robot
5f916e7810 build: update all non-major dependencies 2024-02-01 08:31:07 -08:00
Angular Robot
0386718d4f build: update angular 2024-02-01 08:29:53 -08:00
Charles Lyding
83000bdef2 refactor(@angular-devkit/build-angular): allow internal externalPackages option to exclude packages
To support future use cases, the internal `externalPackages` application builder option now also
accepts an object form with an `exclude` array field in addition to the existing boolean value.
The `exclude` capability allows for specifying individual packages that should always be bundled
when using the external packages functionality. Currently the external packages functionality is
only used by the Vite-based development server.
2024-02-01 10:58:10 -05:00
Alan Agius
2a25e06eae fix(@angular-devkit/build-angular): allow ./ baseHref when using vite based server
Since this change 4b3a965429
A warning is displayed when using `./` as a base href
```
(!) invalid "base" option: ".". The value can only be an absolute URL, "./", or an empty string.
```
2024-02-01 16:37:53 +01:00
Alan Agius
d5a35d7108 refactor(@angular-devkit/build-angular): remove casting since setSourceMapsEnabled is in typings now
Remove redundant casting.
2024-02-01 16:37:41 +01:00
Doug Parker
492b36d799 release: cut the v17.2.0-next.1 release 17.2.0-next.1 2024-01-31 15:28:27 -08:00
Doug Parker
49a5674b91 docs: release notes for the v17.1.2 release 2024-01-31 13:58:26 -08:00
Angular Robot
26424818de build: update dependency css-loader to v6.10.0 2024-01-31 10:04:49 -08:00
Angular Robot
20c46561af build: update angular 2024-01-31 10:04:19 -08:00
Angular Robot
6f5066dec9 build: lock file maintenance 2024-01-31 09:57:52 -08:00
Alan Agius
f4f535653a feat(@angular-devkit/build-angular): add JSON build logs when using the application builder
This change implements the capability to display JSON build logs in the terminal instead of a format readable by humans. This is particularly useful for hosting providers, as it allows them to effortlessly access the necessary information without having to parse the JSON configuration.

To enable this output, set the `NG_BUILD_LOGS_JSON=1` environment variable. Additionally, warnings, errors, and logs are automatically colorized when the standard output is a WritableStream. You can disable the colors by using the `FORCE_COLOR=0` environment variable.

```
FORCE_COLOR=0 NG_BUILD_LOGS_JSON=1 ng b
{
  "errors": [],
  "warnings": [],
  "outputPaths": {
    "root": "file:///usr/local/test/home//test-project/dist/test-project",
    "browser": "file:///usr/local/test/home//test-project/dist/test-project/browser",
    "server": "file:///usr/local/test/home//test-project/dist/test-project/server"
  },
  "prerenderedRoutes": [
    "/"
  ]
}
```

```
NG_BUILD_LOGS_JSON=1 ng b
{
  "errors": [],
  "warnings": [],
  "outputPaths": {
    "root": "file:///usr/local/test/home//test-project/dist/test-project",
    "browser": "file:///usr/local/test/home//test-project/dist/test-project/browser",
    "server": "file:///usr/local/test/home//test-project/dist/test-project/server"
  },
  "prerenderedRoutes": [
    "/"
  ]
}
```
2024-01-31 17:51:15 +01:00
Alan Agius
476a68daa9 fix(@angular-devkit/build-angular): add output location in build stats
This can be used by users to determine where the output path is located without needing to read the angular.json.
2024-01-31 17:51:15 +01:00
Charles Lyding
7c522aa874 feat(@angular-devkit/build-angular): support using custom postcss configuration with application builder
When using the `application` builder, the usage of a custom postcss configuration is now supported.
The builder will automatically detect and use specific postcss configuration files if present in
either the project root directory or the workspace root. Files present in the project root will have
priority over a workspace root file. If using a custom postcss configuration file, the automatic
tailwind integration will be disabled. To use both a custom postcss configuration and tailwind, the
tailwind setup must be included in the custom postcss configuration file.

The configuration files must be JSON and named one of the following:
* `postcss.config.json`
* `.postcssrc.json`

A configuration file can use either an array form or an object form to setup plugins.
An example of the array form:
```
{
    "plugins": [
        "tailwindcss",
        ["rtlcss", { "useCalc": true }]
    ]
}
```

The same in an object form:
```
{
    "plugins": {
        "tailwindcss": {},
        "rtlcss": { "useCalc": true }
    }
}
```

NOTE: Using a custom postcss configuration may result in reduced build and rebuild
performance. Postcss will be used to process all global and component stylesheets
when a custom configuration is present. Without a custom postcss configuration,
postcss is only used for a stylesheet when tailwind is enabled and the stylesheet
requires tailwind processing.
2024-01-31 17:51:03 +01:00
Alan Agius
944cbcdb1a fix(@angular-devkit/build-angular): limit the number of lazy chunks visible in the stats table
Prior to this change in the stats table we listed all the lazy chunk, in some cases this could be hundreds of files.

With this change, we limit the number of files listed. To display all entire list of files users would need to use the `--verbose` flag.
2024-01-30 21:05:35 +01:00
Alan Agius
41ea985f93 fix(@angular-devkit/build-angular): display server bundles in build stats
This commit adds server bundle information to the build logs

Closes #25855
2024-01-30 21:05:35 +01:00
Angular Robot
45820d2a17 build: update all non-major dependencies 2024-01-30 09:07:55 -08:00
Angular Robot
080fef4548 build: update angular 2024-01-30 09:07:02 -08:00
Angular Robot
8515c6bb54 build: update all non-major dependencies 2024-01-29 15:27:28 -08:00
Angular Robot
12f8e3d563 build: update github/codeql-action action to v3.23.2 2024-01-29 15:27:03 -08:00
Angular Robot
c9e23eedb9 build: update angular 2024-01-29 15:26:47 -08:00
Charles Lyding
dda3d27aff refactor(@angular-devkit/build-angular): remove babel core runtime imports from elide-angular-metadata build optimizer pass
The `elide-angular-metadata` build optimization pass have been cleaned up
and restructured to remove the need for a direct runtime dependency on `@babel/core`.
2024-01-29 15:26:32 -08:00
Charles Lyding
b9ec9ee688 refactor(@angular-devkit/build-angular): remove babel core runtime imports from pure-toplevel-functions build optimizer pass
The `pure-toplevel-functions` build optimization pass have been cleaned up
and restructured to remove the need for a direct runtime dependency on `@babel/core`.
2024-01-29 15:26:17 -08:00
Alan Agius
6a4d733dda refactor(@schematics/angular): remove private /components API
Last usages of this API has been removed in https://github.com/angular/components/pull/28424
2024-01-26 22:15:06 +01:00
Alan Agius
822e7a482d fix(@angular-devkit/build-angular): handle regular expressions in proxy config when using Vite
This commit enables proxies to have a RegExp as context when using Vite. See: https://vitejs.dev/config/server-options#server-proxy

Closes #26970
2024-01-26 16:46:30 +01:00
Alan Agius
09c6f5f80b refactor(@angular-devkit/build-angular): remove dependency on text-table
Removes `text-table` from dependencies
2024-01-26 16:45:35 +01:00
Alan Agius
dbd3984f24 fix(@angular-devkit/build-angular): correctly handle glob negation in proxy config when using vite
This commit fixes an issue were negated globs in proxy config were not process correctly when using vite.

Closes #26970
2024-01-26 16:21:08 +01:00
Alan Agius
37ffa5e4a0 fix(@angular-devkit/build-angular): resolve absolute output-path when using esbuild based builders
Prior to this change using an absolute path as a `output-path` resulted in the path to be combined with the workspace root instead of resolved which caused the output to be emitted in the incorrect directory or error in Windows.

Closes #26935
2024-01-26 15:39:21 +01:00
Charles Lyding
910531a3c8 refactor: remove outdated namespace syntax usage
The `namespace` TypeScript usage within the CLI has been removed. This
syntax is not recommended outside of type definition files.
2024-01-26 08:55:53 +01:00
Angular Robot
760328c4a1 build: update all non-major dependencies 2024-01-26 08:55:23 +01:00
Charles Lyding
cd08b55ac6 refactor(@angular-devkit/core): remove single usage of const enum
const enums complicate the potential use of the TypeScript isolatedModules option.
2024-01-25 18:46:41 +01:00
Alan Agius
03e1aa7904 feat(@schematics/angular): add support to bun package manager
This commit adds support to use `bun` as a package manager.

Closes #26837
2024-01-25 18:02:35 +01:00
Alan Agius
600498f2cd feat(@angular/create): add support to bun package manager
This commit adds support to use `bun` as a package manager.

Closes #26837
2024-01-25 18:02:35 +01:00
Alan Agius
b3e206741c feat(@angular/cli): add support to bun package manager
This commit adds support to use `bun` as a package manager.

Closes #26837
2024-01-25 18:02:35 +01:00
Alan Agius
bac79d4000 refactor(@angular-devkit/build-angular): increase type safety in bundle-context
Currently the `result` variable will be set to `any` which caused a large part of this file not to be safely typed.
2024-01-25 15:58:10 +01:00
Alan Agius
479b67fedd refactor(@angular-devkit/build-angular): disable SW and index generation during i18n extraction
This commit disables index and service worker generation when using the i18n extraction together with the esbuild builders.
2024-01-25 15:57:57 +01:00
Alan Agius
d6aea27dbc fix(@angular-devkit/build-angular): add required modules as externals imports
Prior to this change any module which was used using `require` was not listed as an external.

Closes #26833
2024-01-25 15:43:23 +01:00
cexbrayat
9f58f0b1a1 refactor: simplify husky setup
husky v9 simplified its setup, see `How to migrate` in https://github.com/typicode/husky/releases/tag/v9.0.1
2024-01-25 15:38:32 +01:00
Angular Robot
711dbe419d build: update angular 2024-01-25 14:34:51 +01:00
Alan Agius
7717dba907 docs: remove ngx-deploy-npm from missing deploy targets
This package will no longer support Angular CLI workspaces in the next major version. Instead they will soley support NX.

See: https://dev.to/dianjuar/whats-coming-to-ngx-deploy-npm-v8-23gn and https://github.com/angular/angular/pull/53999
2024-01-25 13:51:54 +01:00