Skip to content

Commit

Permalink
feat: 🎸 upgrade to Angular v13
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 🧨 The library now requires Angular v13

✅ Closes: #117
  • Loading branch information
NetanelBasal committed Nov 20, 2021
1 parent 91fd89a commit 26dab48
Show file tree
Hide file tree
Showing 15 changed files with 5,278 additions and 31,187 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ node_modules
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
72 changes: 15 additions & 57 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/playground",
"index": "apps/playground/src/index.html",
Expand All @@ -22,9 +20,7 @@
"apps/playground/src/favicon.ico",
"apps/playground/src/assets"
],
"styles": [
"apps/playground/src/styles.css"
],
"styles": ["apps/playground/src/styles.css"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -89,15 +85,14 @@
},
"test": {
"builder": "@nrwl/jest:jest",
"outputs": [
"coverage/apps/playground"
],
"outputs": ["coverage/apps/playground"],
"options": {
"jestConfig": "apps/playground/jest.config.js",
"passWithNoTests": true
}
}
}
},
"tags": []
},
"playground-e2e": {
"root": "apps/playground-e2e",
Expand All @@ -119,16 +114,14 @@
},
"lint": {
"builder": "@nrwl/linter:eslint",
"outputs": [
"{options.outputFile}"
],
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/playground-e2e/**/*.{js,ts}"
]
"lintFilePatterns": ["apps/playground-e2e/**/*.{js,ts}"]
}
}
}
},
"tags": [],
"implicitDependencies": ["playground"]
},
"reactive-forms": {
"projectType": "library",
Expand All @@ -138,9 +131,7 @@
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"outputs": [
"dist/libs/reactive-forms"
],
"outputs": ["dist/libs/reactive-forms"],
"options": {
"project": "libs/reactive-forms/ng-package.json"
},
Expand All @@ -156,9 +147,7 @@
},
"test": {
"builder": "@nrwl/jest:jest",
"outputs": [
"coverage/libs/reactive-forms"
],
"outputs": ["coverage/libs/reactive-forms"],
"options": {
"jestConfig": "libs/reactive-forms/jest.config.js",
"passWithNoTests": true
Expand All @@ -173,39 +162,8 @@
]
}
}
}
}
},
"cli": {
"defaultCollection": "@nrwl/angular",
"packageManager": "npm"
},
"schematics": {
"@nrwl/angular": {
"application": {
"linter": "eslint"
},
"library": {
"linter": "eslint"
},
"storybook-configuration": {
"linter": "eslint"
}
},
"@nrwl/angular:application": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "jest"
},
"@nrwl/angular:component": {
"style": "css"
"tags": []
}
},
"defaultProject": "playground"
}
}
}
3 changes: 2 additions & 1 deletion apps/playground/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ module.exports = {
},
coverageDirectory: '../../coverage/apps/playground',
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
Expand Down
12 changes: 0 additions & 12 deletions apps/playground/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@
* BROWSER POLYFILLS
*/

