@prisma-next/cli 0.12.0-dev.16 → 0.12.0-dev.2

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.
Files changed (104) hide show
  1. package/dist/cli.mjs +160 -177
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/{client-Cdxcme1x.mjs → client-KgJorIvG.mjs} +8 -21
  4. package/dist/client-KgJorIvG.mjs.map +1 -0
  5. package/dist/{command-helpers-Cmdqyhz9.mjs → command-helpers-Bbw1GbwL.mjs} +2 -32
  6. package/dist/{command-helpers-Cmdqyhz9.mjs.map → command-helpers-Bbw1GbwL.mjs.map} +1 -1
  7. package/dist/commands/contract-emit.mjs +1 -1
  8. package/dist/commands/contract-infer.mjs +1 -1
  9. package/dist/commands/db-init.mjs +4 -4
  10. package/dist/commands/db-schema.mjs +3 -3
  11. package/dist/commands/db-sign.mjs +4 -4
  12. package/dist/commands/db-update.mjs +5 -5
  13. package/dist/commands/db-verify.mjs +1 -1
  14. package/dist/commands/migrate.d.mts +1 -1
  15. package/dist/commands/migrate.mjs +5 -5
  16. package/dist/commands/migration-check.mjs +1 -1
  17. package/dist/commands/migration-graph.d.mts +5 -23
  18. package/dist/commands/migration-graph.d.mts.map +1 -1
  19. package/dist/commands/migration-graph.mjs +2 -2
  20. package/dist/commands/migration-list.d.mts +3 -3
  21. package/dist/commands/migration-list.mjs +2 -2
  22. package/dist/commands/migration-log.d.mts +3 -3
  23. package/dist/commands/migration-log.mjs +3 -3
  24. package/dist/commands/migration-new.mjs +3 -3
  25. package/dist/commands/migration-plan.d.mts +1 -1
  26. package/dist/commands/migration-plan.mjs +1 -1
  27. package/dist/commands/migration-show.d.mts +1 -1
  28. package/dist/commands/migration-show.mjs +3 -3
  29. package/dist/commands/migration-status.d.mts +1 -1
  30. package/dist/commands/migration-status.mjs +4 -4
  31. package/dist/commands/migration-status.mjs.map +1 -1
  32. package/dist/commands/ref.d.mts +1 -1
  33. package/dist/commands/ref.mjs +2 -2
  34. package/dist/{contract-at-errors-Cz0z5PJi.mjs → contract-at-errors-BxP-TOMl.mjs} +2 -2
  35. package/dist/{contract-at-errors-Cz0z5PJi.mjs.map → contract-at-errors-BxP-TOMl.mjs.map} +1 -1
  36. package/dist/{contract-emit-CC9jDOmu.mjs → contract-emit-D-4jrNve.mjs} +3 -3
  37. package/dist/{contract-emit-CC9jDOmu.mjs.map → contract-emit-D-4jrNve.mjs.map} +1 -1
  38. package/dist/{contract-emit-DPMij44i.mjs → contract-emit-DxcGl4Uq.mjs} +3 -3
  39. package/dist/{contract-emit-DPMij44i.mjs.map → contract-emit-DxcGl4Uq.mjs.map} +1 -1
  40. package/dist/{contract-infer-DaFPNrZH.mjs → contract-infer-D8uEbJuu.mjs} +3 -3
  41. package/dist/{contract-infer-DaFPNrZH.mjs.map → contract-infer-D8uEbJuu.mjs.map} +1 -1
  42. package/dist/{contract-space-aggregate-loader-CirAEsM8.mjs → contract-space-aggregate-loader-DvZwdkrr.mjs} +2 -2
  43. package/dist/{contract-space-aggregate-loader-CirAEsM8.mjs.map → contract-space-aggregate-loader-DvZwdkrr.mjs.map} +1 -1
  44. package/dist/{db-verify-BSA1a_W_.mjs → db-verify-v_vUKXTU.mjs} +4 -4
  45. package/dist/{db-verify-BSA1a_W_.mjs.map → db-verify-v_vUKXTU.mjs.map} +1 -1
  46. package/dist/exports/control-api.d.mts +1 -1
  47. package/dist/exports/control-api.d.mts.map +1 -1
  48. package/dist/exports/control-api.mjs +2 -2
  49. package/dist/exports/index.mjs +1 -1
  50. package/dist/exports/init-output.mjs +1 -1
  51. package/dist/{framework-components-DynSvww4.mjs → framework-components-fYXjz_in.mjs} +2 -2
  52. package/dist/{framework-components-DynSvww4.mjs.map → framework-components-fYXjz_in.mjs.map} +1 -1
  53. package/dist/{global-flags-DG4uY5tV.d.mts → global-flags-DEHjV8_s.d.mts} +1 -1
  54. package/dist/{global-flags-DG4uY5tV.d.mts.map → global-flags-DEHjV8_s.d.mts.map} +1 -1
  55. package/dist/{init-B6kKrmf7.mjs → init-Cv9UzWL5.mjs} +58 -5
  56. package/dist/init-Cv9UzWL5.mjs.map +1 -0
  57. package/dist/{inspect-live-schema-Dn56wDhG.mjs → inspect-live-schema-C6ohV_oQ.mjs} +3 -3
  58. package/dist/{inspect-live-schema-Dn56wDhG.mjs.map → inspect-live-schema-C6ohV_oQ.mjs.map} +1 -1
  59. package/dist/{migration-check-DzH1u-O1.mjs → migration-check-BiBJoYYW.mjs} +2 -2
  60. package/dist/{migration-check-DzH1u-O1.mjs.map → migration-check-BiBJoYYW.mjs.map} +1 -1
  61. package/dist/{migration-command-scaffold-V52dV2Tv.mjs → migration-command-scaffold-CjvwO6at.mjs} +3 -3
  62. package/dist/{migration-command-scaffold-V52dV2Tv.mjs.map → migration-command-scaffold-CjvwO6at.mjs.map} +1 -1
  63. package/dist/{migration-graph-Cm3oee8C.mjs → migration-graph-D7DVUElV.mjs} +80 -326
  64. package/dist/migration-graph-D7DVUElV.mjs.map +1 -0
  65. package/dist/{migration-plan-CaeKCKp4.mjs → migration-plan-9DJ7q7_z.mjs} +5 -5
  66. package/dist/{migration-plan-CaeKCKp4.mjs.map → migration-plan-9DJ7q7_z.mjs.map} +1 -1
  67. package/dist/{migration-types-CAQ-0TEE.d.mts → migration-types-D2FW63pr.d.mts} +1 -1
  68. package/dist/{migration-types-CAQ-0TEE.d.mts.map → migration-types-D2FW63pr.d.mts.map} +1 -1
  69. package/dist/{migrations-DQ1t3XFL.mjs → migrations-Cv2jxNNK.mjs} +2 -2
  70. package/dist/{migrations-DQ1t3XFL.mjs.map → migrations-Cv2jxNNK.mjs.map} +1 -1
  71. package/dist/{output-CF_hqzI-.mjs → output-B60Gw5fu.mjs} +1 -1
  72. package/dist/{output-CF_hqzI-.mjs.map → output-B60Gw5fu.mjs.map} +1 -1
  73. package/dist/{terminal-ui-C3xGyxW-.d.mts → terminal-ui-5Y6mrg93.d.mts} +1 -1
  74. package/dist/{terminal-ui-C3xGyxW-.d.mts.map → terminal-ui-5Y6mrg93.d.mts.map} +1 -1
  75. package/dist/{types-DiC683UW.d.mts → types-Dt_SfqFm.d.mts} +2 -8
  76. package/dist/{types-DiC683UW.d.mts.map → types-Dt_SfqFm.d.mts.map} +1 -1
  77. package/dist/{verify-CreSJ1Mz.mjs → verify-DCA9Sldu.mjs} +2 -2
  78. package/dist/{verify-CreSJ1Mz.mjs.map → verify-DCA9Sldu.mjs.map} +1 -1
  79. package/package.json +18 -22
  80. package/src/cli.ts +0 -5
  81. package/src/commands/init/index.ts +35 -6
  82. package/src/commands/init/init.ts +14 -1
  83. package/src/commands/init/inputs.ts +75 -0
  84. package/src/commands/migration-graph.ts +2 -43
  85. package/src/commands/migration-status.ts +1 -1
  86. package/src/control-api/client.ts +1 -11
  87. package/src/control-api/operations/apply.ts +0 -1
  88. package/src/control-api/operations/migration-apply.ts +3 -10
  89. package/src/control-api/types.ts +1 -12
  90. package/src/utils/formatters/migration-graph-layout.ts +5 -27
  91. package/src/utils/formatters/migration-graph-tree-render.ts +51 -360
  92. package/src/utils/global-flags.ts +0 -35
  93. package/src/utils/telemetry.ts +32 -68
  94. package/dist/client-Cdxcme1x.mjs.map +0 -1
  95. package/dist/commands/telemetry/index.d.mts +0 -7
  96. package/dist/commands/telemetry/index.d.mts.map +0 -1
  97. package/dist/commands/telemetry/index.mjs +0 -2
  98. package/dist/init-B6kKrmf7.mjs.map +0 -1
  99. package/dist/migration-graph-Cm3oee8C.mjs.map +0 -1
  100. package/dist/telemetry-Q88WHwlv.mjs +0 -122
  101. package/dist/telemetry-Q88WHwlv.mjs.map +0 -1
  102. package/src/commands/telemetry/index.ts +0 -107
  103. package/src/commands/telemetry/status.ts +0 -67
  104. package/src/utils/formatters/migration-graph-lane-colors.ts +0 -31
