Skip to content

Commit

Permalink
feat: update angular schematic and sandbox to v12 (#16534)
Browse files Browse the repository at this point in the history
* feat: update schematic deps to angular 12. update sandbox to angular 12.

* chore: remove console.log

* fix: add e2e config option to angular.json that starts server and opens cypress
  • Loading branch information
admah committed May 17, 2021
1 parent 256d0d1 commit 278006d
Show file tree
Hide file tree
Showing 21 changed files with 220 additions and 9,767 deletions.
10 changes: 5 additions & 5 deletions npm/cypress-schematic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"unlink:sandbox": "cd sandbox && yarn unlink @cypress/schematic && cd .. && yarn unlink"
},
"dependencies": {
"@angular-devkit/architect": "^0.1001.0",
"@angular-devkit/core": "^10.1.0",
"@angular-devkit/schematics": "^10.1.0",
"@schematics/angular": "^10.1.0",
"@angular-devkit/architect": "^0.1200.0",
"@angular-devkit/core": "^12.0.0",
"@angular-devkit/schematics": "^12.0.0",
"@schematics/angular": "^12.0.0",
"jsonc-parser": "^3.0.0",
"rxjs": "6.6.2"
},
"devDependencies": {
"@angular-devkit/schematics-cli": "^0.1102.12",
"@angular-devkit/schematics-cli": "^12.0.0",
"@types/chai-enzyme": "0.6.7",
"@types/mocha": "8.0.3",
"@types/node": "^12.11.1",
Expand Down
1 change: 0 additions & 1 deletion npm/cypress-schematic/sandbox/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
Expand Down
4 changes: 2 additions & 2 deletions npm/cypress-schematic/sandbox/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sandbox

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.11.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.0.0.

## Development server

Expand All @@ -20,7 +20,7 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Run `ng e2e` to execute the end-to-end tests via a platform of your choice.

## Further help

Expand Down
82 changes: 32 additions & 50 deletions npm/cypress-schematic/sandbox/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"projects": {
"sandbox": {
"projectType": "application",
"schematics": {},
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
Expand All @@ -18,7 +22,6 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
Expand All @@ -30,44 +33,48 @@
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "sandbox:build"
},
"configurations": {
"production": {
"browserTarget": "sandbox:build:production"
},
"development": {
"browserTarget": "sandbox:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
Expand All @@ -91,31 +98,6 @@
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "sandbox:serve"
},
"configurations": {
"production": {
"devServerTarget": "sandbox:serve:production"
}
}
}
}
}
Expand Down
39 changes: 0 additions & 39 deletions npm/cypress-schematic/sandbox/e2e/protractor.conf.js

This file was deleted.

24 changes: 0 additions & 24 deletions npm/cypress-schematic/sandbox/e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions npm/cypress-schematic/sandbox/e2e/src/app.po.ts

This file was deleted.

13 changes: 0 additions & 13 deletions npm/cypress-schematic/sandbox/e2e/tsconfig.json

This file was deleted.

42 changes: 18 additions & 24 deletions npm/cypress-schematic/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,34 @@
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"dependencies": {
"@angular/animations": "~11.2.12",
"@angular/common": "~11.2.12",
"@angular/compiler": "~11.2.12",
"@angular/core": "~11.2.12",
"@angular/forms": "~11.2.12",
"@angular/platform-browser": "~11.2.12",
"@angular/platform-browser-dynamic": "~11.2.12",
"@angular/router": "~11.2.12",
"@angular/animations": "~12.0.0",
"@angular/common": "~12.0.0",
"@angular/compiler": "~12.0.0",
"@angular/core": "~12.0.0",
"@angular/forms": "~12.0.0",
"@angular/platform-browser": "~12.0.0",
"@angular/platform-browser-dynamic": "~12.0.0",
"@angular/router": "~12.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"
"tslib": "^2.1.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.11",
"@angular/cli": "~11.2.11",
"@angular/compiler-cli": "~11.2.12",
"@angular-devkit/build-angular": "~12.0.0",
"@angular/cli": "~12.0.0",
"@angular/compiler-cli": "~12.0.0",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
"jasmine-core": "~3.7.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.1.5"
"typescript": "~4.2.3"
}
}
13 changes: 1 addition & 12 deletions npm/cypress-schematic/sandbox/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ <h2>Next Steps</h2>
<pre *ngSwitchCase="'pwa'">ng add @angular/pwa</pre>
<pre *ngSwitchCase="'dependency'">ng add _____</pre>
<pre *ngSwitchCase="'test'">ng test</pre>
<pre *ngSwitchCase="'build'">ng build --prod</pre>
<pre *ngSwitchCase="'build'">ng build</pre>
</div>

<!-- Links -->
Expand Down Expand Up @@ -461,17 +461,6 @@ <h2>Next Steps</h2>
</svg>
</a>

<a class="circle-link" title="Protractor" href="https://www.protractortest.org/" target="_blank" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" width="21.81" height="23.447" viewBox="0 0 21.81 23.447">
<title>Angular Protractor Logo</title>
<g id="Group_26" data-name="Group 26" transform="translate(0)">
<path id="Path_28" data-name="Path 28" d="M4620.155,311.417h0l-10.881,3.9,1.637,14.4,9.244,5.152,9.244-5.152,1.685-14.4Z" transform="translate(-4609.274 -311.417)" fill="#e13439"/>
<path id="Path_29" data-name="Path 29" d="M4702.088,311.417v23.447l9.244-5.152,1.685-14.4Z" transform="translate(-4691.207 -311.417)" fill="#b52f32"/>
<path id="Path_30" data-name="Path 30" d="M4651.044,369.58v-.421h1.483a7.6,7.6,0,0,0-2.106-5.052l-1.123,1.123-.3-.3,1.122-1.121a7.588,7.588,0,0,0-4.946-2.055v1.482h-.421v-1.485a7.589,7.589,0,0,0-5.051,2.058l1.122,1.121-.3.3-1.123-1.123a7.591,7.591,0,0,0-2.106,5.052h1.482v.421h-1.489v1.734h15.241V369.58Zm-10.966-.263a4.835,4.835,0,0,1,9.67,0Z" transform="translate(-4634.008 -355.852)" fill="#fff"/>
</g>
</svg>
</a>

<a class="circle-link" title="Find a Local Meetup" href="https://www.meetup.com/find/?keywords=angular" target="_blank" rel="noopener">
<svg xmlns="http://www.w3.org/2000/svg" width="24.607" height="23.447" viewBox="0 0 24.607 23.447">
<title>Meetup Logo</title>
Expand Down
4 changes: 2 additions & 2 deletions npm/cypress-schematic/sandbox/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

export const environment = {
Expand All @@ -13,4 +13,4 @@ export const environment = {
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
2 changes: 1 addition & 1 deletion npm/cypress-schematic/sandbox/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ if (environment.production) {
}

platformBrowserDynamic().bootstrapModule(AppModule)
.catch((err) => console.error(err)) // eslint-disable-line no-console
.catch((err) => console.error(err))
2 changes: 1 addition & 1 deletion npm/cypress-schematic/sandbox/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone' // Included with Angular CLI.
import 'zone.js' // Included with Angular CLI.

/***************************************************************************************************
* APPLICATION IMPORTS
Expand Down
2 changes: 1 addition & 1 deletion npm/cypress-schematic/sandbox/src/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/zone-testing'
import 'zone.js/testing'
import { getTestBed } from '@angular/core/testing'
import {
BrowserDynamicTestingModule,
Expand Down

0 comments on commit 278006d

Please sign in to comment.