Add a new doc, `aio/UPDATING.md`, with instructions on updating the
angular.io app to align with the latest Angular CLI/framework/Material.
Also, update the instructions on updating the docs examples apps.
PR Close#47250
With this change we replace AIO examples to use stable Angular packages.
The main reasons for this is that prereleases might contain bugs that
are not in the stable version especially in the Angular CLI were it's
not validated in G3.
PR Close#47092
All docs examples share the same `node_modules/` (symlinked into each
example from `aio/tools/examples/shared/node_modules/`). However, each
example type has a different `package.json`, which comes from
`aio/tools/examples/shared/boilerplate/*`). In order to ensure that the
dependencies in each example's `package.json` are the same as the ones
in the symlinked `node_modules/` (i.e. the ones that CI tests are run
with), we have a script (`yarn run sync-deps`) that can sync
dependencies from `shared/package.json` into the boilerplate
`package.json` files.
Previously, this script had to be run manually, which was easy to
forget/not know about and resulted in the boilerplate dependencies
often being out-of-sync with the ones in `shared/package.json` (and by
extension, the ones that were actually installed in `node_modules/`).
This commit helps keep the boilerplate dependencies up-to-date in the
following ways:
- Adds the `sync-deps` script to the `postinstall` scripts.
This ensures that dependencies remain in sync whenever someone
manually updates dependencies in `shared/package.json`.
- Runs the `sync-deps` script as a Renovate post-upgrade task.
This ensures that the depenencies remain in sync whenever Renovate
updates dependencies in `shared/package.json`.
For more info on configuring post-upgrade tasks in Renovate, see:
- [postUpgradeTasks][1]
- [allowedPostUpgradeCommands][2]
- [allowPostUpgradeCommandTemplating][3]
NOTE:
For the Renovate change to take effect, the [global config][4] in
`angular/dev-infra` also needs to be updated. This will be done in a
separate PR.
[1]: https://docs.renovatebot.com/configuration-options/#postupgradetasks
[2]: https://docs.renovatebot.com/self-hosted-configuration/#allowedpostupgradecommands
[3]: https://docs.renovatebot.com/self-hosted-configuration/#allowpostupgradecommandtemplating
[4]: 22d3067021/.github/ng-renovate/runner-config.js
PR Close#47009
With the recent lock file maintenance, the `@types/angular` dependency
ended up being duplicated. This seems to happen because we locked our
type dependency, but other Angular deps like `angular-route` had a
looser dependency, resulting in e.g. `1.7` types and `1.8` types to be
loaded.
This ultimately ended up breaking TypeScript's auto-discovering
of types and broke some example compilations e.g.
```
app/app.animations.ts(3,3): error TS2339: Property 'animation' does not exist on type 'IModule'.
app/app.config.ts(5,45): error TS2694: Namespace 'angular' has no exported member 'route'.
app/phone-detail/phone-detail.component.ajs.ts(10,37): error TS2694: Namespace 'angular' has no exported member 'route'.
```
We fix this by loosening the type dependency ranges, updating all of
these. Also we update AngularJS itself to the final version.
PR Close#46819
Update the docs examples to the latest prerelease versions of Angular
CLI and framework (v14.0.0-rc.0).
Also update the example apps to more closely align with new CLI apps.
See also the [diff][1] between a basic v13.0.0-rc.3 CLI app and a
v14.0.0-rc.0 one.
[1]: https://github.com/cexbrayat/angular-cli-diff/compare/13.0.0-rc.3...14.0.0-rc.0
PR Close#45997
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
The SystemJS examples were using an outdated version of rollup that did
not support export fields. Now with the recent changes where we removed
secondary package.json files, the rather old/somewhat outdated SystemJS
examples failed bundling since exports were not considered.
PR Close#45405
This is needed because Angular CLI 13.3 contains fixes that are needed for Stackblitz Node 16 to compile Sass. We also added `copyfiles` in `aio/tools/examples/shared/package.json` as `yarn sync-deps` was failing due to the missing dependency.
PR Close#45502
.substr() is deprecated so we replace it with functions which work similarily but aren't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
PR Close#45397
Node.js v12 will become EOL on 2022-04-30. As a result, Angular CLI v14 will no longer support Node.js v12.
BREAKING CHANGE:
Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later.
PR Close#45286
Updates AIO and the live examples to 13.1.0 in order to resolve a build error when opened on Stackblitz. They were using TS 4.5 with Angular ~13.0.0 which doesn't support 4.5.
Fixes#44480.
PR Close#44487
Adds support for TypeScript 4.5. Includes the following changes:
* Bumping the package versions.
* Fixing a few calls to `createExportSpecifier` and `createImportSpecifier` that require an extra parameter.
* Adding some missing methods to the TS compiler hosts.
* Fixing an issue in the TS mocks for the ngcc tests where a regex was too agressive and was trying to match a path like `/node_modules/@typescript/lib-es5`.
* Accounting for type-only import specifiers when reporting DI errors (see #43620).
Fixes#43620.
PR Close#44164
In #44214, the `package.json` used to install dependencies for docs
examples was updated, but the corresponding lockfile was not.
Update the lockfile to keep it in sync with `package.json`.
PR Close#44232
In PR #43975, the `Angular Elements` guide was updated to remove
mentions of the Custom Elements-related polyfills, since they are no
longer necessary in v13+ (due to all CLI projects being ES2015+ and all
supported browsers natively supporting Custom Elements).
This commit updates the related docs example boilerplate to not include
the unneeded `@webcomponents/custom-elements` polyfill.
PR Close#44214
Previously, the SystemJS-based docs examples (typically `ngUpgrade`
examples) were not compatible with Angular v13 (due to the removal of
UMD bundles from the published packages).
This commit makes the examples compatible with Angular v13 and
re-enables the tests for all SystemJS-based examples on CI.
PR Close#43868
Due to an oversight, the `systemjs` package was previously not included
as a dependency in the boilerplate `package.json` file for
SystemJS-based docs examples, despite it being required by the app.
PR Close#43868
Use the cross-platform `copyfiles` package instead of using `cp` which fails on Windows machines when copying files in the `postbuild` script of the "schematics-for-libraries" example.
PR Close#30966
This commit updates the docs examples to the latest prerelease versions
of Angular CLI, framework and CDK/Material.
It also updates the apps to more closely align with new apps CLI apps.
See also the [diff][1] between a basic v13.0.0-rc.0 CLI app and a
v13.0.0-rc.2 one.
[1]: cexbrayat/angular-cli-diff@13.0.0-rc.0...13.0.0-rc.2
PR Close#43583
This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.
PR Close#43880
This commit updates the docs examples to Angular v13.0.0-rc.0. In
addition to updating the dependency versions, it also updates the
projects' structure and configs to more closely match what a new v13 CLI
app would look like. See, also, the [diff][1] between a basic v12.1.3
CLI app and a v13.0.0-rc.0 one.
(NOTE: v12.1.3 was the last version for which we aligned the projects
with how a new CLI app would look like.)
Additionlly:
- Since we now use RxJS v7 in docs examples, this commit removes the
extra CI steps to explicitly test the docs examples against RxJS v7.
- Since Angular v13 no longer supports IE, this commit removes an
IE-specific section from `upgrade-setup.md`.
[1]: https://github.com/cexbrayat/angular-cli-diff/compare/12.1.3..13.0.0-rc.0
PR Close#43880
remove the deprecated tslint from the examples of type systemjs
note: eslint hasn't be applied and linting has been removed entirely
to follow angular's unopinionated view on linting
PR Close#43746
When the docs examples tests run with `--cliSpecsConcurrency` greater
than 1 (as happens on CI), the output of each process is [buffered][1]
(to avoid interleaved output from multiple, parallel processes) and is
only printed out once the process exits (either successfully or with an
error). However, in cases where a process did not exit, the buffered
output would be never printed out, thus making debugging the failure
harder. This is the case, for example, if a build error happens during
`ng e2e`. This can be seen in action in [this CI job][2], where the job
fails due to no output, but the error (which is an incompatible TS
version) is never printed out.
To make debugging such situations easier in the future, this commit
updates the `spawnExt()` helper to reject (causing the buffered output
to be printed out) if there is no output from the spawned process for
more than 5 minutes.
[1]: c721135e37/aio/tools/examples/run-example-e2e.mjs (L293)
[2]: https://circleci.com/gh/angular/angular/1061751
PR Close#43683