@@ -7,7 +7,6 @@ import type {
7
7
  TargetMigrationsCapability,
8
8
  } from '@prisma-next/framework-components/control';
9
9
  import {
10
- buildSynthMigrationEdge,
11
10
  type ContractMarkerRecordLike,
12
11
  type ContractSpaceAggregate,
13
12
  type ContractSpaceMember,
@@ -320,7 +319,7 @@ export async function executeMigrationApply<TFamilyId extends string, TTargetId
320
319
  includeMarkers: true,
321
320
  });
322
321
  const totalMigrationsApplied = applied.value.orderedResolutions.reduce(
323
- (sum, r) => sum + r.entry.migrationEdges.length,
322
+ (sum, r) => sum + (r.entry.migrationEdges?.length ?? 0),
324
323
  0,
325
324
  );
326
325
  const summary = `Applied ${totalMigrationsApplied} migration(s) (${applied.value.totalOpsExecuted} operation(s)) across ${orderedAll.length} contract space(s)`;
@@ -362,13 +361,7 @@ function buildAtHeadResolution(args: {
362
361
  displayOps: [],
363
362
  destinationContract: member.contract(),
364
363
  strategy: 'graph-walk',
365
- migrationEdges: [
366
- buildSynthMigrationEdge({
367
- currentMarkerStorageHash: liveMarker?.storageHash,
368
- destinationStorageHash: targetHash,
369
- operationCount: 0,
370
- }),
371
- ],
364
+ migrationEdges: [],
372
365
  };
373
366
  }
