@utoo/pack 1.4.12-alpha.8 → 1.4.13-alpha.0
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/cjs/commands/dev.js +13 -2
- package/cjs/core/hmr.d.ts +1 -1
- package/cjs/core/hmr.js +6 -4
- package/cjs/core/project.js +0 -1
- package/esm/commands/dev.js +13 -2
- package/esm/core/hmr.d.ts +1 -1
- package/esm/core/hmr.js +6 -4
- package/esm/core/project.js +0 -1
- package/package.json +9 -9
package/cjs/commands/dev.js
CHANGED
|
@@ -234,8 +234,19 @@ async function runDev(options, projectPath, rootPath, serverOptions) {
|
|
|
234
234
|
: serveOptsBase.hostname;
|
|
235
235
|
(0, printServerInfo_1.printServerInfo)(scheme, displayHost, serveOptsBase.port);
|
|
236
236
|
}
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
let cleanupStarted = false;
|
|
238
|
+
const cleanup = async () => {
|
|
239
|
+
if (cleanupStarted) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
cleanupStarted = true;
|
|
243
|
+
try {
|
|
244
|
+
await hotReloader.close();
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
console.error(err);
|
|
248
|
+
process.exit(1);
|
|
249
|
+
}
|
|
239
250
|
// We always create HTTP/1.1 server (http or https), so closeAllConnections exists; Hono's
|
|
240
251
|
// ServerType union includes HTTP/2, so TS does not narrow. Use runtime check to satisfy types.
|
|
241
252
|
if ("closeAllConnections" in server &&
|
package/cjs/core/hmr.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface HotReloaderInterface {
|
|
|
38
38
|
/** Handle a message from a client (JSON string). */
|
|
39
39
|
handleClientMessage(ws: WSLike, data: string): void;
|
|
40
40
|
buildFallbackError(): Promise<void>;
|
|
41
|
-
close(): void
|
|
41
|
+
close(): Promise<void>;
|
|
42
42
|
}
|
|
43
43
|
export type ChangeSubscriptions = Map<string, Promise<AsyncIterableIterator<TurbopackResult>>>;
|
|
44
44
|
export type ReadyIds = Set<string>;
|
package/cjs/core/hmr.js
CHANGED
|
@@ -548,11 +548,12 @@ async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
|
548
548
|
async buildFallbackError() {
|
|
549
549
|
// Not implemented yet.
|
|
550
550
|
},
|
|
551
|
-
close() {
|
|
551
|
+
async close() {
|
|
552
552
|
closed = true;
|
|
553
|
-
|
|
554
|
-
closePromise !== null && closePromise !== void 0 ? closePromise : (closePromise =
|
|
555
|
-
.
|
|
553
|
+
const disposePromise = disposeBackgroundWatchSubscriptions();
|
|
554
|
+
closePromise !== null && closePromise !== void 0 ? closePromise : (closePromise = (bundleOptions.config.persistentCaching
|
|
555
|
+
? project.shutdown()
|
|
556
|
+
: project.onExit())
|
|
556
557
|
.catch((err) => {
|
|
557
558
|
console.error(err);
|
|
558
559
|
})
|
|
@@ -563,6 +564,7 @@ async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
|
563
564
|
wsClient.close();
|
|
564
565
|
}
|
|
565
566
|
clients.clear();
|
|
567
|
+
await Promise.all([disposePromise, closePromise]);
|
|
566
568
|
},
|
|
567
569
|
};
|
|
568
570
|
handleEntrypointsSubscription().catch((err) => {
|
package/cjs/core/project.js
CHANGED
package/esm/commands/dev.js
CHANGED
|
@@ -228,8 +228,19 @@ async function runDev(options, projectPath, rootPath, serverOptions) {
|
|
|
228
228
|
: serveOptsBase.hostname;
|
|
229
229
|
printServerInfo(scheme, displayHost, serveOptsBase.port);
|
|
230
230
|
}
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
let cleanupStarted = false;
|
|
232
|
+
const cleanup = async () => {
|
|
233
|
+
if (cleanupStarted) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
cleanupStarted = true;
|
|
237
|
+
try {
|
|
238
|
+
await hotReloader.close();
|
|
239
|
+
}
|
|
240
|
+
catch (err) {
|
|
241
|
+
console.error(err);
|
|
242
|
+
process.exit(1);
|
|
243
|
+
}
|
|
233
244
|
// We always create HTTP/1.1 server (http or https), so closeAllConnections exists; Hono's
|
|
234
245
|
// ServerType union includes HTTP/2, so TS does not narrow. Use runtime check to satisfy types.
|
|
235
246
|
if ("closeAllConnections" in server &&
|
package/esm/core/hmr.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface HotReloaderInterface {
|
|
|
38
38
|
/** Handle a message from a client (JSON string). */
|
|
39
39
|
handleClientMessage(ws: WSLike, data: string): void;
|
|
40
40
|
buildFallbackError(): Promise<void>;
|
|
41
|
-
close(): void
|
|
41
|
+
close(): Promise<void>;
|
|
42
42
|
}
|
|
43
43
|
export type ChangeSubscriptions = Map<string, Promise<AsyncIterableIterator<TurbopackResult>>>;
|
|
44
44
|
export type ReadyIds = Set<string>;
|
package/esm/core/hmr.js
CHANGED
|
@@ -543,11 +543,12 @@ export async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
|
543
543
|
async buildFallbackError() {
|
|
544
544
|
// Not implemented yet.
|
|
545
545
|
},
|
|
546
|
-
close() {
|
|
546
|
+
async close() {
|
|
547
547
|
closed = true;
|
|
548
|
-
|
|
549
|
-
closePromise !== null && closePromise !== void 0 ? closePromise : (closePromise =
|
|
550
|
-
.
|
|
548
|
+
const disposePromise = disposeBackgroundWatchSubscriptions();
|
|
549
|
+
closePromise !== null && closePromise !== void 0 ? closePromise : (closePromise = (bundleOptions.config.persistentCaching
|
|
550
|
+
? project.shutdown()
|
|
551
|
+
: project.onExit())
|
|
551
552
|
.catch((err) => {
|
|
552
553
|
console.error(err);
|
|
553
554
|
})
|
|
@@ -558,6 +559,7 @@ export async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
|
558
559
|
wsClient.close();
|
|
559
560
|
}
|
|
560
561
|
clients.clear();
|
|
562
|
+
await Promise.all([disposePromise, closePromise]);
|
|
561
563
|
},
|
|
562
564
|
};
|
|
563
565
|
handleEntrypointsSubscription().catch((err) => {
|
package/esm/core/project.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utoo/pack",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.13-alpha.0",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"types": "esm/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@hono/node-server": "^1.19.11",
|
|
42
42
|
"@hono/node-ws": "^1.3.0",
|
|
43
43
|
"@swc/helpers": "0.5.15",
|
|
44
|
-
"@utoo/pack-shared": "1.4.
|
|
44
|
+
"@utoo/pack-shared": "1.4.13-alpha.0",
|
|
45
45
|
"domparser-rs": "^0.0.7",
|
|
46
46
|
"find-up": "4.1.0",
|
|
47
47
|
"get-port": "5.1.1",
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
"directory": "packages/pack"
|
|
97
97
|
},
|
|
98
98
|
"optionalDependencies": {
|
|
99
|
-
"@utoo/pack-darwin-arm64": "1.4.
|
|
100
|
-
"@utoo/pack-darwin-x64": "1.4.
|
|
101
|
-
"@utoo/pack-linux-arm64-gnu": "1.4.
|
|
102
|
-
"@utoo/pack-linux-arm64-musl": "1.4.
|
|
103
|
-
"@utoo/pack-linux-x64-gnu": "1.4.
|
|
104
|
-
"@utoo/pack-linux-x64-musl": "1.4.
|
|
105
|
-
"@utoo/pack-win32-x64-msvc": "1.4.
|
|
99
|
+
"@utoo/pack-darwin-arm64": "1.4.13-alpha.0",
|
|
100
|
+
"@utoo/pack-darwin-x64": "1.4.13-alpha.0",
|
|
101
|
+
"@utoo/pack-linux-arm64-gnu": "1.4.13-alpha.0",
|
|
102
|
+
"@utoo/pack-linux-arm64-musl": "1.4.13-alpha.0",
|
|
103
|
+
"@utoo/pack-linux-x64-gnu": "1.4.13-alpha.0",
|
|
104
|
+
"@utoo/pack-linux-x64-musl": "1.4.13-alpha.0",
|
|
105
|
+
"@utoo/pack-win32-x64-msvc": "1.4.13-alpha.0"
|
|
106
106
|
}
|
|
107
107
|
}
|