From 2b95289ee2de9cb0f307d6af202beb8945c832ca Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 22 Jul 2020 14:40:02 +0300 Subject: [PATCH] fix(docs-infra): correctly add `polyfills.ts` file as boilerplate for `i18n` docs examples (#38173) Docs examples of type `i18n` need a slightly modified version of `polyfills.ts` that imports `@angular/localize/init`. Previously, this file was not included in `i18n` example projects for two reasons: - While the file was included in the `i18n` boilerplate files (at `aio/tools/examples/shared/boilerplate/i18n/`), it was not included in the boilerplate file list in `example-boilerplate.js`. - The file was in the wrong location: It was located at the project root instead of inside the `src/` directory. This commit addresses the above issues (i.e. adds the file to the boilerplate file list for `i18n` projects and moves the file inside the `src/` directory). PR Close #38173 --- aio/tools/examples/example-boilerplate.js | 2 +- aio/tools/examples/example-boilerplate.spec.js | 2 +- .../examples/shared/boilerplate/i18n/{ => src}/polyfills.ts | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename aio/tools/examples/shared/boilerplate/i18n/{ => src}/polyfills.ts (100%) diff --git a/aio/tools/examples/example-boilerplate.js b/aio/tools/examples/example-boilerplate.js index 7292a43568..0bc06e8290 100644 --- a/aio/tools/examples/example-boilerplate.js +++ b/aio/tools/examples/example-boilerplate.js @@ -32,7 +32,7 @@ const cliRelativePath = BOILERPLATE_PATHS.cli.map(file => `../cli/${file}`); BOILERPLATE_PATHS.elements = [...cliRelativePath, 'package.json', 'src/polyfills.ts']; -BOILERPLATE_PATHS.i18n = [...cliRelativePath, 'angular.json', 'package.json']; +BOILERPLATE_PATHS.i18n = [...cliRelativePath, 'angular.json', 'package.json', 'src/polyfills.ts']; BOILERPLATE_PATHS['service-worker'] = [...cliRelativePath, 'angular.json', 'package.json']; diff --git a/aio/tools/examples/example-boilerplate.spec.js b/aio/tools/examples/example-boilerplate.spec.js index 1a4f8fb2ed..db9c8d5f72 100644 --- a/aio/tools/examples/example-boilerplate.spec.js +++ b/aio/tools/examples/example-boilerplate.spec.js @@ -11,7 +11,7 @@ describe('example-boilerplate tool', () => { const sharedNodeModulesDir = path.resolve(sharedDir, 'node_modules'); const BPFiles = { cli: 20, - i18n: 2, + i18n: 3, universal: 2, systemjs: 7, common: 1, diff --git a/aio/tools/examples/shared/boilerplate/i18n/polyfills.ts b/aio/tools/examples/shared/boilerplate/i18n/src/polyfills.ts similarity index 100% rename from aio/tools/examples/shared/boilerplate/i18n/polyfills.ts rename to aio/tools/examples/shared/boilerplate/i18n/src/polyfills.ts