Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 1c9b4f6

Browse files
committed
build: update dependencies and add script to optimize scene images
- update to Angular 11.2.5 for faster rebuild times - update puppeteer, typescript, light-server, karma, firebase-tools, rxjs, zone.js - update stackblitz dependencies as well - update lighthouse and skipped HTTPS audits based on angular/angular@2cd66ee - use imagemin with pngquant to optimize the PNG images generated for the component scenes - Annie used pngquant to do this once in 7/20 and this tries to match those quality settings and sizes - fix warning about SpecReporter's displayStacktrace option - reduce audit perf min since we see 28 sometimes in CI - switch to the new Firebase emulators since `firebase serve` is deprecated
1 parent 71e9cc6 commit 1c9b4f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1529
-553
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ npm-debug.log
4141
yarn-error.log
4242
testem.log
4343
firebase-debug.log
44+
ui-debug.log
4445
.firebase/
4546
/typings
4647

firebase.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,14 @@
8787
"tmp",
8888
"deploy"
8989
]
90+
},
91+
"emulators": {
92+
"hosting": {
93+
"port": 4200
94+
},
95+
"ui": {
96+
"enabled": true,
97+
"port": 4202
98+
}
9099
}
91100
}

package.json

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
"start:jit": "ng serve --aot=false",
1010
"start:prod": "ng serve --prod",
1111
"start:scenes": "ng serve scenes",
12-
"start:static": "firebase serve --only hosting --port 4200",
12+
"start:emulators": "firebase emulators:start",
1313
"lint": "ng lint",
1414
"test": "ng test",
15-
"pree2e": "webdriver-manager update",
1615
"e2e": "ng e2e",
17-
"generate-scenes": "ng e2e --port 4201 scenes",
1816
"build": "ng build",
1917
"build:scenes": "ng build scenes",
2018
"build:content": "yarn upgrade @angular/components-examples",
2119
"build:sm": "ng build --prod --source-map",
2220
"prod-build": "ng build --prod",
23-
"postinstall": "webdriver-manager update --gecko false && ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
21+
"postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points",
2422
"publish-prod": "bash ./tools/deploy.sh stable prod",
2523
"publish-dev": "bash ./tools/deploy.sh",
2624
"publish-beta": "bash ./tools/deploy.sh stable beta",
25+
"scenes:generate": "ng e2e --port 4201 scenes && yarn scenes:optimize",
26+
"scenes:optimize": "node tools/optimize-scene-screenshots",
2727
"test:audit:a11y": "node tools/audit-docs-a11y",
2828
"test:audit:a11y:localhost": "run-p --race \"~~light-server -s dist/material-angular-io -p 4200 --quiet\" \"test:audit:a11y http://localhost:4200\" --",
2929
"test:audit:a11y:ci": "run-p --race \"~~light-server -s ../dist/material-angular-io -p 4200 --quiet\" \"test:audit:a11y http://localhost:4200\" --",
@@ -34,55 +34,58 @@
3434
},
3535
"private": true,
3636
"dependencies": {
37-
"@angular/animations": "^11.1.2",
37+
"@angular/animations": "^11.2.5",
3838
"@angular/cdk": "^11.2.4",
3939
"@angular/cdk-experimental": "^11.2.4",
40-
"@angular/common": "^11.1.2",
41-
"@angular/compiler": "^11.1.2",
40+
"@angular/common": "^11.2.5",
41+
"@angular/compiler": "^11.2.5",
4242
"@angular/components-examples": "angular/material2-docs-content#11.2.x",
43-
"@angular/core": "^11.1.2",
44-
"@angular/forms": "^11.1.2",
43+
"@angular/core": "^11.2.5",
44+
"@angular/forms": "^11.2.5",
4545
"@angular/google-maps": "^11.2.4",
4646
"@angular/material": "^11.2.4",
4747
"@angular/material-experimental": "^11.2.4",
4848
"@angular/material-moment-adapter": "^11.2.4",
49-
"@angular/platform-browser": "^11.1.2",
50-
"@angular/platform-browser-dynamic": "^11.1.2",
51-
"@angular/router": "^11.1.2",
49+
"@angular/platform-browser": "^11.2.5",
50+
"@angular/platform-browser-dynamic": "^11.2.5",
51+
"@angular/router": "^11.2.5",
5252
"@angular/youtube-player": "^11.2.4",
5353
"material-components-web": "10.0.0-canary.2ed2d829b.0",
5454
"moment": "^2.29.1",
55-
"rxjs": "^6.6.3",
55+
"rxjs": "^6.6.6",
5656
"tslib": "^2.1.0",
57-
"zone.js": "^0.11.3"
57+
"zone.js": "^0.11.4"
5858
},
5959
"devDependencies": {
60-
"@angular-devkit/build-angular": "^0.1101.4",
61-
"@angular/cli": "^11.1.4",
62-
"@angular/compiler-cli": "^11.1.2",
63-
"@angular/localize": "^11.1.2",
64-
"@types/jasmine": "^3.6.0",
65-
"@types/node": "^12.19.12",
60+
"@angular-devkit/build-angular": "^0.1102.4",
61+
"@angular/cli": "^11.2.4",
62+
"@angular/compiler-cli": "^11.2.5",
63+
"@angular/localize": "^11.2.5",
64+
"@types/imagemin": "^7.0.0",
65+
"@types/jasmine": "^3.6.6",
66+
"@types/node": "^12.20.5",
6667
"@types/shelljs": "~0.8.8",
6768
"codelyzer": "^6.0.1",
68-
"firebase-tools": "^9.2.1",
69+
"firebase-tools": "^9.6.0",
70+
"imagemin": "^7.0.1",
71+
"imagemin-pngquant": "^9.0.2",
6972
"jasmine-core": "^3.6.0",
70-
"jasmine-spec-reporter": "^5.0.2",
71-
"karma": "~5.2.1",
73+
"jasmine-spec-reporter": "^6.0.0",
74+
"karma": "~6.2.0",
7275
"karma-chrome-launcher": "^3.1.0",
7376
"karma-coverage-istanbul-reporter": "^3.0.3",
7477
"karma-firefox-launcher": "^2.1.0",
7578
"karma-jasmine": "^4.0.1",
7679
"karma-jasmine-html-reporter": "^1.5.4",
77-
"light-server": "^2.6.2",
78-
"lighthouse": "~7.0.0",
80+
"light-server": "^2.9.1",
81+
"lighthouse": "~7.2.0",
7982
"lighthouse-logger": "~1.2.0",
8083
"npm-run-all": "^4.1.5",
8184
"protractor": "^7.0.0",
82-
"puppeteer": "5.4.1",
85+
"puppeteer": "~8.0.0",
8386
"shelljs": "^0.8.4",
8487
"ts-node": "^8.10.2",
8588
"tslint": "^6.1.3",
86-
"typescript": "4.1.2"
89+
"typescript": "~4.1.5"
8790
}
8891
}

