Skip to content

Commit dc6e2cc

Browse files
chore(qwik-nx): v3 (#239)
* chore(qwik-nx): migrate to nx v20 * feat(qwik-nx): make directory a required option for generators * test(qwik-nx): update tests * chore(repo): bump deps again * test(qwik-nx): update e2e * feat(qwik-nx): add "root" prop migration * refactor(qwik-nx): params cleanup * refactor(repo): eslint updates
1 parent c3391fb commit dc6e2cc

File tree

81 files changed

+5711
-4099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+5711
-4099
lines changed

.eslintrc.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@typescript-eslint/no-non-null-assertion": "off",
3131
"unused-imports/no-unused-imports": "error",
3232
"no-duplicate-imports": "error",
33-
"unused-imports/no-unused-vars": "error",
33+
"@typescript-eslint/no-unused-vars": "error",
3434
"@typescript-eslint/naming-convention": [
3535
"error",
3636
{
@@ -41,13 +41,16 @@
4141
"selector": "enumMember",
4242
"format": ["PascalCase"]
4343
}
44-
]
44+
],
45+
"no-extra-semi": "error"
4546
}
4647
},
4748
{
4849
"files": ["*.js", "*.jsx"],
4950
"extends": ["plugin:@nx/javascript"],
50-
"rules": {}
51+
"rules": {
52+
"no-extra-semi": "error"
53+
}
5154
},
5255
{
5356
"files": [

.github/actions/test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020

2121
- name: Test
2222
shell: bash
23-
run: npx nx affected --target=test --base=${{ env.NX_BASE }} --head=HEAD
23+
run: npx nx affected --target=test --base=${{ env.NX_BASE }} --head=HEAD ${{ runner.os == 'Windows' && '--maxWorkers=1' }}
2424

2525
- name: E2E Tests
2626
# TODO: temporary disabled e2e on windows

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,7 @@ Thumbs.db
4343

4444
# Nx
4545
.nx/cache
46-
migrations.json
46+
.nx/workspace-data
47+
migrations.json
48+
vite.config.*.timestamp*
49+
vitest.config.*.timestamp*

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/dist
44
/coverage
55
CHANGELOG.md
6-
/.nx/cache
6+
/.nx/cache
7+
/.nx/workspace-data

e2e/qwik-nx-e2e/tests/application-basic-behavior.suite.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { names } from '@nx/devkit';
2121
export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
2222
const isPreset = generator === 'preset';
2323
const appPathPrefix = isPreset ? 'apps/' : '';
24-
const libPathPrefix = isPreset ? 'libs/' : '';
24+
const libPathPrefix = '';
2525
const devServerPort = 4212;
2626
const previewServerPort = 4232;
2727
describe(`Basic behavior with ${generator} generator`, () => {
@@ -77,7 +77,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
7777
'should create qwik-nx',
7878
async () => {
7979
const result = await runNxCommandAsync(`build ${project}`);
80-
expect(result.stdout).toContain(
80+
expect(stripConsoleColors(result.stdout)).toContain(
8181
`Running type check for the "${project}"..`
8282
);
8383
expect(
@@ -91,7 +91,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
9191
.join('')
9292
.replace(/\n|\s/g, '')
9393
);
94-
expect(result.stdout).toContain(
94+
expect(stripConsoleColors(result.stdout)).toContain(
9595
`Successfully ran target build for project ${project}`
9696
);
9797
expect(() =>
@@ -167,7 +167,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
167167
'unit tests should pass in the created app',
168168
async () => {
169169
const result = await runNxCommandAsync(`test ${project}`);
170-
expect(result.stdout).toContain(
170+
expect(stripConsoleColors(result.stdout)).toContain(
171171
`Successfully ran target test for project ${project}`
172172
);
173173
},
@@ -186,7 +186,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
186186
const result = await runNxCommandAsync(`test ${project}`, {
187187
silenceError: true,
188188
});
189-
expect(result.stdout).toContain(
189+
expect(stripConsoleColors(result.stdout)).toContain(
190190
`Running target test for project ${project} failed`
191191
);
192192
},
@@ -211,7 +211,7 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
211211
.join('')
212212
.replace(/\n|\s/g, '')
213213
);
214-
expect(result.stdout).toContain(
214+
expect(stripConsoleColors(result.stdout)).toContain(
215215
`Successfully ran target build for project ${project}`
216216
);
217217
},

e2e/qwik-nx-e2e/tests/chore.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ describe('misc checks', () => {
2323
expect(packageJson.dependencies).toBeUndefined();
2424
expect(packageJson.devDependencies).toBeUndefined();
2525
expect(packageJson.peerDependencies).toEqual({
26-
'@nx/devkit': '^17.0.0 || ^18.0.0 || ^19.0.0',
27-
'@nx/js': '^17.0.0 || ^18.0.0 || ^19.0.0',
28-
'@nx/eslint': '^17.0.0 || ^18.0.0 || ^19.0.0',
29-
'@nx/vite': '^17.0.0 || ^18.0.0 || ^19.0.0',
26+
'@nx/devkit': '^20.0.0',
27+
'@nx/js': '^20.0.0',
28+
'@nx/eslint': '^20.0.0',
29+
'@nx/vite': '^20.0.0',
3030
});
3131
},
3232
DEFAULT_E2E_TIMEOUT

e2e/qwik-nx-e2e/tests/micro-frontends.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('Micro-frontends e2e', () => {
5757
async () => {
5858
const checkProject = async (name: string) => {
5959
const result = await runNxCommandAsync(`build ${name}`);
60-
expect(result.stdout).toContain(
60+
expect(stripConsoleColors(result.stdout)).toContain(
6161
`Successfully ran target build for project ${name}`
6262
);
6363
expect(() =>
@@ -152,7 +152,7 @@ describe('Micro-frontends e2e', () => {
152152
`generate qwik-nx:remote ${remote3} --host=${project} --port=5176 --no-interactive`
153153
);
154154
const result = await runNxCommandAsync(`build ${remote3}`);
155-
expect(result.stdout).toContain(
155+
expect(stripConsoleColors(result.stdout)).toContain(
156156
`Successfully ran target build for project ${remote3}`
157157
);
158158
expect(() =>

e2e/qwik-nx-e2e/tests/qwik-nx-cloudflare.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
killPort,
1212
killPorts,
1313
DEFAULT_E2E_TIMEOUT,
14+
stripConsoleColors,
1415
} from '@qwikifiers/e2e/utils';
1516

1617
const CLOUDFLARE_PREVIEW_PORT = 4173;
@@ -49,7 +50,7 @@ describe('qwik nx cloudflare generator', () => {
4950
'should be able to successfully build the application',
5051
async () => {
5152
const result = await runNxCommandAsync(`build-cloudflare ${project}`);
52-
expect(result.stdout).toContain(
53+
expect(stripConsoleColors(result.stdout)).toContain(
5354
`Successfully ran target build for project ${project}`
5455
);
5556
expect(() =>

e2e/qwik-nx-e2e/tests/qwik-nx-netlify.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
killPort,
1212
killPorts,
1313
DEFAULT_E2E_TIMEOUT,
14+
stripConsoleColors,
1415
} from '@qwikifiers/e2e/utils';
1516

1617
const NETLIFY_PREVIEW_PORT = 8888;
@@ -41,7 +42,7 @@ describe('qwik nx netlify generator', () => {
4142
'should be able to successfully build the application',
4243
async () => {
4344
const result = await runNxCommandAsync(`build-netlify ${project}`);
44-
expect(result.stdout).toContain(
45+
expect(stripConsoleColors(result.stdout)).toContain(
4546
`Successfully ran target build for project ${project}`
4647
);
4748
expect(() =>

e2e/qwik-nx-e2e/tests/qwik-nx-vite.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
removeFile,
1616
killPorts,
1717
DEFAULT_E2E_TIMEOUT,
18+
stripConsoleColors,
1819
} from '@qwikifiers/e2e/utils';
1920

2021
describe('qwikNxVite plugin e2e', () => {
@@ -109,7 +110,7 @@ describe('qwikNxVite plugin e2e', () => {
109110
'should be able to successfully build the application',
110111
async () => {
111112
const result = await runNxCommandAsync(`build ${project}`);
112-
expect(result.stdout).toContain(
113+
expect(stripConsoleColors(result.stdout)).toContain(
113114
`Successfully ran target build for project ${project}`
114115
);
115116
expect(() =>

0 commit comments

Comments
 (0)