Skip to content

Commit 654aef5

Browse files
feat(qwik-angular): angular 17 compatibility (#2)
* chore(qwik-angular): migrate to nx v17 * feat(qwik-angular): angular 17 compatibility
1 parent 426950b commit 654aef5

File tree

15 files changed

+5042
-10090
lines changed

15 files changed

+5042
-10090
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ testem.log
3939
Thumbs.db
4040

4141
.angular
42+
43+
.nx/cache

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
/dist
33
/coverage
44
.angular
5+
6+
/.nx/cache

.verdaccio/config.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ storage: ../tmp/local-registry/storage
44
# a list of other known repositories we can talk to
55
uplinks:
66
npmjs:
7-
url: http://localhost:4873/
8-
maxage: 60m
7+
url: https://registry.npmjs.org/
8+
cache: true
9+
yarn:
10+
url: https://registry.yarnpkg.com
11+
cache: true
912

1013
packages:
1114
'**':
@@ -22,7 +25,8 @@ packages:
2225
logs:
2326
type: stdout
2427
format: pretty
25-
level: warn
28+
level: http
2629

2730
publish:
2831
allow_offline: true # set offline to true to allow publish offline
32+

nx.json

+11-13
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,26 @@
33
"affected": {
44
"defaultBase": "master"
55
},
6-
"tasksRunnerOptions": {
7-
"default": {
8-
"runner": "nx-cloud",
9-
"options": {
10-
"cacheableOperations": ["build", "lint", "test", "e2e"],
11-
"accessToken": "NmYxNjExYTQtNGQxOS00MjBlLWI0ODAtZTJiZDZhYjhmZGE5fHJlYWQtd3JpdGU="
12-
}
13-
}
14-
},
156
"targetDefaults": {
167
"build": {
178
"dependsOn": ["^build"],
18-
"inputs": ["production", "^production"]
9+
"inputs": ["production", "^production"],
10+
"cache": true
1911
},
2012
"lint": {
2113
"inputs": [
2214
"default",
2315
"{workspaceRoot}/.eslintrc.json",
2416
"{workspaceRoot}/.eslintignore"
25-
]
17+
],
18+
"cache": true
2619
},
2720
"test": {
28-
"inputs": ["default", "^production"]
21+
"inputs": ["default", "^production"],
22+
"cache": true
23+
},
24+
"e2e": {
25+
"cache": true
2926
}
3027
},
3128
"namedInputs": {
@@ -41,5 +38,6 @@
4138
"workspaceLayout": {
4239
"appsDir": "packages",
4340
"libsDir": "packages"
44-
}
41+
},
42+
"nxCloudAccessToken": "NmYxNjExYTQtNGQxOS00MjBlLWI0ODAtZTJiZDZhYjhmZGE5fHJlYWQtd3JpdGU="
4543
}

package.json

+16-18
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,42 @@
77
"devDependencies": {
88
"@builder.io/qwik": "~1.2.6",
99
"@builder.io/qwik-city": "~1.2.6",
10-
"@nx/angular": "16.5.0",
11-
"@nx/eslint-plugin": "16.5.0",
12-
"@nx/js": "16.5.0",
13-
"@nx/linter": "16.5.0",
14-
"@nx/vite": "16.5.0",
15-
"@nx/workspace": "16.5.0",
10+
"@nx/angular": "17.1.1",
11+
"@nx/eslint-plugin": "17.1.1",
12+
"@nx/js": "17.1.1",
13+
"@nx/vite": "17.1.1",
14+
"@nx/workspace": "17.1.1",
1615
"@swc/cli": "~0.1.62",
17-
"@swc/core": "~1.3.51",
16+
"@swc/core": "1.3.96",
1817
"@types/node": "^18.16.1",
1918
"@types/yargs": "^17.0.24",
20-
"@typescript-eslint/eslint-plugin": "^5.60.1",
21-
"@typescript-eslint/parser": "^5.60.1",
19+
"@typescript-eslint/eslint-plugin": "6.10.0",
20+
"@typescript-eslint/parser": "6.10.0",
2221
"@vitest/ui": "~0.32.0",
2322
"chalk": "^4.1.2",
24-
"eslint": "~8.15.0",
25-
"eslint-config-prettier": "8.1.0",
23+
"eslint": "8.46.0",
24+
"eslint-config-prettier": "9.0.0",
2625
"eslint-plugin-qwik": "~1.2.6",
2726
"node-fetch": "~3.3.0",
28-
"nx": "16.5.0",
29-
"nx-cloud": "latest",
27+
"nx": "17.1.1",
3028
"prettier": "^2.6.2",
31-
"qwik-nx": "^1.0.8",
29+
"qwik-nx": "^2.0.2",
3230
"rollup": "^3.27.1",
33-
"sass": "~1.56.1",
3431
"tslib": "^2.3.0",
35-
"typescript": "~5.1.3",
32+
"typescript": "5.2.2",
3633
"undici": "^5.22.0",
3734
"verdaccio": "^5.0.4",
3835
"vite": "~4.4.0",
3936
"vite-plugin-dts": "~2.3.0",
4037
"vite-tsconfig-paths": "~4.2.0",
4138
"vitest": "~0.32.0",
42-
"yargs": "^17.7.2"
39+
"yargs": "^17.7.2",
40+
"@nx/eslint": "17.1.1"
4341
},
4442
"nx": {
4543
"includedScripts": []
4644
},
4745
"dependencies": {
48-
"@swc/helpers": "~0.5.0"
46+
"@swc/helpers": "0.5.3"
4947
}
5048
}

packages/add-angular-to-qwik/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
## What is It?
44