scenes/e2e/protractor.conf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Protractor configuration file, see link for more information
33
// https://github.com/angular/protractor/blob/master/lib/config.ts
44

5+
const { StacktraceOption } = require('jasmine-spec-reporter/built/configuration');
56
const { SpecReporter } = require('jasmine-spec-reporter');
67

78
/**
@@ -27,6 +28,6 @@ exports.config = {
2728
require('ts-node').register({
2829
project: require('path').join(__dirname, './tsconfig.json')
2930
});
30-
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: StacktraceOption.PRETTY } }));
3132
}
32-
};
33+
};

src/app/shared/stack-blitz/stack-blitz-writer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ const dependencies = {
7373
'@angular/router': angularVersion,
7474
'angular-in-memory-web-api': '~0.11.0',
7575
'moment': '^2.29.1',
76-
'rxjs': '^6.6.3',
76+
'rxjs': '^6.6.6',
7777
'tslib': '^2.1.0',
78-
'zone.js': '^0.11.3',
78+
'zone.js': '^0.11.4',
7979
};
8080

8181
const testDependencies = {
@@ -90,13 +90,13 @@ const testDependencies = {
9090
'@angular/platform-browser': angularVersion,
9191
'@angular/platform-browser-dynamic': angularVersion,
9292
'@angular/router': angularVersion,
93-
'@types/jasmine': '^3.6.0',
93+
'@types/jasmine': '^3.6.6',
9494
'angular-in-memory-web-api': '~0.11.0',
9595
'jasmine-core': '^3.6.0',
9696
'moment': '^2.29.1',
97-
'rxjs': '^6.6.3',
97+
'rxjs': '^6.6.6',
9898
'tslib': '^2.1.0',
99-
'zone.js': '^0.11.3',
99+
'zone.js': '^0.11.4',
100100
};
101101

102102
/**
-68 Bytes
5 Bytes
116 Bytes
22 Bytes
-286 Bytes

src/assets/screenshots/card.scene.png

11 Bytes
-295 Bytes
-322 Bytes
-403 Bytes
-819 Bytes
-15 Bytes
-129 Bytes
15 Bytes
30 Bytes

src/assets/screenshots/icon.scene.png

-148 Bytes
-52 Bytes

src/assets/screenshots/list.scene.png

-30 Bytes

src/assets/screenshots/menu.scene.png

-78 Bytes
9 Bytes
29 Bytes
-110 Bytes
-580 Bytes
1.51 KB
87 Bytes
-276 Bytes
-423 Bytes
-67 Bytes
-143 Bytes

src/assets/screenshots/sort.scene.png

-133 Bytes
-451 Bytes
-152 Bytes

src/assets/screenshots/tabs.scene.png

-14 Bytes
5 Bytes
-161 Bytes

src/assets/screenshots/tree.scene.png

-2 Bytes

src/assets/stack-blitz/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@
2424
"@angular/router": "^11.0.0",
2525
"angular-in-memory-web-api": "~0.11.0",
2626
"moment": "^2.29.1",
27-
"rxjs": "^6.6.3",
28-
"tslib": "^2.0.3",
29-
"zone.js": "^0.11.2"
27+
"rxjs": "^6.6.6",
28+
"tslib": "^2.1.0",
29+
"zone.js": "^0.11.4"
3030
},
3131
"devDependencies": {
32-
"@angular-devkit/build-angular": "^0.1101.0",
33-
"@angular/cli": "^11.1.0",
32+
"@angular-devkit/build-angular": "^0.1102.4",
33+
"@angular/cli": "^11.2.4",
3434
"@angular/compiler-cli": "^11.0.0",
3535
"@angular/language-service": "^11.0.0",
3636
"@angular/localize": "^11.0.0",
37-
"@types/node": "^12.19.12",
37+
"@types/node": "^12.20.5",
3838
"codelyzer": "^6.0.1",
3939
"ts-node": "^8.10.2",
4040
"tslint": "~6.1.3",
41-
"typescript": "~4.1.2"
41+
"typescript": "~4.1.5"
4242
}
4343
}

tools/audit-docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const MIN_SCORES_PER_PAGE = [
3232
url: '',
3333
minScores: {
3434
'pwa': 70,
35-
'performance': 30,
35+
'performance': 28,
3636
'seo': 98,
3737
'best-practices': 100,
3838
'accessibility': 100

tools/lighthouse-audit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const LIGHTHOUSE_FLAGS = {
1717
logLevel : process.env.CI ? 'error' : 'info'
1818
}; // Be less verbose on CI.
1919
const SKIPPED_HTTPS_AUDITS = [
20-
'redirects-http', 'uses-http2', 'uses-long-cache-ttl', 'canonical', 'uses-text-compression'
20+
'uses-long-cache-ttl', 'canonical', 'uses-text-compression'
2121
];
2222
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer';
2323
const WAIT_FOR_SW_DELAY = 5000;

tools/optimize-scene-screenshots.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/env node
2+
'use strict';
3+
4+
const imagemin = require('imagemin');
5+
const imageminPngquant = require('imagemin-pngquant');
6+
7+
/**
8+
* Runs imagemin with pngquant to optimize the PNG images generated for the component scenes.
9+
*
10+
* Usage:
11+
* ```sh
12+
* node tools/optimize-scene-screenshots
13+
* ```
14+
*/
15+
16+
// Imports
17+
const sh = require('shelljs');
18+
sh.set('-e');
19+
20+
imagemin(['src/assets/screenshots/*.png'], {
21+
destination: 'src/assets/screenshots',
22+
plugins: [imageminPngquant({quality: [0.4, 0.6]})]
23+
})
24+
.then(() => console.log('Optimization complete.'))
25+
.catch(error => console.error);

0 commit comments

Comments
 (0)