Skip to content

Commit c83ae0c

Browse files
authored
Modernize Angular sample (#96)
1 parent b899eee commit c83ae0c

36 files changed

+9326
-18042
lines changed

samples/angular-sample/.browserslistrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

samples/angular-sample/.gitignore

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,42 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
22

3-
# compiled output
3+
# Compiled output
44
/dist
55
/tmp
66
/out-tsc
7-
# Only exists if Bazel was run
87
/bazel-out
98

10-
# dependencies
9+
# Node
1110
/node_modules
12-
13-
# profiling files
14-
chrome-profiler-events*.json
15-
speed-measure-plugin*.json
11+
npm-debug.log
12+
yarn-error.log
1613

1714
# IDEs and editors
18-
/.idea
15+
.idea/
1916
.project
2017
.classpath
2118
.c9/
2219
*.launch
2320
.settings/
2421
*.sublime-workspace
2522

26-
# IDE - VSCode
23+
# Visual Studio Code
2724
.vscode/*
2825
!.vscode/settings.json
2926
!.vscode/tasks.json
3027
!.vscode/launch.json
3128
!.vscode/extensions.json
3229
.history/*
3330

34-
# misc
31+
# Miscellaneous
3532
/.angular/cache
36-
/.sass-cache
33+
.sass-cache/
3734
/connect.lock
3835
/coverage
3936
/libpeerconnection.log
40-
npm-debug.log
41-
yarn-error.log
4237
testem.log
4338
/typings
4439

45-
# System Files
40+
# System files
4641
.DS_Store
4742
Thumbs.db
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3+
"recommendations": ["angular.ng-template"]
4+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"name": "ng serve",
7+
"type": "chrome",
8+
"request": "launch",
9+
"preLaunchTask": "npm: start",
10+
"url": "http://localhost:4200/"
11+
},
12+
{
13+
"name": "ng test",
14+
"type": "chrome",
15+
"request": "launch",
16+
"preLaunchTask": "npm: test",
17+
"url": "http://localhost:9876/debug.html"
18+
}
19+
]
20+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3+
"version": "2.0.0",
4+
"tasks": [
5+
{
6+
"type": "npm",
7+
"script": "start",
8+
"isBackground": true,
9+
"problemMatcher": {
10+
"owner": "typescript",
11+
"pattern": "$tsc",
12+
"background": {
13+
"activeOnStart": true,
14+
"beginsPattern": {
15+
"regexp": "(.*?)"
16+
},
17+
"endsPattern": {
18+
"regexp": "bundle generation complete"
19+
}
20+
}
21+
}
22+
},
23+
{
24+
"type": "npm",
25+
"script": "test",
26+
"isBackground": true,
27+
"problemMatcher": {
28+
"owner": "typescript",
29+
"pattern": "$tsc",
30+
"background": {
31+
"activeOnStart": true,
32+
"beginsPattern": {
33+
"regexp": "(.*?)"
34+
},
35+
"endsPattern": {
36+
"regexp": "bundle generation complete"
37+
}
38+
}
39+
}
40+
}
41+
]
42+
}

samples/angular-sample/angular.json

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,96 +5,96 @@
55
"projects": {
66
"angular-sample": {
77
"projectType": "application",
8-
"schematics": {},
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
913
"root": "",
1014
"sourceRoot": "src",
1115
"prefix": "app",
1216
"architect": {
1317
"build": {
14-
"builder": "@angular-devkit/build-angular:browser",
18+
"builder": "@angular-devkit/build-angular:application",
1519
"options": {
1620
"outputPath": "dist/angular-sample",
1721
"index": "src/index.html",
18-
"main": "src/main.ts",
19-
"polyfills": "src/polyfills.ts",
22+
"browser": "src/main.ts",
23+
"polyfills": [
24+
"zone.js"
25+
],
2026
"tsConfig": "tsconfig.app.json",
27+
"inlineStyleLanguage": "scss",
2128
"assets": [
2229
"src/favicon.ico",
2330
"src/assets"
2431
],
2532
"styles": [
26-
"src/styles.css"
33+
"src/styles.scss"
2734
],
28-
"scripts": [],
29-
"vendorChunk": true,
30-
"extractLicenses": false,
31-
"buildOptimizer": false,
32-
"sourceMap": true,
33-
"optimization": false,
34-
"namedChunks": true
35+
"scripts": []
3536
},
3637
"configurations": {
3738
"production": {
38-
"fileReplacements": [
39-
{
40-
"replace": "src/environments/environment.ts",
41-
"with": "src/environments/environment.prod.ts"
42-
}
43-
],
44-
"optimization": true,
45-
"outputHashing": "all",
46-
"sourceMap": false,
47-
"namedChunks": false,
48-
"extractLicenses": true,
49-
"vendorChunk": false,
50-
"buildOptimizer": true,
5139
"budgets": [
5240
{
5341
"type": "initial",
54-
"maximumWarning": "2mb",
55-
"maximumError": "5mb"
42+
"maximumWarning": "500kB",
43+
"maximumError": "1MB"
5644
},
5745
{
5846
"type": "anyComponentStyle",
59-
"maximumWarning": "6kb",
60-
"maximumError": "10kb"
47+
"maximumWarning": "2kB",
48+
"maximumError": "4kB"
6149
}
62-
]
50+
],
51+
"outputHashing": "all"
52+
},
53+
"development": {
54+
"optimization": false,
55+
"extractLicenses": false,
56+
"sourceMap": true
6357
}
6458
},
65-
"defaultConfiguration": ""
59+
"defaultConfiguration": "production"
6660
},
6761
"serve": {
6862
"builder": "@angular-devkit/build-angular:dev-server",
69-
"options": {
70-
"browserTarget": "angular-sample:build"
71-
},
7263
"configurations": {
7364
"production": {
74-
"browserTarget": "angular-sample:build:production"
65+
"buildTarget": "angular-sample:build:production"
66+
},
67+
"development": {
68+
"buildTarget": "angular-sample:build:development"
7569
}
76-
}
70+
},
71+
"defaultConfiguration": "development"
7772
},
7873
"extract-i18n": {
79-
"builder": "@angular-devkit/build-angular:extract-i18n",
80-
"options": {
81-
"browserTarget": "angular-sample:build"
82-
}
74+
"builder": "@angular-devkit/build-angular:extract-i18n"
8375
},
84-
"e2e": {
85-
"builder": "@angular-devkit/build-angular:protractor",
76+
"test": {
77+
"builder": "@angular-devkit/build-angular:karma",
8678
"options": {
87-
"protractorConfig": "e2e/protractor.conf.js",
88-
"devServerTarget": "angular-sample:serve"
89-
},
90-
"configurations": {
91-
"production": {
92-
"devServerTarget": "angular-sample:serve:production"
93-
}
79+
"polyfills": [
80+
"zone.js",
81+
"zone.js/testing"
82+
],
83+
"tsConfig": "tsconfig.spec.json",
84+
"inlineStyleLanguage": "scss",
85+
"assets": [
86+
{
87+
"glob": "**/*",
88+
"input": "public"
89+
}
90+
],
91+
"styles": [
92+
"src/styles.scss"
93+
],
94+
"scripts": []
9495
}
9596
}
9697
}
9798
}
98-
},
99-
"defaultProject": "angular-sample"
99+
}
100100
}

samples/angular-sample/karma.conf.js

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)