149 Commits

Author SHA1 Message Date
Charles Lyding
fa9bce0e9a test: enable @typescript-eslint/no-unnecessary-type-assertion lint rule
The `@typescript-eslint/no-unnecessary-type-assertion` rule is now enabled and all failures
have been addressed within the code.
2024-06-25 16:57:03 -04:00
Charles Lyding
17e168379e build: additional fixes for tsetse rule compliance
Due to bazel rules_nodejs caching, several additional `JSON.parse` usages were not
caught in the first set of fixes. These have now been addressed. Also,
the `must-use-promises` rule has been patched to match the behavior of the
`@typescript-eslint/no-floating-promises` for consistency.
The bazel option `suppressTsconfigOverrideWarnings` was also removed from the
`tsconfig` as it is a no-op and was previously used for now removed feature.
Test files are currently excluded from the `JSON.parse` rule to avoid large
changes to test code.
2024-06-25 11:17:33 -04:00
Charles Lyding
39f946a848 build: enabled isolated modules TypeScript option
The TypeScript `isolatedModules` option is now enabled for all TypeScript
code within the repository. As a result, all packages will now be built
with the option enabled. This does not affect projects created with the CLI
and is only related to the building of the actual Angular CLI code.
The `isolatedModules` option ensures that code can be emitted without the
TypeScript typechecker and allows tools other than TypeScript to potentially
be used. Code was updated to correct all errors after the option was enabled.
Additionally, some early code fixes were done to add function and accessor
return types to prepare for future `isolatedDeclarations` usage. More changes
would be needed to consider turning on `isolatedDeclarations`, however.
2024-06-23 15:34:49 +02:00
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
57d57b4211 fix(@angular-devkit/architect): resolve builder aliases from containing package
When resolving a builder alias, the base path for the resolution will now
use the containing package. This prevents potential resolution failure due
to varying package manager installation strategies.
2024-05-02 10:00:18 -04:00
Charles Lyding
6d9a06a437 refactor(@angular-devkit/architect): allow aliasing builder names in package builder manifest
A builder's manifest definition within a package (typically `builders.json`) can now contain
a string value that will be used as a builder specifier when loading the named builder. This
allows a builder name to be aliased to another builder. The other builder may also be in
another package.
The build resolution logic has also been updated to remove use of the global `require` to
support eventual direct ESM usage.
2024-04-09 07:50:10 -04: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
Charles Lyding
8f47f1e965 feat(@angular-devkit/build-angular): provide default and abbreviated build target support for dev-server and extract-i18n
The `buildTarget` options for both the `dev-server` and `extract-i8n` builders
now have default values that reflect the recommended and new project generated
values. The defaults are as follows where `<current-project>` is the name of the project
where the `dev-server` or `extract-i18n` builder target is located:
* `dev-server` --> `<current-project>:build:development`
* `extract-i18n` --> `<current-project>:build`

Additionally, abbreviated target specifiers are now supported for these
options. This allows target specifiers such as `::production` which would expand
to `<current-project>:build:production` for either builder.
Abbreviated target specifiers are only supported for the `buildTarget` option in
the `dev-server` and `extract-i18n` builders.
2024-01-12 10:58:29 -08:00
Charles Lyding
6d8d948ad0 refactor(@angular-devkit/build-angular): cache compiled load ESM file helper
The dynamically compiled ESM import helper is now cached to prevent the need
to recompile the helper function everytime a load ESM helper call is made.
This helper is currently used to workaround dynamic import limitations with
the TypeScript compilation output. Once the build process is updated, it will
no longer be required.
2023-11-03 10:36:27 +01:00
Alan Agius
11420667f9 build: use single Node.js toolchain to run unit tests
E2E tests are used to run tests on multiple platforms and node.js versions.
2023-10-30 17:50:47 +01:00
aanchal
efeae1e1f1 docs: remove duplicate words 2023-08-04 14:49:14 -04:00
aanchal
9506d4bafa docs: fix typos 2023-08-03 14:13:50 -04:00
aanchal
b94958d419 docs: fix typo in api.ts 2023-08-03 14:11:43 -04:00
Angular Robot
367ddabed0 build: update dependency rxjs to v7.8.1 2023-04-27 10:01:39 +00:00
Charles Lyding
48871381a1 fix(@angular-devkit/architect): allow registered builder teardowns to execute
Previously, the base job handler was completing the entire job before any teardowns
could attempt to execute.
2023-04-05 09:25:37 +00: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
7f93735e98 build: use bazel to perform release builds
When performing a release via the dev-infra `ng-dev` tooling, the release
builds for the packages that will be published are now performed using bazel.
Prior to this, the release builds were performed using a custom build script
that programmatically invoked TypeScript APIs. The Bazel build and discovery
process for the releasable packages is performed by a script that is based on
the scripts from components and framework repositories. Several small modifications
were performed to match the behavior and structure of the cli repository:
* Use of `packages` as the source root in the bazel query
* Use of `pkg_npm` rule in the bazel query
* Partial transition to native Node.js `fs` APIs instead of `shelljs`
* Directory creation per package when copying output (supports multiple package scopes)
* Copying of archives (tgz) for each package

