diff --git a/aio/tools/examples/example-boilerplate.js b/aio/tools/examples/example-boilerplate.js index 773b37aea6..5cac1ae324 100644 --- a/aio/tools/examples/example-boilerplate.js +++ b/aio/tools/examples/example-boilerplate.js @@ -61,6 +61,12 @@ BOILERPLATE_PATHS.i18n = [ 'package.json' ]; +BOILERPLATE_PATHS['service-worker'] = [ + ...cliRelativePath, + 'angular.json', + 'package.json' +]; + BOILERPLATE_PATHS.testing = [ ...cliRelativePath, 'angular.json' diff --git a/aio/tools/examples/shared/boilerplate/service-worker/angular.json b/aio/tools/examples/shared/boilerplate/service-worker/angular.json new file mode 100644 index 0000000000..ba4dc645a4 --- /dev/null +++ b/aio/tools/examples/shared/boilerplate/service-worker/angular.json @@ -0,0 +1,136 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "angular.io-example": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "prefix": "app", + "schematics": {}, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.app.json", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "serviceWorker": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "angular.io-example:build" + }, + "configurations": { + "production": { + "browserTarget": "angular.io-example:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "angular.io-example:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "styles": [ + "src/styles.css" + ], + "scripts": [], + "assets": [ + "src/favicon.ico", + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "angular.io-example-e2e": { + "root": "e2e/", + "projectType": "application", + "prefix": "", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "angular.io-example:serve" + }, + "configurations": { + "production": { + "devServerTarget": "angular.io-example:serve:production" + } + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": "e2e/tsconfig.e2e.json", + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "defaultProject": "angular.io-example" +} diff --git a/aio/tools/examples/shared/boilerplate/service-worker/package.json b/aio/tools/examples/shared/boilerplate/service-worker/package.json new file mode 100644 index 0000000000..7de5334909 --- /dev/null +++ b/aio/tools/examples/shared/boilerplate/service-worker/package.json @@ -0,0 +1,53 @@ +{ + "name": "angular.io-example", + "version": "0.0.0", + "license": "MIT", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "^7.0.0", + "@angular/common": "^7.0.0", + "@angular/compiler": "^7.0.0", + "@angular/core": "^7.0.0", + "@angular/forms": "^7.0.0", + "@angular/http": "^7.0.0", + "@angular/platform-browser": "^7.0.0", + "@angular/platform-browser-dynamic": "^7.0.0", + "@angular/router": "^7.0.0", + "@angular/service-worker": "^7.0.0", + "angular-in-memory-web-api": "^0.6.0", + "core-js": "^2.5.4", + "rxjs": "^6.3.0", + "web-animations-js": "^2.3.1", + "zone.js": "~0.8.26" + }, + "devDependencies": { + "@angular-devkit/build-angular": "^0.10.0", + "@angular/cli": "^7.0.0", + "@angular/compiler-cli": "^7.0.0", + "@angular/language-service": "^7.0.0", + "@types/jasmine": "~2.8.8", + "@types/jasminewd2": "~2.0.3", + "@types/node": "~8.9.4", + "codelyzer": "~4.3.0", + "jasmine-core": "~2.99.1", + "jasmine-marbles": "^0.4.0", + "jasmine-spec-reporter": "~4.2.1", + "karma": "~3.0.0", + "karma-chrome-launcher": "~2.2.0", + "karma-coverage-istanbul-reporter": "~2.0.1", + "karma-jasmine": "~1.1.2", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.4.0", + "ts-node": "~7.0.0", + "tslint": "~5.11.0", + "typescript": "~3.1.1" + } +}