Skip to content

Commit

Permalink
feat: update to Angular 19 (#200)
Browse files Browse the repository at this point in the history
Changes that were applied:

- bump dependency versions
- applied migrations from `migrations.json`
- remove unused component imports
- add `as unknown` to `updateOptions` to fix a previously working
  type conversion
- add `skipToken` check to `normalizeOptions` to narrow down typing
  • Loading branch information
luii authored Dec 17, 2024
1 parent b0d39bb commit f6f79a1
Show file tree
Hide file tree
Showing 24 changed files with 12,227 additions and 11,773 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prefix": "query",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ testem.log
Thumbs.db

.nx/cache
.nx/workspace-data
.angular
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
/coverage
.angular
.nx

/.nx/workspace-data
3 changes: 2 additions & 1 deletion devtools/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prefix": "query",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"url": "https://github.com/sponsors/ngneat"
},
"peerDependencies": {
"@angular/core": ">=16.0.0 <19.0.0",
"@tanstack/query-devtools": "5.4.2"
"@angular/core": ">=16.0.0 <=19.0.4",
"@tanstack/query-devtools": "5.61.4"
},
"dependencies": {
"tslib": "^2.3.0"
"tslib": "^2.4.0"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getJestProjects } from '@nx/jest';
import { getJestProjectsAsync } from '@nx/jest';

