Skip to content

Commit 37662ed

Browse files
feat(qwik-nx): setup for micro frontends (#75)
* feat: use [email protected] * feat(qwik-nx): executors for micro-frontends * feat(qwik-nx): host and remote generators for micro-frontends * feat: use nx 15.7 * feat(qwik-nx): cleanup for the structure of micro frontend apps * update host with remotes * chore: add lint target for the qwik-nx-e2e project * chore: cleanup
1 parent 2bc2893 commit 37662ed

Some content is hidden

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

54 files changed

+2900
-379
lines changed

e2e/qwik-nx-e2e/.eslintrc.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": [
19+
"./package.json",
20+
"./generators.json",
21+
"./executors.json",
22+
"./migrations.json"
23+
],
24+
"parser": "jsonc-eslint-parser",
25+
"rules": {
26+
"@nrwl/nx/nx-plugin-checks": "error"
27+
}
28+
}
29+
]
30+
}

e2e/qwik-nx-e2e/project.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
"jestConfig": "e2e/qwik-nx-e2e/jest.config.ts",
1212
"maxWorkers": 1
1313
}
14+
},
15+
"lint": {
16+
"executor": "@nrwl/linter:eslint",
17+
"outputs": ["{options.outputFile}"],
18+
"options": {
19+
"lintFilePatterns": ["e2e/qwik-nx-e2e/**/*.ts"]
20+
}
1421
}
1522
},
1623
"tags": [],

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

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ import {
1010
promisifiedTreeKill,
1111
killPort,
1212
stripConsoleColors,
13+
killPorts,
1314
} from '@qwikifiers/e2e/utils';
1415

1516
export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
17+
const devServerPort = 4212;
18+
const previewServerPort = 4232;
1619
describe(`Basic behavior with ${generator} generator`, () => {
1720
let project: string;
1821

19-
beforeAll(() => {
22+
beforeAll(async () => {
23+
await killPorts(devServerPort, previewServerPort);
2024
ensureNxProject('qwik-nx', 'dist/packages/qwik-nx');
21-
});
25+
}, 10000);
2226

2327
beforeAll(async () => {
2428
project = uniq('qwik-nx');
@@ -77,32 +81,35 @@ export function testApplicationBasicBehavior(generator: 'app' | 'preset') {
7781
}, 200000);
7882

7983
it('should serve application in dev mode with custom port', async () => {
80-
const port = 4212;
8184
const p = await runCommandUntil(
82-
`run ${project}:serve --port=${port}`,
85+
`run ${project}:serve --port=${devServerPort}`,
8386
(output) => {
84-
return output.includes('Local:') && output.includes(`:${port}`);
87+
return (
88+
output.includes('Local:') && output.includes(`:${devServerPort}`)
89+
);
8590
}
8691
);
8792
try {
8893
await promisifiedTreeKill(p.pid!, 'SIGKILL');
89-
await killPort(port);
94+
await killPort(devServerPort);
9095
} catch {
9196
// ignore
9297
}
9398
}, 200000);
9499

95100
it('should serve application in preview mode with custom port', async () => {
96-
const port = 4232;
97101
const p = await runCommandUntil(
98-
`run ${project}:preview --port=${port}`,
102+
`run ${project}:preview --port=${previewServerPort}`,
99103
(output) => {
100-
return output.includes('Local:') && output.includes(`:${port}`);
104+
return (
105+
output.includes('Local:') &&
106+
output.includes(`:${previewServerPort}`)
107+
);
101108
}
102109
);
103110
try {
104111
await promisifiedTreeKill(p.pid!, 'SIGKILL');
105-
await killPort(port);
112+
await killPort(previewServerPort);
106113
} catch {
107114
// ignore
108115
}

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import {
2-
checkFilesExist,
32
ensureNxProject,
43
readJson,
54
runNxCommandAsync,
6-
uniq,
75
} from '@nrwl/nx-plugin/testing';
86

9-
import {
10-
runCommandUntil,
11-
promisifiedTreeKill,
12-
killPort,
13-
} from '@qwikifiers/e2e/utils';
14-
157
describe('appGenerator e2e', () => {
168
// Setting up individual workspaces per
179
// test can cause e2e runs to take a long time.

0 commit comments

Comments
 (0)