create-prisma 0.11.2-pr.86.302.1 → 0.11.2-pr.86.303.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/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as ApplicationLayer } from "./json-output-BNjE-wCr.mjs";
2
+ import { a as ApplicationLayer } from "./json-output-CLRpFy4K.mjs";
3
3
  import { runCreatePrismaCli } from "./index.mjs";
4
4
  import { Effect } from "effect";
5
5
  import { NodeRuntime } from "@effect/platform-node-shared";
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { _ as databaseProviderInputs, c as CreateCommandResultSchema, d as CreateCommandInputSchema, f as CreateTemplateSchema, g as createTemplates, h as authoringStyles, i as getErrorMessage, l as createCommandFailureResult, m as PackageManagerSchema, n as writeJsonResult, o as applicationRuntime, p as DatabaseProviderSchema, r as runCreateCommandEffect, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as isJsonOutputRequested, u as AuthoringStyleSchema, v as normalizeDatabaseProvider, y as packageManagers } from "./json-output-BNjE-wCr.mjs";
2
+ import { _ as databaseProviderInputs, c as CreateCommandResultSchema, d as CreateCommandInputSchema, f as CreateTemplateSchema, g as createTemplates, h as authoringStyles, i as getErrorMessage, l as createCommandFailureResult, m as PackageManagerSchema, n as writeJsonResult, o as applicationRuntime, p as DatabaseProviderSchema, r as runCreateCommandEffect, s as CREATE_PRISMA_RESULT_SCHEMA_VERSION, t as isJsonOutputRequested, u as AuthoringStyleSchema, v as normalizeDatabaseProvider, y as packageManagers } from "./json-output-CLRpFy4K.mjs";
3
3
  import { Console, Effect, Option } from "effect";
4
4
  import { Argument, CliError, Command, Flag } from "effect/unstable/cli";
5
5
 
6
6
  //#region src/index.ts
7
- const CLI_VERSION = "0.11.2-pr.86.302.1";
7
+ const CLI_VERSION = "0.11.2-pr.86.303.1";
8
8
  const optionalArgument = (name, description) => Argument.string(name).pipe(Argument.withDescription(description), Argument.optional, Argument.map(Option.getOrUndefined));
9
9
  const optionalBoolean = (name, description) => Flag.boolean(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
10
10
  const optionalString = (name, description) => Flag.string(name).pipe(Flag.withDescription(description), Flag.optional, Flag.map(Option.getOrUndefined));
@@ -264,7 +264,15 @@ var CommandRunner = class CommandRunner extends Context.Service()("create-prisma
264
264
  const lines = createInterface({ input: stderr });
265
265
  for await (const line of lines) if (line.trim()) spec.onStderrLine?.(line);
266
266
  })() : Promise.resolve();
267
- const [result] = await Promise.all([subprocess, stderrLines]);
267
+ let result;
268
+ try {
269
+ [result] = await Promise.all([subprocess, stderrLines]);
270
+ } catch (cause) {
271
+ const error = cause instanceof Error ? cause : new Error(String(cause));
272
+ subprocess.kill(error);
273
+ await subprocess.catch(() => void 0);
274
+ throw cause;
275
+ }
268
276
  return {
269
277
  exitCode: result.exitCode ?? 1,
270
278
  stdout: typeof result.stdout === "string" ? result.stdout : "",
@@ -330,7 +338,7 @@ const getAnonymousIdEffect = Effect.fn("Telemetry.getAnonymousId")(function* ()
330
338
  return anonymousId;
331
339
  });
