joist-codegen 2.4.0-next.5 → 2.4.0-next.50

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 (184) hide show
  1. package/build/EntityDbMetadata.cjs +21 -3
  2. package/build/EntityDbMetadata.cjs.map +1 -1
  3. package/build/EntityDbMetadata.d.cts +28 -25
  4. package/build/EntityDbMetadata.d.cts.map +1 -1
  5. package/build/EntityDbMetadata.d.mts +28 -25
  6. package/build/EntityDbMetadata.d.mts.map +1 -1
  7. package/build/EntityDbMetadata.js +21 -3
  8. package/build/EntityDbMetadata.js.map +1 -1
  9. package/build/assignTags.d.cts +1 -2
  10. package/build/assignTags.d.cts.map +1 -1
  11. package/build/assignTags.d.mts +1 -2
  12. package/build/assignTags.d.mts.map +1 -1
  13. package/build/codemods/Codemod.d.cts +1 -2
  14. package/build/codemods/Codemod.d.cts.map +1 -1
  15. package/build/codemods/Codemod.d.mts +1 -2
  16. package/build/codemods/Codemod.d.mts.map +1 -1
  17. package/build/codemods/JscodeshiftMod.d.cts +1 -2
  18. package/build/codemods/JscodeshiftMod.d.cts.map +1 -1
  19. package/build/codemods/JscodeshiftMod.d.mts +1 -2
  20. package/build/codemods/JscodeshiftMod.d.mts.map +1 -1
  21. package/build/codemods/codemod_0001-rename_has_async_property.d.cts +2 -2
  22. package/build/codemods/codemod_0001-rename_has_async_property.d.cts.map +1 -1
  23. package/build/codemods/codemod_0001-rename_has_async_property.d.mts +2 -2
  24. package/build/codemods/codemod_0001-rename_has_async_property.d.mts.map +1 -1
  25. package/build/codemods/codemod_0002-rename_async_query_fields.d.cts +2 -2
  26. package/build/codemods/codemod_0002-rename_async_query_fields.d.cts.map +1 -1
  27. package/build/codemods/codemod_0002-rename_async_query_fields.d.mts +2 -2
  28. package/build/codemods/codemod_0002-rename_async_query_fields.d.mts.map +1 -1
  29. package/build/codemods/codemod_0003-rename_find_paginated.d.cts +2 -2
  30. package/build/codemods/codemod_0003-rename_find_paginated.d.cts.map +1 -1
  31. package/build/codemods/codemod_0003-rename_find_paginated.d.mts +2 -2
  32. package/build/codemods/codemod_0003-rename_find_paginated.d.mts.map +1 -1
  33. package/build/codemods/index.d.cts +3 -4
  34. package/build/codemods/index.d.cts.map +1 -1
  35. package/build/codemods/index.d.mts +3 -4
  36. package/build/codemods/index.d.mts.map +1 -1
  37. package/build/config.cjs +8 -3
  38. package/build/config.cjs.map +1 -1
  39. package/build/config.d.cts +30 -27
  40. package/build/config.d.cts.map +1 -1
  41. package/build/config.d.mts +30 -27
  42. package/build/config.d.mts.map +1 -1
  43. package/build/config.js +8 -3
  44. package/build/config.js.map +1 -1
  45. package/build/docs/cache.cjs.map +1 -1
  46. package/build/docs/cache.d.cts +2 -3
  47. package/build/docs/cache.d.cts.map +1 -1
  48. package/build/docs/cache.d.mts +2 -3
  49. package/build/docs/cache.d.mts.map +1 -1
  50. package/build/docs/cache.js.map +1 -1
  51. package/build/docs/generate-metadata-docs.d.cts +1 -2
  52. package/build/docs/generate-metadata-docs.d.cts.map +1 -1
  53. package/build/docs/generate-metadata-docs.d.mts +1 -2
  54. package/build/docs/generate-metadata-docs.d.mts.map +1 -1
  55. package/build/docs/index.d.cts +3 -3
  56. package/build/docs/index.d.cts.map +1 -1
  57. package/build/docs/index.d.mts +3 -3
  58. package/build/docs/index.d.mts.map +1 -1
  59. package/build/docs/markdown.d.cts +8 -8
  60. package/build/docs/markdown.d.cts.map +1 -1
  61. package/build/docs/markdown.d.mts +8 -8
  62. package/build/docs/markdown.d.mts.map +1 -1
  63. package/build/docs/parsing.d.cts +9 -9
  64. package/build/docs/parsing.d.cts.map +1 -1
  65. package/build/docs/parsing.d.mts +9 -9
  66. package/build/docs/parsing.d.mts.map +1 -1
  67. package/build/findEntityScopes.d.cts +3 -4
  68. package/build/findEntityScopes.d.cts.map +1 -1
  69. package/build/findEntityScopes.d.mts +3 -4
  70. package/build/findEntityScopes.d.mts.map +1 -1
  71. package/build/foreignKeyOrdering.d.cts +1 -2
  72. package/build/foreignKeyOrdering.d.cts.map +1 -1
  73. package/build/foreignKeyOrdering.d.mts +1 -2
  74. package/build/foreignKeyOrdering.d.mts.map +1 -1
  75. package/build/generate.d.cts +3 -4
  76. package/build/generate.d.cts.map +1 -1
  77. package/build/generate.d.mts +3 -4
  78. package/build/generate.d.mts.map +1 -1
  79. package/build/generateEntitiesFile.d.cts +1 -2
  80. package/build/generateEntitiesFile.d.cts.map +1 -1
  81. package/build/generateEntitiesFile.d.mts +1 -2
  82. package/build/generateEntitiesFile.d.mts.map +1 -1
  83. package/build/generateEntityCodegenFile.cjs +5 -3
  84. package/build/generateEntityCodegenFile.cjs.map +1 -1
  85. package/build/generateEntityCodegenFile.d.cts +3 -4
  86. package/build/generateEntityCodegenFile.d.cts.map +1 -1
  87. package/build/generateEntityCodegenFile.d.mts +3 -4
  88. package/build/generateEntityCodegenFile.d.mts.map +1 -1
  89. package/build/generateEntityCodegenFile.js +5 -3
  90. package/build/generateEntityCodegenFile.js.map +1 -1
  91. package/build/generateEntityFile.d.cts +1 -2
  92. package/build/generateEntityFile.d.cts.map +1 -1
  93. package/build/generateEntityFile.d.mts +1 -2
  94. package/build/generateEntityFile.d.mts.map +1 -1
  95. package/build/generateEntityTestFile.d.cts +1 -2
  96. package/build/generateEntityTestFile.d.cts.map +1 -1
  97. package/build/generateEntityTestFile.d.mts +1 -2
  98. package/build/generateEntityTestFile.d.mts.map +1 -1
  99. package/build/generateEnumFile.d.cts +1 -2
  100. package/build/generateEnumFile.d.cts.map +1 -1
  101. package/build/generateEnumFile.d.mts +1 -2
  102. package/build/generateEnumFile.d.mts.map +1 -1
  103. package/build/generateFactoriesFiles.d.cts +1 -2
  104. package/build/generateFactoriesFiles.d.cts.map +1 -1
  105. package/build/generateFactoriesFiles.d.mts +1 -2
  106. package/build/generateFactoriesFiles.d.mts.map +1 -1
  107. package/build/generateFlushFunction.d.cts +3 -4
  108. package/build/generateFlushFunction.d.cts.map +1 -1
  109. package/build/generateFlushFunction.d.mts +3 -4
  110. package/build/generateFlushFunction.d.mts.map +1 -1
  111. package/build/generateMetadataFile.cjs +30 -1
  112. package/build/generateMetadataFile.cjs.map +1 -1
  113. package/build/generateMetadataFile.d.cts +2 -3
  114. package/build/generateMetadataFile.d.cts.map +1 -1
  115. package/build/generateMetadataFile.d.mts +2 -3
  116. package/build/generateMetadataFile.d.mts.map +1 -1
  117. package/build/generateMetadataFile.js +31 -2
  118. package/build/generateMetadataFile.js.map +1 -1
  119. package/build/generatePgEnumFile.d.cts +1 -2
  120. package/build/generatePgEnumFile.d.cts.map +1 -1
  121. package/build/generatePgEnumFile.d.mts +1 -2
  122. package/build/generatePgEnumFile.d.mts.map +1 -1
  123. package/build/index.d.cts +4 -4
  124. package/build/index.d.cts.map +1 -1
  125. package/build/index.d.mts +4 -4
  126. package/build/index.d.mts.map +1 -1
  127. package/build/inheritance.d.cts +3 -3
  128. package/build/inheritance.d.cts.map +1 -1
  129. package/build/inheritance.d.mts +3 -3
  130. package/build/inheritance.d.mts.map +1 -1
  131. package/build/installSkills.d.cts +1 -2
  132. package/build/installSkills.d.cts.map +1 -1
  133. package/build/installSkills.d.mts +1 -2
  134. package/build/installSkills.d.mts.map +1 -1
  135. package/build/keywords.d.cts +1 -2
  136. package/build/keywords.d.cts.map +1 -1
  137. package/build/keywords.d.mts +1 -2
  138. package/build/keywords.d.mts.map +1 -1
  139. package/build/loadMetadata.d.cts +7 -8
  140. package/build/loadMetadata.d.cts.map +1 -1
  141. package/build/loadMetadata.d.mts +7 -8
  142. package/build/loadMetadata.d.mts.map +1 -1
  143. package/build/logger.d.cts +3 -4
  144. package/build/logger.d.cts.map +1 -1
  145. package/build/logger.d.mts +3 -4
  146. package/build/logger.d.mts.map +1 -1
  147. package/build/pgMetadata.d.cts +13 -14
  148. package/build/pgMetadata.d.cts.map +1 -1
  149. package/build/pgMetadata.d.mts +13 -14
  150. package/build/pgMetadata.d.mts.map +1 -1
  151. package/build/scanEntityFiles.cjs +6 -1
  152. package/build/scanEntityFiles.cjs.map +1 -1
  153. package/build/scanEntityFiles.d.cts +2 -3
  154. package/build/scanEntityFiles.d.cts.map +1 -1
  155. package/build/scanEntityFiles.d.mts +2 -3
  156. package/build/scanEntityFiles.d.mts.map +1 -1
  157. package/build/scanEntityFiles.js +6 -1
  158. package/build/scanEntityFiles.js.map +1 -1
  159. package/build/sortForeignKeys.d.cts +1 -2
  160. package/build/sortForeignKeys.d.cts.map +1 -1
  161. package/build/sortForeignKeys.d.mts +1 -2
  162. package/build/sortForeignKeys.d.mts.map +1 -1
  163. package/build/symbols.cjs +2 -0
  164. package/build/symbols.cjs.map +1 -1
  165. package/build/symbols.d.cts +117 -117
  166. package/build/symbols.d.cts.map +1 -1
  167. package/build/symbols.d.mts +117 -117
  168. package/build/symbols.d.mts.map +1 -1
  169. package/build/symbols.js +2 -1
  170. package/build/symbols.js.map +1 -1
  171. package/build/tsdoc.d.cts +1 -2
  172. package/build/tsdoc.d.cts.map +1 -1
  173. package/build/tsdoc.d.mts +1 -2
  174. package/build/tsdoc.d.mts.map +1 -1
  175. package/build/utils.cjs +1 -0
  176. package/build/utils.cjs.map +1 -1
  177. package/build/utils.d.cts +21 -22
  178. package/build/utils.d.cts.map +1 -1
  179. package/build/utils.d.mts +21 -22
  180. package/build/utils.d.mts.map +1 -1
  181. package/build/utils.js +1 -0
  182. package/build/utils.js.map +1 -1
  183. package/package.json +10 -10
  184. package/skills/joist-test-factories/SKILL.md +93 -6
