Skip to content

Commit ef60711

Browse files
fix(qwik-nx): handle eslint checks in dev mode (#202)
1 parent c5e0eda commit ef60711

File tree

18 files changed

+227
-40
lines changed

18 files changed

+227
-40
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ npm-debug.log
3333
yarn-error.log
3434
testem.log
3535
/typings
36-
migrations.json
3736

3837
# System Files
3938
.DS_Store
4039
Thumbs.db
40+
41+
# Local Netlify folder
42+
.netlify

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

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
import {
22
ensureNxProject,
3+
listFiles,
34
readJson,
45
runNxCommandAsync,
56
} from '@nx/plugin/testing';
67
import { DEFAULT_E2E_TIMEOUT } from '@qwikifiers/e2e/utils';
78

8-
describe('appGenerator e2e', () => {
9-
// Setting up individual workspaces per
10-
// test can cause e2e runs to take a long time.
11-
// For this reason, we recommend each suite only
12-
// consumes 1 workspace. The tests should each operate
13-
// on a unique project in the workspace, such that they
14-
// are not dependant on one another.
9+
describe('misc checks', () => {
1510
beforeAll(() => {
1611
ensureNxProject('qwik-nx', 'dist/packages/qwik-nx');
1712
});
1813

1914
afterAll(async () => {
20-
// `nx reset` kills the daemon, and performs
21-
// some work which can help clean up e2e leftovers
2215
await runNxCommandAsync('reset');
2316
});
2417

25-
describe("qwik-nx's compiled package.json", () => {
26-
it(
27-
"qwik-nx's package.json should contain only expected dependencies",
28-
async () => {
29-
const packageJson = readJson('node_modules/qwik-nx/package.json');
18+
it(
19+
"qwik-nx's package.json should contain only expected dependencies",
20+
async () => {
21+
const packageJson = readJson('node_modules/qwik-nx/package.json');
3022

31-
expect(packageJson.peerDependencies).toBeUndefined();
32-
expect(packageJson.dependencies).toEqual({
33-
'@nx/devkit': '^16.0.0',
34-
'@nx/js': '^16.0.0',
35-
'@nx/linter': '^16.0.0',
36-
'@nx/vite': '^16.0.0',
37-
});
38-
},
39-
DEFAULT_E2E_TIMEOUT
40-
);
23+
expect(packageJson.peerDependencies).toBeUndefined();
24+
expect(packageJson.dependencies).toEqual({
25+
'@nx/devkit': '^16.0.0',
26+
'@nx/js': '^16.0.0',
27+
'@nx/linter': '^16.0.0',
28+
'@nx/vite': '^16.0.0',
29+
});
30+
},
31+
DEFAULT_E2E_TIMEOUT
32+
);
33+
34+
it('compiled output should contain all expected files', () => {
35+
const expectedFiles = [
36+
'executors.json',
37+
'migrations.json',
38+
'generators.json',
39+
'README.md',
40+
];
41+
const files = new Set(listFiles('node_modules/qwik-nx'));
42+
expect(expectedFiles.every((f) => files.has(f)));
4143
});
4244
});

e2e/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
getPackageManagerCommand,
1313
} from 'nx/src/utils/package-manager';
1414

15-
export const DEFAULT_E2E_TIMEOUT = 2 * 60 * 1000;
15+
export const DEFAULT_E2E_TIMEOUT = 3 * 60 * 1000;
1616

1717
const kill = require('kill-port');
1818
export const isWindows = require('is-windows');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"pnpm": "^8.0.0"
1919
},
2020
"devDependencies": {
21-
"@builder.io/qwik": "^1.2.6",
21+
"@builder.io/qwik": "^1.2.12",
2222
"@commitlint/cli": "^17.3.0",
2323
"@commitlint/config-angular": "^17.3.0",
2424
"@commitlint/config-conventional": "^17.3.0",

packages/qwik-nx/migrations.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
"description": "Enabled type checking can be breaking. Adding a verbose option so that it is clear how to disable it",
2424
"cli": "nx",
2525
"implementation": "./src/migrations/add-verbose-skip-type-check-option-for-the-build-executor/add-verbose-skip-type-check-option-for-the-build-executor"
26+
},
27+
"set-proper-tsconfig-path-for-qwik-vite-plugin": {
28+
"version": "1.0.11",
29+
"description": "set-proper-tsconfig-path-for-qwik-vite-plugin",
30+
"implementation": "./src/migrations/set-proper-tsconfig-path-for-qwik-vite-plugin/set-proper-tsconfig-path-for-qwik-vite-plugin"
2631
}
2732
},
2833
"packageJsonUpdates": {
@@ -262,6 +267,20 @@
262267
"version": "^0.32.0"
263268
}
264269
}
270+
},
271+
"1.0.11": {
272+
"version": "1.0.11",
273+
"packages": {
274+
"@builder.io/qwik": {
275+
"version": "~1.2.12"
276+
},
277+
"@builder.io/qwik-city": {
278+
"version": "~1.2.12"
279+
},
280+
"eslint-plugin-qwik": {
281+
"version": "~1.2.12"
282+
}
283+
}
265284
}
266285
}
267286
}

