Skip to content

Commit

Permalink
feat: upgrade to angular v13 (#3062)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Formly v6 now requires Angular Version >= 13

fix #3053, fix #3049, fix #2701, fix #2958
  • Loading branch information
aitboudad committed Dec 1, 2021
1 parent 43cce72 commit 7dbfdec
Show file tree
Hide file tree
Showing 130 changed files with 19,565 additions and 26,799 deletions.
43 changes: 43 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json", "tsconfig.spec.json"],
"createDefaultProgram": true
},
"extends": ["plugin:@angular-eslint/recommended", "plugin:@angular-eslint/template/process-inline-templates"],
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"prefix": "formly",
"style": "kebab-case",
"type": "element"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"prefix": "formly",
"style": "camelCase",
"type": "attribute"
}
],
"@angular-eslint/no-conflicting-lifecycle": ["warn"],
"@angular-eslint/no-host-metadata-property": ["warn"],
"@angular-eslint/directive-class-suffix": ["off"],
"@angular-eslint/component-class-suffix": ["off"]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {
"@angular-eslint/template/eqeqeq": ["warn"]
}
}
]
}
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm install

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
${{ runner.os }}-
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: '14'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ speed-measure-plugin*.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand All @@ -43,3 +44,5 @@ testem.log
# System Files
.DS_Store
Thumbs.db

.eslintcache
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit ""
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.15.5
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
/hooks
/integration/**/dist
/src/schematics/
/.angular/
**/test.ts
**/*.md
**/*.md
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Formly is a dynamic (JSON powered) form library for Angular that bring unmatched

| Angular version | Formly version |
| --------------- | ---------------------- |
| Angular >= 11 | `@ngx-formly/core@6.x` |
| Angular >= 13 | `@ngx-formly/core@6.x` |
| Angular >= 7 | `@ngx-formly/core@5.x` |
| Angular >= 6 | `@ngx-formly/core@4.x` |
| Angular >= 5 | `@ngx-formly/core@3.x` |
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE-6.0.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
UPGRADE FROM 5.0 to 6.0
=======================
- Formly V6 now requires Angular Version >= 11
- Formly V6 now requires Angular Version >= 13

@ngx-formly/core
----------------
Expand Down
97 changes: 51 additions & 46 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@
"main": "demo/src/main.ts",
"polyfills": "demo/src/polyfills.ts",
"tsConfig": "demo/tsconfig.app.json",
"aot": true,
"assets": ["demo/src/favicon.ico", "demo/src/assets"],
"styles": ["demo/src/styles.scss"],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand Down Expand Up @@ -55,7 +60,8 @@
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand All @@ -75,10 +81,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["demo/tsconfig.app.json", "demo/tsconfig.spec.json", "demo/e2e/tsconfig.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["demo/**/*.ts", "demo/**/*.html"]
}
}
}
Expand All @@ -93,15 +98,20 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "integration/ssr/dist/browser",
"index": "integration/ssr/src/index.html",
"main": "integration/ssr/src/main.ts",
"polyfills": "integration/ssr/src/polyfills.ts",
"tsConfig": "integration/ssr/tsconfig.app.json",
"assets": ["integration/ssr/src/favicon.ico", "integration/ssr/src/assets"],
"styles": ["integration/ssr/src/styles.css"],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -115,7 +125,6 @@
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -131,7 +140,8 @@
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand All @@ -144,19 +154,14 @@
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["integration/ssr/tsconfig.app.json", "integration/ssr/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "integration/ssr/dist/server",
"main": "integration/ssr/server.ts",
"tsConfig": "integration/ssr/tsconfig.server.json"
"tsConfig": "integration/ssr/tsconfig.server.json",
"sourceMap": true,
"optimization": false
},
"configurations": {
"production": {
Expand All @@ -168,7 +173,8 @@
],
"optimization": true
}
}
},
"defaultConfiguration": ""
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
Expand All @@ -193,6 +199,12 @@
"configurations": {
"production": {}
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["integration/ssr/**/*.ts", "integration/ssr/**/*.html"]
}
}
}
},
Expand All @@ -215,10 +227,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/core/tsconfig.lib.json", "src/core/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/core/**/*.ts", "src/core/**/*.html"]
}
}
}
Expand All @@ -242,10 +253,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/ui/bootstrap/tsconfig.lib.json", "src/ui/bootstrap/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/ui/bootstrap/**/*.ts", "src/ui/bootstrap/**/*.html"]
}
}
}
Expand All @@ -269,10 +279,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/ui/ionic/tsconfig.lib.json", "src/ui/ionic/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/ui/ionic/**/*.ts", "src/ui/ionic/**/*.html"]
}
}
}
Expand All @@ -296,10 +305,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/ui/kendo/tsconfig.lib.json", "src/ui/kendo/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/ui/kendo/**/*.ts", "src/ui/kendo/**/*.html"]
}
}
}
Expand All @@ -323,10 +331,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/ui/material/tsconfig.lib.json", "src/ui/material/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/ui/material/**/*.ts", "src/ui/material/**/*.html"]
}
}
}
Expand All @@ -350,10 +357,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/ui/primeng/tsconfig.lib.json", "src/ui/primeng/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/ui/primeng/**/*.ts", "src/ui/primeng/**/*.html"]
}
}
}
Expand All @@ -377,10 +383,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/ui/ng-zorro-antd/tsconfig.lib.json", "src/ui/ng-zorro-antd/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/ui/ng-zorro-antd/**/*.ts", "src/ui/ng-zorro-antd/**/*.html"]
}
}
}
Expand All @@ -404,10 +409,9 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": ["src/ui/nativescript/tsconfig.lib.json", "src/ui/nativescript/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"lintFilePatterns": ["src/ui/nativescript/**/*.ts", "src/ui/nativescript/**/*.html"]
}
}
}
Expand All @@ -416,15 +420,16 @@
"defaultProject": "app",
"cli": {
"analytics": false,
"packageManager": "npm"
"packageManager": "npm",
"defaultCollection": "@angular-eslint/schematics"
},
"schematics": {
"@schematics/angular:component": {
"prefix": "demo",
"prefix": "formly",
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "demo"
"prefix": "formly"
}
}
}
6 changes: 5 additions & 1 deletion build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ exec(`mkdir -p ${distDir}`);

PACKAGES.map((name) => {
// build package
exec(name === 'schematics' ? `ts-node --dir build schematics.ts` : `ng build --prod @ngx-formly/${name}`);
exec(
name === 'schematics'
? `ts-node --dir build schematics.ts`
: `ng build --configuration production @ngx-formly/${name}`,
);

const pkgDir = `${distDir}/${name}`;
exec(`cp README.md ${pkgDir}`);
Expand Down
Binary file not shown.

0 comments on commit 7dbfdec

Please sign in to comment.