Skip to content

Commit 4a5cebb

Browse files
committedMay 28, 2021
build: update to Angular, CLI, and Material to v12
- update other dependencies - fix npm audit warnings
1 parent 9f505c2 commit 4a5cebb

8 files changed

+4631
-5334
lines changed
 

‎angular.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"build": {
2525
"builder": "@angular-devkit/build-angular:browser",
2626
"options": {
27-
"aot": true,
2827
"outputPath": "dist/",
2928
"index": "src/index.html",
3029
"main": "src/main.ts",
@@ -38,10 +37,14 @@
3837
"angular-aria",
3938
"angular-material",
4039
"angular-messages",
41-
"angular-sanitize",
42-
"zone.js/dist/zone-error",
43-
"zone.js/dist/zone"
44-
]
40+
"angular-sanitize"
41+
],
42+
"vendorChunk": true,
43+
"extractLicenses": false,
44+
"buildOptimizer": false,
45+
"sourceMap": true,
46+
"optimization": false,
47+
"namedChunks": true
4548
},
4649
"configurations": {
4750
"production": {
@@ -53,9 +56,7 @@
5356
],
5457
"optimization": true,
5558
"outputHashing": "all",
56-
"sourceMap": true,
5759
"namedChunks": false,
58-
"aot": true,
5960
"extractLicenses": true,
6061
"vendorChunk": false,
6162
"buildOptimizer": true,

‎package-lock.json

+4,562-5,268
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-angular-material-hybrid-demo",
3-
"version": "0.5.2",
3+
"version": "1.0.0",
44
"private": true,
55
"scripts": {
66
"ng": "ng",
@@ -9,25 +9,25 @@
99
"build:templates": "gulp templates",
1010
"watch:templates": "gulp watch",
1111
"build": "npm run build:templates && ng build",
12-
"build:prod": "npm run build:templates && ng build --prod",
12+
"build:prod": "npm run build:templates && ng build -c production",
1313
"prettier": "prettier --write \"**/*.{js,json,css,scss,less,md,ts,html,component.html}\"",
1414
"lint": "ng lint",
1515
"smex": "source-map-explorer",
1616
"deploy": "npm run build:templates && ng deploy",
1717
"update": "npm-check -u"
1818
},
1919
"dependencies": {
20-
"@angular/animations": "11.2.1",
21-
"@angular/cdk": "11.2.1",
22-
"@angular/common": "11.2.1",
23-
"@angular/compiler": "11.2.1",
24-
"@angular/core": "11.2.1",
25-
"@angular/fire": "^6.1.4",
26-
"@angular/forms": "11.2.1",
27-
"@angular/material": "11.2.1",
28-
"@angular/platform-browser": "11.2.1",
29-
"@angular/platform-browser-dynamic": "11.2.1",
30-
"@angular/upgrade": "11.2.1",
20+
"@angular/animations": "12.0.2",
21+
"@angular/cdk": "12.0.2",
22+
"@angular/common": "12.0.2",
23+
"@angular/compiler": "12.0.2",
24+
"@angular/core": "12.0.2",
25+
"@angular/fire": "^6.1.5",
26+
"@angular/forms": "12.0.2",
27+
"@angular/material": "12.0.2",
28+
"@angular/platform-browser": "12.0.2",
29+
"@angular/platform-browser-dynamic": "12.0.2",
30+
"@angular/upgrade": "12.0.2",
3131
"@schuchard/prettier": "^5.0.0",
3232
"@types/angular": "^1.8.1",
3333
"@types/angular-material": "^1.1.72",
@@ -37,36 +37,36 @@
3737
"angular-material": "^1.2.2",
3838
"angular-messages": "^1.8.2",
3939
"angular-sanitize": "^1.8.2",
40-
"firebase": "^8.2.9",
41-
"rxjs": "^6.6.3",
42-
"tslib": "^2.1.0",
40+
"firebase": "^8.6.3",
41+
"rxjs": "^6.6.7",
42+
"tslib": "^2.2.0",
4343
"zone.js": "~0.11.4"
4444
},
4545
"devDependencies": {
46-
"@angular-devkit/architect": "^0.1102.1",
47-
"@angular-devkit/build-angular": "~0.1102.1",
48-
"@angular/cli": "~11.2.1",
49-
"@angular/compiler-cli": "~11.2.1",
50-
"@angular/language-service": "~11.2.1",
46+
"@angular-devkit/architect": "^0.1200.2",
47+
"@angular-devkit/build-angular": "~12.0.2",
48+
"@angular/cli": "~12.0.2",
49+
"@angular/compiler-cli": "~12.0.2",
50+
"@angular/language-service": "~12.0.2",
5151
"@types/gulp": "^4.0.8",
5252
"@types/node": "^14.14.31",
53-
"codelyzer": "^6.0.1",
53+
"codelyzer": "^6.0.2",
5454
"debug": "^4.3.1",
55-
"firebase-tools": "^9.4.0",
55+
"firebase-tools": "^9.12.0",
5656
"gulp": "~4.0.2",
5757
"gulp-angular-templatecache": "~3.0.0",
5858
"gulp-htmlmin": "~5.0.1",
59-
"husky": "4.3.6",
60-
"lint-staged": "^10.5.4",
59+
"husky": "~4.3.8",
60+
"lint-staged": "^11.0.0",
6161
"npm-check": "^5.9.2",
6262
"prettier": "^2.2.1",
63-
"rxjs-tslint-rules": "^4.34.7",
63+
"rxjs-tslint-rules": "^4.34.8",
6464
"source-map-explorer": "^2.5.2",
6565
"ts-node": "^9.1.1",
6666
"tslint": "~6.1.3",
6767
"tslint-config-prettier": "1.18.0",
6868
"tsutils": "^3.20.0",
69-
"typescript": "~4.0.5"
69+
"typescript": "~4.2.4"
7070
},
7171
"husky": {
7272
"hooks": {

‎src/_theme.scss

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1+
@use '~@angular/material' as mat;
12
// Custom Theming for Angular Material
23
// For more information: https://material.angular.io/guide/theming
3-
@import '~@angular/material/theming';
44

55
// Define the palettes for your theme using the Material Design palettes available in palette.scss
66
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
77
// hue. Available color palettes: https://material.io/design/color/
8-
$app-primary: mat-palette($mat-indigo);
9-
$app-accent: mat-palette($mat-green);
8+
$app-primary: mat.define-palette(mat.$indigo-palette);
9+
$app-accent: mat.define-palette(mat.$green-palette);
1010

1111
// The warn palette is optional (defaults to red).
12-
$app-warn: mat-palette($mat-red);
12+
$app-warn: mat.define-palette(mat.$red-palette);
1313

1414
// Override the grey background with white
15-
$mat-light-theme-background: (
16-
status-bar: map_get($mat-grey, 300),
17-
app-bar: map_get($mat-grey, 100),
18-
background: map_get($mat-grey, A100),
15+
mat.$light-theme-background-palette: (
16+
status-bar: map_get(mat.$grey-palette, 300),
17+
app-bar: map_get(mat.$grey-palette, 100),
18+
background: map_get(mat.$grey-palette, A100),
1919
hover: rgba(black, 0.04),
2020
card: white,
2121
dialog: white,
2222
disabled-button: rgba(black, 0.12),
2323
raised-button: white,
24-
focused-button: $dark-focused,
25-
selected-button: map_get($mat-grey, 300),
26-
selected-disabled-button: map_get($mat-grey, 400),
27-
disabled-button-toggle: map_get($mat-grey, 200),
28-
unselected-chip: map_get($mat-grey, 300),
29-
disabled-list-option: map_get($mat-grey, 200),
30-
tooltip: map_get($mat-grey, 700),
24+
focused-button: rgba(black, 0.12),
25+
selected-button: map_get(mat.$grey-palette, 300),
26+
selected-disabled-button: map_get(mat.$grey-palette, 400),
27+
disabled-button-toggle: map_get(mat.$grey-palette, 200),
28+
unselected-chip: map_get(mat.$grey-palette, 300),
29+
disabled-list-option: map_get(mat.$grey-palette, 200),
30+
tooltip: map_get(mat.$grey-palette, 700)
3131
);
3232

3333
// Create the theme object (a Sass map containing all of the palettes).
34-
$app-theme: mat-light-theme($app-primary, $app-accent, $app-warn);
34+
$app-theme: mat.define-light-theme($app-primary, $app-accent, $app-warn);
3535

36-
$custom-typography: mat-typography-config(
37-
$body-1: mat-typography-level(16px, 24px, 400),
36+
$custom-typography: mat.define-typography-config(
37+
$body-1: mat.define-typography-level(16px, 24px, 400),
3838
);

‎src/environments/environment.prod.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { version } from '../../package.json';
1+
import packageInfo from '../../package.json';
22

33
export const environment = {
44
production: true,
5-
version,
5+
version: packageInfo.version,
66
};

‎src/environments/environment.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { version } from '../../package.json';
1+
import packageInfo from '../../package.json';
22

33
// This file can be replaced during build by using the `fileReplacements` array.
44
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
55
// The list of file replacements can be found in `angular.json`.
66

77
export const environment = {
88
production: false,
9-
version,
9+
version: packageInfo.version,
1010
};
1111

1212
/*

‎src/styles.scss

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
@import 'theme';
1+
@use '~@angular/material' as mat;
2+
@use 'theme';
23

34
// Include the common styles for Angular Material. We include this here so that you only
45
// have to load a single css file for Angular Material in your app.
56
// Be sure that you only ever include this mixin once!
6-
@include mat-core($custom-typography);
7+
@include mat.core(theme.$custom-typography);
78

89
// Include theme styles for core and each component used in your app.
910
// Alternatively, you can import and @include the theme mixins for each component
1011
// that you are using.
11-
@include mat-core-theme($app-theme);
12-
@include mat-button-theme($app-theme);
13-
@include mat-icon-theme($app-theme);
14-
@include mat-toolbar-theme($app-theme);
15-
@include mat-divider-theme($app-theme);
16-
@include mat-expansion-panel-theme($app-theme);
17-
@include mat-progress-spinner-theme($app-theme);
18-
@include mat-tabs-theme($app-theme);
12+
@include mat.core-theme(theme.$app-theme);
13+
@include mat.button-theme(theme.$app-theme);
14+
@include mat.icon-theme(theme.$app-theme);
15+
@include mat.toolbar-theme(theme.$app-theme);
16+
@include mat.divider-theme(theme.$app-theme);
17+
@include mat.expansion-theme(theme.$app-theme);
18+
@include mat.progress-spinner-theme(theme.$app-theme);
19+
@include mat.tabs-theme(theme.$app-theme);
1920

2021
/* You can add global styles to this file, and also import other style files */
2122

‎tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"baseUrl": "./",
55
"outDir": "./dist/out-tsc",
6+
"allowSyntheticDefaultImports": true,
67
"forceConsistentCasingInFileNames": true,
78
"strict": true,
89
"noImplicitReturns": true,

0 commit comments

Comments
 (0)
Failed to load comments.