packages/qwik-nx/src/generators/application/__snapshots__/generator.spec.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ export default defineConfig({
427427
ssr: {
428428
outDir: '../../dist/apps/myapp/server',
429429
},
430+
tsconfigFileNames: ['tsconfig.app.json'],
430431
}),
431432
tsconfigPaths({ root: '../../' }),
432433
],

packages/qwik-nx/src/generators/application/files/src/components/router-head/router-head.tsx__template__

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,30 @@ import { useDocumentHead, useLocation } from '@builder.io/qwik-city';
66
*/
77
export const RouterHead = component$(() => {
88
const head = useDocumentHead();
9-
const { url } = useLocation();
9+
const loc = useLocation();
1010

1111
return (
1212
<>
1313
<title>{head.title}</title>
1414

15-
<link rel="canonical" href={url.href} />
15+
<link rel="canonical" href={loc.url.href} />
1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1717
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
1818

1919
{head.meta.map((m) => (
20-
<meta {...m} />
20+
<meta key={m.key} {...m} />
2121
))}
2222

2323
{head.links.map((l) => (
24-
<link {...l} />
24+
<link key={l.key} {...l} />
2525
))}
2626

2727
{head.styles.map((s) => (
28-
<style {...s.props} dangerouslySetInnerHTML={s.style} />
28+
<style key={s.key} {...s.props} dangerouslySetInnerHTML={s.style} />
29+
))}
30+
31+
{head.scripts.map((s) => (
32+
<script key={s.key} {...s.props} dangerouslySetInnerHTML={s.script} />
2933
))}
3034
</>
3135
);

packages/qwik-nx/src/generators/application/files/vite.config.ts__template__

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default defineConfig({
1616
ssr: {
1717
outDir: '<%= offsetFromRoot %>dist/<%= projectRoot %>/server',
1818
},
19+
tsconfigFileNames: ['tsconfig.app.json']
1920
}),
2021
tsconfigPaths({ root: '<%= offsetFromRoot %>' })
2122
],

packages/qwik-nx/src/generators/host/__snapshots__/generator.spec.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,7 @@ export default defineConfig({
955955
ssr: {
956956
outDir: '../../dist/apps/myhostapp/server',
957957
},
958+
tsconfigFileNames: ['tsconfig.app.json'],
958959
}),
959960
tsconfigPaths({ root: '../../' }),
960961
],
@@ -1450,6 +1451,7 @@ export default defineConfig({
14501451
ssr: {
14511452
outDir: '../../dist/apps/remote1/server',
14521453
},
1454+
tsconfigFileNames: ['tsconfig.app.json'],
14531455
}),
14541456
tsconfigPaths({ root: '../../' }),
14551457
],
@@ -1614,6 +1616,7 @@ export default defineConfig({
16141616
ssr: {
16151617
outDir: '../../dist/apps/remote2/server',
16161618
},
1619+
tsconfigFileNames: ['tsconfig.app.json'],
16171620
}),
16181621
tsconfigPaths({ root: '../../' }),
16191622
],

packages/qwik-nx/src/generators/integrations/react-in-app/__snapshots__/generator.spec.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default defineConfig({
1919
ssr: {
2020
outDir: '../../dist/apps/myapp/server',
2121
},
22+
tsconfigFileNames: ['tsconfig.app.json'],
2223
}),
2324
tsconfigPaths({ root: '../../' }),
2425
qwikReact(),
@@ -210,6 +211,7 @@ export default defineConfig({
210211
ssr: {
211212
outDir: '../../dist/apps/myapp/server',
212213
},
214+
tsconfigFileNames: ['tsconfig.app.json'],
213215
}),
214216
tsconfigPaths({ root: '../../' }),
215217
qwikReact(),

0 commit comments

Comments
 (0)