5-
This is a simple utility package that allows runs an integration to add Angular to your existing Qwik application.
5+
This is a simple utility package that runs an integration to add Angular to your existing Qwik application.
66

77
Run `npx add-angular-to-qwik@latest` to try it out!

packages/add-angular-to-qwik/bin/add-angular-to-qwik.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
detectPackageManager,
99
} from 'nx/src/utils/package-manager';
1010
import { output } from 'create-nx-workspace/src/utils/output';
11-
import { readFileSync, unlinkSync, writeFileSync } from 'fs';
11+
import { readFileSync, writeFileSync, rmSync } from 'fs';
1212
import { execSync } from 'child_process';
1313

1414
interface Arguments extends CreateWorkspaceOptions {
@@ -135,7 +135,8 @@ function getRelevantPackageManagerCommand() {
135135
}
136136

137137
function cleanup(isQwikNxInstalled: boolean, uninstallCmd: string) {
138-
unlinkSync('project.json');
138+
rmSync('.nx', {force: true, recursive: true});
139+
rmSync('project.json');
139140
if (!isQwikNxInstalled) {
140141
execSync(`${uninstallCmd} qwik-nx nx`, { stdio: [0, 1, 2] });
141142
}

packages/add-angular-to-qwik/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
},
2525
"homepage": "https://github.com/QwikDev/qwik-angular",
2626
"peerDependencies": {
27-
"qwik-nx": "^1.0.9"
27+
"qwik-nx": "^2.0.2",
28+
"create-nx-workspace": "17.1.1"
2829
},
2930
"publishConfig": {
3031
"access": "public",

packages/add-angular-to-qwik/project.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@
4545
"glob": "LICENSE",
4646
"output": "/"
4747
}
48-
],
49-
"updateBuildableProjectDepsInPackageJson": true
48+
]
5049
}
5150
},
5251
"lint": {
53-
"executor": "@nx/linter:eslint",
52+
"executor": "@nx/eslint:lint",
5453
"options": {
5554
"lintFilePatterns": [
5655
"packages/add-angular-to-qwik/**/*.ts",

packages/qwik-angular/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
"types": "./index.qwik.d.ts",
2929
"dependencies": {
3030
"@analogjs/vite-plugin-angular": "~0.2.0",
31-
"@angular-devkit/build-angular": "^16.0.0",
32-
"@angular/animations": "^16.0.0",
33-
"@angular/common": "^16.0.0",
34-
"@angular/compiler-cli": "^16.0.0",
35-
"@angular/compiler": "^16.0.0",
36-
"@angular/core": "^16.0.0",
37-
"@angular/platform-browser-dynamic": "^16.0.0",
38-
"@angular/platform-browser": "^16.0.0",
39-
"@angular/platform-server": "^16.0.0",
31+
"@angular-devkit/build-angular": "17.0.0",
32+
"@angular/animations": "17.0.2",
33+
"@angular/common": "17.0.2",
34+
"@angular/compiler-cli": "17.0.2",
35+
"@angular/compiler": "17.0.2",
36+
"@angular/core": "17.0.2",
37+
"@angular/platform-browser-dynamic": "17.0.2",
38+
"@angular/platform-browser": "17.0.2",
39+
"@angular/platform-server": "17.0.2",
4040
"@builder.io/qwik": "^1.2.11",
4141
"rxjs": "~7.8.0",
4242
"sass": "^1.60.0",
43-
"zone.js": "~0.13.0"
43+
"zone.js": "~0.14.2"
4444
},
4545
"exports": {
4646
".": {

packages/qwik-angular/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependsOn": ["build"]
1818
},
1919
"lint": {
20-
"executor": "@nx/linter:eslint",
20+
"executor": "@nx/eslint:lint",
2121
"outputs": ["{options.outputFile}"],
2222
"options": {
2323
"lintFilePatterns": ["packages/qwik-angular/**/*.{ts,tsx,js,jsx}"]

packages/qwik-angular/src/lib/client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { createApplication } from '@angular/platform-browser';
1212
import { merge, Subject } from 'rxjs';
1313
import { map, takeUntil } from 'rxjs/operators';
1414
import { extractProjectableNodes } from './extract-projectable-nodes';
15-
import zoneJs from 'zone.js/dist/zone.min.js?url';
15+
import zoneJs from 'zone.js/plugins/zone.min?url';
1616
import { getAngularProps } from './slot';
1717
import { provideAnimations } from '@angular/platform-browser/animations';
1818

packages/qwik-angular/src/lib/vite-plugin/vite.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ function analogQwikPlugin(options: PluginOptions) {
5454
'@angular/platform-browser/animations',
5555
'@angular/compiler',
5656
'@angular/common',
57+
'@angular/common/http',
5758
'@angular/animations',
5859
'@angular/animations/browser',
60+
'@angular/platform-server',
5961
],
60-
exclude: ['@angular/platform-server'],
6162
},
6263
};
6364
},

packages/qwik-angular/vite.config.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="vitest" />
22
import { Plugin, defineConfig } from 'vite';
33

4-
import viteTsConfigPaths from 'vite-tsconfig-paths';
4+
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
55
import dts from 'vite-plugin-dts';
66
import * as path from 'path';
77
import { qwikVite } from '@builder.io/qwik/optimizer';
@@ -18,9 +18,7 @@ export default defineConfig({
1818
skipDiagnostics: true,
1919
}),
2020

21-
viteTsConfigPaths({
22-
root: '../../',
23-
}),
21+
nxViteTsPaths(),
2422
vitePluginFixBundle(),
2523
],
2624

0 commit comments

Comments
 (0)