clivly 0.8.0 → 0.9.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 (112) hide show
  1. package/README.md +330 -134
  2. package/core-drizzle.cjs +3 -1
  3. package/core-drizzle.d.cts +3 -2
  4. package/core-drizzle.d.mts +3 -2
  5. package/core-drizzle.mjs +2 -2
  6. package/core-entity-config.cjs +2 -1
  7. package/core-entity-config.d.cts +2 -2
  8. package/core-entity-config.d.mts +2 -2
  9. package/core-entity-config.mjs +2 -2
  10. package/core-entity-heuristics.d.cts +3 -2
  11. package/core-entity-heuristics.d.mts +3 -2
  12. package/core-mapping-form.d.cts +1 -1
  13. package/core-mapping-form.d.mts +1 -1
  14. package/core-mappings-config.cjs +1 -1
  15. package/core-mappings-config.d.cts +1 -1
  16. package/core-mappings-config.d.mts +1 -1
  17. package/core-mappings-config.mjs +1 -1
  18. package/core-sync-engine.cjs +1 -1
  19. package/core-sync-engine.d.cts +1 -1
  20. package/core-sync-engine.d.mts +1 -1
  21. package/core-sync-engine.mjs +1 -1
  22. package/core-view-compiler.cjs +2 -1
  23. package/core-view-compiler.d.cts +2 -2
  24. package/core-view-compiler.d.mts +2 -2
  25. package/core-view-compiler.mjs +2 -2
  26. package/core.cjs +21 -5
  27. package/core.d.cts +7 -6
  28. package/core.d.mts +7 -6
  29. package/core.mjs +7 -6
  30. package/drizzle-3kvhkwO7.mjs +110 -0
  31. package/drizzle-DooDUGqO.d.mts +41 -0
  32. package/drizzle-bfjVzYR6.cjs +127 -0
  33. package/drizzle-jz0lrAgl.d.cts +41 -0
  34. package/drizzle.cjs +12 -40
  35. package/drizzle.d.cts +3 -11
  36. package/drizzle.d.mts +3 -11
  37. package/drizzle.mjs +12 -41
  38. package/entity-config-D08zAeFY.mjs +657 -0
  39. package/{entity-config-DoUCXtq5.d.cts → entity-config-fKQhimtD.d.cts} +263 -2
  40. package/{entity-config-DoUCXtq5.d.mts → entity-config-fKQhimtD.d.mts} +263 -2
  41. package/entity-config-nuXge6rY.cjs +778 -0
  42. package/index.cjs +768 -122
  43. package/index.d.cts +12 -0
  44. package/index.d.mts +12 -0
  45. package/index.mjs +769 -123
  46. package/internal-BGVUG312.mjs +68 -0
  47. package/internal-BLCK81kB.d.mts +72 -0
  48. package/internal-C-YBW2DB.d.cts +72 -0
  49. package/internal-D4HDi2GC.cjs +97 -0
  50. package/internal-drizzle.cjs +3 -1
  51. package/internal-drizzle.d.cts +2 -2
  52. package/internal-drizzle.d.mts +2 -2
  53. package/internal-drizzle.mjs +2 -2
  54. package/internal-entity-config.cjs +2 -1
  55. package/internal-entity-config.d.cts +2 -2
  56. package/internal-entity-config.d.mts +2 -2
  57. package/internal-entity-config.mjs +2 -2
  58. package/internal-entity-heuristics.cjs +28 -8
  59. package/internal-entity-heuristics.d.cts +2 -12
  60. package/internal-entity-heuristics.d.mts +2 -12
  61. package/internal-entity-heuristics.mjs +28 -8
  62. package/internal-mapping-form.d.cts +1 -1
  63. package/internal-mapping-form.d.mts +1 -1
  64. package/internal-mappings-config.cjs +1 -1
  65. package/internal-mappings-config.d.cts +1 -1
  66. package/internal-mappings-config.d.mts +1 -1
  67. package/internal-mappings-config.mjs +1 -1
  68. package/internal-sync-engine.cjs +1 -1
  69. package/internal-sync-engine.d.cts +1 -1
  70. package/internal-sync-engine.d.mts +1 -1
  71. package/internal-sync-engine.mjs +1 -1
  72. package/internal-view-compiler.cjs +2 -1
  73. package/internal-view-compiler.d.cts +2 -2
  74. package/internal-view-compiler.d.mts +2 -2
  75. package/internal-view-compiler.mjs +2 -2
  76. package/internal.cjs +21 -4
  77. package/internal.d.cts +7 -6
  78. package/internal.d.mts +7 -6
  79. package/internal.mjs +7 -5
  80. package/{mapping-form-D93lhHEc.d.mts → mapping-form-DhY0iFmN.d.cts} +1 -1
  81. package/{mapping-form-lfyEE7EJ.d.cts → mapping-form-Du36VZr1.d.mts} +1 -1
  82. package/{mappings-config-DsUa7-1w.d.mts → mappings-config-B1qNM8VL.d.cts} +7 -1
  83. package/{mappings-config-XmzB4dag.d.cts → mappings-config-BChZsany.d.mts} +7 -1
  84. package/{mappings-config-BsRADNRv.cjs → mappings-config-C8ynKmDK.cjs} +32 -6
  85. package/{mappings-config-Dbgxx3Nv.mjs → mappings-config-DNaYGyKN.mjs} +32 -6
  86. package/namespace-probe-BkUs8raG.d.mts +381 -0
  87. package/namespace-probe-aRFmpU85.d.cts +381 -0
  88. package/package.json +1 -1
  89. package/{entity-config-va2bkH5o.mjs → projection-C5244vGa.cjs} +130 -309
  90. package/{entity-config-D87rV-tE.cjs → projection-D7xmQP4S.mjs} +60 -381
  91. package/{sdk-iqOXeWIp.cjs → sdk-Bj-ZDf4u.cjs} +126 -28
  92. package/{sdk-C6WANW8M.mjs → sdk-BvRD2jAp.mjs} +126 -28
  93. package/sdk.cjs +2 -2
  94. package/sdk.d.cts +36 -1
  95. package/sdk.d.mts +36 -1
  96. package/sdk.mjs +2 -2
  97. package/{sync-engine-DGk_AeHJ.d.mts → sync-engine-DHQ7rXZe.d.mts} +2 -2
  98. package/{sync-engine-B7QIbXro.d.cts → sync-engine-DiPjH53O.d.cts} +2 -2
  99. package/{sync-engine-Do5ru3WF.mjs → sync-engine-SuxSzbZ4.mjs} +9 -2
  100. package/{sync-engine-CzEbpQGv.cjs → sync-engine-abE94g6X.cjs} +9 -2
  101. package/{view-compiler-BIwvm-o2.cjs → view-compiler-Blu4OXJ7.cjs} +103 -12
  102. package/{view-compiler-ChWr_Lml.mjs → view-compiler-CQx8TRrW.mjs} +98 -13
  103. package/{view-compiler-BWz0sGdm.d.cts → view-compiler-CcUwzZut.d.mts} +12 -2
  104. package/{view-compiler-Bn_EJJMO.d.mts → view-compiler-DqAdVxLq.d.cts} +12 -2
  105. package/vite.d.cts +1 -1
  106. package/vite.d.mts +1 -1
  107. package/drizzle-B89tLo4T.mjs +0 -31
  108. package/drizzle-CFOr9dU9.d.mts +0 -20
  109. package/drizzle-DiReZf6d.cjs +0 -36
  110. package/drizzle-DmeKSqeF.d.cts +0 -20
  111. package/types-CsL0rFYh.d.cts +0 -155
  112. package/types-CsL0rFYh.d.mts +0 -155
