Skip to content

Commit

Permalink
feat(angular): upgrade to Angular 15 (ant-design#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
jornare committed Nov 29, 2022
1 parent e9222e5 commit 947c72e
Show file tree
Hide file tree
Showing 12 changed files with 153 additions and 279 deletions.
50 changes: 50 additions & 0 deletions packages/icons-angular/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"prefix": "app",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "app",
"style": "camelCase",
"type": "attribute"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
24 changes: 23 additions & 1 deletion packages/icons-angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@
}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
Expand Down Expand Up @@ -118,11 +127,24 @@
}
]
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"analytics": false
"analytics": false,
"schematicCollections": [
"@angular-eslint/schematics",
"@angular-eslint/schematics"
]
}
}
46 changes: 25 additions & 21 deletions packages/icons-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"start": "ng serve",
"lint": "ng lint",
"test": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCI --code-coverage",
"build": "ng build --prod",
"build": "ng build examples --configuration production",
"build:lib": "npm run generate && ng build ant-design-icons-angular --configuration production && npm run copy:assets",
"generate": "cross-env TS_NODE_PROJECT=scripts/tsconfig.json node --require ts-node/register scripts/generate.ts",
"copy:assets": "cross-env node --require ts-node/register scripts/copy.ts",
Expand All @@ -15,30 +15,36 @@
"license": "MIT",
"private": true,
"dependencies": {
"@ant-design/colors": "^5.0.0",
"@angular/common": "^14.1.0",
"@angular/core": "^14.1.0"
"@angular/common": "^15.0.1",
"@angular/core": "^15.0.1",
"@ant-design/colors": "^5.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.1.0",
"@angular/animations": "^14.1.0",
"@angular/cli": "^14.1.0",
"@angular/compiler": "^14.1.0",
"@angular/compiler-cli": "^14.1.0",
"@angular/forms": "^14.1.0",
"@angular/language-service": "^14.1.0",
"@angular/platform-browser": "^14.1.0",
"@angular/platform-browser-dynamic": "^14.1.0",
"@angular/router": "^14.1.0",
"@angular-devkit/build-angular": "^15.0.1",
"@angular-eslint/builder": "15.1.0",
"@angular-eslint/eslint-plugin": "15.1.0",
"@angular-eslint/eslint-plugin-template": "15.1.0",
"@angular-eslint/schematics": "15.1.0",
"@angular-eslint/template-parser": "15.1.0",
"@angular/animations": "^15.0.1",
"@angular/cli": "^15.0.1",
"@angular/compiler": "^15.0.1",
"@angular/compiler-cli": "^15.0.1",
"@angular/forms": "^15.0.1",
"@angular/language-service": "^15.0.1",
"@angular/platform-browser": "^15.0.1",
"@angular/platform-browser-dynamic": "^15.0.1",
"@angular/router": "^15.0.1",
"@ant-design/icons-svg": "^4.0.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/lodash": "^4.14.136",
"@types/node": "^13.9.3",
"@typescript-eslint/eslint-plugin": "5.44.0",
"@typescript-eslint/parser": "5.44.0",
"classlist": "^2.0.0",
"codelyzer": "^6.0.0",
"core-js": "^2.5.4",
"cross-env": "^5.2.0",
"eslint": "^8.28.0",
"fs-extra": "^7.0.0",
"globby": "^8.0.1",
"jasmine-core": "^3.8.0",
Expand All @@ -50,13 +56,11 @@
"karma-jasmine-html-reporter": "^1.5.0",
"karma-spec-reporter": "^0.0.32",
"lodash": "^4.17.11",
"ng-packagr": "^14.1.0",
"ng-packagr": "^15.0.1",
"prettier": "^1.14.3",
"protractor": "~7.0.0",
"rxjs": "^6.4.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.7.4",
"typescript": "~4.8.4",
"zone.js": "~0.11.4"
}
}
}
41 changes: 41 additions & 0 deletions packages/icons-angular/src/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"extends": "../.eslintrc.json",
"ignorePatterns": [
"!**/*",
"icons/**/*.ts"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"src/tsconfig.(lib|spec).json"
]
},
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"rules": {}
}
]
}
2 changes: 1 addition & 1 deletion packages/icons-angular/src/component/icon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class IconService {
constructor(
protected _rendererFactory: RendererFactory2,
@Optional() protected _handler: HttpBackend,
// tslint:disable-next-line:no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@Optional() @Inject(DOCUMENT) protected _document: any,
protected sanitizer: DomSanitizer,

Expand Down
11 changes: 6 additions & 5 deletions packages/icons-angular/src/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"name": "@ant-design/icons-angular",
"version": "14.1.0",
"version": "15.0.0",
"license": "MIT",
"repository": "https://github.com/ant-design/ant-design-icons/tree/master/packages/icons-angular",
"contributors": [
"Wendell Hu <wendellhu95@gmail.com>"
"Wendell Hu <wendellhu95@gmail.com>",
"Jørn Are Hatlelid <jornare@fronthouse.no>"
],
"dependencies": {
"@ant-design/colors": "^5.0.0",
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^14.1.0",
"@angular/core": "^14.1.0",
"@angular/platform-browser": "^14.1.0",
"@angular/common": "^15.0.0",
"@angular/core": "^15.0.0",
"@angular/platform-browser": "^15.0.0",
"rxjs": "^6.4.0 || ^7.4.0"
}
}
6 changes: 0 additions & 6 deletions packages/icons-angular/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
}
);
// Then we find all the tests.
const context = require.context('./tests', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
2 changes: 1 addition & 1 deletion packages/icons-angular/src/tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function createComponentBed<T>(
fixture.detectChanges();

return {
bed,
bed: (bed as TestBedStatic),
fixture,
nativeElement: fixture.nativeElement,
debugElement: fixture.debugElement,
Expand Down
5 changes: 3 additions & 2 deletions packages/icons-angular/src/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"target": "es2020",
"target": "ES2022",
"lib": [
"es2015",
"dom"
],
"skipLibCheck": true,
"types": [],
"baseUrl": "."
"baseUrl": ".",
"useDefineForClassFields": false
},
"files": [
"public_api.ts"
Expand Down
1 change: 0 additions & 1 deletion packages/icons-angular/src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"esModuleInterop": true,
"target": "es2020",
"types": [
"jasmine",
"node"
Expand Down
5 changes: 3 additions & 2 deletions packages/icons-angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"moduleResolution": "node",
"experimentalDecorators": true,
"skipLibCheck": true,
"target": "es2020",
"target": "ES2022",
"lib": [
"esnext",
"dom"
Expand All @@ -21,6 +21,7 @@
"@ant-design/icons-angular/icons": [
"src/icons/public_api"
]
}
},
"useDefineForClassFields": false
}
}
Loading

0 comments on commit 947c72e

Please sign in to comment.