The snapshot and local build capabilities are not modified as part of this change
but will be merged in a followup as part of a larger transition to use bazel
throughout the package build process.
2023-01-05 03:21:58 +00:00
Charles Lyding
774e83df8b fix(@angular-devkit/architect): default to failure if no builder result is provided
Currently, if an architect builder does not provide any results, the CLI will crash
trying to access an error message property on the result. Instead architect will now
provide a default failure result `{ success: false }` in the event that the builder
exits prior to generating a result. Thrown errors continue to be propagated as before.
2022-11-08 09:33:18 +01: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
93adeeb798 refactor: move experimental jobs API from @angular-devkit/core to @angular-devkit/architect
With this change we move `jobs` APIs to `@angular-devkit/architect` as this are intended to used with `@angular-devkit/architect`.
2022-10-07 11:09:53 -04:00
Jason Bedard
4de9045de8 test: unit test multiple node versions in separate jobs 2022-09-14 10:43:17 -07:00
Charles Lyding
b2add316e7 build: remove unneeded BUILD file licenses rule comments 2022-09-13 10:33:49 -07:00
Charles Lyding
e402c2358c build: adjust BUILD file external comment markers
Improvements to the syncing process allow for reduced usage of the comment markers.
2022-08-31 08:37:19 -04:00
Jason Bedard
db5c1fc13c test: run tests on multiple node versions 2022-08-03 10:33:46 -07:00
Paul Gschwendtner
087ab46ca9 build: update dev-infra packages and account for build-tooling split from ng-dev
The dev-infra build tooling is now decoupled from `ng-dev`. This will
make it easier to update `ng-dev` without necessarily needing to upgrade
the whole build system, Bazel etc. This is useful when e.g. new release
tool features have been added and should also be ported to active LTS
branches.
2022-07-27 12:35:15 +02:00
Charles Lyding
ecdbe721a1 fix(@angular-devkit/architect): complete builders on the next event loop iteration
Waiting to complete the builder until the next tick allows the logging
subscription to flush and provide queued logging entries to the builder
consumer.
2022-06-29 07:58:53 -04:00
Charles Lyding
1e21440c10 build: mark external only bazel rules 2022-06-17 16:25:41 +02:00
Charles Lyding
1b9880c5cb refactor(@angular-devkit/architect): assert catch clause variable type before usage
Prepares the `@angular-devkit/architect` 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
Alan Agius
7fa3e65879 feat(@angular/cli): support TypeScript 4.6.2
BREAKING CHANGE:

Support for TypeScript 4.4 and 4.5 has been removed. Please update to TypeScript 4.6.
2022-03-10 15:36:19 -05:00
Alan Agius
5def2de1bf fix(@angular-devkit/architect): correctly handle ESM builders
Previoiusly, we didn't correctly handle ESM builders as the `import` was always downlevelled to `require` by TypeScript.
2022-01-24 20:33:21 +01:00
Derek Cormier
4721b2796c build: correctly stamp experimental packages in bazel build 2022-01-21 12:50:53 +01:00
Derek Cormier
c2737dd51a build: use placeholder version for stamping 2022-01-12 10:02:23 -08:00
Derek Cormier
4b5c52b0d8 build: perform package.json substitutions in bazel build 2022-01-10 10:25:49 -08:00
Derek Cormier
31801c1a1a build: reproduce original package structure using bazel 2021-12-10 11:06:41 +01:00
Alan Agius
09e039500f feat(@angular-devkit/architect): include workspace extensions in project metadata 2021-10-06 08:02:22 -05:00
Charles Lyding
a7de97e485 build: add Bazel ts_library rule package_name properties to all packages
rules_nodejs 4 requires that a package_name property be specified within a ts_library rule for the output to be linked into the package repository. Failing to add the property can cause test failures due to unresolved packages.
2021-08-26 07:30:44 +02:00
Charles Lyding
1cb07caddc build: transition from ts-api-guardian to dev-infra api-golden utility
The dev-infra tooling now directly provides public API change testing capabilities that leverage the `api-extractor` utility. These new testing capabilities are shared with framework and components.
`ts-api-guardian` has been removed as a dependency as a result.
2021-07-21 14:55:18 -07:00
Charles Lyding
9afe185fc6 build: enable noImplicitOverride TypeScript option
The `noImplicitOverride` TypeScript option improves code quality by ensuring that properties from base classes are not accidentally overriden.
Reference: https://www.typescriptlang.org/tsconfig#noImplicitOverride
2021-07-02 06:40:36 -04:00
Charles Lyding
b3d7080147 build: enable esModuleInterop TypeScript option
The `esModuleInterop` option is recommended to be enable by TypeScript and corrects several assumptions TypeScript would otherwise make when importing CommonJS files.
This option change helps ensure compatibility as packages move towards ESM.
Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
2021-06-13 11:45:55 -04:00
Alan Agius
e992c9a70b build: update files to be fix eslint header/header failures 2021-05-04 09:59:40 -04: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
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Charles Lyding
fc429c9204 refactor(@angular-devkit/architect): remove builder option generic json constraint
The `json.JsonObject` generic constraint did not force the options type to be a valid JSON object but required all builders to add the `json.JsonObject` type to all builder option types when calling `createBuilder`.
2021-04-02 08:09:29 +02:00
Renovate Bot
c2c9a4169c build: update rxjs to version 6.6.7 2021-03-29 08:20:35 -06: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
Renovate Bot
02db14ae95 build: update rxjs to version 6.6.6 2021-02-25 13:59:51 -05:00