@@ -6,12 +6,11 @@ import { Config } from "../config.cjs";
6
6
  * This can either be traditional jscodeshift mods that change the AST, or
7
7
  * also "dumber" mods that `mv` files around.
8
8
  */
9
- type Codemod = {
9
+ export type Codemod = {
10
10
  codemodVersion: number;
11
11
  name: string;
12
12
  description: string;
13
13
  run(config: Config): Promise<void>;
14
14
  };
15
15
  //#endregion
16
- export { Codemod };
17
16
  //# sourceMappingURL=Codemod.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Codemod.d.cts","names":[],"sources":["../../src/codemods/Codemod.ts"],"mappings":";;;;;;;;KAQY;EACV;EACA;EACA;EACA,IAAI,QAAQ,SAAS"}
1
+ {"version":3,"file":"Codemod.d.cts","names":[],"sources":["../../src/codemods/Codemod.ts"],"mappings":";;;;;;;;YAQY;EACV;EACA;EACA;EACA,IAAI,QAAQ,SAAS"}
@@ -6,12 +6,11 @@ import { Config } from "../config.mjs";
6
6
  * This can either be traditional jscodeshift mods that change the AST, or
7
7
  * also "dumber" mods that `mv` files around.
8
8
  */
9
- type Codemod = {
9
+ export type Codemod = {
10
10
  codemodVersion: number;
11
11
  name: string;
12
12
  description: string;
13
13
  run(config: Config): Promise<void>;
14
14
  };
15
15
  //#endregion
16
- export { Codemod };
17
16
  //# sourceMappingURL=Codemod.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Codemod.d.mts","names":[],"sources":["../../src/codemods/Codemod.ts"],"mappings":";;;;;;;;KAQY;EACV;EACA;EACA;EACA,IAAI,QAAQ,SAAS"}
1
+ {"version":3,"file":"Codemod.d.mts","names":[],"sources":["../../src/codemods/Codemod.ts"],"mappings":";;;;;;;;YAQY;EACV;EACA;EACA;EACA,IAAI,QAAQ,SAAS"}
@@ -1,7 +1,7 @@
1
1
  import { Config } from "../config.cjs";
2
2
  import { Codemod } from "./Codemod.cjs";
3
3
  //#region src/codemods/JscodeshiftMod.d.ts
4
- declare class JscodeshiftMod implements Codemod {
4
+ export declare class JscodeshiftMod implements Codemod {
5
5
  codemodVersion: number;
6
6
  name: string;
7
7
  description: string;
@@ -10,5 +10,4 @@ declare class JscodeshiftMod implements Codemod {
10
10
  run(config: Config): Promise<void>;
11
11
  }
12
12
  //#endregion
13
- export { JscodeshiftMod };
14
13
  //# sourceMappingURL=JscodeshiftMod.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"JscodeshiftMod.d.cts","names":[],"sources":["../../src/codemods/JscodeshiftMod.ts"],"mappings":";;;cAQa,0BAA0B;EAE5B;EACA;EACA;UACC;EAJV,YACS,wBACA,cACA,qBACC,QAAO,QAAQ;EAGnB,IAAI,QAAQ,SAAS"}
1
+ {"version":3,"file":"JscodeshiftMod.d.cts","names":[],"sources":["../../src/codemods/JscodeshiftMod.ts"],"mappings":";;;qBAQa,0BAA0B;EAE5B;EACA;EACA;UACC;EAJV,YACS,wBACA,cACA,qBACC,QAAO,QAAQ;EAGnB,IAAI,QAAQ,SAAS"}
@@ -1,7 +1,7 @@
1
1
  import { Config } from "../config.mjs";
2
2
  import { Codemod } from "./Codemod.mjs";
3
3
  //#region src/codemods/JscodeshiftMod.d.ts
4
- declare class JscodeshiftMod implements Codemod {
4
+ export declare class JscodeshiftMod implements Codemod {
5
5
  codemodVersion: number;
6
6
  name: string;
7
7
  description: string;
@@ -10,5 +10,4 @@ declare class JscodeshiftMod implements Codemod {
10
10
  run(config: Config): Promise<void>;
11
11
  }
12
12
  //#endregion
13
- export { JscodeshiftMod };
14
13
  //# sourceMappingURL=JscodeshiftMod.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"JscodeshiftMod.d.mts","names":[],"sources":["../../src/codemods/JscodeshiftMod.ts"],"mappings":";;;cAQa,0BAA0B;EAE5B;EACA;EACA;UACC;EAJV,YACS,wBACA,cACA,qBACC,QAAO,QAAQ;EAGnB,IAAI,QAAQ,SAAS"}
1
+ {"version":3,"file":"JscodeshiftMod.d.mts","names":[],"sources":["../../src/codemods/JscodeshiftMod.ts"],"mappings":";;;qBAQa,0BAA0B;EAE5B;EACA;EACA;UACC;EAJV,YACS,wBACA,cACA,qBACC,QAAO,QAAQ;EAGnB,IAAI,QAAQ,SAAS"}
@@ -1,9 +1,9 @@
1
1
  import { JscodeshiftMod } from "./JscodeshiftMod.cjs";
2
2
  import { Transform } from "jscodeshift";
3
3
  //#region src/codemods/codemod_0001-rename_has_async_property.d.ts
4
- declare const codemod_0001_rename_has_async_property: JscodeshiftMod;
4
+ export declare const codemod_0001_rename_has_async_property: JscodeshiftMod;
5
5
  /** Find/replace the various `*AsyncProperty*` symbols with their `*Property*` counterparts. */
6
6
  declare const transform: Transform;
7
7
  //#endregion
8
- export { codemod_0001_rename_has_async_property, transform as default };
8
+ export { transform as default };
9
9
  //# sourceMappingURL=codemod_0001-rename_has_async_property.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codemod_0001-rename_has_async_property.d.cts","names":[],"sources":["../../src/codemods/codemod_0001-rename_has_async_property.ts"],"mappings":";;;cAIa,wCAAsC;;cAgB7C,WAAW"}
1
+ {"version":3,"file":"codemod_0001-rename_has_async_property.d.cts","names":[],"sources":["../../src/codemods/codemod_0001-rename_has_async_property.ts"],"mappings":";;;qBAIa,wCAAsC;;cAgB7C,WAAW"}
@@ -1,9 +1,9 @@
1
1
  import { JscodeshiftMod } from "./JscodeshiftMod.mjs";
2
2
  import { Transform } from "jscodeshift";
3
3
  //#region src/codemods/codemod_0001-rename_has_async_property.d.ts
4
- declare const codemod_0001_rename_has_async_property: JscodeshiftMod;
4
+ export declare const codemod_0001_rename_has_async_property: JscodeshiftMod;
5
5
  /** Find/replace the various `*AsyncProperty*` symbols with their `*Property*` counterparts. */
6
6
  declare const transform: Transform;
7
7
  //#endregion
8
- export { codemod_0001_rename_has_async_property, transform as default };
8
+ export { transform as default };
9
9
  //# sourceMappingURL=codemod_0001-rename_has_async_property.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codemod_0001-rename_has_async_property.d.mts","names":[],"sources":["../../src/codemods/codemod_0001-rename_has_async_property.ts"],"mappings":";;;cAIa,wCAAsC;;cAgB7C,WAAW"}
1
+ {"version":3,"file":"codemod_0001-rename_has_async_property.d.mts","names":[],"sources":["../../src/codemods/codemod_0001-rename_has_async_property.ts"],"mappings":";;;qBAIa,wCAAsC;;cAgB7C,WAAW"}
@@ -1,9 +1,9 @@
1
1
  import { JscodeshiftMod } from "./JscodeshiftMod.cjs";
2
2
  import { Transform } from "jscodeshift";
3
3
  //#region src/codemods/codemod_0002-rename_async_query_fields.d.ts
4
- declare const codemod_0002_rename_async_query_fields: JscodeshiftMod;
4
+ export declare const codemod_0002_rename_async_query_fields: JscodeshiftMod;
5
5
  /** Find/replace the async query symbols with their async property/field counterparts. */
6
6
  declare const transform: Transform;
7
7
  //#endregion
8
- export { codemod_0002_rename_async_query_fields, transform as default };
8
+ export { transform as default };
9
9
  //# sourceMappingURL=codemod_0002-rename_async_query_fields.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codemod_0002-rename_async_query_fields.d.cts","names":[],"sources":["../../src/codemods/codemod_0002-rename_async_query_fields.ts"],"mappings":";;;cAIa,wCAAsC;;cAoB7C,WAAW"}
1
+ {"version":3,"file":"codemod_0002-rename_async_query_fields.d.cts","names":[],"sources":["../../src/codemods/codemod_0002-rename_async_query_fields.ts"],"mappings":";;;qBAIa,wCAAsC;;cAoB7C,WAAW"}
@@ -1,9 +1,9 @@
1
1
  import { JscodeshiftMod } from "./JscodeshiftMod.mjs";
2
2
  import { Transform } from "jscodeshift";
3
3
  //#region src/codemods/codemod_0002-rename_async_query_fields.d.ts
4
- declare const codemod_0002_rename_async_query_fields: JscodeshiftMod;
4
+ export declare const codemod_0002_rename_async_query_fields: JscodeshiftMod;
5
5
  /** Find/replace the async query symbols with their async property/field counterparts. */
6
6
  declare const transform: Transform;
7
7
  //#endregion
8
- export { codemod_0002_rename_async_query_fields, transform as default };
8
+ export { transform as default };
9
9
  //# sourceMappingURL=codemod_0002-rename_async_query_fields.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codemod_0002-rename_async_query_fields.d.mts","names":[],"sources":["../../src/codemods/codemod_0002-rename_async_query_fields.ts"],"mappings":";;;cAIa,wCAAsC;;cAoB7C,WAAW"}
1
+ {"version":3,"file":"codemod_0002-rename_async_query_fields.d.mts","names":[],"sources":["../../src/codemods/codemod_0002-rename_async_query_fields.ts"],"mappings":";;;qBAIa,wCAAsC;;cAoB7C,WAAW"}
@@ -1,9 +1,9 @@
1
1
  import { JscodeshiftMod } from "./JscodeshiftMod.cjs";
2
2
  import { Transform } from "jscodeshift";
3
3
  //#region src/codemods/codemod_0003-rename_find_paginated.d.ts
4
- declare const codemod_0003_rename_find_paginated: JscodeshiftMod;
4
+ export declare const codemod_0003_rename_find_paginated: JscodeshiftMod;
5
5
  /** Rewrites EntityManager paginated find method calls to the now-paginated find APIs. */
6
6
  declare const transform: Transform;
7
7
  //#endregion
8
- export { codemod_0003_rename_find_paginated, transform as default };
8
+ export { transform as default };
9
9
  //# sourceMappingURL=codemod_0003-rename_find_paginated.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codemod_0003-rename_find_paginated.d.cts","names":[],"sources":["../../src/codemods/codemod_0003-rename_find_paginated.ts"],"mappings":";;;cAIa,oCAAkC;;cAYzC,WAAW"}
1
+ {"version":3,"file":"codemod_0003-rename_find_paginated.d.cts","names":[],"sources":["../../src/codemods/codemod_0003-rename_find_paginated.ts"],"mappings":";;;qBAIa,oCAAkC;;cAYzC,WAAW"}
@@ -1,9 +1,9 @@
1
1
  import { JscodeshiftMod } from "./JscodeshiftMod.mjs";
2
2
  import { Transform } from "jscodeshift";
3
3
  //#region src/codemods/codemod_0003-rename_find_paginated.d.ts
4
- declare const codemod_0003_rename_find_paginated: JscodeshiftMod;
4
+ export declare const codemod_0003_rename_find_paginated: JscodeshiftMod;
5
5
  /** Rewrites EntityManager paginated find method calls to the now-paginated find APIs. */
6
6
  declare const transform: Transform;
7
7
  //#endregion
8
- export { codemod_0003_rename_find_paginated, transform as default };
8
+ export { transform as default };
9
9
  //# sourceMappingURL=codemod_0003-rename_find_paginated.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codemod_0003-rename_find_paginated.d.mts","names":[],"sources":["../../src/codemods/codemod_0003-rename_find_paginated.ts"],"mappings":";;;cAIa,oCAAkC;;cAYzC,WAAW"}
1
+ {"version":3,"file":"codemod_0003-rename_find_paginated.d.mts","names":[],"sources":["../../src/codemods/codemod_0003-rename_find_paginated.ts"],"mappings":";;;qBAIa,oCAAkC;;cAYzC,WAAW"}
@@ -2,11 +2,10 @@ import { Config } from "../config.cjs";
2
2
  import { Codemod } from "./Codemod.cjs";
3
3
  //#region src/codemods/index.d.ts
4
4
  /** Prompts for and runs pending codemods for the user's project. */
5
- declare function maybeRunTransforms(config: Config): Promise<void>;
5
+ export declare function maybeRunTransforms(config: Config): Promise<void>;
6
6
  /** Returns the highest codemod counter known by this version of codegen. */
7
- declare function getLatestCodemodVersion(): number;
7
+ export declare function getLatestCodemodVersion(): number;
8
8
  /** Returns codemods that have not yet been applied to the user's project. */
9
- declare function findApplicableCodemods(codemodVersion: number): Codemod[];
9
+ export declare function findApplicableCodemods(codemodVersion: number): Codemod[];
10
10
  //#endregion
11
- export { findApplicableCodemods, getLatestCodemodVersion, maybeRunTransforms };
12
11
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/codemods/index.ts"],"mappings":";;;;iBAasB,mBAAmB,QAAQ,SAAS;;iBA0C1C;;iBAKA,uBAAuB,yBAAyB"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/codemods/index.ts"],"mappings":";;;;wBAasB,mBAAmB,QAAQ,SAAS;;wBA0C1C;;wBAKA,uBAAuB,yBAAyB"}
@@ -2,11 +2,10 @@ import { Config } from "../config.mjs";
2
2
  import { Codemod } from "./Codemod.mjs";
3
3
  //#region src/codemods/index.d.ts
4
4
  /** Prompts for and runs pending codemods for the user's project. */
5
- declare function maybeRunTransforms(config: Config): Promise<void>;
5
+ export declare function maybeRunTransforms(config: Config): Promise<void>;
6
6
  /** Returns the highest codemod counter known by this version of codegen. */
7
- declare function getLatestCodemodVersion(): number;
7
+ export declare function getLatestCodemodVersion(): number;
8
8
  /** Returns codemods that have not yet been applied to the user's project. */
9
- declare function findApplicableCodemods(codemodVersion: number): Codemod[];
9
+ export declare function findApplicableCodemods(codemodVersion: number): Codemod[];
10
10
  //#endregion
11
- export { findApplicableCodemods, getLatestCodemodVersion, maybeRunTransforms };
12
11
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/codemods/index.ts"],"mappings":";;;;iBAasB,mBAAmB,QAAQ,SAAS;;iBA0C1C;;iBAKA,uBAAuB,yBAAyB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/codemods/index.ts"],"mappings":";;;;wBAasB,mBAAmB,QAAQ,SAAS;;wBA0C1C;;wBAKA,uBAAuB,yBAAyB"}
package/build/config.cjs CHANGED
@@ -25,8 +25,13 @@ const fieldConfig = zod.z.object({
25
25
  stiType: zod.z.optional(zod.z.union([zod.z.string(), zod.z.array(zod.z.string())])),
26
26
  notNull: zod.z.optional(zod.z.boolean()),
27
27
  hasDefault: zod.z.optional(zod.z.boolean()),
28
- lazy: zod.z.optional(zod.z.boolean())
29
- }).strict();
28
+ lazy: zod.z.optional(zod.z.boolean()),
29
+ /** Mark the entity for read locking whenever the field's value is read. */
30
+ assertUnchanged: zod.z.optional(zod.z.boolean())
31
+ }).strict().refine((field) => !field.assertUnchanged || !field.derived && !field.lazy && !field.ignore, {
32
+ message: "assertUnchanged requires a non-derived, non-lazy, non-ignored field",
33
+ path: ["assertUnchanged"]
34
+ });
30
35
  const relationConfig = zod.z.object({
31
36
  derived: zod.z.optional(zod.z.literal("async")),
32
37
  polymorphic: zod.z.optional(zod.z.union([zod.z.literal("notNull"), zod.z.literal(true)])),
@@ -209,7 +214,7 @@ function warnInvalidConfigEntries(config, db) {
209
214
  for (const uniqueBy of entityConfig.uniqueBy || []) for (const name of uniqueBy) {
210
215
  const field = uniqueFields.find((f) => f.fieldName === name);
211
216
  if (!field) require_logger.logger.warn(`Found uniqueBy for non-existent or non-queryable field ${entityName}.${name}`);
212
- else if (field.kind === "primitive" && (field.derived || field.isArray || field.customSerde)) require_logger.logger.warn(`Found uniqueBy for unsupported primitive field ${entityName}.${name}`);
217
+ else if (field.kind === "primitive" && (field.derived || field.customSerde)) require_logger.logger.warn(`Found uniqueBy for unsupported primitive field ${entityName}.${name}`);
213
218
  else if (field.kind === "enum" && (field.derived || field.isArray)) require_logger.logger.warn(`Found uniqueBy for unsupported enum field ${entityName}.${name}`);
214
219
  }
215
220
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs","names":["createFromBuffer","readFileSync","getPath","z","groupBy","getStiEntities","trueIfResolved","getLatestCodemodVersion","sortKeys","parse","join","existsSync","dirname"],"sources":["../src/config.ts"],"sourcesContent":["import { existsSync, promises as fs, readFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\n\nimport { createFromBuffer } from \"@dprint/formatter\";\nimport { getPath } from \"@dprint/json\";\nimport { groupBy } from \"joist-utils\";\nimport { type ParseError, parse } from \"jsonc-parser\";\nimport { z } from \"zod\";\n\nimport { getLatestCodemodVersion } from \"./codemods/index.ts\";\nimport { type DbMetadata, type Entity, type EntityDbMetadata } from \"./EntityDbMetadata.ts\";\nimport { getStiEntities } from \"./inheritance.ts\";\nimport { logger } from \"./logger.ts\";\nimport { fail, sortKeys, trueIfResolved } from \"./utils.ts\";\n\nconst jsonFormatter = createFromBuffer(readFileSync(getPath()));\n\nconst fieldConfig = z\n .object({\n // For getters & ReactiveFields\n derived: z.optional(z.union([z.literal(\"sync\"), z.literal(\"async\")])),\n protected: z.optional(z.boolean()),\n ignore: z.optional(z.boolean()),\n superstruct: z.optional(z.string()),\n zodSchema: z.optional(z.string()),\n type: z.optional(z.string()),\n serde: z.optional(z.string()),\n stiDiscriminator: z.optional(z.record(z.string(), z.string())),\n stiType: z.optional(z.union([z.string(), z.array(z.string())])),\n // Allow subclasses to mark fields as required\n notNull: z.optional(z.boolean()),\n // Allow overriding scanEntities default detection for fields with defaults added by helpers\n hasDefault: z.optional(z.boolean()),\n // Exclude a (large jsonb/text) column from the default SELECT and expose it as a lazy-loaded LazyField\n lazy: z.optional(z.boolean()),\n })\n .strict();\n\nexport type FieldConfig = z.infer<typeof fieldConfig>;\n\nconst relationConfig = z\n .object({\n // For ReactiveReferences\n derived: z.optional(z.literal(\"async\")),\n polymorphic: z.optional(z.union([z.literal(\"notNull\"), z.literal(true)])),\n large: z.optional(z.boolean()),\n orderBy: z.optional(z.string()),\n /**\n * Controls whether this collection's `.get`/`.load` hide soft-deleted entities.\n *\n * Defaults to `\"exclude\"` (soft-deleted entities are hidden); set to `\"include\"` to have\n * this specific o2m/m2m always return soft-deleted entities from `.get`/`.load`.\n */\n softDeletes: z.optional(z.union([z.literal(\"include\"), z.literal(\"exclude\")])),\n // Allow pushing m2o/m2m/o2o relations in a base type (Task) down to a subtype (TaskOld)\n stiType: z.optional(z.union([z.string(), z.array(z.string())])),\n /**\n * Allow specializing a base type relation (SmallPublisher.group: SmallPublisherGroup).\n *\n * Self-referential FKs also support `subType: \"self\"` that means each subtype will point\n * at its own subtype.\n */\n subType: z.optional(z.string()),\n /** Allow skipping self-referential fields getting a `...Recursive` relation. */\n skipRecursiveRelations: z.optional(z.boolean()),\n // Allow marking m2o FKs as required on subclasses\n notNull: z.optional(z.boolean()),\n // Allow overriding scanEntities default detection for fields with defaults added by helpers\n hasDefault: z.optional(z.boolean()),\n })\n .strict();\n\nexport type RelationConfig = z.infer<typeof relationConfig>;\n\nconst uniqueByConfig = z\n .union([z.string(), z.array(z.string()), z.array(z.array(z.string()))])\n .transform(normalizeUniqueByConfig);\n\nconst entityConfig = z\n .object({\n tag: z.string(),\n tableName: z.optional(z.string()),\n fields: z.optional(z.record(z.string(), fieldConfig)),\n relations: z.optional(z.record(z.string(), relationConfig)),\n /** Whether this entity should be abstract, e.g. for inheritance a subtype must be instantiated instead of this type. */\n abstract: z.optional(z.boolean()),\n orderBy: z.optional(z.string()),\n uniqueBy: z.optional(uniqueByConfig),\n })\n .strict();\n\nexport type EntityConfig = z.infer<typeof entityConfig>;\n\nconst timestampConfig = z\n .object({\n /** The names to check for this timestamp, i.e. `created_at` `created`, etc. */\n names: z.array(z.string()),\n /** Whether this timestamp column is required to consider a table an entity, defaults to `false`. */\n required: z.optional(z.boolean()),\n })\n .strict();\n\nexport type TimestampConfig = z.infer<typeof timestampConfig>;\n\nexport const config = z\n .object({\n /** The _build-time_ database URL for reading database metadata. */\n databaseUrl: z.optional(z.string()),\n /** Your application's request-level `Context` type. */\n contextType: z.optional(z.string()),\n /** Your application's database client's `Transaction` type. */\n transactionType: z.optional(z.string()),\n /**\n * Allows the user to specify the `updated_at` / `created_at` column names to look up, and if they're optional.\n *\n * We default to looking for `updated_at`, `updatedAt`, `created_at`, `createdAt`, and optional to true,\n * e.g. tables are not required to have both timestamp columns to be considered entities.\n *\n * These defaults are the most lenient, to facilitate running Joist against an existing schema and\n * seeing all of your entities, regardless of your previous conventions.\n */\n timestampColumns: z.optional(\n z.object({\n createdAt: z.optional(timestampConfig),\n updatedAt: z.optional(timestampConfig),\n deletedAt: z.optional(timestampConfig),\n }),\n ),\n /**\n * Allows the user to have codegen output `Temporal` types instead of the base JS `Date`\n *\n * Additionally, allows for specifying the default time zone for `Temporal` types when converting dates to/from\n * the database.\n */\n temporal: z.optional(z.union([z.boolean(), z.object({ timeZone: z.string() })])),\n /**\n * By default, we create a `flush_database` function for fast testing.\n *\n * However, if you don't want to use this, or you have your own bespoke function like we do\n * that is more application-aware, then you can disable Joist's out-of-the-box one.\n *\n * If you have more than one test database, you can set `createFlushFunction` to the array\n * of test database names, i.e. `mydb_test_1`, `mydb_test_2`, etc.\n */\n createFlushFunction: z.optional(z.union([z.boolean(), z.array(z.string())])),\n entitiesDirectory: z.string().default(\"./src/entities\"),\n codegenPlugins: z.optional(z.array(z.string())),\n entities: z.record(z.string(), entityConfig).default({}),\n ignoredTables: z.optional(z.array(z.string())),\n /** The type of entity `id` fields; defaults to `tagged-string`. */\n idType: z.optional(z.union([z.literal(\"tagged-string\"), z.literal(\"untagged-string\"), z.literal(\"number\")])),\n /** The separator between entity tags and ids; defaults to `:`, and `\"\"` disables the separator. */\n tagDelimiter: z.optional(z.string()),\n /** How we should support non-deferred foreign keys. */\n nonDeferredForeignKeys: z.optional(z.union([z.literal(\"error\"), z.literal(\"warn\"), z.literal(\"ignore\")])),\n /** Enables esm output. */\n esm: z.optional(z.boolean()),\n /** Controls the style of GraphQL pagination scaffolding. */\n paginationStyle: z.optional(z.union([z.literal(\"cursor\"), z.literal(\"limit\")])).default(\"cursor\"),\n /** Enables documentation syncing between .md files and JSDocs. */\n docs: z.optional(z.boolean()),\n /** Installs Joist's bundled Agent Skills into `.claude/skills` and `.agents/skills`; on by default, set `false` to disable. */\n skills: z.optional(z.boolean()),\n /** Output a metadata-docs.ts file with entity/field documentation available at runtime. */\n outputDocs: z.optional(z.boolean()),\n /** Auto-set by probing the project's `tsconfig.json` file. */\n allowImportingTsExtensions: z.optional(z.boolean()),\n /** The latest Joist codemod counter that has been applied to this project. */\n codemodVersion: z.number().int().min(0).default(0),\n\n /** A list of postgres schemas to use for finding tables */\n schemas: z.optional(z.array(z.string())),\n })\n .strict();\n\nexport type Config = z.infer<typeof config> & {\n // We don't persist this, and instead just use it as a cache\n __tableToEntityName?: Record<string, string>;\n};\n\nexport const ormMaintainedFields = [\"createdAt\", \"updatedAt\"];\n\n/** Ensure the user doesn't have any typos in their config. */\nexport function warnInvalidConfigEntries(config: Config, db: DbMetadata): void {\n const entitiesByName = groupBy(db.entities, (e) => e.name);\n for (const [entityName, entityConfig] of Object.entries(config.entities)) {\n const entities = entitiesByName[entityName];\n if (!entities) {\n logger.warn(`Found config for non-existent entity ${entityName}`);\n continue;\n }\n // We don't have keyBy...\n const [entity] = entities;\n\n // Check fields\n const fields = [...entity.primitives, ...entity.enums];\n for (const [name, config] of Object.entries(entityConfig.fields || {})) {\n if (config.ignore) continue;\n let field = fields.find((f) => f.fieldName === name);\n // STI types might be in the base type\n if (!field && entity.stiDiscriminatorField) {\n const stiEntities = getStiEntities(db.entities).get(entity.name)?.subTypes;\n field = stiEntities?.flatMap((st) => [...st.primitives, ...st.enums]).find((f) => f.fieldName === name);\n }\n if (!field) logger.warn(`Found config for non-existent field ${entityName}.${name}`);\n }\n\n // Check relations\n const relations = [\n ...entity.manyToOnes,\n ...entity.oneToManys,\n ...entity.manyToManys,\n ...entity.manyToManyEnums,\n ...entity.oneToOnes,\n ...entity.largeOneToManys,\n ...entity.largeManyToManys,\n ...entity.polymorphics,\n ];\n for (const [name, _] of Object.entries(entityConfig.relations || {})) {\n let relation = relations.find((r) => r.fieldName === name);\n // STI types might be in the subtypes\n if (!relation && entity.stiDiscriminatorField) {\n const stiEntities = getStiEntities(db.entities).get(entity.name)?.subTypes;\n relation = stiEntities\n ?.flatMap((entity) => [\n ...entity.manyToOnes,\n ...entity.oneToManys,\n ...entity.manyToManys,\n ...entity.oneToOnes,\n ...entity.largeOneToManys,\n ...entity.largeManyToManys,\n ...entity.polymorphics,\n ])\n ?.find((f) => f.fieldName === name);\n }\n // CTI subtype specializations (i.e. SmallPublisher.group: SmallPublisherGroup) need to look in the base type\n if (!relation && entity.baseType) {\n const baseType = entity.baseType;\n relation = [\n ...baseType.manyToOnes,\n ...baseType.oneToManys,\n ...baseType.manyToManys,\n ...baseType.oneToOnes,\n ...baseType.largeOneToManys,\n ...baseType.largeManyToManys,\n ...baseType.polymorphics,\n ].find((f) => f.fieldName === name);\n }\n\n if (!relation) logger.warn(`Found config for non-existent relation ${entityName}.${name}`);\n }\n\n const uniqueFields = [\n ...entity.primitives,\n ...entity.enums,\n ...entity.pgEnums,\n ...entity.manyToOnes,\n ...entity.polymorphics,\n ];\n for (const uniqueBy of entityConfig.uniqueBy || []) {\n for (const name of uniqueBy) {\n const field = uniqueFields.find((f) => f.fieldName === name);\n if (!field) {\n logger.warn(`Found uniqueBy for non-existent or non-queryable field ${entityName}.${name}`);\n } else if (field.kind === \"primitive\" && (field.derived || field.isArray || field.customSerde)) {\n logger.warn(`Found uniqueBy for unsupported primitive field ${entityName}.${name}`);\n } else if (field.kind === \"enum\" && (field.derived || field.isArray)) {\n logger.warn(`Found uniqueBy for unsupported enum field ${entityName}.${name}`);\n }\n }\n }\n }\n}\n\nexport function isGetterField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.derived === \"sync\";\n}\n\nexport function isReactiveField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.derived === \"async\";\n}\n\nexport function isReactiveReference(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.derived === \"async\";\n}\n\n/** Returns true if this m2m relation is configured as a ReactiveManyToMany (derived: async). */\nexport function isReactiveManyToMany(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.derived === \"async\";\n}\n\nexport function isProtected(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.protected === true;\n}\n\n/** Whether a column should be excluded from the default SELECT and exposed as a lazy-loaded `LazyField`. */\nexport function isLazyField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.lazy === true;\n}\n\nexport function serdeConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.serde;\n}\n\nexport function superstructConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.superstruct;\n}\n\nexport function zodSchemaConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.zodSchema;\n}\n\nexport function fieldTypeConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.type;\n}\n\nexport function isLargeCollection(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.large === true;\n}\n\n/** Whether a collection should include (or exclude) soft-deleted entities from `.get`/`.load`. */\nexport function softDeletesConfig(\n config: Config,\n entity: Entity,\n fieldName: string,\n): \"include\" | \"exclude\" | undefined {\n return config.entities[entity.name]?.relations?.[fieldName]?.softDeletes;\n}\n\nexport function isFieldIgnored(\n config: Config,\n entity: Entity,\n fieldName: string,\n notNull: boolean = false,\n hasDefault: boolean = false,\n): boolean {\n const ignore = config.entities[entity.name]?.fields?.[fieldName]?.ignore === true;\n if (ignore && notNull && !hasDefault) {\n fail(\n `notNull field ${entity.name}.${fieldName} cannot be ignored. Alter the column to be optional or have a default value prior to ignoring it.`,\n );\n }\n return ignore;\n}\n\nexport function isFieldHasDefault(config: Config, entity: Entity, fieldName: string): boolean {\n const entityConfig = config.entities[entity.name] ?? {};\n const fieldConfig = entityConfig.fields?.[fieldName] ?? entityConfig.relations?.[fieldName] ?? {};\n return fieldConfig.hasDefault === true;\n}\n\nconst configPath = \"./joist-config.json\";\n\nexport async function loadConfig(): Promise<Config> {\n const exists = await trueIfResolved(fs.access(configPath));\n if (exists) {\n const content = await fs.readFile(configPath);\n const result = config.safeParse(stripLegacyConfigKeys(JSON.parse(content.toString())));\n if (!result.success) {\n throw new Error(\n `Invalid joist-config.json: ${result.error.issues\n .map((ze) => `${ze.path.map(String).join(\"/\")} ${ze.message}`)\n .join(\"\\n\")}`,\n );\n }\n result.data.allowImportingTsExtensions ??= projectIsUsingEsmWithImports();\n return result.data;\n }\n // Brand-new projects should not be prompted to run historical codemods.\n const initial = config.parse({ codemodVersion: getLatestCodemodVersion() });\n initial.allowImportingTsExtensions ??= projectIsUsingEsmWithImports();\n return initial;\n}\n\n/**\n * Writes the potentially-updated config entry back to `joist-config.json`.\n *\n * We format the output with prettier so it should both a) look nice and b) be deterministic,\n * such that no changes to the config show up as noops to the scm.\n */\nexport async function writeConfig(config: Config): Promise<void> {\n const sorted: Partial<Config> = sortKeys(config);\n delete sorted.__tableToEntityName;\n delete sorted.allowImportingTsExtensions;\n if (sorted.paginationStyle === \"cursor\") {\n delete sorted.paginationStyle;\n }\n const input = JSON.stringify(sorted);\n const content = jsonFormatter.formatText({ filePath: \"test.json\", fileText: input });\n await fs.writeFile(configPath, content);\n}\n\nexport function stripStiPlaceholders(config: Config, entities: EntityDbMetadata[]): void {\n // Defacto (with today's setup) the config of STI entities lives on the base entity,\n // so don't write confusing subtype-specific entries into the config file.\n // ...hopefully we don't have any code accidentally looking for the STI config...\n for (const entity of entities) {\n if (entity.inheritanceType === \"sti\" && entity.stiDiscriminatorValue) {\n delete config.entities[entity.name];\n }\n }\n}\n\n/** Applies defaults to the timestamp config. */\nexport function getTimestampConfig(config: Config): {\n updatedAtConf: Required<TimestampConfig>;\n createdAtConf: Required<TimestampConfig>;\n deletedAtConf: Required<TimestampConfig>;\n} {\n return {\n createdAtConf: {\n names: [\"created_at\", \"createdAt\"],\n required: false,\n ...config?.timestampColumns?.createdAt,\n },\n updatedAtConf: {\n names: [\"updated_at\", \"updatedAt\"],\n required: false,\n ...config?.timestampColumns?.updatedAt,\n },\n deletedAtConf: {\n names: [\"deleted_at\", \"deletedAt\"],\n required: false,\n ...config?.timestampColumns?.deletedAt,\n },\n };\n}\n\nfunction projectIsUsingEsmWithImports(): boolean {\n // Attempt to find the project's tsconfig.json in the current directory or up the directory hierarchy\n const configPath = findTsConfigFile(process.cwd());\n if (!configPath) {\n return false;\n }\n try {\n // Use jsonc-parser to parse the tsconfig.json file (not the old tsc readConfigFile which was\n // dropped in TypeScript 7), allowing for comments and trailing commas.\n const errors: ParseError[] = [];\n const parsed: unknown = parse(readFileSync(configPath, \"utf8\"), errors, { allowTrailingComma: true });\n if (errors.length > 0 || typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) return false;\n const compilerOptions = (parsed as Record<string, unknown>).compilerOptions;\n return (\n typeof compilerOptions === \"object\" &&\n compilerOptions !== null &&\n !Array.isArray(compilerOptions) &&\n (compilerOptions as Record<string, unknown>).allowImportingTsExtensions === true\n );\n } catch {\n return false;\n }\n}\n\n/** Normalizes `uniqueBy` config sugar into runtime identity candidates. */\nfunction normalizeUniqueByConfig(uniqueBy: string | string[] | string[][]): string[][] {\n if (typeof uniqueBy === \"string\") return [[uniqueBy]];\n if (uniqueBy.every((field) => typeof field === \"string\")) return [uniqueBy];\n return uniqueBy;\n}\n\nfunction stripLegacyConfigKeys(raw: unknown): unknown {\n if (!raw || typeof raw !== \"object\" || Array.isArray(raw)) {\n return raw;\n }\n // Accept old configs so the deprecated key disappears on the next write.\n const parsed = { ...(raw as Record<string, unknown>) };\n delete parsed.version;\n return parsed;\n}\n\n/** Finds the nearest `tsconfig.json` in `directory` or one of its ancestors. */\nfunction findTsConfigFile(directory: string): string | undefined {\n while (true) {\n const fileName = join(directory, \"tsconfig.json\");\n if (existsSync(fileName)) return fileName;\n const parent = dirname(directory);\n if (parent === directory) return undefined;\n directory = parent;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,iBAAA,GAAgBA,kBAAAA,iBAAAA,EAAAA,GAAiBC,GAAAA,aAAAA,EAAAA,GAAaC,aAAAA,QAAAA,CAAQ,CAAC,CAAC;AAE9D,MAAM,cAAcC,IAAAA,EACjB,OAAO;CAEN,SAASA,IAAAA,EAAE,SAASA,IAAAA,EAAE,MAAM,CAACA,IAAAA,EAAE,QAAQ,MAAM,GAAGA,IAAAA,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC;CACpE,WAAWA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CACjC,QAAQA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CAC9B,aAAaA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAClC,WAAWA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAChC,MAAMA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAC3B,OAAOA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAC5B,kBAAkBA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,OAAO,CAAC,CAAC;CAC7D,SAASA,IAAAA,EAAE,SAASA,IAAAA,EAAE,MAAM,C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AM,aAAa,iBAAiB,QAAQ,IAAI,CAAC;CACjD,IAAI,CAAC,YACH,OAAO;CAET,IAAI;EAGF,MAAM,SAAuB,CAAC;EAC9B,MAAM,UAAA,GAAkBC,aAAAA,MAAAA,EAAAA,GAAMR,GAAAA,aAAAA,CAAa,YAAY,MAAM,GAAG,QAAQ,EAAE,oBAAoB,KAAK,CAAC;EACpG,IAAI,OAAO,SAAS,KAAK,OAAO,WAAW,YAAY,WAAW,QAAQ,MAAM,QAAQ,MAAM,GAAG,OAAO;EACxG,MAAM,kBAAmB,OAAmC;EAC5D,OACE,OAAO,oBAAoB,YAC3B,oBAAoB,QACpB,CAAC,MAAM,QAAQ,eAAe,KAC7B,gBAA4C,+BAA+B;CAEhF,QAAQ;EACN,OAAO;CACT;AACF;;AAGA,SAAS,wBAAwB,UAAsD;CACrF,IAAI,OAAO,aAAa,UAAU,OAAO,CAAC,CAAC,QAAQ,CAAC;CACpD,IAAI,SAAS,OAAO,UAAU,OAAO,UAAU,QAAQ,GAAG,OAAO,CAAC,QAAQ;CAC1E,OAAO;AACT;AAEA,SAAS,sBAAsB,KAAuB;CACpD,IAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,MAAM,QAAQ,GAAG,GACtD,OAAO;CAGT,MAAM,SAAS,EAAE,GAAI,IAAgC;CACrD,OAAO,OAAO;CACd,OAAO;AACT;;AAGA,SAAS,iBAAiB,WAAuC;CAC/D,OAAO,MAAM;EACX,MAAM,YAAA,GAAWS,KAAAA,KAAAA,CAAK,WAAW,eAAe;EAChD,KAAA,GAAIC,GAAAA,WAAAA,CAAW,QAAQ,GAAG,OAAO;EACjC,MAAM,UAAA,GAASC,KAAAA,QAAAA,CAAQ,SAAS;EAChC,IAAI,WAAW,WAAW,OAAO,KAAA;EACjC,YAAY;CACd;AACF"}
1
+ {"version":3,"file":"config.cjs","names":["createFromBuffer","readFileSync","getPath","z","groupBy","getStiEntities","trueIfResolved","getLatestCodemodVersion","sortKeys","parse","join","existsSync","dirname"],"sources":["../src/config.ts"],"sourcesContent":["import { existsSync, promises as fs, readFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\n\nimport { createFromBuffer } from \"@dprint/formatter\";\nimport { getPath } from \"@dprint/json\";\nimport { groupBy } from \"joist-utils\";\nimport { type ParseError, parse } from \"jsonc-parser\";\nimport { z } from \"zod\";\n\nimport { getLatestCodemodVersion } from \"./codemods/index.ts\";\nimport { type DbMetadata, type Entity, type EntityDbMetadata } from \"./EntityDbMetadata.ts\";\nimport { getStiEntities } from \"./inheritance.ts\";\nimport { logger } from \"./logger.ts\";\nimport { fail, sortKeys, trueIfResolved } from \"./utils.ts\";\n\nconst jsonFormatter = createFromBuffer(readFileSync(getPath()));\n\nconst fieldConfig = z\n .object({\n // For getters & ReactiveFields\n derived: z.optional(z.union([z.literal(\"sync\"), z.literal(\"async\")])),\n protected: z.optional(z.boolean()),\n ignore: z.optional(z.boolean()),\n superstruct: z.optional(z.string()),\n zodSchema: z.optional(z.string()),\n type: z.optional(z.string()),\n serde: z.optional(z.string()),\n stiDiscriminator: z.optional(z.record(z.string(), z.string())),\n stiType: z.optional(z.union([z.string(), z.array(z.string())])),\n // Allow subclasses to mark fields as required\n notNull: z.optional(z.boolean()),\n // Allow overriding scanEntities default detection for fields with defaults added by helpers\n hasDefault: z.optional(z.boolean()),\n // Exclude a (large jsonb/text) column from the default SELECT and expose it as a lazy-loaded LazyField\n lazy: z.optional(z.boolean()),\n /** Mark the entity for read locking whenever the field's value is read. */\n assertUnchanged: z.optional(z.boolean()),\n })\n .strict()\n .refine((field) => !field.assertUnchanged || (!field.derived && !field.lazy && !field.ignore), {\n message: \"assertUnchanged requires a non-derived, non-lazy, non-ignored field\",\n path: [\"assertUnchanged\"],\n });\n\nexport type FieldConfig = z.infer<typeof fieldConfig>;\n\nconst relationConfig = z\n .object({\n // For ReactiveReferences\n derived: z.optional(z.literal(\"async\")),\n polymorphic: z.optional(z.union([z.literal(\"notNull\"), z.literal(true)])),\n large: z.optional(z.boolean()),\n orderBy: z.optional(z.string()),\n /**\n * Controls whether this collection's `.get`/`.load` hide soft-deleted entities.\n *\n * Defaults to `\"exclude\"` (soft-deleted entities are hidden); set to `\"include\"` to have\n * this specific o2m/m2m always return soft-deleted entities from `.get`/`.load`.\n */\n softDeletes: z.optional(z.union([z.literal(\"include\"), z.literal(\"exclude\")])),\n // Allow pushing m2o/m2m/o2o relations in a base type (Task) down to a subtype (TaskOld)\n stiType: z.optional(z.union([z.string(), z.array(z.string())])),\n /**\n * Allow specializing a base type relation (SmallPublisher.group: SmallPublisherGroup).\n *\n * Self-referential FKs also support `subType: \"self\"` that means each subtype will point\n * at its own subtype.\n */\n subType: z.optional(z.string()),\n /** Allow skipping self-referential fields getting a `...Recursive` relation. */\n skipRecursiveRelations: z.optional(z.boolean()),\n // Allow marking m2o FKs as required on subclasses\n notNull: z.optional(z.boolean()),\n // Allow overriding scanEntities default detection for fields with defaults added by helpers\n hasDefault: z.optional(z.boolean()),\n })\n .strict();\n\nexport type RelationConfig = z.infer<typeof relationConfig>;\n\nconst uniqueByConfig = z\n .union([z.string(), z.array(z.string()), z.array(z.array(z.string()))])\n .transform(normalizeUniqueByConfig);\n\nconst entityConfig = z\n .object({\n tag: z.string(),\n tableName: z.optional(z.string()),\n fields: z.optional(z.record(z.string(), fieldConfig)),\n relations: z.optional(z.record(z.string(), relationConfig)),\n /** Whether this entity should be abstract, e.g. for inheritance a subtype must be instantiated instead of this type. */\n abstract: z.optional(z.boolean()),\n orderBy: z.optional(z.string()),\n uniqueBy: z.optional(uniqueByConfig),\n })\n .strict();\n\nexport type EntityConfig = z.infer<typeof entityConfig>;\n\nconst timestampConfig = z\n .object({\n /** The names to check for this timestamp, i.e. `created_at` `created`, etc. */\n names: z.array(z.string()),\n /** Whether this timestamp column is required to consider a table an entity, defaults to `false`. */\n required: z.optional(z.boolean()),\n })\n .strict();\n\nexport type TimestampConfig = z.infer<typeof timestampConfig>;\n\nexport const config = z\n .object({\n /** The _build-time_ database URL for reading database metadata. */\n databaseUrl: z.optional(z.string()),\n /** Your application's request-level `Context` type. */\n contextType: z.optional(z.string()),\n /** Your application's database client's `Transaction` type. */\n transactionType: z.optional(z.string()),\n /**\n * Allows the user to specify the `updated_at` / `created_at` column names to look up, and if they're optional.\n *\n * We default to looking for `updated_at`, `updatedAt`, `created_at`, `createdAt`, and optional to true,\n * e.g. tables are not required to have both timestamp columns to be considered entities.\n *\n * These defaults are the most lenient, to facilitate running Joist against an existing schema and\n * seeing all of your entities, regardless of your previous conventions.\n */\n timestampColumns: z.optional(\n z.object({\n createdAt: z.optional(timestampConfig),\n updatedAt: z.optional(timestampConfig),\n deletedAt: z.optional(timestampConfig),\n }),\n ),\n /**\n * Allows the user to have codegen output `Temporal` types instead of the base JS `Date`\n *\n * Additionally, allows for specifying the default time zone for `Temporal` types when converting dates to/from\n * the database.\n */\n temporal: z.optional(z.union([z.boolean(), z.object({ timeZone: z.string() })])),\n /**\n * By default, we create a `flush_database` function for fast testing.\n *\n * However, if you don't want to use this, or you have your own bespoke function like we do\n * that is more application-aware, then you can disable Joist's out-of-the-box one.\n *\n * If you have more than one test database, you can set `createFlushFunction` to the array\n * of test database names, i.e. `mydb_test_1`, `mydb_test_2`, etc.\n */\n createFlushFunction: z.optional(z.union([z.boolean(), z.array(z.string())])),\n entitiesDirectory: z.string().default(\"./src/entities\"),\n codegenPlugins: z.optional(z.array(z.string())),\n entities: z.record(z.string(), entityConfig).default({}),\n ignoredTables: z.optional(z.array(z.string())),\n /** The type of entity `id` fields; defaults to `tagged-string`. */\n idType: z.optional(z.union([z.literal(\"tagged-string\"), z.literal(\"untagged-string\"), z.literal(\"number\")])),\n /** The separator between entity tags and ids; defaults to `:`, and `\"\"` disables the separator. */\n tagDelimiter: z.optional(z.string()),\n /** How we should support non-deferred foreign keys. */\n nonDeferredForeignKeys: z.optional(z.union([z.literal(\"error\"), z.literal(\"warn\"), z.literal(\"ignore\")])),\n /** Enables esm output. */\n esm: z.optional(z.boolean()),\n /** Controls the style of GraphQL pagination scaffolding. */\n paginationStyle: z.optional(z.union([z.literal(\"cursor\"), z.literal(\"limit\")])).default(\"cursor\"),\n /** Enables documentation syncing between .md files and JSDocs. */\n docs: z.optional(z.boolean()),\n /** Installs Joist's bundled Agent Skills into `.claude/skills` and `.agents/skills`; on by default, set `false` to disable. */\n skills: z.optional(z.boolean()),\n /** Output a metadata-docs.ts file with entity/field documentation available at runtime. */\n outputDocs: z.optional(z.boolean()),\n /** Auto-set by probing the project's `tsconfig.json` file. */\n allowImportingTsExtensions: z.optional(z.boolean()),\n /** The latest Joist codemod counter that has been applied to this project. */\n codemodVersion: z.number().int().min(0).default(0),\n\n /** A list of postgres schemas to use for finding tables */\n schemas: z.optional(z.array(z.string())),\n })\n .strict();\n\nexport type Config = z.infer<typeof config> & {\n // We don't persist this, and instead just use it as a cache\n __tableToEntityName?: Record<string, string>;\n};\n\nexport const ormMaintainedFields = [\"createdAt\", \"updatedAt\"];\n\n/** Ensure the user doesn't have any typos in their config. */\nexport function warnInvalidConfigEntries(config: Config, db: DbMetadata): void {\n const entitiesByName = groupBy(db.entities, (e) => e.name);\n for (const [entityName, entityConfig] of Object.entries(config.entities)) {\n const entities = entitiesByName[entityName];\n if (!entities) {\n logger.warn(`Found config for non-existent entity ${entityName}`);\n continue;\n }\n // We don't have keyBy...\n const [entity] = entities;\n\n // Check fields\n const fields = [...entity.primitives, ...entity.enums];\n for (const [name, config] of Object.entries(entityConfig.fields || {})) {\n if (config.ignore) continue;\n let field = fields.find((f) => f.fieldName === name);\n // STI types might be in the base type\n if (!field && entity.stiDiscriminatorField) {\n const stiEntities = getStiEntities(db.entities).get(entity.name)?.subTypes;\n field = stiEntities?.flatMap((st) => [...st.primitives, ...st.enums]).find((f) => f.fieldName === name);\n }\n if (!field) logger.warn(`Found config for non-existent field ${entityName}.${name}`);\n }\n\n // Check relations\n const relations = [\n ...entity.manyToOnes,\n ...entity.oneToManys,\n ...entity.manyToManys,\n ...entity.manyToManyEnums,\n ...entity.oneToOnes,\n ...entity.largeOneToManys,\n ...entity.largeManyToManys,\n ...entity.polymorphics,\n ];\n for (const [name, _] of Object.entries(entityConfig.relations || {})) {\n let relation = relations.find((r) => r.fieldName === name);\n // STI types might be in the subtypes\n if (!relation && entity.stiDiscriminatorField) {\n const stiEntities = getStiEntities(db.entities).get(entity.name)?.subTypes;\n relation = stiEntities\n ?.flatMap((entity) => [\n ...entity.manyToOnes,\n ...entity.oneToManys,\n ...entity.manyToManys,\n ...entity.oneToOnes,\n ...entity.largeOneToManys,\n ...entity.largeManyToManys,\n ...entity.polymorphics,\n ])\n ?.find((f) => f.fieldName === name);\n }\n // CTI subtype specializations (i.e. SmallPublisher.group: SmallPublisherGroup) need to look in the base type\n if (!relation && entity.baseType) {\n const baseType = entity.baseType;\n relation = [\n ...baseType.manyToOnes,\n ...baseType.oneToManys,\n ...baseType.manyToManys,\n ...baseType.oneToOnes,\n ...baseType.largeOneToManys,\n ...baseType.largeManyToManys,\n ...baseType.polymorphics,\n ].find((f) => f.fieldName === name);\n }\n\n if (!relation) logger.warn(`Found config for non-existent relation ${entityName}.${name}`);\n }\n\n const uniqueFields = [\n ...entity.primitives,\n ...entity.enums,\n ...entity.pgEnums,\n ...entity.manyToOnes,\n ...entity.polymorphics,\n ];\n for (const uniqueBy of entityConfig.uniqueBy || []) {\n for (const name of uniqueBy) {\n const field = uniqueFields.find((f) => f.fieldName === name);\n if (!field) {\n logger.warn(`Found uniqueBy for non-existent or non-queryable field ${entityName}.${name}`);\n } else if (field.kind === \"primitive\" && (field.derived || field.customSerde)) {\n logger.warn(`Found uniqueBy for unsupported primitive field ${entityName}.${name}`);\n } else if (field.kind === \"enum\" && (field.derived || field.isArray)) {\n logger.warn(`Found uniqueBy for unsupported enum field ${entityName}.${name}`);\n }\n }\n }\n }\n}\n\nexport function isGetterField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.derived === \"sync\";\n}\n\nexport function isReactiveField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.derived === \"async\";\n}\n\nexport function isReactiveReference(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.derived === \"async\";\n}\n\n/** Returns true if this m2m relation is configured as a ReactiveManyToMany (derived: async). */\nexport function isReactiveManyToMany(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.derived === \"async\";\n}\n\nexport function isProtected(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.protected === true;\n}\n\n/** Whether a column should be excluded from the default SELECT and exposed as a lazy-loaded `LazyField`. */\nexport function isLazyField(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.fields?.[fieldName]?.lazy === true;\n}\n\nexport function serdeConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.serde;\n}\n\nexport function superstructConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.superstruct;\n}\n\nexport function zodSchemaConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.zodSchema;\n}\n\nexport function fieldTypeConfig(config: Config, entity: Entity, fieldName: string): string | undefined {\n return config.entities[entity.name]?.fields?.[fieldName]?.type;\n}\n\nexport function isLargeCollection(config: Config, entity: Entity, fieldName: string): boolean {\n return config.entities[entity.name]?.relations?.[fieldName]?.large === true;\n}\n\n/** Whether a collection should include (or exclude) soft-deleted entities from `.get`/`.load`. */\nexport function softDeletesConfig(\n config: Config,\n entity: Entity,\n fieldName: string,\n): \"include\" | \"exclude\" | undefined {\n return config.entities[entity.name]?.relations?.[fieldName]?.softDeletes;\n}\n\nexport function isFieldIgnored(\n config: Config,\n entity: Entity,\n fieldName: string,\n notNull: boolean = false,\n hasDefault: boolean = false,\n): boolean {\n const ignore = config.entities[entity.name]?.fields?.[fieldName]?.ignore === true;\n if (ignore && notNull && !hasDefault) {\n fail(\n `notNull field ${entity.name}.${fieldName} cannot be ignored. Alter the column to be optional or have a default value prior to ignoring it.`,\n );\n }\n return ignore;\n}\n\nexport function isFieldHasDefault(config: Config, entity: Entity, fieldName: string): boolean {\n const entityConfig = config.entities[entity.name] ?? {};\n const fieldConfig = entityConfig.fields?.[fieldName] ?? entityConfig.relations?.[fieldName] ?? {};\n return fieldConfig.hasDefault === true;\n}\n\nconst configPath = \"./joist-config.json\";\n\nexport async function loadConfig(): Promise<Config> {\n const exists = await trueIfResolved(fs.access(configPath));\n if (exists) {\n const content = await fs.readFile(configPath);\n const result = config.safeParse(stripLegacyConfigKeys(JSON.parse(content.toString())));\n if (!result.success) {\n throw new Error(\n `Invalid joist-config.json: ${result.error.issues\n .map((ze) => `${ze.path.map(String).join(\"/\")} ${ze.message}`)\n .join(\"\\n\")}`,\n );\n }\n result.data.allowImportingTsExtensions ??= projectIsUsingEsmWithImports();\n return result.data;\n }\n // Brand-new projects should not be prompted to run historical codemods.\n const initial = config.parse({ codemodVersion: getLatestCodemodVersion() });\n initial.allowImportingTsExtensions ??= projectIsUsingEsmWithImports();\n return initial;\n}\n\n/**\n * Writes the potentially-updated config entry back to `joist-config.json`.\n *\n * We format the output with prettier so it should both a) look nice and b) be deterministic,\n * such that no changes to the config show up as noops to the scm.\n */\nexport async function writeConfig(config: Config): Promise<void> {\n const sorted: Partial<Config> = sortKeys(config);\n delete sorted.__tableToEntityName;\n delete sorted.allowImportingTsExtensions;\n if (sorted.paginationStyle === \"cursor\") {\n delete sorted.paginationStyle;\n }\n const input = JSON.stringify(sorted);\n const content = jsonFormatter.formatText({ filePath: \"test.json\", fileText: input });\n await fs.writeFile(configPath, content);\n}\n\nexport function stripStiPlaceholders(config: Config, entities: EntityDbMetadata[]): void {\n // Defacto (with today's setup) the config of STI entities lives on the base entity,\n // so don't write confusing subtype-specific entries into the config file.\n // ...hopefully we don't have any code accidentally looking for the STI config...\n for (const entity of entities) {\n if (entity.inheritanceType === \"sti\" && entity.stiDiscriminatorValue) {\n delete config.entities[entity.name];\n }\n }\n}\n\n/** Applies defaults to the timestamp config. */\nexport function getTimestampConfig(config: Config): {\n updatedAtConf: Required<TimestampConfig>;\n createdAtConf: Required<TimestampConfig>;\n deletedAtConf: Required<TimestampConfig>;\n} {\n return {\n createdAtConf: {\n names: [\"created_at\", \"createdAt\"],\n required: false,\n ...config?.timestampColumns?.createdAt,\n },\n updatedAtConf: {\n names: [\"updated_at\", \"updatedAt\"],\n required: false,\n ...config?.timestampColumns?.updatedAt,\n },\n deletedAtConf: {\n names: [\"deleted_at\", \"deletedAt\"],\n required: false,\n ...config?.timestampColumns?.deletedAt,\n },\n };\n}\n\nfunction projectIsUsingEsmWithImports(): boolean {\n // Attempt to find the project's tsconfig.json in the current directory or up the directory hierarchy\n const configPath = findTsConfigFile(process.cwd());\n if (!configPath) {\n return false;\n }\n try {\n // Use jsonc-parser to parse the tsconfig.json file (not the old tsc readConfigFile which was\n // dropped in TypeScript 7), allowing for comments and trailing commas.\n const errors: ParseError[] = [];\n const parsed: unknown = parse(readFileSync(configPath, \"utf8\"), errors, { allowTrailingComma: true });\n if (errors.length > 0 || typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) return false;\n const compilerOptions = (parsed as Record<string, unknown>).compilerOptions;\n return (\n typeof compilerOptions === \"object\" &&\n compilerOptions !== null &&\n !Array.isArray(compilerOptions) &&\n (compilerOptions as Record<string, unknown>).allowImportingTsExtensions === true\n );\n } catch {\n return false;\n }\n}\n\n/** Normalizes `uniqueBy` config sugar into runtime identity candidates. */\nfunction normalizeUniqueByConfig(uniqueBy: string | string[] | string[][]): string[][] {\n if (typeof uniqueBy === \"string\") return [[uniqueBy]];\n if (uniqueBy.every((field) => typeof field === \"string\")) return [uniqueBy];\n return uniqueBy;\n}\n\nfunction stripLegacyConfigKeys(raw: unknown): unknown {\n if (!raw || typeof raw !== \"object\" || Array.isArray(raw)) {\n return raw;\n }\n // Accept old configs so the deprecated key disappears on the next write.\n const parsed = { ...(raw as Record<string, unknown>) };\n delete parsed.version;\n return parsed;\n}\n\n/** Finds the nearest `tsconfig.json` in `directory` or one of its ancestors. */\nfunction findTsConfigFile(directory: string): string | undefined {\n while (true) {\n const fileName = join(directory, \"tsconfig.json\");\n if (existsSync(fileName)) return fileName;\n const parent = dirname(directory);\n if (parent === directory) return undefined;\n directory = parent;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,iBAAA,GAAgBA,kBAAAA,iBAAAA,EAAAA,GAAiBC,GAAAA,aAAAA,EAAAA,GAAaC,aAAAA,QAAAA,CAAQ,CAAC,CAAC;AAE9D,MAAM,cAAcC,IAAAA,EACjB,OAAO;CAEN,SAASA,IAAAA,EAAE,SAASA,IAAAA,EAAE,MAAM,CAACA,IAAAA,EAAE,QAAQ,MAAM,GAAGA,IAAAA,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC;CACpE,WAAWA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CACjC,QAAQA,IAAAA,EAAE,SAASA,IAAAA,EAAE,QAAQ,CAAC;CAC9B,aAAaA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAClC,WAAWA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAChC,MAAMA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAC3B,OAAOA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAO,CAAC;CAC5B,kBAAkBA,IAAAA,EAAE,SAASA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,OAAO,CAAC,CAAC;CAC7D,SAASA,IAAAA,EAAE,SAASA,IAAAA,EAAE,MAAM,CAACA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CAE9D,SAAS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declare const fieldConfig: z.ZodObject<{
14
14
  notNull: z.ZodOptional<z.ZodBoolean>;
15
15
  hasDefault: z.ZodOptional<z.ZodBoolean>;
16
16
  lazy: z.ZodOptional<z.ZodBoolean>;
17
+ assertUnchanged: z.ZodOptional<z.ZodBoolean>;
17
18
  }, z.core.$strict>;
18
- type FieldConfig = z.infer<typeof fieldConfig>;
19
+ export type FieldConfig = z.infer<typeof fieldConfig>;
19
20
  declare const relationConfig: z.ZodObject<{
20
21
  derived: z.ZodOptional<z.ZodLiteral<"async">>;
21
22
  polymorphic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"notNull">, z.ZodLiteral<true>]>>;
@@ -28,7 +29,7 @@ declare const relationConfig: z.ZodObject<{
28
29
  notNull: z.ZodOptional<z.ZodBoolean>;
29
30
  hasDefault: z.ZodOptional<z.ZodBoolean>;
30
31
  }, z.core.$strict>;
31
- type RelationConfig = z.infer<typeof relationConfig>;
32
+ export type RelationConfig = z.infer<typeof relationConfig>;
32
33
  declare const entityConfig: z.ZodObject<{
33
34
  tag: z.ZodString;
34
35
  tableName: z.ZodOptional<z.ZodString>;
@@ -45,6 +46,7 @@ declare const entityConfig: z.ZodObject<{
45
46
  notNull: z.ZodOptional<z.ZodBoolean>;
46
47
  hasDefault: z.ZodOptional<z.ZodBoolean>;
47
48
  lazy: z.ZodOptional<z.ZodBoolean>;
49
+ assertUnchanged: z.ZodOptional<z.ZodBoolean>;
48
50
  }, z.core.$strict>>>;
49
51
  relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
50
52
  derived: z.ZodOptional<z.ZodLiteral<"async">>;
@@ -62,13 +64,13 @@ declare const entityConfig: z.ZodObject<{
62
64
  orderBy: z.ZodOptional<z.ZodString>;
63
65
  uniqueBy: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodArray<z.ZodString>>]>, z.ZodTransform<string[][], string | string[] | string[][]>>>;
64
66
  }, z.core.$strict>;
65
- type EntityConfig = z.infer<typeof entityConfig>;
67
+ export type EntityConfig = z.infer<typeof entityConfig>;
66
68
  declare const timestampConfig: z.ZodObject<{
67
69
  names: z.ZodArray<z.ZodString>;
68
70
  required: z.ZodOptional<z.ZodBoolean>;
69
71
  }, z.core.$strict>;
70
- type TimestampConfig = z.infer<typeof timestampConfig>;
71
- declare const config: z.ZodObject<{
72
+ export type TimestampConfig = z.infer<typeof timestampConfig>;
73
+ export declare const config: z.ZodObject<{
72
74
  databaseUrl: z.ZodOptional<z.ZodString>;
73
75
  contextType: z.ZodOptional<z.ZodString>;
74
76
  transactionType: z.ZodOptional<z.ZodString>;
@@ -108,6 +110,7 @@ declare const config: z.ZodObject<{
108
110
  notNull: z.ZodOptional<z.ZodBoolean>;
109
111
  hasDefault: z.ZodOptional<z.ZodBoolean>;
110
112
  lazy: z.ZodOptional<z.ZodBoolean>;
113
+ assertUnchanged: z.ZodOptional<z.ZodBoolean>;
111
114
  }, z.core.$strict>>>;
112
115
  relations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
113
116
  derived: z.ZodOptional<z.ZodLiteral<"async">>;
@@ -138,44 +141,44 @@ declare const config: z.ZodObject<{
138
141
  codemodVersion: z.ZodDefault<z.ZodNumber>;
139
142
  schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
143
  }, z.core.$strict>;
141
- type Config = z.infer<typeof config> & {
144
+ export type Config = z.infer<typeof config> & {
142
145
  __tableToEntityName?: Record<string, string>;
143
146
  };
144
- declare const ormMaintainedFields: string[];
147
+ export declare const ormMaintainedFields: string[];
145
148
  /** Ensure the user doesn't have any typos in their config. */
146
- declare function warnInvalidConfigEntries(config: Config, db: DbMetadata): void;
147
- declare function isGetterField(config: Config, entity: Entity, fieldName: string): boolean;
148
- declare function isReactiveField(config: Config, entity: Entity, fieldName: string): boolean;
149
- declare function isReactiveReference(config: Config, entity: Entity, fieldName: string): boolean;
149
+ export declare function warnInvalidConfigEntries(config: Config, db: DbMetadata): void;
150
+ export declare function isGetterField(config: Config, entity: Entity, fieldName: string): boolean;
151
+ export declare function isReactiveField(config: Config, entity: Entity, fieldName: string): boolean;
152
+ export declare function isReactiveReference(config: Config, entity: Entity, fieldName: string): boolean;
150
153
  /** Returns true if this m2m relation is configured as a ReactiveManyToMany (derived: async). */
151
- declare function isReactiveManyToMany(config: Config, entity: Entity, fieldName: string): boolean;
152
- declare function isProtected(config: Config, entity: Entity, fieldName: string): boolean;
154
+ export declare function isReactiveManyToMany(config: Config, entity: Entity, fieldName: string): boolean;
155
+ export declare function isProtected(config: Config, entity: Entity, fieldName: string): boolean;
153
156
  /** Whether a column should be excluded from the default SELECT and exposed as a lazy-loaded `LazyField`. */
154
- declare function isLazyField(config: Config, entity: Entity, fieldName: string): boolean;
155
- declare function serdeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
156
- declare function superstructConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
157
- declare function zodSchemaConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
158
- declare function fieldTypeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
159
- declare function isLargeCollection(config: Config, entity: Entity, fieldName: string): boolean;
157
+ export declare function isLazyField(config: Config, entity: Entity, fieldName: string): boolean;
158
+ export declare function serdeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
159
+ export declare function superstructConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
160
+ export declare function zodSchemaConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
161
+ export declare function fieldTypeConfig(config: Config, entity: Entity, fieldName: string): string | undefined;
162
+ export declare function isLargeCollection(config: Config, entity: Entity, fieldName: string): boolean;
160
163
  /** Whether a collection should include (or exclude) soft-deleted entities from `.get`/`.load`. */
161
- declare function softDeletesConfig(config: Config, entity: Entity, fieldName: string): "include" | "exclude" | undefined;
162
- declare function isFieldIgnored(config: Config, entity: Entity, fieldName: string, notNull?: boolean, hasDefault?: boolean): boolean;
163
- declare function isFieldHasDefault(config: Config, entity: Entity, fieldName: string): boolean;
164
- declare function loadConfig(): Promise<Config>;
164
+ export declare function softDeletesConfig(config: Config, entity: Entity, fieldName: string): "include" | "exclude" | undefined;
165
+ export declare function isFieldIgnored(config: Config, entity: Entity, fieldName: string, notNull?: boolean, hasDefault?: boolean): boolean;
166
+ export declare function isFieldHasDefault(config: Config, entity: Entity, fieldName: string): boolean;
167
+ export declare function loadConfig(): Promise<Config>;
165
168
  /**
166
169
  * Writes the potentially-updated config entry back to `joist-config.json`.
167
170
  *
168
171
  * We format the output with prettier so it should both a) look nice and b) be deterministic,
169
172
  * such that no changes to the config show up as noops to the scm.
170
173
  */
171
- declare function writeConfig(config: Config): Promise<void>;
172
- declare function stripStiPlaceholders(config: Config, entities: EntityDbMetadata[]): void;
174
+ export declare function writeConfig(config: Config): Promise<void>;
175
+ export declare function stripStiPlaceholders(config: Config, entities: EntityDbMetadata[]): void;
173
176
  /** Applies defaults to the timestamp config. */
174
- declare function getTimestampConfig(config: Config): {
177
+ export declare function getTimestampConfig(config: Config): {
175
178
  updatedAtConf: Required<TimestampConfig>;
176
179
  createdAtConf: Required<TimestampConfig>;
177
180
  deletedAtConf: Required<TimestampConfig>;
178
181
  };
179
182
  //#endregion
180
- export { Config, EntityConfig, FieldConfig, RelationConfig, TimestampConfig, config, fieldTypeConfig, getTimestampConfig, isFieldHasDefault, isFieldIgnored, isGetterField, isLargeCollection, isLazyField, isProtected, isReactiveField, isReactiveManyToMany, isReactiveReference, loadConfig, ormMaintainedFields, serdeConfig, softDeletesConfig, stripStiPlaceholders, superstructConfig, warnInvalidConfigEntries, writeConfig, zodSchemaConfig };
183
+ export {};
181
184
  //# sourceMappingURL=config.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"mappings":";;;cAiBM,aAAW,EAAA;;;;;;;;;;;;;GAmBN,EAAA,KAAA;KAEC,cAAc,EAAE,aAAa;cAEnC,gBAAc,EAAA;;;;;;;;;;;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