/**
* IE11 requires the following for NgClass support on SVG elements
*/
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
Expand Down
2 changes: 1 addition & 1 deletion apps/playground/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]
}
3 changes: 2 additions & 1 deletion libs/reactive-forms/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ module.exports = {
},
coverageDirectory: '../../coverage/libs/reactive-forms',
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular',
'^.+.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
Expand Down
4 changes: 2 additions & 2 deletions libs/reactive-forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
},
"homepage": "https://github.com/ngneat/reactive-forms#readme",
"peerDependencies": {
"@angular/forms": ">= 12.0.0"
"@angular/forms": ">= 13.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/ngneat/reactive-forms"
}
}
}
2 changes: 1 addition & 1 deletion libs/reactive-forms/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"types": [],
"lib": ["dom", "es2018"]
},
"exclude": ["src/test-setup.ts", "**/*.spec.ts"],
"exclude": ["src/test-setup.ts", "**/*.spec.ts", "**/*.test.ts"],
"include": ["**/*.ts"]
}
5 changes: 2 additions & 3 deletions libs/reactive-forms/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}
}
2 changes: 1 addition & 1 deletion libs/reactive-forms/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
"include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"]
}
125 changes: 125 additions & 0 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"migrations": [
{
"version": "13.0.0-beta.1",
"description": "Add default base to nx.json if its not currently set",
"factory": "./src/migrations/update-13-0-0/set-default-base-if-not-set",
"cli": "nx",
"package": "@nrwl/workspace",
"name": "set-default-base-if-not-set"
},
{
"version": "13.0.0-beta.4",
"description": "Move global settings into nx.json, and project specific settings into workspace.json",
"cli": "nx",
"implementation": "./src/migrations/update-13-0-0/config-locations/config-locations",
"package": "@nrwl/workspace",
"name": "13-0-0-config-locations"
},
{
"version": "13.2.0",
"description": "Set --parallel=1 for existing repos to preserve the existing behavior",
"cli": "nx",
"implementation": "./src/migrations/update-13-2-0/set-parallel-default",
"package": "@nrwl/workspace",
"name": "set-parallel-default"
},
{
"cli": "nx",
"version": "13.0.0-beta.10",
"description": "Adds postcss packages needed for Tailwind support if ng-packagr is already installed.",
"factory": "./src/migrations/update-13-0-0/add-postcss-packages",
"package": "@nrwl/angular",
"name": "add-postcss-packages"
},
{
"cli": "nx",
"version": "13.2.0-beta.1",
"description": "Remove deprecated options from webpack-server and webpack-browser.",
"factory": "./src/migrations/update-13-2-0/update-angular-config",
"package": "@nrwl/angular",
"name": "update-angular-config"
},
{
"cli": "nx",
"version": "13.2.0-beta.1",
"description": "Remove enableIvy and add compilationMode to library tsconfig and remove deprecated ng-packagr options.",
"factory": "./src/migrations/update-13-2-0/update-libraries",
"package": "@nrwl/angular",
"name": "update-libraries"
},
{
"cli": "nx",
"version": "13.2.0-beta.1",
"description": "Update jest config to support jest-preset-angular",
"factory": "./src/migrations/update-13-2-0/update-angular-jest-config",
"package": "@nrwl/angular",
"name": "update-angular-jest-config"
},
{
"cli": "nx",
"version": "13.2.0-beta.1",
"description": "Move some imports from @nrwl/angular/testing to jasmine-marbles",
"factory": "./src/migrations/update-13-2-0/update-testing-imports",
"package": "@nrwl/angular",
"name": "update-testing-imports"
},
{
"version": "13.0.0",
"factory": "./update-13/schematic-options",
"description": "Remove no longer valid Angular schematic options from `angular.json`.",
"package": "@angular/cli",
"name": "schematic-options-13"
},
{
"version": "13.0.0",
"factory": "./update-13/update-angular-config",
"description": "Remove deprecated options from 'angular.json' that are no longer present in v13.",
"package": "@angular/cli",
"name": "update-angular-config-v13"
},
{
"version": "13.0.0",
"factory": "./update-13/update-libraries",
"description": "Update library projects to be published in partial mode and removed deprecated options from ng-packagr configuration.",
"package": "@angular/cli",
"name": "update-libraries-v13"
},
{
"version": "13.0.0",
"factory": "./update-13/drop-ie-polyfills",
"description": "Remove polyfills required only for Internet Explorer which is no longer supported.",
"package": "@angular/cli",
"name": "drop-ie-polyfills"
},
{
"version": "13.0.0",
"factory": "./update-13/update-gitignore",
"description": "Updating '.gitignore' to include '.angular/cache'.",
"package": "@angular/cli",
"name": "update-gitignore"
},
{
"version": "13.0.0-beta",
"description": "Migrates `[routerLink]=\"\"` in templates to `[routerLink]=\"[]\"` because these links are likely intended to route to the current page with updated fragment/query params.",
"factory": "./migrations/router-link-empty-expression/index",
"package": "@angular/core",
"name": "migration-v13-router-link-empty-expression"
},
{
"version": "13.0.0-beta",
"description": "In Angular version 13, the `teardown` flag in `TestBed` will be enabled by default. This migration automatically opts out existing apps from the new teardown behavior.",
"factory": "./migrations/testbed-teardown/index",
"package": "@angular/core",
"name": "migration-v13-testbed-teardown"
},
{
"version": "13.1.2-beta.0",
"cli": "nx",
"description": "Support .test. file names in tsconfigs",
"factory": "./src/migrations/update-13-1-2/update-tsconfigs-for-tests",
"package": "@nrwl/jest",
"name": "update-ts-config-for-test-filenames"
}
]
}
Loading

0 comments on commit 26dab48

Please sign in to comment.