26 Commits

Author SHA1 Message Date
Ash Ramirez
434a3740f0 refactor(@angular/cli): update aio links -> adev links
Updates for all angular.io links to the new angular.dev domain. Additionally, adjustment to new resources where the equivalent does not exist on the new site (e.g. Tour of Heroes tutorial)
2024-06-06 11:12:06 +02:00
Charles Lyding
631303664e test: move builder testing infrastructure to separate bazel target module
The builder testing infrastructure and harness has been moved out of the
`@angular-devkit/build-angular` package and into a separate bazel only
module.  This allows the testing code to be shared with other packages
within the repository. It also removes test only code from within
the package that is not specific any of the included builders.
2024-04-17 10:23:50 +02:00
Charles Lyding
f18076a88c test(@angular-devkit/build-angular): add support for builder harness directory expectations
When using the builder harness in unit tests, expectations can now be made directly for
directories. Currently the existence, or lack thereof, can be tested using the harness.
This is similar to be existing file expectations. More capability may be added as needed
in the future.
2023-12-11 10:29:46 +01:00
Alan Agius
6d89c18807 test(@angular-devkit/build-angular): expand unit tests dev-server suite to include vite
This commit updates the dev-server unit test suit to run tests using vite
2023-11-08 16:46:14 +01:00
Charles Lyding
9c4a6be2d1 refactor(@angular-devkit/build-angular): improve accuracy of programmatic watch mode usage for esbuild builders
To better capture file changes after the initial build for the esbuild-based builders in a programmatic usage,
the file watching initialization has been moved to before the first build results are yielded. This allows tests
that execute code to change files with improved accuracy of the watch mode triggering. The application builder
now also supports aborting the watch mode programmatically. This allows tests to gracefully stop the watch mode
and more fully cleanup the test at completion.
2023-10-04 09:49:50 -04:00
Alan Agius
466d86dc8d refactor(@angular-devkit/build-angular): update code base structure to facilitate future builders
This commit updates the code base structure in preparation for future works.
2023-06-09 16:02:14 +02:00
Alan Agius
8095268fa4 build: update to rxjs 7
G3 is now using RXJS version 7 which makes it possible for the CLI to also be updated to RXJS 7.

NB: this change does not remove all usages of the deprecated APIs.

Closes #24371
2023-02-16 14:59:40 +00:00
Alan Agius
f6624b974f feat(@angular-devkit/core): update SchemaRegistry compile to return Promise
Use promise based methods to reduce RXJS usage and boiler-platting.

BREAKING CHANGE: Several changes to the `SchemaRegistry`.
- `compile` method now returns a `Promise`.
- Deprecated `flatten` has been removed without replacement.
2023-02-15 21:03:30 +00:00
Charles Lyding
64d8c473be test(@angular-devkit/build-angular): reduce harness usage of deprecated TestProjectHost
The Builder test harness previously used the deprecated `TestProjectHost` to perform a
variety of file operations during builder unit tests. However, the `TestProjectHost` is
deprecated and uses several layers of rxjs to perform the file operations. The test harness
now uses the Node.js `fs` builtin to directly perform the file operations. This removes several
layers of indirection between the harness and the actual underlying file operations. The removal
of the rxjs operation chaining also reduces stack traces and makes debugging test issues less
complicated.
2023-02-07 19:29:25 +00:00
Alan Agius
c969152de6 refactor: remove analytics API from core and architect
All analytics is now in the @angular/cli package

BREAKING CHANGE: analytics APIs have been removed without replacement from `@angular-devkit/core` and `@angular-devkit/architect`.
2022-10-11 18:52:30 +02:00
Alan Agius
88701115c6 fix(@angular-devkit/build-angular): don't override base-href in HTML when it's not set in builder
With this change we fix a regression were we  set the base-href to `/` when the browser builder `baseHref` option is not set.

Closes #23475
2022-06-30 09:07:00 -04:00
Alan Agius
43f495d57b fix(@angular-devkit/build-angular): set base-href in service worker manifest when using i18n and app-shell
Previously, the base href was not set when using the app-shell builder and i18n.

Closes #22389
2022-06-28 16:33:17 -04:00
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
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
Charles Lyding
5dba8a22b1 test(@angular-devkit/build-angular): disable Webpack caching during harness-based unit tests
The default set of metadata fields provided to all builders executed via the BuilderHarness is controlled programmatically. The BuilderHarness is eventually intended to operate in-memory and without file system access unlike the legacy unit tests. The `cli.cache.enabled` option must therefore be set within the BuilderHarness initialization code. `cli.cache.enabled` set to false provides improved test isolation guarantees by disabling Webpack’s caching.
2021-10-07 17:33:14 +02:00
Alan Agius
0346d6953e refactor: move testy-utils under testing folder
This is so that it is easier to exlude this when globbing.
2021-07-30 12:43:18 +01:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
2021-05-03 07:31:02 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Alan Agius
1da359ac08 feat(@angular-devkit/architect): add implementation for defaultConfiguration
With this change, the architect can be configured to use a default configuration when it's not provided as part of the target.

Consider the below, where `defaultConfiguration` is configured to `production`. Running `ng build` will be invoked with "production" configuration.

```js
"build": {
  "builder": "@angular-devkit/build-angular:browser",
  "defaultConfiguration": "production",
  "options": {
      ...
  },
  "configurations": {
    "production": {
        ...
    }
  }
}
```
2021-03-08 08:45:54 -06:00
Alan Agius
54f44bc49a test(@angular-devkit/build-angular): move output-hashing test to new test harness 2021-01-28 09:35:31 +01:00
Alan Agius
5e2e392241 test(@angular-devkit/build-angular): add appendToFile helper to build harness 2021-01-11 19:15:57 +01:00
Charles Lyding
bec3bec3b2 test(@angular-devkit/build-angular): integrate custom file watching into harness
This change integrates the recently introduced internal custom file watching support into the builder test harness.  This allows the test harness to directly trigger file changes and allows more comprehensive test isolation for builder watch scenarios.
2021-01-05 11:02:57 +00:00
Charles Lyding
f4dfc0b954 test(@angular-devkit/build-angular): simplify usage of content/size Jasmine helpers
This change removes the need to perform an existence check prior to expecting a file's content or size in harness based builder tests.
2021-01-05 11:02:30 +00:00
Charles Lyding
bfd91096be test(@angular-devkit/build-angular): add harness file jasmine helpers
This change adds an `expectFile` jasmine helper function that reduces the amount of code necessary to check a file's existence, size, or content.  Additional contextual information is also displayed when an expectation fails.
2020-12-18 10:37:26 +01:00
Charles Lyding
bcac38331e test(@angular-devkit/build-angular): add builder test harness 2020-12-18 10:37:26 +01:00