alchemy 0.73.0 → 0.73.1

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/bin/alchemy.js CHANGED
@@ -36734,7 +36734,7 @@ function envPaths(name$1, { suffix = "nodejs" } = {}) {
36734
36734
  //#endregion
36735
36735
  //#region package.json
36736
36736
  var name = "alchemy";
36737
- var version = "0.73.0";
36737
+ var version = "0.73.1";
36738
36738
  var license = "Apache-2.0";
36739
36739
  var author = "Sam Goodwin <sam@alchemy.run>";
36740
36740
  var homepage = "https://alchemy.run";
@@ -39254,19 +39254,24 @@ const loggingMiddleware = t.middleware(async ({ path: path$33, next }) => {
39254
39254
  });
39255
39255
  let exitCode = 0;
39256
39256
  try {
39257
- await next();
39258
- await createAndSendEvent({
39257
+ const result = await next();
39258
+ if (result.ok || result.error.cause instanceof CancelSignal) await createAndSendEvent({
39259
39259
  event: "cli.success",
39260
39260
  command: path$33
39261
39261
  });
39262
- } catch (error$83) {
39263
- const isSafeExit = error$83 instanceof ExitSignal && error$83.code === 0;
39264
- await createAndSendEvent({
39265
- event: isSafeExit ? "cli.success" : "cli.error",
39266
- command: path$33
39267
- }, isSafeExit ? void 0 : error$83);
39268
- if (error$83 instanceof ExitSignal) exitCode = error$83.code;
39269
- else throw error$83;
39262
+ else if (result.error.cause instanceof ExitSignal) {
39263
+ exitCode = result.error.cause.code;
39264
+ await createAndSendEvent({
39265
+ event: exitCode === 0 ? "cli.success" : "cli.error",
39266
+ command: path$33
39267
+ }, result.error.cause);
39268
+ } else {
39269
+ await createAndSendEvent({
39270
+ event: "cli.error",
39271
+ command: path$33
39272
+ }, result.error.cause);
39273
+ exitCode = 1;
39274
+ }
39270
39275
  } finally {
39271
39276
  await new Promise((resolve$1) => setTimeout(resolve$1, 100));
39272
39277
  process.exit(exitCode);
@@ -55447,7 +55452,6 @@ async function execAlchemy(main, { cwd: cwd$1 = process.cwd(), quiet, force: for
55447
55452
  const { promise: inspectorUrlPromise, resolve: resolveInspectorUrl } = promiseWithResolvers();
55448
55453
  process.on("SIGINT", async () => {
55449
55454
  await exitPromise;
55450
- throw new ExitSignal(sanitizeExitCode(child.exitCode));
55451
55455
  });
55452
55456
  const child = spawn(command, {
55453
55457
  cwd: cwd$1,
@@ -245,8 +245,9 @@ export async function execAlchemy(
245
245
  promiseWithResolvers<string>();
246
246
 
247
247
  process.on("SIGINT", async () => {
248
+ // hold the parent process open until the child process exits,
249
+ // then the trpc middleware will handle the SIGINT after sending the event
248
250
  await exitPromise;
249
- throw new ExitSignal(sanitizeExitCode(child.exitCode));
250
251
  });
251
252
 
252
253
  const child = spawn(command, {
package/bin/trpc.ts CHANGED
@@ -22,24 +22,30 @@ const loggingMiddleware = t.middleware(async ({ path, next }) => {
22
22
  let exitCode = 0;
23
23
 
24
24
  try {
25
- await next();
26
- await createAndSendEvent({
27
- event: "cli.success",
28
- command: path,
29
- });
30
- } catch (error) {
31
- const isSafeExit = error instanceof ExitSignal && error.code === 0;
32
- await createAndSendEvent(
33
- {
34
- event: isSafeExit ? "cli.success" : "cli.error",
25
+ const result = await next();
26
+ if (result.ok || result.error.cause instanceof CancelSignal) {
27
+ await createAndSendEvent({
28
+ event: "cli.success",
35
29
  command: path,
36
- },
37
- isSafeExit ? undefined : error,
38
- );
39
- if (error instanceof ExitSignal) {
40
- exitCode = error.code;
30
+ });
31
+ } else if (result.error.cause instanceof ExitSignal) {
32
+ exitCode = result.error.cause.code;
33
+ await createAndSendEvent(
34
+ {
35
+ event: exitCode === 0 ? "cli.success" : "cli.error",
36
+ command: path,
37
+ },
38
+ result.error.cause,
39
+ );
41
40
  } else {
42
- throw error;
41
+ await createAndSendEvent(
42
+ {
43
+ event: "cli.error",
44
+ command: path,
45
+ },
46
+ result.error.cause,
47
+ );
48
+ exitCode = 1;
43
49
  }
44
50
  } finally {
45
51
  //* this is a node issue https://github.com/nodejs/node/issues/56645
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alchemy",
3
- "version": "0.73.0",
3
+ "version": "0.73.1",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Sam Goodwin <sam@alchemy.run>",
6
6
  "homepage": "https://alchemy.run",
@@ -34,7 +34,7 @@ var h={async fetch(e,r){let n=new URL(e.url);n.host=r.TUNNEL_HOST;let l=new Head
34
34
  Alchemy</a>.</p>
35
35
  </div>
36
36
  <div class="bg-slate-200 px-5 py-3 flex flex-col w-full max-w-lg">
37
- <p class="text-sm text-slate-500">Alchemy 0.73.0</p>
37
+ <p class="text-sm text-slate-500">Alchemy 0.73.1</p>
38
38
  </div>
39
39
  </div>
40
40
  </body>