export default {
projects: getJestProjects(),
};
export default async () => ({
projects: await getJestProjectsAsync(),
});
223 changes: 175 additions & 48 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -1,82 +1,209 @@
{
"migrations": [
{
"version": "18.1.0-beta.3",
"description": "Moves affected.defaultBase to defaultBase in `nx.json`",
"implementation": "./src/migrations/update-17-2-0/move-default-base",
"cli": "nx",
"version": "19.2.0-beta.2",
"description": "Updates the default workspace data directory to .nx/workspace-data",
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory",
"package": "nx",
"name": "19-2-0-move-graph-cache-directory"
},
{
"cli": "nx",
"version": "19.2.2-beta.0",
"description": "Updates the nx wrapper.",
"implementation": "./src/migrations/update-17-3-0/update-nxw",
"package": "nx",
"name": "19-2-2-update-nx-wrapper"
},
{
"version": "19.2.4-beta.0",
"description": "Set project name in nx.json explicitly",
"implementation": "./src/migrations/update-19-2-4/set-project-name",
"x-repair-skip": true,
"package": "nx",
"name": "move-default-base-to-nx-json-root"
"name": "19-2-4-set-project-name"
},
{
"version": "20.0.0-beta.7",
"description": "Migration for v20.0.0-beta.7",
"implementation": "./src/migrations/update-20-0-0/move-use-daemon-process",
"package": "nx",
"name": "move-use-daemon-process"
},
{
"version": "20.0.1",
"description": "Set `useLegacyCache` to true for migrating workspaces",
"implementation": "./src/migrations/update-20-0-1/use-legacy-cache",
"x-repair-skip": true,
"package": "nx",
"name": "use-legacy-cache"
},
{
"version": "20.2.0-beta.5",
"description": "Update TypeScript ESLint packages to v8.13.0 if they are already on v8",
"implementation": "./src/migrations/update-20-2-0/update-typescript-eslint-v8-13-0",
"package": "@nx/eslint",
"name": "update-typescript-eslint-v8.13.0"
},
{
"cli": "nx",
"version": "19.1.0-beta.6",
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs",
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi",
"package": "@nx/eslint-plugin",
"name": "update-19-1-0-rename-no-extra-semi"
"version": "20.0.0-beta.5",
"description": "replace getJestProjects with getJestProjectsAsync",
"implementation": "./src/migrations/update-20-0-0/replace-getJestProjects-with-getJestProjectsAsync",
"package": "@nx/jest",
"name": "replace-getJestProjects-with-getJestProjectsAsync"
},
{
"cli": "nx",
"version": "18.1.0-beta.1",
"requires": {
"@angular/core": ">=17.2.0"
},
"description": "Update the @angular/cli package version to ~17.2.0.",
"factory": "./src/migrations/update-18-1-0/update-angular-cli",
"version": "19.6.0-beta.0",
"description": "Use serve-static or preview for webServerCommand.",
"implementation": "./src/migrations/update-19-6-0/use-serve-static-preview-for-command",
"package": "@nx/playwright",
"name": "19-6-0-use-serve-static-preview-for-command"
},
{
"cli": "nx",
"version": "19.6.0-beta.1",
"description": "Add inferred ciTargetNames to targetDefaults with dependsOn to ensure dependent application builds are scheduled before atomized tasks.",
"implementation": "./src/migrations/update-19-6-0/add-e2e-ci-target-defaults",
"package": "@nx/playwright",
"name": "update-19-6-0-add-e2e-ci-target-defaults"
},
{
"cli": "nx",
"version": "19.2.1-beta.0",
"requires": { "@angular-eslint/eslint-plugin": ">=18.0.0" },
"description": "Installs the '@typescript-eslint/utils' package when having installed '@angular-eslint/eslint-plugin' or '@angular-eslint/eslint-plugin-template' with version >=18.0.0.",
"factory": "./src/migrations/update-19-2-1/add-typescript-eslint-utils",
"package": "@nx/angular",
"name": "update-angular-cli-version-17-2-0"
"name": "add-typescript-eslint-utils"
},
{
"cli": "nx",
"version": "18.1.1-beta.0",
"description": "Ensure targetDefaults inputs for task hashing when '@nx/angular:webpack-browser' is used are correct for Module Federation.",
"factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs",
"version": "19.5.0-beta.1",
"requires": { "@angular/core": ">=18.1.0" },
"description": "Update the @angular/cli package version to ~18.1.0.",
"factory": "./src/migrations/update-19-5-0/update-angular-cli",
"package": "@nx/angular",
"name": "fix-target-defaults-for-webpack-browser"
"name": "update-angular-cli-version-18-1-0"
},
{
"cli": "nx",
"version": "18.2.0-beta.0",
"requires": {
"@angular/core": ">=17.3.0"
},
"description": "Update the @angular/cli package version to ~17.3.0.",
"factory": "./src/migrations/update-18-2-0/update-angular-cli",
"version": "19.6.0-beta.4",
"description": "Ensure Module Federation DTS is turned off by default.",
"factory": "./src/migrations/update-19-6-0/turn-off-dts-by-default",
"package": "@nx/angular",
"name": "update-angular-cli-version-17-3-0"
"name": "update-19-6-0"
},
{
"cli": "nx",
"version": "19.1.0-beta.2",
"requires": {
"@angular/core": ">=18.0.0"
},
"description": "Update the @angular/cli package version to ~18.0.0.",
"factory": "./src/migrations/update-19-1-0/update-angular-cli",
"version": "19.6.0-beta.7",
"requires": { "@angular/core": ">=18.2.0" },
"description": "Update the @angular/cli package version to ~18.2.0.",
"factory": "./src/migrations/update-19-6-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-18-0-0"
"name": "update-angular-cli-version-18-2-0"
},
{
"cli": "nx",
"version": "18.1.0-beta.3",
"description": "Remove invalid baseUrl option from @nx/playwright:playwright targets in project.json.",
"implementation": "./src/migrations/update-18-1-0/remove-baseUrl-from-project-json",
"package": "@nx/playwright",
"name": "18-1-0-remove-baseUrl-from-project-json"
"version": "19.6.1-beta.0",
"description": "Ensure Target Defaults are set correctly for Module Federation.",
"factory": "./src/migrations/update-19-6-1/ensure-depends-on-for-mf",
"package": "@nx/angular",
"name": "update-19-6-1-ensure-module-federation-target-defaults"
},
{
"cli": "nx",
"version": "20.2.0-beta.2",
"description": "Update the ModuleFederationConfig import use @nx/module-federation.",
"factory": "./src/migrations/update-20-2-0/migrate-mf-imports-to-new-package",
"package": "@nx/angular",
"name": "update-20-2-0-update-module-federation-config-import"
},
{
"cli": "nx",
"version": "20.2.0-beta.2",
"description": "Update the withModuleFederation import use @nx/module-federation/angular.",
"factory": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package",
"package": "@nx/angular",
"name": "update-20-2-0-update-with-module-federation-import"
},
{
"cli": "nx",
"version": "20.2.0-beta.5",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Update the @angular/cli package version to ~19.0.0.",
"factory": "./src/migrations/update-20-2-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-19-0-0"
},
{
"cli": "nx",
"version": "20.2.0-beta.5",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Add the '@angular/localize/init' polyfill to the 'polyfills' option of targets using esbuild-based executors.",
"factory": "./src/migrations/update-20-2-0/add-localize-polyfill-to-targets",
"package": "@nx/angular",
"name": "add-localize-polyfill-to-targets"
},
{
"cli": "nx",
"version": "20.2.0-beta.5",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Update '@angular/ssr' import paths to use the new '/node' entry point when 'CommonEngine' is detected.",
"factory": "./src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point",
"package": "@nx/angular",
"name": "update-angular-ssr-imports-to-use-node-entry-point"
},
{
"cli": "nx",
"version": "20.2.0-beta.6",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Disable the Angular ESLint prefer-standalone rule if not set.",
"factory": "./src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone",
"package": "@nx/angular",
"name": "disable-angular-eslint-prefer-standalone"
},
{
"cli": "nx",
"version": "20.2.0-beta.8",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Remove Angular ESLint rules that were removed in v19.0.0.",
"factory": "./src/migrations/update-20-2-0/remove-angular-eslint-rules",
"package": "@nx/angular",
"name": "remove-angular-eslint-rules"
},
{
"cli": "nx",
"version": "20.2.0-beta.8",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Remove the deprecated 'tailwindConfig' option from ng-packagr executors. Tailwind CSS configurations located at the project or workspace root will be picked up automatically.",
"factory": "./src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors",
"package": "@nx/angular",
"name": "remove-tailwind-config-from-ng-packagr-executors"
},
{
"version": "19.0.0",
"description": "Updates non-standalone Directives, Component and Pipes to 'standalone:false' and removes 'standalone:true' from those who are standalone",
"factory": "./bundles/explicit-standalone-flag#migrate",
"package": "@angular/core",
"name": "explicit-standalone-flag"
},
{
"version": "18.0.0",
"description": "Updates two-way bindings that have an invalid expression to use the longform expression instead.",
"factory": "./migrations/invalid-two-way-bindings/bundle",
"version": "19.0.0",
"description": "Updates ExperimentalPendingTasks to PendingTasks",
"factory": "./bundles/pending-tasks#migrate",
"package": "@angular/core",
"name": "invalid-two-way-bindings"
"name": "pending-tasks"
},
{
"version": "18.0.0",
"description": "Replace deprecated HTTP related modules with provider functions",
"factory": "./migrations/http-providers/bundle",
"version": "19.0.0",
"description": "Replaces `APP_INITIALIZER`, `ENVIRONMENT_INITIALIZER` & `PLATFORM_INITIALIZER` respectively with `provideAppInitializer`, `provideEnvironmentInitializer` & `providePlatformInitializer`.",
"factory": "./bundles/provide-initializer#migrate",
"optional": true,
"package": "@angular/core",
"name": "migration-http-providers"
"name": "provide-initializer"
}
]
}
}
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@
"style": "scss"
}
},
"defaultProject": "query-playground"
"defaultProject": "query-playground",
"useLegacyCache": true
}
Loading

0 comments on commit f6f79a1

Please sign in to comment.