From 5007b97db65b943a664ce489cae356cf7b338286 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 17 Mar 2020 22:28:54 +0200 Subject: [PATCH] build(docs-infra): clean up dependencies and npm scripts in `systemjs` docs examples (#36015) Previously, the `package.json` files added as boilerplate to docs example projects of type `systemjs` were incorrect/outdated. They contained unused dependencies and npm scripts and omitted used dependencies. This is not a big issue, because these examples are not offered as live StackBlitz examples or downloadable ZIP archives, but having incorrect `package.json` files is confusing and makes it more complicated to update these examples. This commit updates the `package.json` templates for the `systemjs` docs examples and other configuration files to include used dependencies (and remove unused ones). It also removes unused npm scripts. PR Close #36015 --- .../rollup-config.js | 1 - .../customizer/package-json/systemjs.json | 39 ++++++++++----- .../boilerplate/ivy/systemjs/rollup-config.js | 1 - .../shared/boilerplate/systemjs/package.json | 47 +++++++++++++++---- 4 files changed, 66 insertions(+), 22 deletions(-) diff --git a/aio/content/examples/upgrade-phonecat-2-hybrid/rollup-config.js b/aio/content/examples/upgrade-phonecat-2-hybrid/rollup-config.js index e1cb56844d..6cfaf379e7 100644 --- a/aio/content/examples/upgrade-phonecat-2-hybrid/rollup-config.js +++ b/aio/content/examples/upgrade-phonecat-2-hybrid/rollup-config.js @@ -1,5 +1,4 @@ // #docregion -import rollup from 'rollup' import nodeResolve from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs'; import uglify from 'rollup-plugin-uglify' diff --git a/aio/tools/example-zipper/customizer/package-json/systemjs.json b/aio/tools/example-zipper/customizer/package-json/systemjs.json index 535bf0cc52..3d81cba99e 100644 --- a/aio/tools/example-zipper/customizer/package-json/systemjs.json +++ b/aio/tools/example-zipper/customizer/package-json/systemjs.json @@ -13,32 +13,47 @@ { "name": "serve:upgrade" }, { "name": "build:aot" }, { "name": "serve:aot" }, - { "name": "build:babel" }, - { "name": "copy-dist-files" }, - { "name": "i18n" } + { "name": "copy-dist-files" } ], "dependencies": [ - "systemjs" + "@angular/animations", + "@angular/common", + "@angular/compiler", + "@angular/core", + "@angular/forms", + "@angular/platform-browser", + "@angular/platform-browser-dynamic", + "@angular/router", + "@angular/upgrade", + "rxjs", + "systemjs", + "tslib", + "zone.js" ], "devDependencies": [ + "@angular/compiler-cli", "@types/angular", "@types/angular-animate", - "@types/angular-cookies", "@types/angular-mocks", "@types/angular-resource", "@types/angular-route", - "@types/angular-sanitize", - "babel-cli", - "babel-preset-angular2", - "babel-preset-es2015", - "canonical-path", - "http-server", + "@types/jasmine", + "@types/jasminewd2", + "@types/node", "concurrently", + "http-server", + "jasmine-core", + "karma", + "karma-chrome-launcher", + "karma-jasmine", + "karma-jasmine-html-reporter", "lite-server", + "protractor", "rollup", "rollup-plugin-commonjs", "rollup-plugin-node-resolve", "rollup-plugin-uglify", - "source-map-explorer" + "tslint", + "typescript" ] } diff --git a/aio/tools/examples/shared/boilerplate/ivy/systemjs/rollup-config.js b/aio/tools/examples/shared/boilerplate/ivy/systemjs/rollup-config.js index 6f8f0334a3..ec1bbb5908 100644 --- a/aio/tools/examples/shared/boilerplate/ivy/systemjs/rollup-config.js +++ b/aio/tools/examples/shared/boilerplate/ivy/systemjs/rollup-config.js @@ -1,5 +1,4 @@ // #docregion -import rollup from 'rollup' import nodeResolve from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs'; import uglify from 'rollup-plugin-uglify' diff --git a/aio/tools/examples/shared/boilerplate/systemjs/package.json b/aio/tools/examples/shared/boilerplate/systemjs/package.json index d9747ad511..5f1a830d67 100644 --- a/aio/tools/examples/shared/boilerplate/systemjs/package.json +++ b/aio/tools/examples/shared/boilerplate/systemjs/package.json @@ -22,22 +22,53 @@ "build:upgrade": "tsc", "serve:upgrade": "http-server", - "build:cli": "ng build --no-progress", - "serve:cli": "http-server dist/", "build:aot": "ngc -p tsconfig-aot.json && rollup -c rollup-config.js", "serve:aot": "lite-server -c bs-config.aot.json", - "build:babel": "babel src -d src --extensions \".es6\" --source-maps", - "clean": "rimraf src/dist && rimraf src/app/*.js* && rimraf src/universal/*.js* && rimraf src/main.js*", - "copy-dist-files": "node ./copy-dist-files.js", - "i18n": "ng-xi18n" + "copy-dist-files": "node ./copy-dist-files.js" }, "keywords": [], "author": "", "license": "MIT", - "dependencies": {}, + "dependencies": { + "@angular/animations": "~9.0.3", + "@angular/common": "~9.0.3", + "@angular/compiler": "~9.0.3", + "@angular/core": "~9.0.3", + "@angular/forms": "~9.0.3", + "@angular/platform-browser": "~9.0.3", + "@angular/platform-browser-dynamic": "~9.0.3", + "@angular/router": "~9.0.3", + "@angular/upgrade": "~9.0.3", + "rxjs": "~6.5.4", + "tslib": "^1.10.0", + "zone.js": "~0.10.2" + }, "devDependencies": { - "@angular/cli": "^1.2.0" + "@angular/compiler-cli": "~9.0.3", + "@types/angular": "1.6.47", + "@types/angular-animate": "1.5.10", + "@types/angular-mocks": "1.6.0", + "@types/angular-resource": "1.5.14", + "@types/angular-route": "1.3.5", + "@types/jasmine": "~3.5.0", + "@types/jasminewd2": "~2.0.3", + "@types/node": "^12.11.1", + "concurrently": "^5.0.1", + "http-server": "^0.12.0", + "jasmine-core": "~3.5.0", + "karma": "~4.3.0", + "karma-chrome-launcher": "~3.1.0", + "karma-jasmine": "~2.0.1", + "karma-jasmine-html-reporter": "^1.4.2", + "lite-server": "^2.2.2", + "protractor": "~5.4.3", + "rollup": "^1.1.0", + "rollup-plugin-commonjs": "^9.2.1", + "rollup-plugin-node-resolve": "^4.0.0", + "rollup-plugin-uglify": "^1.0.1", + "tslint": "~5.18.0", + "typescript": "~3.7.5" }, "repository": {} }