Skip to content

Commit c5e0eda

Browse files
replace default port (#195)
* replace default port * update preview port * chore: update snapshots * Update integration-configuration-name.ts * Update e2e/qwik-nx-e2e/tests/micro-frontends.spec.ts Co-authored-by: Dmitriy Stepanenko <[email protected]> * Delete package-lock.json * Update e2e/qwik-nx-e2e/tests/micro-frontends.spec.ts Co-authored-by: Dmitriy Stepanenko <[email protected]> * Update e2e/qwik-nx-e2e/tests/micro-frontends.spec.ts Co-authored-by: Dmitriy Stepanenko <[email protected]> --------- Co-authored-by: Dmitriy Stepanenko <[email protected]>
1 parent 1ab9953 commit c5e0eda

File tree

13 files changed

+83
-83
lines changed

13 files changed

+83
-83
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ async function checkPageResponses(host: string) {
250250
function getHostOutput(output: string, port: number): string | undefined {
251251
// extracts the host url from the output message
252252
// the reason it's done is because it can either be in these formats:
253-
// http://localhost:4200 or https://127.0.0.1:4200
253+
// http://localhost:5173 or https://127.0.0.1:5173
254254
const regexp = new RegExp(
255255
`Local:(?:\\s{3})(http(?:s)?:\\/\\/(?:.+):${port})`
256256
);

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
DEFAULT_E2E_TIMEOUT,
1515
} from '@qwikifiers/e2e/utils';
1616

17-
const PORTS = [4200, 4201, 4202, 4203];
17+
const PORTS = [5173, 5174, 5175, 5175];
1818

1919
describe('Micro-frontends e2e', () => {
2020
let project: string, remote1: string, remote2: string;
@@ -52,8 +52,8 @@ describe('Micro-frontends e2e', () => {
5252
const configFilePath = `apps/${project}/src/config/remotes.json`;
5353
expect(() => checkFilesExist(configFilePath)).not.toThrow();
5454
const config = readJson(configFilePath);
55-
expect(config[remote1]).toEqual('http://localhost:4201');
56-
expect(config[remote2]).toEqual('http://localhost:4202');
55+
expect(config[remote1]).toEqual('http://localhost:5174');
56+
expect(config[remote2]).toEqual('http://localhost:5175');
5757
},
5858
DEFAULT_E2E_TIMEOUT
5959
);
@@ -155,7 +155,7 @@ describe('Micro-frontends e2e', () => {
155155
async () => {
156156
const remote3 = uniq('qwik-nx');
157157
await runNxCommandAsync(
158-
`generate qwik-nx:remote ${remote3} --host=${project} --port=4203 --no-interactive`
158+
`generate qwik-nx:remote ${remote3} --host=${project} --port=5176 --no-interactive`
159159
);
160160
const result = await runNxCommandAsync(`build ${remote3}`);
161161
expect(result.stdout).toContain(
@@ -214,10 +214,10 @@ async function runHostAndRemotes(
214214
const localhost = `${prefix}Local: http://localhost:${port}/`;
215215
return stripped.includes(ip) || stripped.includes(localhost);
216216
};
217-
invokedHost ||= includesInvokeMessage(hostName, 4200, false);
218-
invokedRemote1 ||= includesInvokeMessage(remote1, 4201);
219-
invokedRemote2 ||= includesInvokeMessage(remote2, 4202);
220-
invokedRemote3 ||= !!remote3 && includesInvokeMessage(remote3, 4203);
217+
invokedHost ||= includesInvokeMessage(hostName, 5173, false);
218+
invokedRemote1 ||= includesInvokeMessage(remote1, 5174);
219+
invokedRemote2 ||= includesInvokeMessage(remote2, 5175);
220+
invokedRemote3 ||= !!remote3 && includesInvokeMessage(remote3, 5176);
221221

222222
showedAllRemotesInvokedInfo ||= stripConsoleColors(
223223
output.replace(/\n|\s/g, '')
@@ -307,10 +307,10 @@ async function previewHostAndRemotes(
307307
builtRemote3 ||= !!remote3 && includesBuiltMessage(remote3);
308308

309309
// serve output
310-
invokedHost ||= includesInvokeMessage(hostName, 4200, false);
311-
invokedRemote1 ||= includesInvokeMessage(remote1, 4201);
312-
invokedRemote2 ||= includesInvokeMessage(remote2, 4202);
313-
invokedRemote3 ||= !!remote3 && includesInvokeMessage(remote3, 4203);
310+
invokedHost ||= includesInvokeMessage(hostName, 5173, false);
311+
invokedRemote1 ||= includesInvokeMessage(remote1, 5174);
312+
invokedRemote2 ||= includesInvokeMessage(remote2, 5175);
313+
invokedRemote3 ||= !!remote3 && includesInvokeMessage(remote3, 5176);
314314

315315
showedAllRemotesInvokedInfo ||= stripConsoleColors(
316316
output.replace(/\n|\s/g, '')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
DEFAULT_E2E_TIMEOUT,
1414
} from '@qwikifiers/e2e/utils';
1515

16-
const CLOUDFLARE_PREVIEW_PORT = 4300;
16+
const CLOUDFLARE_PREVIEW_PORT = 4173;
1717

1818
describe('qwik nx cloudflare generator', () => {
1919
// Setting up individual workspaces per

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ Object {
4646
"executor": "@nx/vite:preview-server",
4747
"options": Object {
4848
"buildTarget": "frontend-myapp:build",
49-
"port": 4300,
49+
"port": 4173,
5050
},
5151
},
5252
"serve": Object {
5353
"executor": "@nx/vite:dev-server",
5454
"options": Object {
5555
"buildTarget": "frontend-myapp:build.client",
5656
"mode": "ssr",
57-
"port": 4200,
57+
"port": 5173,
5858
},
5959
},
6060
"serve.debug": Object {
@@ -114,15 +114,15 @@ Object {
114114
"executor": "@nx/vite:preview-server",
115115
"options": Object {
116116
"buildTarget": "frontend-myapp:build",
117-
"port": 4300,
117+
"port": 4173,
118118
},
119119
},
120120
"serve": Object {
121121
"executor": "@nx/vite:dev-server",
122122
"options": Object {
123123
"buildTarget": "frontend-myapp:build.client",
124124
"mode": "ssr",
125-
"port": 4200,
125+
"port": 5173,
126126
},
127127
},
128128
"serve.debug": Object {
@@ -182,15 +182,15 @@ Object {
182182
"executor": "@nx/vite:preview-server",
183183
"options": Object {
184184
"buildTarget": "myapp:build",
185-
"port": 4300,
185+
"port": 4173,
186186
},
187187
},
188188
"serve": Object {
189189
"executor": "@nx/vite:dev-server",
190190
"options": Object {
191191
"buildTarget": "myapp:build.client",
192192
"mode": "ssr",
193-
"port": 4200,
193+
"port": 5173,
194194
},
195195
},
196196
"serve.debug": Object {
@@ -250,15 +250,15 @@ Object {
250250
"executor": "@nx/vite:preview-server",
251251
"options": Object {
252252
"buildTarget": "frontend-myapp:build",
253-
"port": 4300,
253+
"port": 4173,
254254
},
255255
},
256256
"serve": Object {
257257
"executor": "@nx/vite:dev-server",
258258
"options": Object {
259259
"buildTarget": "frontend-myapp:build.client",
260260
"mode": "ssr",
261-
"port": 4200,
261+
"port": 5173,
262262
},
263263
},
264264
"serve.debug": Object {
@@ -318,15 +318,15 @@ Object {
318318
"executor": "@nx/vite:preview-server",
319319
"options": Object {
320320
"buildTarget": "myapp:build",
321-
"port": 4300,
321+
"port": 4173,
322322
},
323323
},
324324
"serve": Object {
325325
"executor": "@nx/vite:dev-server",
326326
"options": Object {
327327
"buildTarget": "myapp:build.client",
328328
"mode": "ssr",
329-
"port": 4200,
329+
"port": 5173,
330330
},
331331
},
332332
"serve.debug": Object {
@@ -386,15 +386,15 @@ Object {
386386
"executor": "@nx/vite:preview-server",
387387
"options": Object {
388388
"buildTarget": "frontend-myapp:build",
389-
"port": 4300,
389+
"port": 4173,
390390
},
391391
},
392392
"serve": Object {
393393
"executor": "@nx/vite:dev-server",
394394
"options": Object {
395395
"buildTarget": "frontend-myapp:build.client",
396396
"mode": "ssr",
397-
"port": 4200,
397+
"port": 5173,
398398
},
399399
},
400400
"serve.debug": Object {
@@ -486,15 +486,15 @@ exports[`qwik-nx generator should run successfully 2`] = `
486486
\\"executor\\": \\"@nx/vite:preview-server\\",
487487
\\"options\\": {
488488
\\"buildTarget\\": \\"myapp:build\\",
489-
\\"port\\": 4300
489+
\\"port\\": 4173
490490
}
491491
},
492492
\\"serve\\": {
493493
\\"executor\\": \\"@nx/vite:dev-server\\",
494494
\\"options\\": {
495495
\\"buildTarget\\": \\"myapp:build.client\\",
496496
\\"mode\\": \\"ssr\\",
497-
\\"port\\": 4200
497+
\\"port\\": 5173
498498
}
499499
},
500500
\\"serve.debug\\": {

packages/qwik-nx/src/generators/application/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@
8787
"devServerPort": {
8888
"type": "number",
8989
"description": "The port for the dev server of the app.",
90-
"default": 4200
90+
"default": 5173
9191
},
9292
"previewServerPort": {
9393
"type": "number",
9494
"description": "The port for the preview server of the app.",
95-
"default": 4300
95+
"default": 4173
9696
}
9797
},
9898
"required": ["name"]

packages/qwik-nx/src/generators/application/utils/normalize-options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function normalizeOptions(
4949
styleExtension,
5050
setupVitest: options.unitTestRunner === 'vitest',
5151
parsedTags,
52-
devServerPort: options.devServerPort ?? 4200,
53-
previewServerPort: options.previewServerPort ?? 4300,
52+
devServerPort: options.devServerPort ?? 5173,
53+
previewServerPort: options.previewServerPort ?? 4173,
5454
};
5555
}

0 commit comments

Comments
 (0)