49 Commits

Author SHA1 Message Date
Paul Gschwendtner
397ea00552 build: migrate @angular-devkit/architect/node tests to rules_js
Migrates the sub-entry point tests for architect/node to `rules_js`.
2025-01-21 18:19:11 +01:00
Paul Gschwendtner
4fee94a96c build: rename //:root_modules to //:node_modules.
This is necessary as `rules_js` requires this "common name" when dealing
with Yarn workspaces, linking first party dependencies automatically.

In the future, we may be able to send a PR to `rules_js` to support a
custom name somehow.
2025-01-15 19:20:40 +01:00
Paul Gschwendtner
a8335cf950 build: never use interop targets for ts compilations
* Removes `interop_deps` from the `ts_project` interop macro.
* Keeps `_rjs` suffix for now as we still need the interop targets for
  e.g. `jasmine_node_test` and the `rules_nodejs` linker.

In follow-ups we can remove the suffix, and interop layer.
2025-01-09 09:42:06 +01:00
Alan Agius
aa6bf07f35 fix(@angular-devkit/architect): provide better error when builder is not defined
When a builder is not defined a more actionable error message is now displayed.

Closes #29226
2025-01-06 15:19:00 +01:00
Charles Lyding
fe1ae69339 fix(@angular-devkit/architect): avoid Node.js resolution for relative builder schema
To avoid the need to perform Node.js resolution for the typical case of a relative
builder schema, a check is now performed to determine if a schema path within the
build manifest appears to be relative.
2024-12-17 16:28:37 -05:00
Paul Gschwendtner
7a0adb9ca3 build: migrate remaining angular-devkit/architect to ts_project
This completes `ts_library` to `ts_project` for the architect devkit
package.
2024-12-17 11:47:09 -05:00
dai1ooleet0aesei
2b8a02bac0 feat(@angular-devkit/architect): require build schemas from modules 2024-12-12 08:18:56 -08: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
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
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
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
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
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
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
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
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
Alan Agius
09e039500f feat(@angular-devkit/architect): include workspace extensions in project metadata 2021-10-06 08:02:22 -05: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
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
aedfcc1862 build: update to @types/node version 12 2021-02-08 14:07:24 -05:00
Charles Lyding
24b0a49a73 refactor(@angular-devkit/architect): abstract workspace access from architect
This change allows architect runtime implementations to have more control over how builder information and options for targets are found.  A workspace file (and accompanying definition class) is not necessarily needed now.  This also has benefits for unit testing by reducing the amount of potential setup needed per test.
2020-11-16 08:52:22 -05:00
Tobias Gassmann
57b80ee09c fix(@angular-devkit/architect): add name of the non-existing project to error message 2020-08-13 10:14:28 +02:00
Keen Yee Liau
fa9136a971 build: minor fixes for google3 sync
This commit makes a few minor changes to enable syncing the CLI repository
into google3.

1. mark pkg_tar and pkg_npm as external
2. remove dependencies (marked as comment) which are stale in google3
3. remove TS files generated from JSON schema in BUILD files since these
   files are compiled and added to the g3 codebase at sync time
4. Some minor typing changes
5. Remove duplicate licenses
6. mark dependencies which are not available in g3 as external
7. Immediately type the result of JSON.parse() as required by g3 linter.
   Otherwise, the type defaults to `any`.
2020-07-24 22:52:22 +02:00
Filipe Silva
b51cf8d1e6 build: use ts_library macro with common defaults 2020-04-30 15:12:46 -07:00
Filipe Silva
9a28114f6b test: remove non-bazel test setup 2020-04-30 15:12:46 -07:00
Filipe Silva
eceb5cdaa6 build: use rules_nodejs 1.6.0 features
Contains fixes related to the symlink behaviour inside of bazel. Without it, webpack needs to be configured to be aware of symlinks and preserve the paths.
2020-04-30 15:12:46 -07:00
Keen Yee Liau
e5db6a8ccd build: BUILD files formatted to have load statements at the top 2020-04-23 10:31:56 -07:00
Filipe Silva
60e92d54fb style: reformat bazel files 2020-04-07 09:07:19 -07:00
Filipe Silva
5f3f736936 build: move BUILD.bazel files for secondary entry points into own folder
Without this change, module names will be computed with incorrect paths containing duplicate path fragments (e.g. `@angular-devkit/architect/testing/testing/test-logger`).
2020-04-07 09:07:19 -07:00
Filipe Silva
aaf2d802a8 fix(@angular-devkit/architect): temporary workaround for TS bug with UMDs
The TS bug is https://github.com/microsoft/TypeScript/issues/36780.

The workaround is needed because `ts_library` emits UMDs currently. This will change with https://github.com/bazelbuild/rules_typescript/pull/492 and https://github.com/bazelbuild/rules_nodejs/pull/1687.
2020-04-07 09:07:19 -07:00
Filipe Silva
86d4385440 build: use TypeScript 3.7 2020-01-09 13:43:49 -08:00
Charles Lyding
8ffb755ef0 refactor(@angular-devkit/architect): remove usage of experimental workspace API 2019-10-25 09:53:34 -07:00
Charles Lyding
c8f8028e80 fix(@angular-devkit/architect): clone workspace objects before builder use 2019-10-25 09:53:34 -07:00
Filipe Silva
27c3650d80 feat(@angular-devkit/architect): support multiple configs in WorkspaceNodeModulesArchitectHost
Add support for parsing multiple configurations in a single string using comma as a separator.

This support is only at the host level (`WorkspaceNodeModulesArchitectHost` in this case) and does not change the underlying Architect API.

Different hosts are able to compose target options in different ways.
2019-10-14 13:40:48 -07:00
Charles Lyding
0d104c0aba feat(@angular-devkit/architect): support accessing project metadata 2019-09-24 13:18:33 -07:00
Charles
ef360dd7f8 refactor(@angular-devkit/architect): use standard node resolution methods where possible (#15622)
* refactor(@angular-devkit/architect): use standard node resolution methods where possible

* refactor(@angular-devkit/core): use standard node resolution methods where possible
2019-09-18 14:49:22 +01:00
Alan Agius
53d027837e fix(@angular-devkit/architect): error out when invalid configurations are provided
Fixes #14654
2019-06-10 13:43:39 -07:00
Charles Lyding
548fefddbd docs(@angular-devkit/architect): add comment about deprecated workspace usage 2019-05-09 10:04:57 -07:00
Charles Lyding
cbb493eb81 refactor(@angular-devkit/architect): support stable workspaces API 2019-05-07 16:24:37 -06:00
Charles Lyding
588d61e608 refactor(@angular-devkit/architect): remove temporary index2 entrypoint 2019-04-04 19:49:56 -07:00
Hans Larsen
128af102a3 feat(@angular-devkit/architect): getOptionsForTarget should return null
If the target does not exist in the workspace.
2019-03-13 13:51:22 -07:00
Hans Larsen
e2163a0bde refactor(@angular-devkit/architect): clarify some error messages
They will be redone in classes before RC, but for now this helps diagnose
obscure messages.
2019-03-13 13:51:22 -07:00
Hans Larsen
79a6988275 feat(@angular-devkit/architect): add node architect host
This host resolves using the package resolution and reading the targets
from the workspace API.
2019-02-19 13:51:29 -08:00