From 12f509c2189f0c9258b9a2aa9a26bf397bc41c52 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Thu, 10 Jan 2019 22:24:24 +0200 Subject: [PATCH] docs(service-worker): fix the `service-worker-getting-started` docs example (#28020) Changes: - Change the project type to `service-worker`, so that it gets appropriate `package.json` (with `@angular/service-worker` dependency) and `angular.json` (with `serviceWorker: true` in production config). - Move `ngsw-config.json` to the correct directory. - Specify custom test commands for aio's `yarn example-e2e` to also verify that the ServiceWorker bits are set up correctly. PR Close #28020 --- .../service-worker-getting-started/example-config.json | 10 ++++++++++ .../{src => }/ngsw-config.json | 0 2 files changed, 10 insertions(+) rename aio/content/examples/service-worker-getting-started/{src => }/ngsw-config.json (100%) mode change 100755 => 100644 diff --git a/aio/content/examples/service-worker-getting-started/example-config.json b/aio/content/examples/service-worker-getting-started/example-config.json index e69de29bb2..b0e7e5672e 100644 --- a/aio/content/examples/service-worker-getting-started/example-config.json +++ b/aio/content/examples/service-worker-getting-started/example-config.json @@ -0,0 +1,10 @@ +{ + "projectType": "service-worker", + "e2e": [ + {"cmd": "yarn", "args": ["e2e", "--no-webdriver-update"]}, + {"cmd": "yarn", "args": ["build", "--prod"]}, + {"cmd": "node", "args": ["--eval", "assert(fs.existsSync('./dist/ngsw.json'), 'ngsw.json is missing')"]}, + {"cmd": "node", "args": ["--eval", "assert(fs.existsSync('./dist/ngsw-worker.js'), 'ngsw-worker.js is missing')"]}, + {"cmd": "node", "args": ["--eval", "assert(require('./package.json').dependencies['@angular/service-worker'], '@angular/service-worker is missing')"]} + ] +} diff --git a/aio/content/examples/service-worker-getting-started/src/ngsw-config.json b/aio/content/examples/service-worker-getting-started/ngsw-config.json old mode 100755 new mode 100644 similarity index 100% rename from aio/content/examples/service-worker-getting-started/src/ngsw-config.json rename to aio/content/examples/service-worker-getting-started/ngsw-config.json