562 Commits

Author SHA1 Message Date
George Kalpakas a7bec2b181 build(docs-infra): auto-generate SW navigationUrls from Firebase config (#42452)
Previously, redirects had to be configured in both the Firebase config
(`firebase.json`) and the ServiceWorker config (`ngsw-config.json`).
This made it challenging to correctly configure redirects, since one had
to understand the different formats of the two configs, and was also
prone to getting out-of-sync configs.

This commit simplifies the process of adding redirects by removing the
need to update the ServiceWorker config (`ngsw-config.json`) and keep it
in sync with the Firebase config (`firebase.json`). Instead the
ServiceWorker `navigationUrls` are automatically generated from the list
of redirects in the Firebase config.

NOTE:
Currently, the automatic generation only supports the limited set of
patterns that are necessary to translate the existing redirects. It can
be made more sophisticated in the future, should the need arise.

PR Close #42452
2021-06-18 17:32:59 +00:00
George Kalpakas 311ca931fd build(docs-infra): align code with new CLI v12 apps (#42259)
This commit aligns the angular.io config files more closely to how a
newly generated CLI v12 app would look like. This helps validate the
setup and makes it easier to apply new chages in the future (by
preventing the angular.io layout from deviating too much from the
default new app layout).

PR Close #42259
2021-06-14 09:54:08 -07:00
George Kalpakas 8f651f378f build: update dependency lighthouse to v8 (#42471)
Update LightHouse to v8.0.0 to take advantage of the latest fixes and
improvements.

PR Close #42471
2021-06-03 13:16:50 -07:00
Zach Arend 765854ed8f build: allow node v15 and above for aio (#42367)
Changes the engines rule in aio to accept any node version greater than
or equal to v14. This allows node v15 to work with aio.

addresses #42076

PR Close #42367
2021-05-26 14:24:18 -07:00
Suguru Inatomi 6c136f3c4e build(docs-infra): allow only Node.js v14 and above (#42093)
The AIO doc-gen uses JavaScript syntax that requires node.js 14.0.0 or above.

Closes #42086

PR Close #42093
2021-05-26 20:07:52 +00:00
George Kalpakas d0214e70c0 build(docs-infra): upgrade cli command docs sources to fa38af27f (#42173)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/88d955627...fa38af27f):

**Modified**
- help/serve.json

PR Close #42173
2021-05-19 10:05:24 -07:00
Renovate Bot c2bcf6c9e6 build: update angular (#42035)
Merge conflicts in yarn.lock and aio/yarn.lock were resolved manually by
@alxhub (by running `yarn` to update the lockfiles instead of guessing at
conflict resolution).

PR Close #42035
2021-05-13 16:32:13 -04:00
George Kalpakas 03dcdbd788 build(docs-infra): upgrade cli command docs sources to 88d955627 (#42039)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/0f1fe9a4d...88d955627):

**Modified**
- help/update.json

PR Close #42039
2021-05-13 13:53:53 -04:00
Renovate Bot c909bb8f57 build: update all non-major dependencies (#41956) (#42024)
Manually merged from PR #41956 to 12.0.x, resolving a simple conflict in
`packages/localize/package.json`.

PR Close #42024
2021-05-10 12:34:46 -04:00
Ajit Singh cffba6fa0b build: update node version to stop aio from breaking while generating docs (#42009)
When aio yarn docs-only command runs on v12.14.1 it fails details given on issue #41979. Upgrading node version to v12.17.0 solves this but creates a new warning (node:467072) ExperimentalWarning: The ESM module loader is experimental.
This warning gets removed in v12.20.0. Upgrading node version to 12.20.0

PR Close #42009
2021-05-10 10:39:39 -04:00
Renovate Bot 921703f388 build: update angular (#41955)
PR Close #41955
2021-05-07 10:03:37 -04:00
George Kalpakas 343a54654f build(docs-infra): upgrade cli command docs sources to 0f1fe9a4d (#41959)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/320213975...0f1fe9a4d):

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

PR Close #41959
2021-05-06 09:40:01 -04:00
Renovate Bot 65bc1fe248 build: update dependency fs-extra to v10 (#41937)
PR Close #41937
2021-05-06 09:36:18 -04:00
George Kalpakas e453d37dee build(docs-infra): upgrade cli command docs sources to 320213975 (#41939)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/d965a67c6...320213975):

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

PR Close #41939
2021-05-04 08:11:36 -07:00
George Kalpakas 9928dc0251 build(docs-infra): revert watchr to v3.0.1 to restore docs-watch performance (#41903)
[`watchr` v4.0.0][1] changes the way watched directories are
scanned/watched, thus causing a great increase in the consumed CPU and
RAM. This affects the performance of the `docs-watch` and transitively
`serve-and-sync` npm scripts.
(For reference, on my local machine it goes from 0% CPU and 275MB RAM
with v3.0.1 to 50% CPU and 10GB RAM with v4+.)

This commit pins `watchr` to version 3.0.1 (which is the latest version
that does not cause performance issues) and disabled automatic updates
via Renovate.

[1]: https://github.com/bevry/watchr/releases/tag/v4.0.0

PR Close #41903
2021-05-03 10:05:31 -07:00
Renovate Bot d97d127ba3 build: update angular (#41871)
PR Close #41871
2021-04-30 14:31:09 -07:00
George Kalpakas 8da896f541 build(docs-infra): upgrade cli command docs sources to d965a67c6 (#41895)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/54ce436c9...d965a67c6):

**Modified**
- help/add.json
- help/analytics.json
- help/deploy.json
- help/e2e.json
- help/help.json
- help/lint.json
- help/new.json
- help/run.json
- help/test.json

PR Close #41895
2021-04-30 14:25:47 -07:00
Pete Bacon Darwin d7763a90e8 build(docs-infra): update to latest puppeteer (#41764)
The updates to WebDriver required an update to puppeteer to ensure
that the correct Chromium was downloaded.

PR Close #41764
2021-04-28 12:33:21 -07:00
Alan Agius 0aa9239524 build(docs-infra): add assert polyfill (#41764)
With this change we add the `assert` polyfill which is required because `timezone-mock` is a Node.JS library which is being used in Browser.

PR Close #41764
2021-04-28 12:33:21 -07:00
Alan Agius 0dcadabd34 build(docs-infra): update angular packages to 12.0.0-rc.0 (#41764)
Update Angular packages to `12.0.0-rc.0`

PR Close #41764
2021-04-28 12:33:21 -07:00
George Kalpakas 77a5157fba build: update remark packages (#41721)
This commit updates the `remark` packages to v12 instead of the latest
(v13), because v13 is a major breaking change that requires more
investigation and work.

More specifically, v13 replaces the internals of `remark` with a new
CommonMark-compliant parser. (See their [release notes][1] for more
info.)

This change causes our old `remark` plugins (in [renderMarkdown.js][2])
to stop working.

[1]: https://github.com/remarkjs/remark/releases/tag/13.0.0
[2]: https://github.com/angular/angular/blob/d42019d4128ca0d9f233a085bfe838f93f8d0412/aio/tools/transforms/remark-package/services/renderMarkdown.js#L17-L24

PR Close #41721
2021-04-28 09:27:23 -07:00
Pete Bacon Darwin f9af98460c 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 fe1fa7d6c2 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:14 -07:00
George Kalpakas 04da9fbdd1 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]: https://github.com/angular/angular/blob/251bec159af1e8f90c3af9820695c645800207e4/aio/tools/transforms/angular-base-package/processors/generateKeywords.js

PR Close #41724
2021-04-26 11:00:59 -07:00
George Kalpakas 17bae32271 build(docs-infra): upgrade cli command docs sources to 54ce436c9 (#41781)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/8a5dfd9bb...54ce436c9):

**Modified**
- help/build.json

PR Close #41781
2021-04-23 09:42:18 -07:00
George Kalpakas 6221227e10 build(docs-infra): upgrade cli command docs sources to 8a5dfd9bb (#41766)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/bdbc66133...8a5dfd9bb):

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

PR Close #41766
2021-04-22 08:45:29 -07:00
George Kalpakas 804a694c9e build(docs-infra): upgrade cli command docs sources to bdbc66133 (#41720)
Updating [angular#12.0.x](https://github.com/angular/angular/tree/12.0.x) from
[cli-builds#12.0.x](https://github.com/angular/cli-builds/tree/12.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/37b5f1c99...bdbc66133):

**Modified**
- help/build.json
- help/generate.json
- help/test.json

PR Close #41720
2021-04-20 09:43:20 -07:00
Renovate Bot 37ce86b546 build: update jsdom to version 16.5.3 (#41695)
PR Close #41695
2021-04-19 14:16:46 -07:00
Renovate Bot ad69a53679 build: update jasmine-spec-reporter to version 7.0.0 (#41692)
PR Close #41692
2021-04-19 08:30:54 -07:00
Renovate Bot e90bc598fd build: update image-size to version 1.0.0 (#41691)
PR Close #41691
2021-04-19 08:30:20 -07:00
Alan Agius a1ff47c738 build(docs-infra): remove view engine related code (#41638) (#41662)
This is a pre-update to Angular 12 cleanup.

This is not needed for version 12, since applications cannot be built using View Engine.

PR Close #41638

(cherry picked from commit 70425539f7)

PR Close #41662
2021-04-16 09:26:18 -07:00
Renovate Bot d1447d43e7 build: update angular packages (#41633)
PR Close #41633
2021-04-16 08:52:39 -07:00
Joey Perrott ee615e0744 build: upgrade to node 14 (#41544)
Upgrade local development environment for the angular repo to use node 14
dropping node 10 from supported for development within the angular repo.

PR Close #41544
2021-04-14 09:40:17 -07:00
Alan Agius 852b5e366e build: update @angular-devkit/build-angular to use commit SHA (#41434)
This is a temporary workaround until the CLI version containing a fix for the regression caused by deacc74 is available on NPM.

Without this change CLI builds will fail with;
```
angularCompiler.getNextProgram is not a function
```

PR Close #41434
2021-04-12 16:46:29 -07:00
Pete Bacon Darwin 5600df28e9 build(docs-infra): update dgeni-packages dependency (#41434)
This update includes fixes that prevented us from updating
other dependencies.

PR Close #41434
2021-04-12 16:46:29 -07:00
Alan Agius ed7d288364 build: update several dependencies (#41434)
With this change we update several dependencies to avoid Renovate creating a lot of PRs during onboarding. We also remove yarn workspaces as after further analysis these are not needed.

Certain dependencies such as `@octokit/rest`, `remark` and `@babel/*` have not been updated as they require a decent amount of work to update, and it's best to leave them for a seperate PR.

PR Close #41434
2021-04-12 16:46:29 -07:00
Joey Perrott c385e74454 build: rely on engines to prevent using npm for dependency install (#41477)
Rather than relying on a preinstall script, set `engine-strict` to `true` in a
project `.npmrc` file, relying on the `engines` having `npm` set to note that
yarn should be used instead.

---

Output from `npm install` changes from:
```
$ npm install

> angular-srcs@12.0.0-next.7 preinstall /usr/local/account/js/angular
> node tools/yarn/check-yarn.js

/usr/local/account/js/angular/tools/yarn/check-yarn.js:12
  throw new Error(
  ^

Error: Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/
    at Object.<anonymous> (/usr/local/account/js/angular/tools/yarn/check-yarn.js:12:9)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-srcs@12.0.0-next.7 preinstall: `node tools/yarn/check-yarn.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-srcs@12.0.0-next.7 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/local/account/.npm/_logs/2021-04-06T22_54_02_292Z-debug.log
```
to
```
$ npm install
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for angular-srcs@12.0.0-next.7: wanted: {"node":">=10.19.0 <13.0.0","yarn":">=1.22.4 <2","npm":"Plesae use yarn instead of NPM to install dependencies"} (current: {"node":"10.20.1","npm":"6.14.4"})
npm ERR! notsup Not compatible with your version of node/npm: angular-srcs@12.0.0-next.7
npm ERR! notsup Not compatible with your version of node/npm: angular-srcs@12.0.0-next.7
npm ERR! notsup Required: {"node":">=10.19.0 <13.0.0","yarn":">=1.22.4 <2","npm":"Plesae use yarn instead of NPM to install dependencies"}
npm ERR! notsup Actual:   {"npm":"6.14.4","node":"10.20.1"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/local/account/.npm/_logs/2021-04-06T22_53_23_912Z-debug.log
```

PR Close #41477
2021-04-07 12:05:01 -07:00
Joey Perrott 4a68e13d1b build: update package.json engines range for nodes in preparation for upgrade (#41472)
In preparation for upgrading to `node@14`, and dropping `node@10`, updating the engines
for local `package.json`s.

PR Close #41472
2021-04-06 12:46:31 -07:00
George Kalpakas a623bf4e70 build(docs-infra): enable linting for ng-packages-installer scripts (#41429)
This commit enables linting for the scripts in
`aio/tools/ng-packages-installer/`. It also makes the necessary changes
to the files to make linting pass.

PR Close #41429
2021-04-06 10:22:53 -07:00
George Kalpakas d42019d412 build(docs-infra): update eslint and eslint-plugin-jasmine to latest versions (#41429)
This commit updates the `eslint` and `eslint-plugin-jasmine` packages to
latest versions to take advantage of latest fixes and improvements.

PR Close #41429
2021-04-06 10:22:53 -07:00
George Kalpakas 2a76d8419c build(docs-infra): upgrade cli command docs sources to 37b5f1c99 (#41444)
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](https://github.com/angular/cli-builds/compare/e240e5b7c...37b5f1c99):

**Modified**
- help/build.json
- help/extract-i18n.json

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/ea073c560...37b5f1c99) since PR #41435:

**Modified**
- help/build.json

##
Closes #41435

PR Close #41444
2021-04-05 12:42:44 -07:00
GChuf 46a97b985e build: Bump minimum required node version to 10.19.0 (#41390)
Critical security vulnerability fixed in node v 10.19.0
Other performance and security updates since node 10.9.0

PR Close #41390
2021-04-02 10:29:24 -07:00
George Kalpakas 18abd3ce01 build(docs-infra): upgrade cli command docs sources to e240e5b7c (#41411)
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](https://github.com/angular/cli-builds/compare/b6effecae...e240e5b7c):

**Modified**
- help/extract-i18n.json
- help/generate.json

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/935b1fdee...e240e5b7c) since PR #41394:

**Modified**
- help/generate.json

##
Closes #41394

PR Close #41411
2021-04-01 12:07:45 -07:00
Pete Bacon Darwin fccffc647b refactor(docs-infra): include more info in search index data (#41368)
The AIO search index is built in a WebWorker on the browser from a set
of page information that is downloaded as a JSON file (`search-data.json`).
We want to keep this file as small as possible while providing enough
data to generate a useful index to query against.

Previously, we only included one copy of each (non-ignored) term from each
doc but this prevents more subtle ranking of query results, since the number
of occurences of a term in a doc is lost.

This commit changes the generated file in the following ways:

- All non-ignored terms are now included in the order in which they appear
  in the doc.
- The terms are indexed into a dictonary to avoid the text of the term being
  repeated in every doc that contains the term.
- Each term is pre-"stemmed" using the same Porter Stemming algorith that the
  Lunr search engine uses.

The web-worker has been updated to decode the new format of the file.
Now that all terms are included, it may enable some level of phrase based
matching in the future.

The size of the generated file is considerably larger than previously, but
on production HTTP servers the data is sent compressed, which reduces the
size dramatically.

PR Close #41368
2021-04-01 12:02:37 -07:00
Pete Bacon Darwin a371646a37 build: update yargs dependency to 16.2.0. (#41351)
This avoids a vulnerability in the transitive y18n dependency.

Fixes #41215

PR Close #41351
2021-03-30 16:59:38 -07:00
George Kalpakas 655507012b build(docs-infra): upgrade cli command docs sources to b6effecae (#41259)
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](https://github.com/angular/cli-builds/compare/5f5448301...b6effecae):

**Modified**
- help/extract-i18n.json

PR Close #41259
2021-03-18 10:02:54 -07:00
Kristiyan Kostadinov 59ef40988e feat(core): support TypeScript 4.2 (#41158)
Updates the repo to TypeScript 4.2 and tslib 2.1.0.

PR Close #41158
2021-03-17 09:10:25 -07:00
George Kalpakas 6bc22a7557 build(docs-infra): upgrade cli command docs sources to 5f5448301 (#41239)
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](https://github.com/angular/cli-builds/compare/46538eea1...5f5448301):

**Modified**
- help/build.json
- help/lint.json

PR Close #41239
2021-03-17 09:06:37 -07:00
George Kalpakas 6bdad5ef6c build(docs-infra): upgrade cli command docs sources to 46538eea1 (#41227)
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](https://github.com/angular/cli-builds/compare/edc1d0bc7...46538eea1):

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

PR Close #41227
2021-03-16 11:04:21 -07:00
George Kalpakas 8c939dcb40 fix(docs-infra): fix angular.io on browsers that support Custom Elements but not ES2015 (#41183)
Before #41162, angular.io was broken on IE 11 due to missing a polyfill
for an API (`Reflect.construct()`) needed by the Custom Elements ES5
shim. #41162 tried to fix this by loading the necessary polyfill
(`es.reflect.construct.js`) on browsers that do not support ES2015
modules (including IE 11).

It turns out that the fix in #41162 was itself broken, because the
`es.reflect.consruct.js` script (included directly in the page via a
`<script>` tag) was in CommonJS format (which cannot run in the browser
as is). By chance, this still allowed browsers that supported neither
Custom Elements nor ES2015 modules (such as IE 11) to work correctly as
a side-effect of loading the `@webcomponents/custom-elements` polyfill
after the Custom Elements ES5 shim (`native-shim.js`). However, on the
few browsers that natively support Custom Elements but not ES2015
modules, angular.io would still be broken.

This commit correctly fixes angular.io on all browsers by properly
bundling the polyfills and transpiling to ES5.

Implementation-wise, we use [esbuild][1] for bundling the polyfills (and
converting from CommonJS to a browser-compatible, IIFE-based format) and
[swc][2] for downleveling the code to ES5 (since `esbuild` only supports
ES2015+).

[1]: https://esbuild.github.io/
[2]: https://swc.rs/

PR Close #41183
2021-03-12 13:22:57 -08:00