@prisma-next/migration-tools 0.4.0-dev.9 → 0.5.0-dev.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.
Files changed (51) hide show
  1. package/README.md +1 -1
  2. package/dist/{attestation-DnebS4XZ.mjs → attestation-DtF8tEOM.mjs} +24 -23
  3. package/dist/attestation-DtF8tEOM.mjs.map +1 -0
  4. package/dist/{errors-C_XuSbX7.mjs → errors-BKbRGCJM.mjs} +9 -2
  5. package/dist/errors-BKbRGCJM.mjs.map +1 -0
  6. package/dist/exports/attestation.d.mts +20 -6
  7. package/dist/exports/attestation.d.mts.map +1 -1
  8. package/dist/exports/attestation.mjs +3 -3
  9. package/dist/exports/dag.d.mts +8 -6
  10. package/dist/exports/dag.d.mts.map +1 -1
  11. package/dist/exports/dag.mjs +181 -107
  12. package/dist/exports/dag.mjs.map +1 -1
  13. package/dist/exports/io.d.mts +16 -13
  14. package/dist/exports/io.d.mts.map +1 -1
  15. package/dist/exports/io.mjs +2 -2
  16. package/dist/exports/migration-ts.d.mts +15 -21
  17. package/dist/exports/migration-ts.d.mts.map +1 -1
  18. package/dist/exports/migration-ts.mjs +28 -36
  19. package/dist/exports/migration-ts.mjs.map +1 -1
  20. package/dist/exports/migration.d.mts +48 -18
  21. package/dist/exports/migration.d.mts.map +1 -1
  22. package/dist/exports/migration.mjs +75 -85
  23. package/dist/exports/migration.mjs.map +1 -1
  24. package/dist/exports/refs.mjs +1 -1
  25. package/dist/exports/types.d.mts +2 -2
  26. package/dist/exports/types.mjs +2 -16
  27. package/dist/{io-Cun81AIZ.mjs → io-CCnYsUHU.mjs} +18 -22
  28. package/dist/io-CCnYsUHU.mjs.map +1 -0
  29. package/dist/types-DyGXcWWp.d.mts +71 -0
  30. package/dist/types-DyGXcWWp.d.mts.map +1 -0
  31. package/package.json +5 -4
  32. package/src/attestation.ts +34 -26
  33. package/src/dag.ts +140 -154
  34. package/src/errors.ts +8 -0
  35. package/src/exports/attestation.ts +2 -1
  36. package/src/exports/io.ts +1 -1
  37. package/src/exports/migration-ts.ts +1 -1
  38. package/src/exports/migration.ts +8 -1
  39. package/src/exports/types.ts +2 -8
  40. package/src/graph-ops.ts +65 -0
  41. package/src/io.ts +23 -24
  42. package/src/migration-base.ts +99 -101
  43. package/src/migration-ts.ts +28 -50
  44. package/src/queue.ts +37 -0
  45. package/src/types.ts +15 -55
  46. package/dist/attestation-DnebS4XZ.mjs.map +0 -1
  47. package/dist/errors-C_XuSbX7.mjs.map +0 -1
  48. package/dist/exports/types.mjs.map +0 -1
  49. package/dist/io-Cun81AIZ.mjs.map +0 -1
  50. package/dist/types-D2uX4ql7.d.mts +0 -100
  51. package/dist/types-D2uX4ql7.d.mts.map +0 -1
