Skip to content

Commit 80593ea

Browse files
authored
chore: upgrade sample to angular 14 (#1968)
* chore: upgrade ng 12 => ng 13 * chore: upgrade sample to angular 14 * fix: restore provided msal public client behavior a regression removed the functionality to correctly use an explicity provided Msal PublicClientApplication originaly delivered in #1181. This fixes the regresssion, cleans up repeated code, and adds missing doc comments * fix: rewrite css to ensure correct excaping of unicode characters for lit * moved gulp-replace-task to devDependencies
1 parent 1edf635 commit 80593ea

File tree

10 files changed

+70
-14543
lines changed

10 files changed

+70
-14543
lines changed

gulpfile.js

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const sass = require('gulp-sass')(require('sass'));
33
const gap = require('gulp-append-prepend');
44
const cleanCSS = require('gulp-clean-css');
55
const rename = require('gulp-rename');
6-
var license = require('gulp-header-license');
6+
const license = require('gulp-header-license');
7+
const replace = require('gulp-replace-task');
78

89
scssFileHeader = `
910
// THIS FILE IS AUTO GENERATED
@@ -36,14 +37,27 @@ export const PACKAGE_VERSION = '[VERSION]';
3637
`;
3738

3839
function runSass() {
39-
return gulp
40-
.src('src/**/!(shared)*.scss')
41-
.pipe(sass())
42-
.pipe(cleanCSS())
43-
.pipe(gap.prependText(scssFileHeader))
44-
.pipe(gap.appendText(scssFileFooter))
45-
.pipe(rename({ extname: '-css.ts' }))
46-
.pipe(gulp.dest('src/'));
40+
return (
41+
gulp
42+
.src('src/**/!(shared)*.scss')
43+
.pipe(sass())
44+
.pipe(cleanCSS())
45+
// replacement to make office-ui-fabric-core icons work with lit-element
46+
.pipe(
47+
replace({
48+
patterns: [
49+
{
50+
match: /:"\\([0-9a-f])/g,
51+
replacement: ':"\\u$1'
52+
}
53+
]
54+
})
55+
)
56+
.pipe(gap.prependText(scssFileHeader))
57+
.pipe(gap.appendText(scssFileFooter))
58+
.pipe(rename({ extname: '-css.ts' }))
59+
.pipe(gulp.dest('src/'))
60+
);
4761
}
4862

4963
function setLicense() {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"gulp-clean-css": "4.3.0",
8686
"gulp-header-license": "^1.0.10",
8787
"gulp-rename": "^2.0.0",
88+
"gulp-replace-task": "^2.0.1",
8889
"gulp-sass": "^5.1.0",
8990
"gulp-util": "^3.0.8",
9091
"husky": "^4.3.0",

samples/angular-app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ speed-measure-plugin*.json
3232
.history/*
3333

3434
# misc
35+
/.angular/cache
3536
/.sass-cache
3637
/connect.lock
3738
/coverage

samples/angular-app/angular.json

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,17 @@
1818
"prefix": "app",
1919
"architect": {
2020
"build": {
21-
"builder": "@angular-builders/custom-webpack:browser",
21+
"builder": "@angular-devkit/build-angular:browser",
2222
"options": {
23-
"customWebpackConfig": {
24-
"path": "./webpack.config.js"
25-
},
2623
"outputPath": "dist/demo-mgt-angular",
2724
"index": "src/index.html",
2825
"main": "src/main.ts",
2926
"polyfills": "src/polyfills.ts",
3027
"tsConfig": "tsconfig.app.json",
28+
"inlineStyleLanguage": "scss",
3129
"aot": true,
32-
"assets": [
33-
"src/favicon.ico",
34-
"src/assets"
35-
],
36-
"styles": [
37-
"src/styles.scss"
38-
],
30+
"assets": ["src/favicon.ico", "src/assets"],
31+
"styles": ["src/styles.scss"],
3932
"scripts": []
4033
},
4134
"configurations": {
@@ -66,25 +59,31 @@
6659
"maximumError": "10kb"
6760
}
6861
]
62+
},
63+
"development": {
64+
"buildOptimizer": false,
65+
"optimization": false,
66+
"vendorChunk": true,
67+
"extractLicenses": false,
68+
"sourceMap": true,
69+
"namedChunks": true
6970
}
7071
}
7172
},
7273
"serve": {
73-
"builder": "@angular-builders/custom-webpack:dev-server",
74+
"builder": "@angular-devkit/build-angular:dev-server",
7475
"options": {
7576
"browserTarget": "demo-mgt-angular:build"
7677
},
7778
"configurations": {
7879
"production": {
7980
"browserTarget": "demo-mgt-angular:build:production"
81+
},
82+
"development": {
83+
"browserTarget": "demo-mgt-angular:build:development"
8084
}
81-
}
82-
},
83-
"extract-i18n": {
84-
"builder": "@angular-devkit/build-angular:extract-i18n",
85-
"options": {
86-
"browserTarget": "demo-mgt-angular:build"
87-
}
85+
},
86+
"defaultConfiguration": "development"
8887
},
8988
"test": {
9089
"builder": "@angular-devkit/build-angular:karma",
@@ -93,29 +92,11 @@
9392
"polyfills": "src/polyfills.ts",
9493
"tsConfig": "tsconfig.spec.json",
9594
"karmaConfig": "karma.conf.js",
96-
"assets": [
97-
"src/favicon.ico",
98-
"src/assets"
99-
],
100-
"styles": [
101-
"src/styles.scss"
102-
],
95+
"assets": ["src/favicon.ico", "src/assets"],
96+
"styles": ["src/styles.scss"],
10397
"scripts": []
10498
}
10599
},
106-
"lint": {
107-
"builder": "@angular-devkit/build-angular:tslint",
108-
"options": {
109-
"tsConfig": [
110-
"tsconfig.app.json",
111-
"tsconfig.spec.json",
112-
"e2e/tsconfig.json"
113-
],
114-
"exclude": [
115-
"**/node_modules/**"
116-
]
117-
}
118-
},
119100
"e2e": {
120101
"builder": "@angular-devkit/build-angular:protractor",
121102
"options": {
@@ -129,6 +110,6 @@
129110
}
130111
}
131112
}
132-
}},
133-
"defaultProject": "demo-mgt-angular"
113+
}
114+
}
134115
}

0 commit comments

Comments
 (0)