Skip to content

Commit

Permalink
Merge pull request #4 from safe-fleet/feat/upgrade-angular
Browse files Browse the repository at this point in the history
feat(*): upgrade to angular 13
  • Loading branch information
camilo1006 authored Oct 7, 2022
2 parents de666fd + 5c75ca6 commit 509304f
Show file tree
Hide file tree
Showing 15 changed files with 40,677 additions and 21,399 deletions.
51 changes: 51 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"root": true,
"ignorePatterns": [
"projects/testing/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"prefix": "mew",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "mew",
"style": "camelCase",
"type": "attribute"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ node_modules
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
51 changes: 11 additions & 40 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"version": 1,
"newProjectRoot": "projects",
"cli": {
"packageManager": "yarn"
"analytics": false,
"packageManager": "yarn",
"defaultCollection": "@angular-eslint/schematics"
},
"projects": {
"ngx-translate-plugins": {
Expand All @@ -21,13 +23,8 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -73,14 +70,9 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"src/styles.css"
],
"styles": ["src/styles.css"],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
"assets": ["src/favicon.ico", "src/assets"]
},
"configurations": {
"headless": {
Expand All @@ -89,15 +81,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
Expand All @@ -117,15 +103,6 @@
"devServerTarget": "ngx-translate-plugins:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
},
Expand Down Expand Up @@ -161,15 +138,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"projects/testing/tsconfig.lib.json",
"projects/testing/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
"lintFilePatterns": ["projects/testing/**/*.ts", "projects/testing/**/*.html"]
}
}
}
Expand Down
24 changes: 10 additions & 14 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@ module.exports = {
'ts-jest': {
tsconfig: './projects/testing/tsconfig.spec.json',
stringifyContentPathRegex: '\\.html$',
astTransformers: {
before: [
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer',
],
},
diagnostics: {
ignoreCodes: [151001],
},
},
ignoreCodes: [151001]
}
}
},
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest',
'^.+\\.(ts|js|mjs|html|svg)$': 'jest-preset-angular'
},
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/setupJest.ts'],
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],
moduleFileExtensions: ['ts', 'js', 'html'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', 'contract.spec.ts$', 'comp.spec.ts$'],
silent: true,
moduleDirectories: ['node_modules'],
moduleDirectories: ['node_modules', '.'],
roots: ['<rootDir>/projects/testing/src'],
collectCoverage: true,
collectCoverageFrom: [
Expand All @@ -41,8 +35,10 @@ module.exports = {
'!**/*.d.ts',
'!**/public-api.ts'
],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/projects/testing/' }),
transformIgnorePatterns: [`/node_modules/`],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/projects/testing/'
}),
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
coverageDirectory: 'coverage',
coverageReporters: ['json', 'lcov', 'clover', 'html', 'text'],
coverageReporters: ['json', 'lcov', 'clover', 'html', 'text']
};
Loading

0 comments on commit 509304f

Please sign in to comment.