@@ -1,100 +0,0 @@
1
- import { Contract } from "@prisma-next/contract/types";
2
- import { MigrationPlanOperation } from "@prisma-next/framework-components/control";
3
-
4
- //#region src/types.d.ts
5
- interface MigrationHints {
6
- readonly used: readonly string[];
7
- readonly applied: readonly string[];
8
- readonly plannerVersion: string;
9
- readonly planningStrategy: string;
10
- }
11
- /**
12
- * Shared fields for all migration manifests (draft and attested).
13
- */
14
- interface MigrationManifestBase {
15
- readonly from: string;
16
- readonly to: string;
17
- readonly kind: 'regular' | 'baseline';
18
- readonly fromContract: Contract | null;
19
- readonly toContract: Contract;
20
- readonly hints: MigrationHints;
21
- readonly labels: readonly string[];
22
- readonly authorship?: {
23
- readonly author?: string;
24
- readonly email?: string;
25
- };
26
- readonly signature?: {
27
- readonly keyId: string;
28
- readonly value: string;
29
- } | null;
30
- readonly createdAt: string;
31
- }
32
- /**
33
- * A draft migration that has been planned but not yet attested.
34
- * Draft migrations have `migrationId: null` and are excluded from
35
- * graph reconstruction and apply.
36
- */
37
- interface DraftMigrationManifest extends MigrationManifestBase {
38
- readonly migrationId: null;
39
- }
40
- /**
41
- * An attested migration with a content-addressed migrationId.
42
- * Only attested migrations participate in the migration graph.
43
- */
44
- interface AttestedMigrationManifest extends MigrationManifestBase {
45
- readonly migrationId: string;
46
- }
47
- /**
48
- * Union of draft and attested manifests. This is what the on-disk
49
- * format represents — `migrationId` is `null` for drafts, a string
50
- * for attested migrations.
51
- */
52
- type MigrationManifest = DraftMigrationManifest | AttestedMigrationManifest;
53
- type MigrationOps = readonly MigrationPlanOperation[];
54
- /**
55
- * An on-disk migration directory containing a manifest and operations.
56
- * The manifest may be draft or attested.
57
- */
58
- interface BaseMigrationBundle {
59
- readonly dirName: string;
60
- readonly dirPath: string;
61
- readonly manifest: MigrationManifest;
62
- readonly ops: MigrationOps;
63
- }
64
- /**
65
- * A bundle known to be attested (migrationId is a string).
66
- * Use this after filtering bundles to attested-only.
67
- */
68
- interface AttestedMigrationBundle extends BaseMigrationBundle {
69
- readonly manifest: AttestedMigrationManifest;
70
- }
71
- interface DraftMigrationBundle extends BaseMigrationBundle {
72
- readonly manifest: DraftMigrationManifest;
73
- }
74
- /**
75
- * An entry in the migration graph. Only attested migrations appear in the
76
- * graph, so `migrationId` is always a string.
77
- */
78
- interface MigrationChainEntry {
79
- readonly from: string;
80
- readonly to: string;
81
- readonly migrationId: string;
82
- readonly dirName: string;
83
- readonly createdAt: string;
84
- readonly labels: readonly string[];
85
- }
86
- interface MigrationGraph {
87
- readonly nodes: ReadonlySet<string>;
88
- readonly forwardChain: ReadonlyMap<string, readonly MigrationChainEntry[]>;
89
- readonly reverseChain: ReadonlyMap<string, readonly MigrationChainEntry[]>;
90
- readonly migrationById: ReadonlyMap<string, MigrationChainEntry>;
91
- }
92
- /**
93
- * Type guard that narrows a MigrationBundle to an AttestedMigrationBundle.
94
- * Use with `.filter(isAttested)` to get a typed array of attested bundles.
95
- */
96
- declare function isAttested(bundle: BaseMigrationBundle): bundle is AttestedMigrationBundle;
97
- declare function isDraft(bundle: BaseMigrationBundle): bundle is DraftMigrationBundle;
98
- //#endregion
99
- export { DraftMigrationManifest as a, MigrationHints as c, isAttested as d, isDraft as f, DraftMigrationBundle as i, MigrationManifest as l, AttestedMigrationManifest as n, MigrationChainEntry as o, BaseMigrationBundle as r, MigrationGraph as s, AttestedMigrationBundle as t, MigrationOps as u };
100
- //# sourceMappingURL=types-D2uX4ql7.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-D2uX4ql7.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;UAGiB,cAAA;;EAAA,SAAA,OAAA,EAAc,SAAA,MAAA,EAAA;EAUrB,SAAA,cAAA,EAAqB,MAAA;EAIN,SAAA,gBAAA,EAAA,MAAA;;;;AAczB;AAQA,UA1BU,qBAAA,CA0BiC;EAS/B,SAAA,IAAA,EAAA,MAAiB;EAEjB,SAAA,EAAA,EAAA,MAAY;EAMP,SAAA,IAAA,EAAA,SAAmB,GAAA,UAGf;EAQJ,SAAA,YAAA,EAlDQ,QAkDgB,GAAA,IACpB;EAGJ,SAAA,UAAA,EArDM,QAqDe;EAQrB,SAAA,KAAA,EA5DC,cA4DkB;EASnB,SAAA,MAAA,EAAc,SAAA,MAAA,EAAA;EACb,SAAA,UAAA,CAAA,EAAA;IACoC,SAAA,MAAA,CAAA,EAAA,MAAA;IAA7B,SAAA,KAAA,CAAA,EAAA,MAAA;EAC6B,CAAA;EAA7B,SAAA,SAAA,CAAA,EAAA;IACqB,SAAA,KAAA,EAAA,MAAA;IAApB,SAAA,KAAA,EAAA,MAAA;EAAW,CAAA,GAAA,IAAA;EAOrB,SAAA,SAAU,EAAA,MAAS;AAInC;;;;;;UAxEiB,sBAAA,SAA+B;;;;;;;UAQ/B,yBAAA,SAAkC;;;;;;;;KASvC,iBAAA,GAAoB,yBAAyB;KAE7C,YAAA,YAAwB;;;;;UAMnB,mBAAA;;;qBAGI;gBACL;;;;;;UAOC,uBAAA,SAAgC;qBAC5B;;UAGJ,oBAAA,SAA6B;qBACzB;;;;;;UAOJ,mBAAA;;;;;;;;UASA,cAAA;kBACC;yBACO,6BAA6B;yBAC7B,6BAA6B;0BAC5B,oBAAoB;;;;;;iBAO9B,UAAA,SAAmB,gCAAgC;iBAInD,OAAA,SAAgB,gCAAgC"}