374
367
 
@@ -411,7 +404,7 @@ function buildSuccess(args: BuildSuccessArgs): MigrationApplySuccess {
411
404
  // JSON-shape consumers (e.g. `parsed.applied.length` in integration
412
405
  // tests). The aggregate per-space breakdown lives on `perSpace[]`.
413
406
  const applied = args.orderedResolutions.flatMap((r) => {
414
- const edges = r.entry.migrationEdges;
407
+ const edges = r.entry.migrationEdges ?? [];
415
408
  return edges.map((edge) => ({
416
409
  spaceId: r.spaceId,
417
410
  dirName: edge.dirName,
@@ -2,11 +2,7 @@ import type {
2
2
  ContractSourceDiagnostics,
3
3
  ContractSourceProvider,
4
4
  } from '@prisma-next/config/config-types';
5
- import type {
6
- Contract,
7
- ContractMarkerRecord,
8
- LedgerEntryRecord,
9
- } from '@prisma-next/contract/types';
5
+ import type { Contract, ContractMarkerRecord } from '@prisma-next/contract/types';
10
6
  import type {
11
7
  ControlAdapterDescriptor,
12
8
  ControlDriverDescriptor,
@@ -880,13 +876,6 @@ export interface ControlClient {
880
876
  */
881
877
  readAllMarkers(): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
882
878
 
883
- /**
884
- * Reads the per-migration ledger journal for `space` in apply order.
885
- * Returns an empty array when the ledger store does not yet exist or
886
- * has no rows for that space.
887
- */
888
- readLedger(space?: string): Promise<readonly LedgerEntryRecord[]>;
889
-
890
879
  /**
891
880
  * Applies pre-planned on-disk migrations to the database.
892
881
  * Each migration runs in its own transaction with full execution checks.
@@ -379,7 +379,6 @@ function emptyCells(width: number): StructuralCell[] {
379
379
  function buildBranchConnectorCells(
380
380
  startLane: number,
381
381
  endLane: number,
382
- fanTargetLanes: ReadonlySet<number>,
383
382
  activeLanes: ReadonlySet<number>,
384
383
  gridWidth: number,
385
384
  ): StructuralCell[] {
@@ -394,13 +393,7 @@ function buildBranchConnectorCells(
394
393
  } else if (lane === endLane) {
395
394
  cells[lane] = { kind: 'branch-corner' };
396
395
  } else if (lane > startLane && lane < endLane) {
397
- if (fanTargetLanes.has(lane)) {
398
- cells[lane] = { kind: 'branch-tee' };
399
- } else if (activeLanes.has(lane)) {
400
- cells[lane] = { kind: 'arc-crossing' };
401
- } else {
402
- cells[lane] = { kind: 'branch-tee' };
403
- }
396
+ cells[lane] = { kind: 'branch-tee' };
404
397
  }
405
398
  }
406
399
  return cells;
@@ -409,7 +402,6 @@ function buildBranchConnectorCells(
409
402
  function buildMergeConnectorCells(
410
403
  startLane: number,
411
404
  endLane: number,
412
- fanTargetLanes: ReadonlySet<number>,
413
405
  activeLanes: ReadonlySet<number>,
414
406
  gridWidth: number,
415
407
  ): StructuralCell[] {
@@ -424,13 +416,7 @@ function buildMergeConnectorCells(
424
416
  } else if (lane === endLane) {
425
417
  cells[lane] = { kind: 'merge-corner' };
426
418
  } else if (lane > startLane && lane < endLane) {
427
- if (fanTargetLanes.has(lane)) {
428
- cells[lane] = { kind: 'merge-tee' };
429
- } else if (activeLanes.has(lane)) {
430
- cells[lane] = { kind: 'arc-crossing' };
431
- } else {
432
- cells[lane] = { kind: 'horizontal-pass' };
433
- }
419
+ cells[lane] = activeLanes.has(lane) ? { kind: 'merge-tee' } : { kind: 'horizontal-pass' };
434
420
  }
435
421
  }
436
422
  return cells;
@@ -936,14 +922,13 @@ function layoutComponent(
936
922
  const endLane = Math.max(...laneIndices);
937
923
  ensureGridWidth(endLane + 1);
938
924
  const activeLanes = new Set(activeLaneIndices());
939
- const fanTargetLanes = new Set(laneIndices);
940
925
  rows.push({
941
926
  kind: 'merge-connector',
942
927
  contractHash,
943
928
  startLane,
944
929
  endLane,
945
930
  branchCount: laneIndices.length,
946
- cells: buildMergeConnectorCells(startLane, endLane, fanTargetLanes, activeLanes, gridWidth),
931
+ cells: buildMergeConnectorCells(startLane, endLane, activeLanes, gridWidth),
947
932
  });
948
933
  for (const index of laneIndices) {
949
934
  if (index !== startLane) setLane(index, null);
@@ -956,7 +941,6 @@ function layoutComponent(
956
941
  startLane: number,
957
942
  endLane: number,
958
943
  branchCount: number,
959
- fanTargetLanes: readonly number[],
960
944
  ): void {
961
945
  ensureGridWidth(endLane + 1);
962
946
  const activeLanes = new Set(activeLaneIndices());
@@ -966,13 +950,7 @@ function layoutComponent(
966
950
  startLane,
967
951
  endLane,
968
952
  branchCount,
969
- cells: buildBranchConnectorCells(
970
- startLane,
971
- endLane,
972
- new Set(fanTargetLanes),
973
- activeLanes,
974
- gridWidth,
975
- ),
953
+ cells: buildBranchConnectorCells(startLane, endLane, activeLanes, gridWidth),
976
954
  });
977
955
  }
978
956
 
@@ -1068,7 +1046,7 @@ function layoutComponent(
1068
1046
 
1069
1047
  if (groups.length >= 2) {
1070
1048
  const endLane = Math.max(...laneForGroup);
1071
- emitBranchConnector(node, column, endLane, groups.length, laneForGroup);
1049
+ emitBranchConnector(node, column, endLane, groups.length);
1072
1050
  }
1073
1051
 
1074
1052
  for (let groupIndex = 0; groupIndex < groups.length; groupIndex++) {