332
340
  const getCommonProperties = () => ({
333
- "cli-version": "0.11.2-pr.86.302.1",
341
+ "cli-version": "0.11.2-pr.86.303.1",
334
342
  "node-version": process.version,
335
343
  platform: process.platform,
336
344
  arch: process.arch
@@ -421,7 +429,7 @@ const trackCreateCompletedEffect = Effect.fn("Telemetry.createCompleted")(functi
421
429
  yield* trackCliTelemetryEffect(CREATE_PRISMA_NEXT_COMPLETED_EVENT, {
422
430
  ...getBaseCreateProperties(params.input, params.context),
423
431
  "duration-ms": params.durationMs
424
- }).pipe(Effect.scoped, Effect.catch(() => Effect.void));
432
+ }).pipe(Effect.scoped, Effect.timeout("2 seconds"), Effect.catch(() => Effect.void));
425
433
  });
426
434
  const trackCreateFailedEffect = Effect.fn("Telemetry.createFailed")(function* (params) {
427
435
  yield* trackCliTelemetryEffect(CREATE_PRISMA_NEXT_FAILED_EVENT, {
@@ -434,14 +442,14 @@ const trackCreateFailedEffect = Effect.fn("Telemetry.createFailed")(function* (p
434
442
  "error-code": getErrorCode(params.error),
435
443
  "prisma-cli-command": getPrismaCliFailureProperty(params.error, "prismaCliCommand"),
436
444
  "prisma-cli-error-code": getPrismaCliFailureProperty(params.error, "prismaCliErrorCode")
437
- }).pipe(Effect.scoped, Effect.catch(() => Effect.void));
445
+ }).pipe(Effect.scoped, Effect.timeout("2 seconds"), Effect.catch(() => Effect.void));
438
446
  });
439
447
  const trackCreateCancelledEffect = Effect.fn("Telemetry.createCancelled")(function* (params) {
440
448
  yield* trackCliTelemetryEffect(CREATE_PRISMA_NEXT_CANCELLED_EVENT, {
441
449
  ...getBaseCreateProperties(params.input, params.context),
442
450
  "duration-ms": params.durationMs,
443
451
  "cancellation-stage": params.stage
444
- }).pipe(Effect.scoped, Effect.catch(() => Effect.void));
452
+ }).pipe(Effect.scoped, Effect.timeout("2 seconds"), Effect.catch(() => Effect.void));
445
453
  });
446
454
 
447
455
  //#endregion
@@ -471,10 +479,7 @@ const detectFromPackageJson = Effect.fn("PackageManager.detectFromPackageJson")(
471
479
  const packageJsonPath = path.join(projectDir, "package.json");
472
480
  if (!(yield* fs.exists(packageJsonPath))) return null;
473
481
  const packageJsonSource = yield* fs.readFileString(packageJsonPath).pipe(Effect.catch(() => Effect.succeed("")));
474
- const packageJson = yield* Effect.try({
475
- try: () => JSON.parse(packageJsonSource),
476
- catch: () => null
477
- });
482
+ const packageJson = yield* Effect.try(() => JSON.parse(packageJsonSource)).pipe(Effect.catch(() => Effect.succeed(null)));
478
483
  return packageJson ? parsePackageManagerField(packageJson.packageManager) : null;
479
484
  });
480
485
  const detectFromDenoConfig = Effect.fn("PackageManager.detectFromDenoConfig")(function* (projectDir) {
@@ -1352,7 +1357,8 @@ const deployNewProjectWithComposerEffect = Effect.fn("Deployment.deploy")(functi
1352
1357
  workspace: details?.workspace ?? selectedWorkspace,
1353
1358
  project: details?.project ?? { name: appName }
1354
1359
  };
1355
- }).pipe(Effect.tapError((error) => Effect.sync(() => {
1360
+ }).pipe(Effect.tapCause((cause) => Effect.sync(() => {
1361
+ const error = Cause.squash(cause);
1356
1362
  if (deploymentLog) {
1357
1363
  deploymentLog.error("Deployment failed.");
1358
1364
  deploymentLog = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma",
3
- "version": "0.11.2-pr.86.302.1",
3
+ "version": "0.11.2-pr.86.303.1",
4
4
  "private": false,
5
5
  "description": "Create Prisma 8 projects with first-party templates and great DX.",
6
6
  "homepage": "https://github.com/prisma/create-prisma",