@utoo/pack 1.4.12-alpha.6 → 1.4.12-alpha.7

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.
@@ -234,19 +234,8 @@ async function runDev(options, projectPath, rootPath, serverOptions) {
234
234
  : serveOptsBase.hostname;
235
235
  (0, printServerInfo_1.printServerInfo)(scheme, displayHost, serveOptsBase.port);
236
236
  }
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
- }
237
+ const cleanup = () => {
238
+ hotReloader.close();
250
239
  // We always create HTTP/1.1 server (http or https), so closeAllConnections exists; Hono's
251
240
  // ServerType union includes HTTP/2, so TS does not narrow. Use runtime check to satisfy types.
252
241
  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(): Promise<void>;
41
+ close(): 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,11 @@ async function createHotReloader(bundleOptions, projectPath, rootPath) {
548
548
  async buildFallbackError() {
549
549
  // Not implemented yet.
550
550
  },
551
- async close() {
551
+ close() {
552
552
  closed = true;
553
- const disposePromise = disposeBackgroundWatchSubscriptions();
553
+ void disposeBackgroundWatchSubscriptions();
554
554
  closePromise !== null && closePromise !== void 0 ? closePromise : (closePromise = project
555
- .shutdown()
555
+ .onExit()
556
556
  .catch((err) => {
557
557
  console.error(err);
558
558
  })
@@ -563,7 +563,6 @@ async function createHotReloader(bundleOptions, projectPath, rootPath) {
563
563
  wsClient.close();
564
564
  }
565
565
  clients.clear();
566
- await Promise.all([disposePromise, closePromise]);
567
566
  },
568
567
  };
569
568
  handleEntrypointsSubscription().catch((err) => {
@@ -228,19 +228,8 @@ async function runDev(options, projectPath, rootPath, serverOptions) {
228
228
  : serveOptsBase.hostname;
229
229
  printServerInfo(scheme, displayHost, serveOptsBase.port);
230
230
  }
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
- }
231
+ const cleanup = () => {
232
+ hotReloader.close();
244
233
  // We always create HTTP/1.1 server (http or https), so closeAllConnections exists; Hono's
245
234
  // ServerType union includes HTTP/2, so TS does not narrow. Use runtime check to satisfy types.
246
235
  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(): Promise<void>;
41
+ close(): 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,11 @@ export async function createHotReloader(bundleOptions, projectPath, rootPath) {
543
543
  async buildFallbackError() {
544
544
  // Not implemented yet.
545
545
  },
546
- async close() {
546
+ close() {
547
547
  closed = true;
548
- const disposePromise = disposeBackgroundWatchSubscriptions();
548
+ void disposeBackgroundWatchSubscriptions();
549
549
  closePromise !== null && closePromise !== void 0 ? closePromise : (closePromise = project
550
- .shutdown()
550
+ .onExit()
551
551
  .catch((err) => {
552
552
  console.error(err);
553
553
  })
@@ -558,7 +558,6 @@ export async function createHotReloader(bundleOptions, projectPath, rootPath) {
558
558
  wsClient.close();
559
559
  }
560
560
  clients.clear();
561
- await Promise.all([disposePromise, closePromise]);
562
561
  },
563
562
  };
564
563
  handleEntrypointsSubscription().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack",
3
- "version": "1.4.12-alpha.6",
3
+ "version": "1.4.12-alpha.7",
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.12-alpha.6",
44
+ "@utoo/pack-shared": "1.4.12-alpha.7",
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.12-alpha.6",
100
- "@utoo/pack-darwin-x64": "1.4.12-alpha.6",
101
- "@utoo/pack-linux-arm64-gnu": "1.4.12-alpha.6",
102
- "@utoo/pack-linux-arm64-musl": "1.4.12-alpha.6",
103
- "@utoo/pack-linux-x64-gnu": "1.4.12-alpha.6",
104
- "@utoo/pack-linux-x64-musl": "1.4.12-alpha.6",
105
- "@utoo/pack-win32-x64-msvc": "1.4.12-alpha.6"
99
+ "@utoo/pack-darwin-arm64": "1.4.12-alpha.7",
100
+ "@utoo/pack-darwin-x64": "1.4.12-alpha.7",
101
+ "@utoo/pack-linux-arm64-gnu": "1.4.12-alpha.7",
102
+ "@utoo/pack-linux-arm64-musl": "1.4.12-alpha.7",
103
+ "@utoo/pack-linux-x64-gnu": "1.4.12-alpha.7",
104
+ "@utoo/pack-linux-x64-musl": "1.4.12-alpha.7",
105
+ "@utoo/pack-win32-x64-msvc": "1.4.12-alpha.7"
106
106
  }
107
107
  }