Skip to content

Commit 5312787

Browse files
committed
update configuration apps
1 parent 3e64ecb commit 5312787

Some content is hidden

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

56 files changed

+573
-602
lines changed

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
22
# For additional information regarding the format and rule options, please see:
33
# https://github.com/browserslist/browserslist#queries
4-
#
5-
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
67

78
> 0.5%
8-
last 2 versions
9-
Firefox ESR
9+
supports es6-module and last 3 major versions
1010
not dead
11-
not IE 9-11
11+
not IE 9-11
12+
not op_mini all

apps/angular-thirty-seconds/.eslintrc.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"overrides": [
55
{
66
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:@nrwl/nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
711
"rules": {
812
"@angular-eslint/directive-selector": "off",
913
"@angular-eslint/component-selector": "off",
1014
"@angular-eslint/no-empty-lifecycle-method": "off",
1115
"@angular-eslint/no-input-rename": "off",
1216
"@angular-eslint/component-class-suffix": "off",
1317
"@angular-eslint/use-lifecycle-interface": "off"
14-
},
15-
"extends": [
16-
"plugin:@nrwl/nx/angular",
17-
"plugin:@angular-eslint/template/process-inline-templates"
18-
]
18+
}
1919
},
2020
{
2121
"files": ["*.html"],
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'angular-thirty-seconds',
4+
preset: '../../jest.preset.js',
5+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
6+
globals: {
7+
'ts-jest': {
8+
tsconfig: '<rootDir>/tsconfig.spec.json',
9+
stringifyContentPathRegex: '\\.(html|svg)$',
10+
},
11+
},
12+
coverageDirectory: '../../coverage/apps/angular-thirty-seconds',
13+
transform: {
14+
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
15+
},
16+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
17+
snapshotSerializers: [
18+
'jest-preset-angular/build/serializers/no-ng-attributes',
19+
'jest-preset-angular/build/serializers/ng-snapshot',
20+
'jest-preset-angular/build/serializers/html-comment',
21+
],
22+
};

