Commit Graph

4491 Commits

Author SHA1 Message Date
George Kalpakas 2076bde100 build(docs-infra): take disambiguated doc paths into account when generating the sitemap (#41842)
In ##41788, the `disambiguateDocsPathsProcessor` was introduced to fix
an issue with case-insensitively equal paths. This processor may alter
the paths of some docs and thus their final URL in the app.

Previously, both the `disambiguateDocPathsProcessor` and the
`createSitemap` processor (which relies on the docs' computed paths to
generate the sitemap file) were configured to run before the
"rendering-docs" phase. However, this resulted in the
`disambiguateDocPathsProcessor`'s running after `createSitemap`, which
meant that the sitemap did not include the updated doc paths.

This commit fixes it by ensuring that the
`disambiguateDocPathsProcessor` is explicitly run before the
`createSitemap` processor, so that the latter will be able to take into
account any changes made by the former.

PR Close #41842
2021-04-27 14:05:23 -07:00
George Kalpakas 1aee5a79c6 test(docs-infra): make it easier to identify the failing URL in `testFirebaseRedirection.spec.ts` (#41842)
This commit includes the URL under test in the test description in
`testFirebaseRedirection.spec.ts` to make it easier to identify the
affected URL when a test fails.

It also avoids unnecessarily creating multiple `FirebaseRedirector`
instances by sharing instances between tests.

PR Close #41842
2021-04-27 14:05:23 -07:00
George Kalpakas d1f5a9e44b test(docs-infra): update `firebase-test-utils` to support regex-based redirects (#41842)
This commit updates the utilities in `firebase-test-utils/` to also
support testing Firebase redirects that are configured using regular
expressions (via the `regex` property).
See the [Firebase docs][1] for more details.

[1]: https://firebase.google.com/docs/hosting/full-config#redirects

PR Close #41842
2021-04-27 14:05:23 -07:00
George Kalpakas ae1ce5f9c7 refactor(docs-infra): prepare `firebase-test-utils` for accepting regex-based redirects (#41842)
Currently, the utilities for testing Firebase redirects assume that the
redirects are configured using the glob-based `source` property.
However, Firebase also supports configuring redirects using regular
expressions (via the `regex` property).
See the [Firebase docs][1] for more details.

This commit refactors the utilities in `firebase-test-utils/` to make it
easy to add support for such regex-based redirect configurations.

[1]: https://firebase.google.com/docs/hosting/full-config#redirects

PR Close #41842
2021-04-27 14:05:23 -07:00
George Kalpakas 36e10e7932 test(docs-infra): fix `create-example` tests on Windows (#41842)
Previously, the tests in `create-example.spec.ts` made assertions using
some hard-coded absolute paths (something like `/foo/bar`). This caused
the tests to fail on Windows, where the absolute paths are prefixed with
the drive letter (something like `C:/foo/bar`).

This commit uses `path.resolve()` to ensure paths are converted to the
format used on the current OS.

PR Close #41842
2021-04-27 14:05:23 -07:00
Amadou Sall 3783976543 docs: remove the section "Using components vs services from other modules" (#41835)
This section states that "Importing a module with services means that you will have a new instance of that service". This is only true for lazy-loaded `NgModules`. For non-lazy-loaded modules, my understanding is that the providers arrays are flattened into the root injector meaning that importing a module with a service doesn't create a new instance of that service.

PR Close #41835
2021-04-27 10:16:49 -07:00
Pete Bacon Darwin 01d1c46b16 build(docs-infra): update dgeni-packages to fix version list (#41832)
The current version was not being computed correctly for
next and rc deployments of the angular.io website.

Fixes #41829

PR Close #41832
2021-04-27 10:15:29 -07:00
Joey Perrott 2f678fcedb build: update node version requirements (#41822)
Update the node version requirements to only include the LTS versions supported, rather
than accidently including the active versions.

PR Close #41822
2021-04-26 15:21:13 -07:00
Kapunahele Wong 09abee359d docs: add metadata documentation to httpClient (#41706)
PR Close #41706
2021-04-26 15:17:51 -07:00
Chau Tran e47ea2959c docs: add chau tran to GDE resources (#41817)
PR Close #41817
2021-04-26 15:16:40 -07:00
Pete Bacon Darwin 4b4f565df1 docs: fix links to docs with ambiguous paths (#41788)
These docs were linking directly to docs that have ambiguous paths.
These changes ensure that these links are not affected by the
disambiguation processing of those docs.

PR Close #41788
2021-04-26 12:12:00 -07:00
Pete Bacon Darwin 538286df16 build(docs-infra): add path disambiguation (#41788)
When two documents have the same `outputPath`, only differing by
letter casing, there can be problems on case-insensitive file-systems:
Only one of each of the docs would end up being written.

Moreover, the Webpack 5 bundler will error if it comes across files
that have this kind of ambiguous paths.

This commit adds a new docType: `disambiguator`, which will display
a list of the docs that match an ambiguous path. Each of the ambiguous
docs is then given a unique path and outputPath to ensure there are no
collisions.

PR Close #41788
2021-04-26 12:12:00 -07:00
Pete Bacon Darwin 2ede980fea build(docs-infra): no duplicate docTypes in postProcessHtml processor (#41788)
This processor was being initialized with the same docTypes twice.

PR Close #41788
2021-04-26 12:11:59 -07:00
Renovate Bot 9e113f9cc4 build: update to version (#41806)
PR Close #41806
2021-04-26 12:06:48 -07:00
George Kalpakas 99f2ffc740 build: update stemmer to version 2.0.0 (#41724)
NOTE:
`stemmer` v2.0.0 switched to ES modules (see
words/stemmer@03519229c8), which means
that the only way to consume it in our CommonJS setup (for example, in
[generateKeywords][1]) is via an async `import()`.

This commit makes the `generateKeywords` processor asynchronous in order
to be able to dynamically import and use `stemmer`.

[1]: 251bec159a/aio/tools/transforms/angular-base-package/processors/generateKeywords.js

PR Close #41724
2021-04-26 11:00:59 -07:00
George Kalpakas a938849148 fix(docs-infra): apply custom `autoLinkCode` filters to single-word `<code>` elements (#41709)
Previously, the `autoLinkCode` Dgeni post-processor would not apply the
custom filters when matching the whole contents of a `<code>` element.
This meant that custom filters would not be applied to single-word
`<code>` elements.

You can see occurrences of this issue in the following sections of the
"Reactive forms" guide:
- [Creating nested form groups][1]
  (look for `street, city, state, and zip controls`)
- [Using the FormBuilder service to generate controls][2]
  (look for `group method`)

This commit fixes this by also applying the custom filters when
processing the whole contents of a `<code>` element.

This commit also updates the `filterPipes` custom filter to allow
matching a pipe's name in a single-word `<code>` element (where there is
no preceeding `|` character).

[1]: https://v10.angular.io/guide/reactive-forms#creating-nested-form-groups
[2]: https://v10.angular.io/guide/reactive-forms#using-the-formbuilder-service-to-generate-controls

PR Close #41709
2021-04-26 10:59:08 -07:00
George Kalpakas de19b8bb88 fix(docs-infra): do not process generated nodes for auto-linking (#41709)
While generating the docs, when a `<code>` element is inspected for
auto-linking, the `autoLinkCode` Dgeni post-processor will break its
contents up into words and generate text nodes for those words that
should not be auto-linked.

Previously, our text node visitor would visit these generated text nodes
and try to auto-link them too. As a result, it would unnecessarily
process nodes that had already been checked (and could potentially
generate links that would otherwise be ignored).

You can see an occurrence of this issue in the
[Create the product list][1] section of the
"Getting started with Angular" tutorial (look for `<a>`).

This commit fixes this by ensuring the visitor will skip the current
node and any nodes generated by `autoLinkCode`.

[1]: https://v11.angular.io/start#create-the-product-list

PR Close #41709
2021-04-26 10:59:07 -07:00
George Kalpakas 6465b5056a build(docs-infra): fix e2e testing SystemJS-based docs examples (#41796)
This commits makes the SystemJS-based docs examples more self-contained
by ensuring the necessary WebDrivers are fetched before running the e2e
tests.
This is a follow-up to #41689. (See there for more discussion.)

PR Close #41796
2021-04-26 09:25:12 -07:00
George Kalpakas 27ad7624d0 fix(docs-infra): fix external link icons positioning (#41794)
While trying to fix the appearance of `<code>` elements inside of
anchors with external URLs in #41694, the positioning of external link
icons was broken for anchors that would span multiple lines (see #41774
for details).

This commit fixes the positioning of external link icons, while still
preserving the correct appearance of `<code>` elements inside anchors
with external URLs.

NOTE:
Different types of links with external URLs can be seen in the following
docs sections:
- http://localhost:4200/docs#assumptions
- http://localhost:4200/guide/http#security-xsrf-protection
- http://localhost:4200/guide/workspace-config#generation-schematics

Fixes #41774

PR Close #41794
2021-04-26 09:24:04 -07:00
Kapunahele Wong 01e546f116 docs: improve accessibility of architecture example (#41314)
PR Close #41314
2021-04-26 09:13:49 -07:00
Kapunahele Wong 326884736e docs: make inputs-outputs example more accessible (#41288)
PR Close #41288
2021-04-26 09:12:17 -07:00
Kapunahele Wong 70fb3e958b docs: improve accessibility of http example (#41057)
PR Close #41057
2021-04-26 09:11:07 -07:00
Sam Severance 9f88da220c docs: Indicate `HttpClientModule` being imported (#41749)
PR Close #41749
2021-04-23 11:38:34 -07:00
George Kalpakas 81f61b276b build(docs-infra): upgrade cli command docs sources to 2310e277b (#41780)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](064c3356e...2310e277b):

**Modified**
- help/build.json

PR Close #41780
2021-04-23 09:41:34 -07:00
Keen Yee Liau 64567d3d39 docs: Remove Protractor test from CI examples (#41733)
Protractor tests are no longer included in new projects starting from
Angular version 12.

PR Close #41733
2021-04-22 10:44:41 -07:00
George Kalpakas 6ca6302cf1 build(docs-infra): upgrade cli command docs sources to 064c3356e (#41765)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](79d820c92...064c3356e):

**Modified**
- help/build.json
- help/e2e.json
- help/generate.json
- help/new.json

PR Close #41765
2021-04-22 08:44:42 -07:00
Aristeidis Bampakos dfdd4a2d74 docs: ident the library shematics guide properly (#41755)
PR Close #41755
2021-04-22 08:41:01 -07:00
George Kalpakas 122c8ba0e3 build(docs-infra): fix `StackblitzBuilder` after `jsdom` update (#41725)
In commit c617f1f768, `jsdom` was updated
from v9 to v16. This includes a breaking change that caused
`StackblitzBuilder` to fail to generate the StackBlitz examples.
However, this failure went unnoticed, because `StackblitzBuilder` still
completed successfully after failing to generate the examples. (This has
been fixed in the previous commit.)

This commit updates `StackblitzBuilder` to use the new `jsdom` API.

PR Close #41725
2021-04-22 08:38:20 -07:00
George Kalpakas 5a80bc6eb5 build(docs-infra): exit with an error code if generating StackBlitz examples fails (#41725)
Previously, failing to generate one or more StackBlitz examples would
log the errors but exit the command successfully. This made it easy to
miss such failures.

This commit fixes this by exiting the process with an error code if
generating one or more StackBlitz examples fails.
(In order to be able to see all potential errors, all examples are
attempted to be generated before exiting the process.)

PR Close #41725
2021-04-22 08:38:20 -07:00
Kapunahele Wong 6611d5c1c9 docs: add instructions for opting into latest Language Service (#41600)
PR Close #41600
2021-04-21 17:29:05 -07:00
Kapunahele Wong a2b671e61b docs: add margin to button boilerplate CSS for examples (#41413)
PR Close #41413
2021-04-20 11:37:27 -07:00
George Kalpakas 364ff96f28 build(docs-infra): upgrade cli command docs sources to 79d820c92 (#41719)
Updating [angular#master](https://github.com/angular/angular/tree/master) from
[cli-builds#master](https://github.com/angular/cli-builds/tree/master).

##
Relevant changes in
[commit range](d902a289b...79d820c92):

**Modified**
- help/generate.json

PR Close #41719
2021-04-20 09:42:42 -07:00
Daniel Díaz e238f2c33a docs: rewrites animation query () method use (#41710)
PR Close #41710
2021-04-20 09:40:29 -07:00
unknown 0a19fc095d docs: add Material Design for Bootstrap to UI Component resources (#41702)
PR Close #41702
2021-04-20 09:39:15 -07:00
Oluwole Majiyagbe 03f3dcb700 docs: add API CMS capability to Angular App resources (#40924)
PR Close #40924
2021-04-20 09:37:50 -07:00
Pete Bacon Darwin 70341bcfed build(docs-infra): update docs examples to Angular v11.2.10 (#41689)
This commit updates the docs examples to Angular v11.2.10. See the [diff between 11.0.1 and 11.2.10 (FW) and 11.2.9 (CLI)][1].

The changes are fairly trivial including:

- Removal of `emitDecoratorMetadata` from tsconfig.json files, where no JIT compilation is required.
- Setting `enableI18nLegacyMessageIdFormat` to `false` for CLI based applications - the i18n example was already migrated away from legacy message IDs.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.9..11.0.1

PR Close #41689
2021-04-19 14:18:51 -07:00
Pete Bacon Darwin 1573510187 refactor(docs-infra): tidy up systemjs boilerplate for upgrade examples (#41689)
The ngUpgrade examples mostly rely upon SystemJS configuration.
This commit tidies up how these examples are built and tested so that
it will be easier to migrate them to work with Angular 11.2.x

PR Close #41689
2021-04-19 14:18:51 -07:00
Pete Bacon Darwin e06f1960f4 docs: migrate example to use non-legacy message IDs (#41689)
From 11.x, new projects are set up to use the latest message ID format.
This commit updates the i18n example project to stop using legacy IDs.

PR Close #41689
2021-04-19 14:18:51 -07:00
Renovate Bot c617f1f768 build: update jsdom to version 16.5.3 (#41695)
PR Close #41695
2021-04-19 14:16:46 -07:00
Bendik Skarpnes 5e343173e8 docs: fix styling issues in example CSS (#41222)
PR Close #41222
2021-04-19 14:15:45 -07:00
Pierre Portejoie fdd55c9ec7 docs: fix tutorial indicating the app is working when an error is actually displayed (#40732)
PR Close #40732
2021-04-19 14:14:58 -07:00
Amadou Sall 322db1755a docs: add missing preposition in the animations guide (#41697)
PR Close #41697
2021-04-19 08:35:11 -07:00
George Kalpakas 404ec48051 fix(docs-infra): fix code inside anchor elements with external URLs (#41694)
Previously, due to the `inline-flex` display style of anchor elements
with external URLs, `<code>` elements nested inside such anchor elements
would cause extra spacing between lines. An occurrence of this can be
seen in the [Angular workspace configuration][1] guide.

This commit fixes the problem by removing the `inline-flex` display
style (allowing anchor elements to fall back to the default `inline`
style).

For reference, the `inline-flex` style was introduced in commit
7944ee2c30 in order to avoid underlining
link icons. This style seems to no longer be necessary (either it was
never necessary or the underlying browser bug that made it necessary was
fixed).

Before: ![code links before][2]
After: ![code links after][3]

[1]: https://next.angular.io/guide/workspace-config#generation-schematics
[2]: https://user-images.githubusercontent.com/8604205/115149753-34589780-a06e-11eb-8d4e-825b5e94282d.png
[3]: https://user-images.githubusercontent.com/8604205/115149755-3589c480-a06e-11eb-9b15-825d75c74878.png

PR Close #41694
2021-04-19 08:32:08 -07:00
George Kalpakas 52bade5413 refactor(docs-infra): remove duplicate `ol` selector (#41694)
This commit removes a duplicate `ol` selector from `typography.scss`.

PR Close #41694
2021-04-19 08:32:08 -07:00
George Kalpakas f10a7e1f7e refactor(docs-infra): simplify regex in search WebWorker (#41693)
This commit simplifies a regex used in angular.io's search WebWorker. It
also updates some comments to add more context on what the code does.

PR Close #41693
2021-04-19 08:31:31 -07:00
Renovate Bot 343b9d0ddc build: update jasmine-spec-reporter to version 7.0.0 (#41692)
PR Close #41692
2021-04-19 08:30:54 -07:00
Renovate Bot 0c23c8b0ac build: update image-size to version 1.0.0 (#41691)
PR Close #41691
2021-04-19 08:30:19 -07:00
George Kalpakas 17c2f6ef07 docs: replace hair space with regular space in `creating-libraries.md` (#41690)
This commit replaces a [hair space][1] with a regular space in
`creating-libraries.md`.
(You can see the hair space "in action" in the "Schematics for
Libraries" link right above the [Publishing your library][2] section.

[1]: https://en.wikipedia.org/wiki/Template:Hair_space
[2]: https://v10.angular.io/guide/creating-libraries#publishing-your-library

PR Close #41690
2021-04-19 08:29:44 -07:00
George Kalpakas 185090b15d docs: add missing backticks in `schematics-for-libraries.md` (#41681)
PR Close #41681
2021-04-19 08:26:35 -07:00
George Kalpakas 13913231f1 test(docs-infra): change URL separator from `\t` to `-->` in `URLS_TO_REDIRECT.txt` (#41680)
Previously, the `URLS_TO_REDIRECT.txt` file was expected to separate
URLs by a `\t` character. This could easily been mistaken for a regular
space and would often result in test errors when updating the file.

This commit updates the `URLS_TO_REDIRECT.txt` file and the
corresponding test helpers to use `-->` (potentially surrounded by
whitespace) as a separator for the URLs. This also gives a hint about
the "from" --> "to" relationship of the redirect URL pair.

PR Close #41680
2021-04-19 08:26:01 -07:00