package/index.d.cts CHANGED
@@ -1,6 +1,9 @@
1
1
  //#region src/detect.d.ts
2
2
  type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
3
3
  //#endregion
4
+ //#region src/app-layout.d.ts
5
+ type AppLayout = "app" | "src/app";
6
+ //#endregion
4
7
  //#region src/workspace-graph.d.ts
5
8
  interface WorkspacePackage {
6
9
  /** Absolute path to the package directory. */
@@ -30,6 +33,12 @@ interface DiscoveredTable {
30
33
  columns: DiscoveredColumn[];
31
34
  moduleKey: string;
32
35
  tableName: string;
36
+ /**
37
+ * Every unique key as DB column names, PKs included. Absent when reflection
38
+ * is unavailable or failed (unknown); present as `[]` when reflection
39
+ * succeeded and the table genuinely has no unique keys (confirmed none).
40
+ */
41
+ uniqueConstraints?: string[][];
33
42
  }
34
43
  interface DiscoveredSchema {
35
44
  db: {
@@ -51,6 +60,7 @@ interface ProbeHit {
51
60
  //#region src/index.d.ts
52
61
  declare function nearestCommand(input: string): string | undefined;
53
62
  interface AddDeps {
63
+ fileExists: (path: string) => boolean;
54
64
  out: (line: string) => void;
55
65
  readDeps: (cwd: string) => Record<string, string>;
56
66
  readFile: (path: string) => string | null;
@@ -71,6 +81,7 @@ interface RunInitOptions {
71
81
  diff?: boolean;
72
82
  discoverSchema?: (schemaPath: string, cwd: string) => Promise<DiscoveredSchema>;
73
83
  dryRun?: boolean;
84
+ fileExists?: (path: string) => boolean;
74
85
  force: boolean;
75
86
  installPackages?: (options: {
76
87
  cwd: string;
@@ -88,6 +99,7 @@ interface RunInitOptions {
88
99
  readEnv?: (cwd: string) => string;
89
100
  readFile?: (path: string) => string | null;
90
101
  readOwnVersion?: () => string | undefined;
102
+ resolveAppLayout?: (cwd: string, fileExists: (path: string) => boolean) => AppLayout;
91
103
  resolveSchemaPath?: (cwd: string) => string | null;
92
104
  resolveTargetApp?: (cwd: string) => {
93
105
  candidates?: string[];
package/index.d.mts CHANGED
@@ -1,6 +1,9 @@
1
1
  //#region src/detect.d.ts
2
2
  type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
3
3
  //#endregion
4
+ //#region src/app-layout.d.ts
5
+ type AppLayout = "app" | "src/app";
6
+ //#endregion
4
7
  //#region src/workspace-graph.d.ts
5
8
  interface WorkspacePackage {
6
9
  /** Absolute path to the package directory. */
@@ -30,6 +33,12 @@ interface DiscoveredTable {
30
33
  columns: DiscoveredColumn[];
31
34
  moduleKey: string;
32
35
  tableName: string;
36
+ /**
37
+ * Every unique key as DB column names, PKs included. Absent when reflection
38
+ * is unavailable or failed (unknown); present as `[]` when reflection
39
+ * succeeded and the table genuinely has no unique keys (confirmed none).
40
+ */
41
+ uniqueConstraints?: string[][];
33
42
  }
34
43
  interface DiscoveredSchema {
35
44
  db: {
@@ -51,6 +60,7 @@ interface ProbeHit {
51
60
  //#region src/index.d.ts
52
61
  declare function nearestCommand(input: string): string | undefined;
53
62
  interface AddDeps {
63
+ fileExists: (path: string) => boolean;
54
64
  out: (line: string) => void;
55
65
  readDeps: (cwd: string) => Record<string, string>;
56
66
  readFile: (path: string) => string | null;
@@ -71,6 +81,7 @@ interface RunInitOptions {
71
81
  diff?: boolean;
72
82
  discoverSchema?: (schemaPath: string, cwd: string) => Promise<DiscoveredSchema>;
73
83
  dryRun?: boolean;
84
+ fileExists?: (path: string) => boolean;
74
85
  force: boolean;
75
86
  installPackages?: (options: {
76
87
  cwd: string;
@@ -88,6 +99,7 @@ interface RunInitOptions {
88
99
  readEnv?: (cwd: string) => string;
89
100
  readFile?: (path: string) => string | null;
90
101
  readOwnVersion?: () => string | undefined;
102
+ resolveAppLayout?: (cwd: string, fileExists: (path: string) => boolean) => AppLayout;
91
103
  resolveSchemaPath?: (cwd: string) => string | null;
92
104
  resolveTargetApp?: (cwd: string) => {
93
105
  candidates?: string[];