apps/angular-thirty-seconds/karma.conf.js

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 28 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
{
2-
"sourceRoot": "apps/angular-thirty-seconds/src",
2+
"name": "angular-thirty-seconds",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
34
"projectType": "application",
5+
"sourceRoot": "apps/angular-thirty-seconds/src",
46
"prefix": "codelab",
5-
"generators": {
6-
"@nrwl/schematics:component": {
7-
"style": "scss"
8-
}
9-
},
107
"targets": {
118
"build": {
129
"executor": "@angular-devkit/build-angular:browser",
@@ -39,54 +36,40 @@
3936
"node_modules/prismjs/prism.js",
4037
"node_modules/prismjs/components/prism-typescript.min.js",
4138
"node_modules/prismjs/plugins/line-numbers/prism-line-numbers.js"
42-
],
43-
"aot": false,
44-
"vendorChunk": true,
45-
"extractLicenses": false,
46-
"buildOptimizer": false,
47-
"sourceMap": true,
48-
"optimization": false,
49-
"namedChunks": true
39+
]
5040
},
41+
"defaultConfiguration": "production",
5142
"configurations": {
43+
"development": {
44+
"buildOptimizer": false,
45+
"optimization": false,
46+
"vendorChunk": true,
47+
"extractLicenses": false,
48+
"sourceMap": true,
49+
"namedChunks": true
50+
},
5251
"production": {
52+
"outputHashing": "all",
5353
"fileReplacements": [
5454
{
5555
"replace": "apps/angular-thirty-seconds/src/environments/environment.ts",
5656
"with": "apps/angular-thirty-seconds/src/environments/environment.prod.ts"
5757
}
58-
],
59-
"baseHref": "/30/",
60-
"deployUrl": "/30/",
61-
"optimization": true,
62-
"outputHashing": "all",
63-
"sourceMap": false,
64-
"namedChunks": false,
65-
"aot": true,
66-
"extractLicenses": true,
67-
"vendorChunk": false,
68-
"buildOptimizer": true,
69-
"budgets": [
70-
{
71-
"type": "initial",
72-
"maximumWarning": "60mb",
73-
"maximumError": "70mb"
74-
}
7558
]
7659
}
77-
},
78-
"defaultConfiguration": ""
60+
}
7961
},
8062
"serve": {
8163
"executor": "@angular-devkit/build-angular:dev-server",
82-
"options": {
83-
"browserTarget": "angular-thirty-seconds:build"
84-
},
8564
"configurations": {
8665
"production": {
8766
"browserTarget": "angular-thirty-seconds:build:production"
67+
},
68+
"development": {
69+
"browserTarget": "angular-thirty-seconds:build:development"
8870
}
89-
}
71+
},
72+
"defaultConfiguration": "development"
9073
},
9174
"extract-i18n": {
9275
"executor": "@angular-devkit/build-angular:extract-i18n",
@@ -95,33 +78,20 @@
9578
}
9679
},
9780
"test": {
98-
"executor": "@angular-devkit/build-angular:karma",
81+
"executor": "@nrwl/jest:jest",
82+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
9983
"options": {
100-
"main": "apps/angular-thirty-seconds/src/test.ts",
101-
"polyfills": "apps/angular-thirty-seconds/src/polyfills.ts",
102-
"tsConfig": "apps/angular-thirty-seconds/tsconfig.spec.json",
103-
"karmaConfig": "apps/angular-thirty-seconds/karma.conf.js",
104-
"styles": [
105-
"apps/angular-thirty-seconds/src/styles.scss"
106-
],
107-
"scripts": [],
108-
"assets": [
109-
"apps/angular-thirty-seconds/src/favicon.ico",
110-
"apps/angular-thirty-seconds/src/assets"
111-
]
84+
"jestConfig": "apps/angular-thirty-seconds/jest.config.ts",
85+
"passWithNoTests": true
11286
}
11387
},
11488
"lint": {
11589
"executor": "@nrwl/linter:eslint",
116-
"outputs": [
117-
"{options.outputFile}"
118-
],
90+
"outputs": ["{options.outputFile}"],
11991
"options": {
120-
"lintFilePatterns": [
121-
"apps/angular-thirty-seconds/**/*.ts",
122-
"apps/angular-thirty-seconds/**/*.html"
123-
]
92+
"lintFilePatterns": ["apps/angular-thirty-seconds/**/*.ts", "apps/angular-thirty-seconds/**/*.html"]
12493
}
12594
}
126-
}
95+
},
96+
"tags": []
12797
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'jest-preset-angular/setup-jest';

apps/angular-thirty-seconds/src/test.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,24 @@ import {
77
platformBrowserDynamicTesting,
88
} from '@angular/platform-browser-dynamic/testing';
99

10+
declare const require: {
11+
context(
12+
path: string,
13+
deep?: boolean,
14+
filter?: RegExp
15+
): {
16+
<T>(id: string): T;
17+
keys(): string[];
18+
};
19+
};
20+
1021
// First, initialize the Angular testing environment.
1122
getTestBed().initTestEnvironment(
1223
BrowserDynamicTestingModule,
13-
platformBrowserDynamicTesting(),
14-
{
15-
teardown: { destroyAfterEach: false },
16-
}
24+
platformBrowserDynamicTesting()
1725
);
26+
27+
// Then we find all the tests.
28+
const context = require.context('./', true, /\.spec\.ts$/);
29+
// And load the modules.
30+
context.keys().forEach(context);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "../../../dist/out-tsc",
5-
"types": [],
6-
"allowSyntheticDefaultImports": true
4+
"outDir": "../../dist/out-tsc",
5+
"types": []
76
},
8-
"exclude": ["test.ts", "**/*.spec.ts"],
9-
"include": ["**/*.ts"]
7+
"files": ["src/main.ts", "src/polyfills.ts"],
8+
"include": ["src/**/*.d.ts"],
9+
"exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"]
1010
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src/**/*.ts"],
4+
"compilerOptions": {
5+
"types": ["jest", "node"]
6+
}
7+
}

0 commit comments

Comments
 (0)