Skip to content

Commit

Permalink
build(deps): update to angular 17 (#23)
Browse files Browse the repository at this point in the history
* build: update to angular 17

* build(deps): update ngxs

* build: re-create package-lock

* build(composables): re-add dev dependencies

* build(deps): downgrade ng-packagr

* Revert "build(deps): downgrade ng-packagr"

This reverts commit 3208f5b.

* build(deps): add rollup as optional dependency
  • Loading branch information
homj authored Dec 15, 2023
1 parent 929ab6c commit 16abb94
Show file tree
Hide file tree
Showing 10 changed files with 4,699 additions and 4,944 deletions.
46 changes: 10 additions & 36 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,15 @@
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/demo",
"index": "apps/demo/src/index.html",
"main": "apps/demo/src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "apps/demo/tsconfig.app.json",
"assets": [
"apps/demo/src/favicon.ico",
"apps/demo/src/assets"
],
"styles": [
"apps/demo/src/styles.scss"
],
"assets": ["apps/demo/src/favicon.ico", "apps/demo/src/assets"],
"styles": ["apps/demo/src/styles.scss"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -75,46 +66,29 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "demo:build:production"
"buildTarget": "demo:build:production"
},
"development": {
"browserTarget": "demo:build:development"
"buildTarget": "demo:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo:build"
"buildTarget": "demo:build"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": [
"apps/demo/**/*.ts",
"apps/demo/**/*.html"
]
}
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/demo/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
"jestConfig": "apps/demo/jest.config.ts"
}
},
"serve-static": {
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h2>Old</h2>
<header>
<h2>New</h2>
<p>
Using <strong>@bynary/composables</strong> (<a
Using <strong>&#64;bynary/composables</strong> (<a
href="https://github.com/bynaryDE/angular-extensions/blob/main/apps/demo/src/app/components/button/button.component.ts"
target="_blank"
>code</a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
<ng-container [ngSwitch]="colorScheme.resolved()">
<span *ngSwitchCase="'dark'">🌚</span>
<span *ngSwitchDefault>🌝</span>
</ng-container>
@switch (colorScheme.resolved()) { @case('dark') {🌚} @default {🌝} }
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, HostListener } from '@angular/core';
import { bindAttribute } from '@bynary/composables/attribute';
import { ColorScheme, useColorScheme } from '@bynary/composables/observer';
Expand All @@ -7,7 +6,6 @@ import { useStorage } from '@bynary/composables/storage';
@Component({
selector: 'demo-color-scheme-switch',
standalone: true,
imports: [CommonModule],
templateUrl: './color-scheme-switch.component.html',
styleUrls: ['./color-scheme-switch.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
Expand Down
12 changes: 6 additions & 6 deletions libs/composables/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
"nx"
],
"peerDependencies": {
"@angular/core": ">=16.0.0 <18.0.0",
"@angular/cdk": ">=16.0.0 <18.0.0",
"@angular/common": ">=16.0.0 <18.0.0",
"@angular/core": ">=16.0.0 <18.0.0",
"@angular/platform-browser": ">=16.0.0 <18.0.0",
"@ngxs/store": "^3.8.1",
"rxjs": ">=7.0.0",
"@angular/common": "16.2.9",
"jest-preset-angular": "~13.1.0",
"jest-matchmedia-mock": "^1.1.0"
"jest-matchmedia-mock": "^1.1.0",
"jest-preset-angular": "~13.1.0"
},
"dependencies": {},
"devDependencies": {
"jest-preset-angular": "~13.1.0",
"jest-matchmedia-mock": "^1.1.0"
"jest-matchmedia-mock": "^1.1.0",
"jest-preset-angular": "~13.1.0"
},
"sideEffects": false
}
32 changes: 2 additions & 30 deletions libs/composables/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,40 +26,12 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/composables/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
"jestConfig": "libs/composables/jest.config.ts"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/composables/**/*.ts",
"libs/composables/**/*.html",
"libs/composables/package.json",
"libs/composables/attribute/**/*.ts",
"libs/composables/attribute/**/*.html",
"libs/composables/class/**/*.ts",
"libs/composables/class/**/*.html",
"libs/composables/observer/**/*.ts",
"libs/composables/observer/**/*.html",
"libs/composables/storage/**/*.ts",
"libs/composables/storage/**/*.html",
"libs/composables/title/**/*.ts",
"libs/composables/title/**/*.html",
"libs/composables/theme/**/*.ts",
"libs/composables/theme/**/*.html",
"libs/composables/ngxs/**/*.ts",
"libs/composables/ngxs/**/*.html"
]
}
"outputs": ["{options.outputFile}"]
}
}
}
122 changes: 102 additions & 20 deletions migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,115 @@
"migrations": [
{
"cli": "nx",
"version": "17.0.0-beta.1",
"description": "Updates the default cache directory to .nx/cache",
"implementation": "./src/migrations/update-17-0-0/move-cache-directory",
"package": "nx",
"name": "17.0.0-move-cache-directory"
"version": "17.1.0-beta.5",
"requires": {
"@angular/core": ">=17.0.0"
},
"description": "Update the @angular/cli package version to ~17.0.0.",
"factory": "./src/migrations/update-17-1-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-17-0-0"
},
{
"cli": "nx",
"version": "17.0.0-beta.3",
"description": "Use minimal config for tasksRunnerOptions",
"implementation": "./src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options",
"package": "nx",
"name": "17.0.0-use-minimal-config-for-tasks-runner-options"
"version": "17.1.0-beta.5",
"requires": {
"@angular/core": ">=17.0.0"
},
"description": "Rename 'browserTarget' to 'buildTarget'.",
"factory": "./src/migrations/update-17-1-0/browser-target-to-build-target",
"package": "@nx/angular",
"name": "rename-browser-target-to-build-target"
},
{
"version": "17.0.0-rc.1",
"description": "Migration for v17.0.0-rc.1",
"implementation": "./src/migrations/update-17-0-0/rm-default-collection-npm-scope",
"package": "nx",
"name": "rm-default-collection-npm-scope"
"cli": "nx",
"version": "17.1.0-beta.5",
"requires": {
"@angular/core": ">=17.0.0"
},
"description": "Replace usages of '@nguniversal/builders' with '@angular-devkit/build-angular'.",
"factory": "./src/migrations/update-17-1-0/replace-nguniversal-builders",
"package": "@nx/angular",
"name": "replace-nguniversal-builders"
},
{
"cli": "nx",
"version": "17.1.0-beta.5",
"requires": {
"@angular/core": ">=17.0.0"
},
"description": "Replace usages of '@nguniversal/' packages with '@angular/ssr'.",
"factory": "./src/migrations/update-17-1-0/replace-nguniversal-engines",
"package": "@nx/angular",
"name": "replace-nguniversal-engines"
},
{
"cli": "nx",
"version": "17.1.0-beta.5",
"requires": {
"@angular/core": ">=17.0.0"
},
"description": "Replace the deep imports from 'zone.js/dist/zone' and 'zone.js/dist/zone-testing' with 'zone.js' and 'zone.js/testing'.",
"factory": "./src/migrations/update-17-1-0/update-zone-js-deep-import",
"package": "@nx/angular",
"name": "update-zone-js-deep-import"
},
{
"cli": "nx",
"version": "17.2.0-beta.2",
"description": "Rename '@nx/angular:webpack-dev-server' executor to '@nx/angular:dev-server'",
"factory": "./src/migrations/update-17-2-0/rename-webpack-dev-server",
"package": "@nx/angular",
"name": "rename-webpack-dev-server-executor"
},
{
"version": "17.1.0-beta.2",
"description": "Move jest executor options to nx.json targetDefaults",
"implementation": "./src/migrations/update-17-1-0/move-options-to-target-defaults",
"package": "@nx/jest",
"name": "move-options-to-target-defaults"
},
{
"version": "17.1.0-beta.1",
"description": "Updates for @typescript-utils/utils v6.9.1+",
"implementation": "./src/migrations/update-17-1-0/update-typescript-eslint",
"package": "@nx/linter",
"name": "update-typescript-eslint"
},
{
"version": "17.2.0-beta.0",
"description": "Simplify eslintFilePatterns",
"implementation": "./src/migrations/update-17-2-0/simplify-eslint-patterns",
"package": "@nx/linter",
"name": "simplify-eslint-patterns"
},
{
"version": "17.0.0",
"description": "Angular v17 introduces a new control flow syntax that uses the @ and } characters. This migration replaces the existing usages with their corresponding HTML entities.",
"factory": "./migrations/block-template-entities/bundle",
"package": "@angular/core",
"name": "block-template-entities"
},
{
"version": "17.0.0",
"description": "CompilerOption.useJit and CompilerOption.missingTranslation are unused under Ivy. This migration removes their usage",
"factory": "./migrations/compiler-options/bundle",
"package": "@angular/core",
"name": "migration-v17-compiler-options"
},
{
"version": "17.0.0",
"description": "Updates `TransferState`, `makeStateKey`, `StateKey` imports from `@angular/platform-browser` to `@angular/core`.",
"factory": "./migrations/transfer-state/bundle",
"package": "@angular/core",
"name": "migration-transfer-state"
},
{
"version": "17.0.0-beta.7",
"description": "update-17-0-0-rename-to-eslint",
"implementation": "./src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint",
"package": "@nx/eslint",
"name": "update-17-0-0-rename-to-eslint"
"version": "17.0.0-0",
"description": "Updates the Angular CDK to v17",
"factory": "./ng-update/index#updateToV17",
"package": "@angular/cdk",
"name": "migration-v17"
}
]
}
21 changes: 13 additions & 8 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"e2e": {
"inputs": ["default", "^production"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json", "{workspaceRoot}/.eslintignore"],
"cache": true
},
"@nx/jest:jest": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"namedInputs": {
Expand Down
Loading

0 comments on commit 16abb94

Please sign in to comment.