@travetto/web-http 7.0.0-rc.4 → 7.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/package.json +4 -4
- package/support/cli.web_http.ts +9 -9
package/README.md
CHANGED
|
@@ -41,7 +41,6 @@ Initialized {
|
|
|
41
41
|
env: 'local',
|
|
42
42
|
debug: false,
|
|
43
43
|
production: false,
|
|
44
|
-
dynamic: false,
|
|
45
44
|
resourcePaths: [
|
|
46
45
|
'./doc-exec/resources'
|
|
47
46
|
],
|
|
@@ -212,7 +211,6 @@ Initialized {
|
|
|
212
211
|
env: 'prod',
|
|
213
212
|
debug: false,
|
|
214
213
|
production: true,
|
|
215
|
-
dynamic: false,
|
|
216
214
|
resourcePaths: [
|
|
217
215
|
'./doc-exec/resources'
|
|
218
216
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/web-http",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.5",
|
|
4
4
|
"description": "Web HTTP Server Support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"directory": "module/web-http"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/web": "^7.0.0-rc.
|
|
29
|
+
"@travetto/web": "^7.0.0-rc.4"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/cli": "^7.0.0-rc.
|
|
33
|
-
"@travetto/test": "^7.0.0-rc.
|
|
32
|
+
"@travetto/cli": "^7.0.0-rc.3",
|
|
33
|
+
"@travetto/test": "^7.0.0-rc.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@travetto/test": {
|
package/support/cli.web_http.ts
CHANGED
|
@@ -9,14 +9,14 @@ import type { WebHttpServer } from '../src/types.ts';
|
|
|
9
9
|
/**
|
|
10
10
|
* Run a web server
|
|
11
11
|
*/
|
|
12
|
-
@CliCommand({ runTarget: true, with: { debugIpc: true,
|
|
12
|
+
@CliCommand({ runTarget: true, with: { debugIpc: true, restartForDev: true, module: true, env: true } })
|
|
13
13
|
export class WebHttpCommand implements CliCommandShape {
|
|
14
14
|
|
|
15
15
|
/** Port to run on */
|
|
16
16
|
port?: number;
|
|
17
17
|
|
|
18
18
|
/** Kill conflicting port owner */
|
|
19
|
-
killConflict?: boolean;
|
|
19
|
+
killConflict?: boolean = !Runtime.production;
|
|
20
20
|
|
|
21
21
|
preMain(): void {
|
|
22
22
|
if (this.port) {
|
|
@@ -28,12 +28,12 @@ export class WebHttpCommand implements CliCommandShape {
|
|
|
28
28
|
await Registry.init();
|
|
29
29
|
const instance = await DependencyRegistryIndex.getInstance(toConcrete<WebHttpServer>());
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
() => instance.serve(),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
if (this.killConflict) {
|
|
32
|
+
const handle = await Util.acquireWithRetry(() => instance.serve(), NetUtil.freePortOnConflict, 5);
|
|
33
|
+
return handle.complete;
|
|
34
|
+
} else {
|
|
35
|
+
const handle = await instance.serve();
|
|
36
|
+
return handle.complete;
|
|
37
|
+
}
|
|
38
38
|
}
|
|
39
39
|
}
|