Paul Gschwendtner 832bfffc43 build: migrate @angular-devkit/build-angular tests to rules_js
Migrates the `@angular-devkit/build-angular` tests to `rules_js`. This
was a rather larger undertaking as the tests were very reliant on e.g.
the directory structure or specific node module layout; so some changes
were needed.

- the Sass files include a much larger file header now. That is because
  the npm Sass files have much larger paths, given being inside a
  symlinked pnpm store directory. E.g.

  ```

/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../../../../node_modules/.aspect_rules_js/css-loader@7.1.2_webpack_5.97.1/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[1]!../../../../../node_modules/.aspect_rules_js/postcss-loader@8.1.1_1462687623/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].rules[0].oneOf[0].use[2]!./src/test-style-a.css?ngGlobalStyle ***!
  \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
.test-a {color: red}
  ```

- Similarly to above, hashed chunk files can change given different
  paths of e.g. Webpack, or external sources.

- Tests for verifying the lazy module chunks may enable
  `preserveSymlinks` just to make the chunk names shorter and easier to
  verify, avoiding truncatd super long paths to the e.g. pnpm stores
  again.

- the ngsw-worker.js file cannot be copied using `copyFile` as that
  results in permissions being copied as well. In Bazel, now that
  the npm files are properly captured, are readonly, so subsequent
  builds (e.g. the watch tests) will fail to copy/override the file
  again! Reading and writing the file consistently seems appropriate.

- Tests relying on puppeteer and webdriver-manager worked in the past,
  by accident, because postinstall scripts (from e.g. puppeteer) were
  able to modify content of other packages (e.g. the puppeteer-core
  cache of browsers then). This does not work with `rules_js` anymore,
  so we need to keep the cache local to the puppeteer postinstall
  script. This requires a little trickery right now to ensure resolution
  of the browsers at runtime works..

- server tests did miss the `node` types to be explicitly listed (as
  they would be in a fresh project), and this caused failures. Likely
  because we no longer patch resolution.

- avoid npm-module style imports from tests within the same package.
  This is not allowed with `rules_js` and also is inconsistent.
2025-01-29 09:02:41 +01:00
2025-01-28 21:40:45 +01:00
2025-01-10 15:05:28 +01:00
2025-01-28 21:40:45 +01:00
2024-12-16 12:17:17 -05:00
2019-01-18 11:58:02 -08:00
2023-07-07 11:15:49 -07:00
2024-09-19 15:06:26 -04:00
2024-11-27 15:59:19 +01:00

Angular CLI - The CLI tool for Angular.


Angular CLI logo

The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold,
and maintain Angular applications directly from a command shell.

angular.dev/tools/cli

Contributing Guidelines · Submit an Issue · Blog


Documentation

Get started with Angular CLI, learn the fundamentals and explore advanced topics on our documentation website.

Development Setup

Prerequisites

Setting Up a Project

Install the Angular CLI globally:

npm install -g @angular/cli

Create workspace:

ng new [PROJECT NAME]

Run the application:

cd [PROJECT NAME]
ng serve

Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.

Quickstart

Get started in 5 minutes.

Ecosystem

angular ecosystem logos

Changelog

Learn about the latest improvements.

Upgrading

Check out our upgrade guide to find out the best way to upgrade your project.

Contributing

Contributing Guidelines

Read through our contributing guidelines to learn about our submission process, coding rules and more.

Want to Help?

Want to report a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.

Code of Conduct

Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.

Developer Guide

Read through our developer guide to learn about how to build and test the Angular CLI locally.

Community

Join the conversation and help the community.

Packages

This is a monorepo which contains many tools and packages:

Tools

Project Package Version Links
Angular Build System @angular/build latest README snapshot
Angular CLI @angular/cli latest README snapshot
Architect CLI @angular-devkit/architect-cli latest snapshot
Schematics CLI @angular-devkit/schematics-cli latest snapshot

Packages

Project Package Version Links
Angular SSR @angular/ssr latest README snapshot
Architect @angular-devkit/architect latest README snapshot
Build Angular @angular-devkit/build-angular latest README snapshot
Build Webpack @angular-devkit/build-webpack latest README snapshot
Core @angular-devkit/core latest README snapshot
Schematics @angular-devkit/schematics latest README snapshot

Misc

Project Package Version Links
Angular Create @angular/create latest README
Webpack Angular Plugin @ngtools/webpack latest snapshot

Schematics

Project Package Version Links
Angular PWA Schematics @angular/pwa latest snapshot
Angular Schematics @schematics/angular latest snapshot

Love Angular CLI? Give our repo a star ⬆️.

Description
CLI tool for Angular
Readme 234 MiB
Languages
TypeScript 95%
Starlark 2.3%
JavaScript 1.3%
HTML 1%
EJS 0.3%