angular/aio/tools
George Kalpakas 89b5248e85 test(docs-infra): ensure examples are split correctly across shards (#46005)
Previously, the examples were split across shards based on the order in
which `globby()` returned them. This was based on the assumption that
`globby()`/the OS would list files in a deterministic order. However, it
turns out that examples can be listed in different orders between
executions, leading in them not being split correctly across shards on
CI (which further means that some examples may be tested multiple times
and others may not be tested at all).
You can see an example [here][1], where the `getting-started` example is
tested in both the 4th and 5th shards.

This commit fixes this by explicitly sorting the examples based on their
path.

[1]: https://circleci.com/gh/angular/angular/1165448

PR Close #46005
2022-05-16 09:35:42 -07:00
..
cli-patches docs(docs-infra): apply the one-sentence-per-line rule to Markdown files in aio/tools/ (#38992) 2020-09-30 09:20:00 -04:00
example-zipper refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
examples test(docs-infra): ensure examples are split correctly across shards (#46005) 2022-05-16 09:35:42 -07:00
firebase-test-utils build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
ng-packages-installer refactor(docs-infra): introduce max-len 120 eslint rule (#43439) 2021-09-15 10:47:35 -07:00
stackblitz-builder refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
transforms build: clean up references to old master branch (#45856) 2022-05-04 16:23:33 -07:00
README.md build(docs-infra): switch the example-e2e script to ESM (#42921) 2021-07-23 10:37:35 -07:00

AIO project tooling

This document gives an overview of the tools that we use to generate the content for the angular.io website.

The application that actually renders this content can be found in the /aio/src folder. The handwritten content can be found in the /aio/content folder.

Each subfolder in this /aio/tools/ folder contains a self-contained tool and its configuration. There is a README.md file in each folder that describes the tool in more detail.

cli-patches

The AIO application is built using the Angular CLI tool. We are often trialling new features for the CLI, which we apply to the library after it is installed. This folder contains git patch files that contain these new features and a utility to apply those patches to the CLI library.

See the README.md for more details.

examples

Many of the documentation pages contain snippets of code examples. We extract these snippets from real working example applications, which are stored in subfolders of the /aio/content/examples folder. Each example can be built and run independently. Each example also provides e2e specs, which are run as part of our CI build tasks, to verify that the examples continue to work as expected, as changes are made to the core Angular libraries.

In order to build, run and test these examples independently we need to install dependencies into their sub-folder. Also there are a number of common boilerplate files that are needed to configure each example's project. We maintain these common boilerplate files centrally to reduce the amount of effort if one of them needs to change.

This examples tool folder contains three utilities:

  • example-boilerplate.js - install/remove the npm dependencies and boilerplate files into/from each of the examples' subfolders.
  • run-example-e2e.mjs - run the e2e tests for one or more examples
  • create-example.js - create a new example from the example-scaffold/ directory or by importing files from a CLI project.

See the README.md for more details.

example-zipper

In the AIO application, we offer the reader the option to download each example as a full self-contained runnable project packaged as a zip file. These zip files are generated by the utility in this folder.

See the README.md for more details.

stackblitz-builder

In the AIO application, we can embed a running version of the example as a Stackblitz session. We can also provide a link to create a runnable version of the example in the Stackblitz editor.

See the README.md for more details.

transforms

All the content that is rendered by the AIO application, and some of its configuration files, are generated from source files by Dgeni. Dgeni is a general purpose documentation generation tool.

Markdown files in /aio/content, code comments in the core Angular source files and example files are processed and transformed into files that are consumed by the AIO application.

Dgeni is configured by "packages", which contain services and processors. Some of these packages are installed as node_modules from the dgeni-packages and some are specific to the AIO project.

The project specific packages are stored in the aio/tools/transforms folder. See the README.md for more details.