@typeorm/codemod 1.0.0

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 (275) hide show
  1. package/README.md +59 -0
  2. package/dist/cli/colors.d.ts +7 -0
  3. package/dist/cli/colors.js +12 -0
  4. package/dist/cli/colors.js.map +1 -0
  5. package/dist/cli/error.d.ts +1 -0
  6. package/dist/cli/error.js +11 -0
  7. package/dist/cli/error.js.map +1 -0
  8. package/dist/cli/list-transforms.d.ts +1 -0
  9. package/dist/cli/list-transforms.js +27 -0
  10. package/dist/cli/list-transforms.js.map +1 -0
  11. package/dist/cli/parse-args.d.ts +10 -0
  12. package/dist/cli/parse-args.js +52 -0
  13. package/dist/cli/parse-args.js.map +1 -0
  14. package/dist/cli/print-guide.d.ts +1 -0
  15. package/dist/cli/print-guide.js +15 -0
  16. package/dist/cli/print-guide.js.map +1 -0
  17. package/dist/cli/print-summary.d.ts +17 -0
  18. package/dist/cli/print-summary.js +70 -0
  19. package/dist/cli/print-summary.js.map +1 -0
  20. package/dist/cli/print-todos.d.ts +1 -0
  21. package/dist/cli/print-todos.js +13 -0
  22. package/dist/cli/print-todos.js.map +1 -0
  23. package/dist/cli/print-usage.d.ts +1 -0
  24. package/dist/cli/print-usage.js +31 -0
  25. package/dist/cli/print-usage.js.map +1 -0
  26. package/dist/cli/run-dependencies.d.ts +6 -0
  27. package/dist/cli/run-dependencies.js +45 -0
  28. package/dist/cli/run-dependencies.js.map +1 -0
  29. package/dist/cli/run-transforms.d.ts +21 -0
  30. package/dist/cli/run-transforms.js +119 -0
  31. package/dist/cli/run-transforms.js.map +1 -0
  32. package/dist/cli/run.d.ts +9 -0
  33. package/dist/cli/run.js +30 -0
  34. package/dist/cli/run.js.map +1 -0
  35. package/dist/dependencies/config.d.ts +24 -0
  36. package/dist/dependencies/config.js +3 -0
  37. package/dist/dependencies/config.js.map +1 -0
  38. package/dist/dependencies/find-package-json.d.ts +5 -0
  39. package/dist/dependencies/find-package-json.js +34 -0
  40. package/dist/dependencies/find-package-json.js.map +1 -0
  41. package/dist/dependencies/index.d.ts +5 -0
  42. package/dist/dependencies/index.js +14 -0
  43. package/dist/dependencies/index.js.map +1 -0
  44. package/dist/dependencies/upgrade.d.ts +11 -0
  45. package/dist/dependencies/upgrade.js +128 -0
  46. package/dist/dependencies/upgrade.js.map +1 -0
  47. package/dist/dependencies/v1.d.ts +2 -0
  48. package/dist/dependencies/v1.js +32 -0
  49. package/dist/dependencies/v1.js.map +1 -0
  50. package/dist/index.d.ts +2 -0
  51. package/dist/index.js +45 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/lib/colors.d.ts +9 -0
  54. package/dist/lib/colors.js +14 -0
  55. package/dist/lib/colors.js.map +1 -0
  56. package/dist/lib/error.d.ts +1 -0
  57. package/dist/lib/error.js +11 -0
  58. package/dist/lib/error.js.map +1 -0
  59. package/dist/lib/format-time.d.ts +1 -0
  60. package/dist/lib/format-time.js +12 -0
  61. package/dist/lib/format-time.js.map +1 -0
  62. package/dist/lib/highlight.d.ts +1 -0
  63. package/dist/lib/highlight.js +7 -0
  64. package/dist/lib/highlight.js.map +1 -0
  65. package/dist/lib/spinner.d.ts +5 -0
  66. package/dist/lib/spinner.js +39 -0
  67. package/dist/lib/spinner.js.map +1 -0
  68. package/dist/transforms/ast-helpers.d.ts +50 -0
  69. package/dist/transforms/ast-helpers.js +153 -0
  70. package/dist/transforms/ast-helpers.js.map +1 -0
  71. package/dist/transforms/index.d.ts +7 -0
  72. package/dist/transforms/index.js +41 -0
  73. package/dist/transforms/index.js.map +1 -0
  74. package/dist/transforms/resolve.d.ts +1 -0
  75. package/dist/transforms/resolve.js +28 -0
  76. package/dist/transforms/resolve.js.map +1 -0
  77. package/dist/transforms/scan.d.ts +4 -0
  78. package/dist/transforms/scan.js +33 -0
  79. package/dist/transforms/scan.js.map +1 -0
  80. package/dist/transforms/stats.d.ts +11 -0
  81. package/dist/transforms/stats.js +42 -0
  82. package/dist/transforms/stats.js.map +1 -0
  83. package/dist/transforms/todo.d.ts +2 -0
  84. package/dist/transforms/todo.js +10 -0
  85. package/dist/transforms/todo.js.map +1 -0
  86. package/dist/transforms/transformer.d.ts +8 -0
  87. package/dist/transforms/transformer.js +19 -0
  88. package/dist/transforms/transformer.js.map +1 -0
  89. package/dist/transforms/v1/column-readonly.d.ts +6 -0
  90. package/dist/transforms/v1/column-readonly.js +37 -0
  91. package/dist/transforms/v1/column-readonly.js.map +1 -0
  92. package/dist/transforms/v1/column-unsigned-numeric.d.ts +6 -0
  93. package/dist/transforms/v1/column-unsigned-numeric.js +65 -0
  94. package/dist/transforms/v1/column-unsigned-numeric.js.map +1 -0
  95. package/dist/transforms/v1/column-width-zerofill.d.ts +6 -0
  96. package/dist/transforms/v1/column-width-zerofill.js +26 -0
  97. package/dist/transforms/v1/column-width-zerofill.js.map +1 -0
  98. package/dist/transforms/v1/connection-to-datasource.d.ts +6 -0
  99. package/dist/transforms/v1/connection-to-datasource.js +205 -0
  100. package/dist/transforms/v1/connection-to-datasource.js.map +1 -0
  101. package/dist/transforms/v1/datasource-mongodb.d.ts +7 -0
  102. package/dist/transforms/v1/datasource-mongodb.js +96 -0
  103. package/dist/transforms/v1/datasource-mongodb.js.map +1 -0
  104. package/dist/transforms/v1/datasource-mssql-domain.d.ts +7 -0
  105. package/dist/transforms/v1/datasource-mssql-domain.js +35 -0
  106. package/dist/transforms/v1/datasource-mssql-domain.js.map +1 -0
  107. package/dist/transforms/v1/datasource-mssql.d.ts +7 -0
  108. package/dist/transforms/v1/datasource-mssql.js +82 -0
  109. package/dist/transforms/v1/datasource-mssql.js.map +1 -0
  110. package/dist/transforms/v1/datasource-mysql-connector.d.ts +6 -0
  111. package/dist/transforms/v1/datasource-mysql-connector.js +25 -0
  112. package/dist/transforms/v1/datasource-mysql-connector.js.map +1 -0
  113. package/dist/transforms/v1/datasource-name.d.ts +6 -0
  114. package/dist/transforms/v1/datasource-name.js +46 -0
  115. package/dist/transforms/v1/datasource-name.js.map +1 -0
  116. package/dist/transforms/v1/datasource-sap.d.ts +6 -0
  117. package/dist/transforms/v1/datasource-sap.js +63 -0
  118. package/dist/transforms/v1/datasource-sap.js.map +1 -0
  119. package/dist/transforms/v1/datasource-sqlite-options.d.ts +6 -0
  120. package/dist/transforms/v1/datasource-sqlite-options.js +35 -0
  121. package/dist/transforms/v1/datasource-sqlite-options.js.map +1 -0
  122. package/dist/transforms/v1/datasource-sqlite-type.d.ts +6 -0
  123. package/dist/transforms/v1/datasource-sqlite-type.js +28 -0
  124. package/dist/transforms/v1/datasource-sqlite-type.js.map +1 -0
  125. package/dist/transforms/v1/find-options-lock-modes.d.ts +6 -0
  126. package/dist/transforms/v1/find-options-lock-modes.js +81 -0
  127. package/dist/transforms/v1/find-options-lock-modes.js.map +1 -0
  128. package/dist/transforms/v1/find-options-string-relations.d.ts +6 -0
  129. package/dist/transforms/v1/find-options-string-relations.js +69 -0
  130. package/dist/transforms/v1/find-options-string-relations.js.map +1 -0
  131. package/dist/transforms/v1/find-options-string-select.d.ts +6 -0
  132. package/dist/transforms/v1/find-options-string-select.js +36 -0
  133. package/dist/transforms/v1/find-options-string-select.js.map +1 -0
  134. package/dist/transforms/v1/global-functions.d.ts +7 -0
  135. package/dist/transforms/v1/global-functions.js +98 -0
  136. package/dist/transforms/v1/global-functions.js.map +1 -0
  137. package/dist/transforms/v1/index.d.ts +40 -0
  138. package/dist/transforms/v1/index.js +109 -0
  139. package/dist/transforms/v1/index.js.map +1 -0
  140. package/dist/transforms/v1/migrations-get-all.d.ts +7 -0
  141. package/dist/transforms/v1/migrations-get-all.js +39 -0
  142. package/dist/transforms/v1/migrations-get-all.js.map +1 -0
  143. package/dist/transforms/v1/mongodb-stats.d.ts +7 -0
  144. package/dist/transforms/v1/mongodb-stats.js +52 -0
  145. package/dist/transforms/v1/mongodb-stats.js.map +1 -0
  146. package/dist/transforms/v1/mongodb-types.d.ts +6 -0
  147. package/dist/transforms/v1/mongodb-types.js +84 -0
  148. package/dist/transforms/v1/mongodb-types.js.map +1 -0
  149. package/dist/transforms/v1/query-builder-native-parameters.d.ts +6 -0
  150. package/dist/transforms/v1/query-builder-native-parameters.js +20 -0
  151. package/dist/transforms/v1/query-builder-native-parameters.js.map +1 -0
  152. package/dist/transforms/v1/query-builder-on-conflict.d.ts +7 -0
  153. package/dist/transforms/v1/query-builder-on-conflict.js +56 -0
  154. package/dist/transforms/v1/query-builder-on-conflict.js.map +1 -0
  155. package/dist/transforms/v1/query-builder-or-update.d.ts +6 -0
  156. package/dist/transforms/v1/query-builder-or-update.js +56 -0
  157. package/dist/transforms/v1/query-builder-or-update.js.map +1 -0
  158. package/dist/transforms/v1/query-builder-print-sql.d.ts +7 -0
  159. package/dist/transforms/v1/query-builder-print-sql.js +49 -0
  160. package/dist/transforms/v1/query-builder-print-sql.js.map +1 -0
  161. package/dist/transforms/v1/query-builder-replace-property-names.d.ts +7 -0
  162. package/dist/transforms/v1/query-builder-replace-property-names.js +42 -0
  163. package/dist/transforms/v1/query-builder-replace-property-names.js.map +1 -0
  164. package/dist/transforms/v1/query-builder-where-expression.d.ts +6 -0
  165. package/dist/transforms/v1/query-builder-where-expression.js +39 -0
  166. package/dist/transforms/v1/query-builder-where-expression.js.map +1 -0
  167. package/dist/transforms/v1/query-runner-loaded-tables-views.d.ts +7 -0
  168. package/dist/transforms/v1/query-runner-loaded-tables-views.js +54 -0
  169. package/dist/transforms/v1/query-runner-loaded-tables-views.js.map +1 -0
  170. package/dist/transforms/v1/relation-count.d.ts +7 -0
  171. package/dist/transforms/v1/relation-count.js +41 -0
  172. package/dist/transforms/v1/relation-count.js.map +1 -0
  173. package/dist/transforms/v1/remove-abstract-repository.d.ts +5 -0
  174. package/dist/transforms/v1/remove-abstract-repository.js +93 -0
  175. package/dist/transforms/v1/remove-abstract-repository.js.map +1 -0
  176. package/dist/transforms/v1/remove-connector-package.d.ts +4 -0
  177. package/dist/transforms/v1/remove-connector-package.js +19 -0
  178. package/dist/transforms/v1/remove-connector-package.js.map +1 -0
  179. package/dist/transforms/v1/remove-datasource-name.d.ts +4 -0
  180. package/dist/transforms/v1/remove-datasource-name.js +56 -0
  181. package/dist/transforms/v1/remove-datasource-name.js.map +1 -0
  182. package/dist/transforms/v1/remove-mongodb-options.d.ts +5 -0
  183. package/dist/transforms/v1/remove-mongodb-options.js +86 -0
  184. package/dist/transforms/v1/remove-mongodb-options.js.map +1 -0
  185. package/dist/transforms/v1/remove-relation-count.d.ts +5 -0
  186. package/dist/transforms/v1/remove-relation-count.js +49 -0
  187. package/dist/transforms/v1/remove-relation-count.js.map +1 -0
  188. package/dist/transforms/v1/remove-replace-property-names.d.ts +5 -0
  189. package/dist/transforms/v1/remove-replace-property-names.js +35 -0
  190. package/dist/transforms/v1/remove-replace-property-names.js.map +1 -0
  191. package/dist/transforms/v1/remove-sap-options.d.ts +4 -0
  192. package/dist/transforms/v1/remove-sap-options.js +54 -0
  193. package/dist/transforms/v1/remove-sap-options.js.map +1 -0
  194. package/dist/transforms/v1/remove-unsigned-numeric.d.ts +4 -0
  195. package/dist/transforms/v1/remove-unsigned-numeric.js +76 -0
  196. package/dist/transforms/v1/remove-unsigned-numeric.js.map +1 -0
  197. package/dist/transforms/v1/remove-use-container.d.ts +5 -0
  198. package/dist/transforms/v1/remove-use-container.js +63 -0
  199. package/dist/transforms/v1/remove-use-container.js.map +1 -0
  200. package/dist/transforms/v1/remove-width-zerofill.d.ts +4 -0
  201. package/dist/transforms/v1/remove-width-zerofill.js +29 -0
  202. package/dist/transforms/v1/remove-width-zerofill.js.map +1 -0
  203. package/dist/transforms/v1/rename-connection-to-datasource.d.ts +4 -0
  204. package/dist/transforms/v1/rename-connection-to-datasource.js +111 -0
  205. package/dist/transforms/v1/rename-connection-to-datasource.js.map +1 -0
  206. package/dist/transforms/v1/rename-exist-to-exists.d.ts +4 -0
  207. package/dist/transforms/v1/rename-exist-to-exists.js +25 -0
  208. package/dist/transforms/v1/rename-exist-to-exists.js.map +1 -0
  209. package/dist/transforms/v1/rename-find-by-ids.d.ts +4 -0
  210. package/dist/transforms/v1/rename-find-by-ids.js +64 -0
  211. package/dist/transforms/v1/rename-find-by-ids.js.map +1 -0
  212. package/dist/transforms/v1/rename-get-all-migrations.d.ts +5 -0
  213. package/dist/transforms/v1/rename-get-all-migrations.js +32 -0
  214. package/dist/transforms/v1/rename-get-all-migrations.js.map +1 -0
  215. package/dist/transforms/v1/rename-loaded-tables-views.d.ts +5 -0
  216. package/dist/transforms/v1/rename-loaded-tables-views.js +48 -0
  217. package/dist/transforms/v1/rename-loaded-tables-views.js.map +1 -0
  218. package/dist/transforms/v1/rename-or-update-overload.d.ts +4 -0
  219. package/dist/transforms/v1/rename-or-update-overload.js +46 -0
  220. package/dist/transforms/v1/rename-or-update-overload.js.map +1 -0
  221. package/dist/transforms/v1/rename-print-sql-to-log-query.d.ts +4 -0
  222. package/dist/transforms/v1/rename-print-sql-to-log-query.js +25 -0
  223. package/dist/transforms/v1/rename-print-sql-to-log-query.js.map +1 -0
  224. package/dist/transforms/v1/replace-global-functions.d.ts +5 -0
  225. package/dist/transforms/v1/replace-global-functions.js +92 -0
  226. package/dist/transforms/v1/replace-global-functions.js.map +1 -0
  227. package/dist/transforms/v1/replace-lock-modes.d.ts +4 -0
  228. package/dist/transforms/v1/replace-lock-modes.js +75 -0
  229. package/dist/transforms/v1/replace-lock-modes.js.map +1 -0
  230. package/dist/transforms/v1/replace-mongodb-stats.d.ts +5 -0
  231. package/dist/transforms/v1/replace-mongodb-stats.js +54 -0
  232. package/dist/transforms/v1/replace-mongodb-stats.js.map +1 -0
  233. package/dist/transforms/v1/replace-mongodb-types.d.ts +4 -0
  234. package/dist/transforms/v1/replace-mongodb-types.js +72 -0
  235. package/dist/transforms/v1/replace-mongodb-types.js.map +1 -0
  236. package/dist/transforms/v1/replace-mssql-domain.d.ts +5 -0
  237. package/dist/transforms/v1/replace-mssql-domain.js +25 -0
  238. package/dist/transforms/v1/replace-mssql-domain.js.map +1 -0
  239. package/dist/transforms/v1/replace-on-conflict.d.ts +5 -0
  240. package/dist/transforms/v1/replace-on-conflict.js +49 -0
  241. package/dist/transforms/v1/replace-on-conflict.js.map +1 -0
  242. package/dist/transforms/v1/replace-readonly-column.d.ts +4 -0
  243. package/dist/transforms/v1/replace-readonly-column.js +28 -0
  244. package/dist/transforms/v1/replace-readonly-column.js.map +1 -0
  245. package/dist/transforms/v1/replace-set-native-parameters.d.ts +4 -0
  246. package/dist/transforms/v1/replace-set-native-parameters.js +25 -0
  247. package/dist/transforms/v1/replace-set-native-parameters.js.map +1 -0
  248. package/dist/transforms/v1/replace-sqlite-options.d.ts +4 -0
  249. package/dist/transforms/v1/replace-sqlite-options.js +29 -0
  250. package/dist/transforms/v1/replace-sqlite-options.js.map +1 -0
  251. package/dist/transforms/v1/replace-sqlite-type.d.ts +4 -0
  252. package/dist/transforms/v1/replace-sqlite-type.js +22 -0
  253. package/dist/transforms/v1/replace-sqlite-type.js.map +1 -0
  254. package/dist/transforms/v1/replace-where-expression-type.d.ts +4 -0
  255. package/dist/transforms/v1/replace-where-expression-type.js +41 -0
  256. package/dist/transforms/v1/replace-where-expression-type.js.map +1 -0
  257. package/dist/transforms/v1/repository-abstract.d.ts +7 -0
  258. package/dist/transforms/v1/repository-abstract.js +83 -0
  259. package/dist/transforms/v1/repository-abstract.js.map +1 -0
  260. package/dist/transforms/v1/repository-exist.d.ts +6 -0
  261. package/dist/transforms/v1/repository-exist.js +20 -0
  262. package/dist/transforms/v1/repository-exist.js.map +1 -0
  263. package/dist/transforms/v1/repository-find-by-ids.d.ts +6 -0
  264. package/dist/transforms/v1/repository-find-by-ids.js +74 -0
  265. package/dist/transforms/v1/repository-find-by-ids.js.map +1 -0
  266. package/dist/transforms/v1/repository-find-one-by-id.d.ts +6 -0
  267. package/dist/transforms/v1/repository-find-one-by-id.js +55 -0
  268. package/dist/transforms/v1/repository-find-one-by-id.js.map +1 -0
  269. package/dist/transforms/v1/upgrade-dependencies.d.ts +15 -0
  270. package/dist/transforms/v1/upgrade-dependencies.js +163 -0
  271. package/dist/transforms/v1/upgrade-dependencies.js.map +1 -0
  272. package/dist/transforms/v1/use-container.d.ts +7 -0
  273. package/dist/transforms/v1/use-container.js +54 -0
  274. package/dist/transforms/v1/use-container.js.map +1 -0
  275. package/package.json +50 -0
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceSqliteOptions = exports.description = void 0;
4
+ exports.description = "rename `busyTimeout` to `timeout` and remove `flags` in SQLite config";
5
+ const replaceSqliteOptions = (file, api) => {
6
+ const j = api.jscodeshift;
7
+ const root = j(file.source);
8
+ let hasChanges = false;
9
+ // Rename busyTimeout → timeout
10
+ root.find(j.ObjectProperty, {
11
+ key: { type: "Identifier", name: "busyTimeout" },
12
+ }).forEach((path) => {
13
+ if (path.node.key.type === "Identifier") {
14
+ path.node.key.name = "timeout";
15
+ hasChanges = true;
16
+ }
17
+ });
18
+ // Remove flags
19
+ root.find(j.ObjectProperty, {
20
+ key: { type: "Identifier", name: "flags" },
21
+ }).forEach((path) => {
22
+ j(path).remove();
23
+ hasChanges = true;
24
+ });
25
+ return hasChanges ? root.toSource() : undefined;
26
+ };
27
+ exports.replaceSqliteOptions = replaceSqliteOptions;
28
+ exports.default = exports.replaceSqliteOptions;
29
+ //# sourceMappingURL=replace-sqlite-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-sqlite-options.js","sourceRoot":"","sources":["../../../src/transforms/v1/replace-sqlite-options.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GACpB,uEAAuE,CAAA;AAEpE,MAAM,oBAAoB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC7D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,+BAA+B;IAC/B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE;KACnD,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,SAAS,CAAA;YAC9B,UAAU,GAAG,IAAI,CAAA;QACrB,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,eAAe;IACf,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;KAC7C,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAA;QAChB,UAAU,GAAG,IAAI,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAxBY,QAAA,oBAAoB,wBAwBhC;AAED,kBAAe,4BAAoB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { API, FileInfo } from "jscodeshift";
2
+ export declare const description = "replace `sqlite` driver with `better-sqlite3`";
3
+ export declare const replaceSqliteType: (file: FileInfo, api: API) => string | undefined;
4
+ export default replaceSqliteType;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceSqliteType = exports.description = void 0;
4
+ const ast_helpers_1 = require("../ast-helpers");
5
+ exports.description = "replace `sqlite` driver with `better-sqlite3`";
6
+ const replaceSqliteType = (file, api) => {
7
+ const j = api.jscodeshift;
8
+ const root = j(file.source);
9
+ let hasChanges = false;
10
+ // TSX parser uses ObjectProperty (not Property) and StringLiteral
11
+ root.find(j.ObjectProperty, {
12
+ key: { type: "Identifier", name: "type" },
13
+ value: { type: "StringLiteral", value: "sqlite" },
14
+ }).forEach((path) => {
15
+ (0, ast_helpers_1.setStringValue)(path.node.value, "better-sqlite3");
16
+ hasChanges = true;
17
+ });
18
+ return hasChanges ? root.toSource() : undefined;
19
+ };
20
+ exports.replaceSqliteType = replaceSqliteType;
21
+ exports.default = exports.replaceSqliteType;
22
+ //# sourceMappingURL=replace-sqlite-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-sqlite-type.js","sourceRoot":"","sources":["../../../src/transforms/v1/replace-sqlite-type.ts"],"names":[],"mappings":";;;AACA,gDAA+C;AAElC,QAAA,WAAW,GAAG,+CAA+C,CAAA;AAEnE,MAAM,iBAAiB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC1D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,kEAAkE;IAClE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE;QACzC,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE;KACpD,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,4BAAc,EAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAA;QACjD,UAAU,GAAG,IAAI,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAfY,QAAA,iBAAiB,qBAe7B;AAED,kBAAe,yBAAiB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { API, FileInfo } from "jscodeshift";
2
+ export declare const description = "rename `WhereExpression` to `WhereExpressionBuilder`";
3
+ export declare const replaceWhereExpressionType: (file: FileInfo, api: API) => string | undefined;
4
+ export default replaceWhereExpressionType;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceWhereExpressionType = exports.description = void 0;
4
+ exports.description = "rename `WhereExpression` to `WhereExpressionBuilder`";
5
+ const replaceWhereExpressionType = (file, api) => {
6
+ const j = api.jscodeshift;
7
+ const root = j(file.source);
8
+ let hasChanges = false;
9
+ // Rename in imports
10
+ root.find(j.ImportSpecifier, {
11
+ imported: { name: "WhereExpression" },
12
+ }).forEach((path) => {
13
+ path.node.imported.name = "WhereExpressionBuilder";
14
+ if (path.node.local?.type === "Identifier" &&
15
+ path.node.local?.name === "WhereExpression") {
16
+ path.node.local.name = "WhereExpressionBuilder";
17
+ }
18
+ hasChanges = true;
19
+ });
20
+ // Rename in type references
21
+ root.find(j.TSTypeReference, {
22
+ typeName: { name: "WhereExpression" },
23
+ }).forEach((path) => {
24
+ if (path.node.typeName.type === "Identifier") {
25
+ path.node.typeName.name = "WhereExpressionBuilder";
26
+ hasChanges = true;
27
+ }
28
+ });
29
+ // Rename in identifiers (variable types, parameters, etc.)
30
+ root.find(j.Identifier, { name: "WhereExpression" }).forEach((path) => {
31
+ if (path.parent.node.type !== "ImportSpecifier" &&
32
+ path.parent.node.type !== "TSTypeReference") {
33
+ path.node.name = "WhereExpressionBuilder";
34
+ hasChanges = true;
35
+ }
36
+ });
37
+ return hasChanges ? root.toSource() : undefined;
38
+ };
39
+ exports.replaceWhereExpressionType = replaceWhereExpressionType;
40
+ exports.default = exports.replaceWhereExpressionType;
41
+ //# sourceMappingURL=replace-where-expression-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-where-expression-type.js","sourceRoot":"","sources":["../../../src/transforms/v1/replace-where-expression-type.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GACpB,sDAAsD,CAAA;AAEnD,MAAM,0BAA0B,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IACnE,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,oBAAoB;IACpB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE;QACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;KACxC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,wBAAwB,CAAA;QAClD,IACI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,YAAY;YACtC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,KAAK,iBAAiB,EAC7C,CAAC;YACC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,wBAAwB,CAAA;QACnD,CAAC;QACD,UAAU,GAAG,IAAI,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,4BAA4B;IAC5B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE;QACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;KACxC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,wBAAwB,CAAA;YAClD,UAAU,GAAG,IAAI,CAAA;QACrB,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,2DAA2D;IAC3D,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAClE,IACI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,iBAAiB;YAC3C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,iBAAiB,EAC7C,CAAC;YACC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;YACzC,UAAU,GAAG,IAAI,CAAA;QACrB,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAzCY,QAAA,0BAA0B,8BAyCtC;AAED,kBAAe,kCAA0B,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { API, FileInfo } from "jscodeshift";
2
+ export declare const name: string;
3
+ export declare const description = "flag removed `@EntityRepository` and `AbstractRepository` for manual migration";
4
+ export declare const manual = true;
5
+ export declare const repositoryAbstract: (file: FileInfo, api: API) => string | undefined;
6
+ export declare const fn: (file: FileInfo, api: API) => string | undefined;
7
+ export default fn;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fn = exports.repositoryAbstract = exports.manual = exports.description = exports.name = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const ast_helpers_1 = require("../ast-helpers");
9
+ const todo_1 = require("../todo");
10
+ const stats_1 = require("../stats");
11
+ exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
12
+ exports.description = "flag removed `@EntityRepository` and `AbstractRepository` for manual migration";
13
+ exports.manual = true;
14
+ const repositoryAbstract = (file, api) => {
15
+ const j = api.jscodeshift;
16
+ const root = j(file.source);
17
+ let hasChanges = false;
18
+ let hasTodos = false;
19
+ // Find @EntityRepository decorators and add TODO
20
+ root.find(j.Decorator, {
21
+ expression: {
22
+ type: "CallExpression",
23
+ callee: { type: "Identifier", name: "EntityRepository" },
24
+ },
25
+ }).forEach((path) => {
26
+ (0, todo_1.addTodoComment)(path.node, "`@EntityRepository` was removed — use a custom service class with `dataSource.getRepository()`", j);
27
+ hasChanges = true;
28
+ hasTodos = true;
29
+ });
30
+ // Find classes extending AbstractRepository and add TODO
31
+ root.find(j.ClassDeclaration).forEach((path) => {
32
+ const superClass = path.node.superClass;
33
+ if (!superClass)
34
+ return;
35
+ let name = null;
36
+ if (superClass.type === "Identifier") {
37
+ name = superClass.name;
38
+ }
39
+ else if (superClass.type === "MemberExpression" &&
40
+ superClass.property.type === "Identifier") {
41
+ name = superClass.property.name;
42
+ }
43
+ if (name !== "AbstractRepository")
44
+ return;
45
+ (0, todo_1.addTodoComment)(path.node, "`AbstractRepository` was removed — use a custom service class with `dataSource.getRepository()`", j);
46
+ hasChanges = true;
47
+ hasTodos = true;
48
+ });
49
+ // Find getCustomRepository() calls and add TODO
50
+ const addGetCustomRepoTodo = (path) => {
51
+ const message = "`getCustomRepository()` was removed — use a custom service class with `dataSource.getRepository()`";
52
+ const parentNode = path.parent.node;
53
+ if (parentNode.type === "ExpressionStatement") {
54
+ (0, todo_1.addTodoComment)(parentNode, message, j);
55
+ }
56
+ else {
57
+ (0, todo_1.addTodoComment)(path.node, message, j);
58
+ }
59
+ hasChanges = true;
60
+ hasTodos = true;
61
+ };
62
+ root.find(j.CallExpression, {
63
+ callee: {
64
+ type: "MemberExpression",
65
+ property: { type: "Identifier", name: "getCustomRepository" },
66
+ },
67
+ }).forEach(addGetCustomRepoTodo);
68
+ // Also find standalone getCustomRepository() calls
69
+ root.find(j.CallExpression, {
70
+ callee: { type: "Identifier", name: "getCustomRepository" },
71
+ }).forEach(addGetCustomRepoTodo);
72
+ // Remove imports
73
+ if ((0, ast_helpers_1.removeImportSpecifiers)(root, j, "typeorm", new Set(["EntityRepository", "AbstractRepository"]))) {
74
+ hasChanges = true;
75
+ }
76
+ if (hasTodos)
77
+ stats_1.stats.count.todo(api, exports.name, file);
78
+ return hasChanges ? root.toSource() : undefined;
79
+ };
80
+ exports.repositoryAbstract = repositoryAbstract;
81
+ exports.fn = exports.repositoryAbstract;
82
+ exports.default = exports.fn;
83
+ //# sourceMappingURL=repository-abstract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-abstract.js","sourceRoot":"","sources":["../../../src/transforms/v1/repository-abstract.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAAuD;AACvD,kCAAwC;AACxC,oCAAgC;AAEnB,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GACpB,gFAAgF,CAAA;AACvE,QAAA,MAAM,GAAG,IAAI,CAAA;AAEnB,MAAM,kBAAkB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC3D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,QAAQ,GAAG,KAAK,CAAA;IAEpB,iDAAiD;IACjD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE;QACnB,UAAU,EAAE;YACR,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,EAAE;SAC3D;KACJ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB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EAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QACzC,CAAC;QACD,UAAU,GAAG,IAAI,CAAA;QACjB,QAAQ,GAAG,IAAI,CAAA;IACnB,CAAC,CAAA;IAED,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,MAAM,EAAE;YACJ,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,qBAAqB,EAAE;SAChE;KACJ,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAEhC,mDAAmD;IACnD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,qBAAqB,EAAE;KAC9D,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAEhC,iBAAiB;IACjB,IACI,IAAA,oCAAsB,EAClB,IAAI,EACJ,CAAC,EACD,SAAS,EACT,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC,CACtD,EACH,CAAC;QACC,UAAU,GAAG,IAAI,CAAA;IACrB,CAAC;IAED,IAAI,QAAQ;QAAE,aAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,YAAI,EAAE,IAAI,CAAC,CAAA;IAE/C,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAzFY,QAAA,kBAAkB,sBAyF9B;AAEY,QAAA,EAAE,GAAG,0BAAkB,CAAA;AACpC,kBAAe,UAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { API, FileInfo } from "jscodeshift";
2
+ export declare const name: string;
3
+ export declare const description = "rename `Repository.exist()` to `exists()`";
4
+ export declare const repositoryExist: (file: FileInfo, api: API) => string | undefined;
5
+ export declare const fn: (file: FileInfo, api: API) => string | undefined;
6
+ export default fn;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fn = exports.repositoryExist = exports.description = exports.name = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const ast_helpers_1 = require("../ast-helpers");
9
+ exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
10
+ exports.description = "rename `Repository.exist()` to `exists()`";
11
+ const repositoryExist = (file, api) => {
12
+ const j = api.jscodeshift;
13
+ const root = j(file.source);
14
+ const hasChanges = (0, ast_helpers_1.renameMemberMethod)(root, j, "exist", "exists");
15
+ return hasChanges ? root.toSource() : undefined;
16
+ };
17
+ exports.repositoryExist = repositoryExist;
18
+ exports.fn = exports.repositoryExist;
19
+ exports.default = exports.fn;
20
+ //# sourceMappingURL=repository-exist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-exist.js","sourceRoot":"","sources":["../../../src/transforms/v1/repository-exist.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAAmD;AAEtC,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GAAG,2CAA2C,CAAA;AAE/D,MAAM,eAAe,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IACxD,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAE3B,MAAM,UAAU,GAAG,IAAA,gCAAkB,EAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;IAEjE,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAPY,QAAA,eAAe,mBAO3B;AAEY,QAAA,EAAE,GAAG,uBAAe,CAAA;AACjC,kBAAe,UAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { API, FileInfo } from "jscodeshift";
2
+ export declare const name: string;
3
+ export declare const description = "replace `findByIds()` with `findBy()` and `In` operator";
4
+ export declare const repositoryFindByIds: (file: FileInfo, api: API) => string | undefined;
5
+ export declare const fn: (file: FileInfo, api: API) => string | undefined;
6
+ export default fn;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fn = exports.repositoryFindByIds = exports.description = exports.name = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const ast_helpers_1 = require("../ast-helpers");
9
+ exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
10
+ exports.description = "replace `findByIds()` with `findBy()` and `In` operator";
11
+ const repositoryFindByIds = (file, api) => {
12
+ const j = api.jscodeshift;
13
+ const root = j(file.source);
14
+ let hasChanges = false;
15
+ let needsInImport = false;
16
+ if (!(0, ast_helpers_1.fileImportsFrom)(root, j, "typeorm")) {
17
+ return undefined;
18
+ }
19
+ root.find(j.CallExpression, {
20
+ callee: {
21
+ type: "MemberExpression",
22
+ property: { name: "findByIds" },
23
+ },
24
+ }).forEach((path) => {
25
+ if (path.node.callee.type !== "MemberExpression" ||
26
+ path.node.arguments.length !== 1) {
27
+ return;
28
+ }
29
+ const idsArg = path.node.arguments[0];
30
+ // Replace .findByIds(ids) with .findBy({ id: In(ids) })
31
+ path.node.callee.property = j.identifier("findBy");
32
+ path.node.arguments = [
33
+ j.objectExpression([
34
+ j.property("init", j.identifier("id"), j.callExpression(j.identifier("In"), [idsArg])),
35
+ ]),
36
+ ];
37
+ hasChanges = true;
38
+ needsInImport = true;
39
+ });
40
+ // Add In import if needed
41
+ if (needsInImport) {
42
+ const typeormImports = root.find(j.ImportDeclaration, {
43
+ source: { value: "typeorm" },
44
+ });
45
+ let hasInImport = false;
46
+ typeormImports.forEach((path) => {
47
+ path.node.specifiers?.forEach((spec) => {
48
+ if (spec.type === "ImportSpecifier" &&
49
+ spec.imported.type === "Identifier" &&
50
+ spec.imported.name === "In") {
51
+ hasInImport = true;
52
+ }
53
+ });
54
+ });
55
+ if (!hasInImport) {
56
+ if (typeormImports.length > 0) {
57
+ // Add to existing typeorm import
58
+ typeormImports.at(0).forEach((path) => {
59
+ path.node.specifiers?.push(j.importSpecifier(j.identifier("In")));
60
+ });
61
+ }
62
+ else {
63
+ // Create new import
64
+ const newImport = j.importDeclaration([j.importSpecifier(j.identifier("In"))], j.literal("typeorm"));
65
+ root.find(j.ImportDeclaration).at(-1).insertAfter(newImport);
66
+ }
67
+ }
68
+ }
69
+ return hasChanges ? root.toSource() : undefined;
70
+ };
71
+ exports.repositoryFindByIds = repositoryFindByIds;
72
+ exports.fn = exports.repositoryFindByIds;
73
+ exports.default = exports.fn;
74
+ //# sourceMappingURL=repository-find-by-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-find-by-ids.js","sourceRoot":"","sources":["../../../src/transforms/v1/repository-find-by-ids.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAAgD;AAEnC,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GACpB,yDAAyD,CAAA;AAEtD,MAAM,mBAAmB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC5D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAA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,CAAC;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAhFY,QAAA,mBAAmB,uBAgF/B;AAEY,QAAA,EAAE,GAAG,2BAAmB,CAAA;AACrC,kBAAe,UAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { API, FileInfo } from "jscodeshift";
2
+ export declare const name: string;
3
+ export declare const description = "replace `findOneById()` with `findOneBy()` using `{ id: value }`";
4
+ export declare const repositoryFindOneById: (file: FileInfo, api: API) => string | undefined;
5
+ export declare const fn: (file: FileInfo, api: API) => string | undefined;
6
+ export default fn;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fn = exports.repositoryFindOneById = exports.description = exports.name = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
9
+ exports.description = "replace `findOneById()` with `findOneBy()` using `{ id: value }`";
10
+ const repositoryFindOneById = (file, api) => {
11
+ const j = api.jscodeshift;
12
+ const root = j(file.source);
13
+ let hasChanges = false;
14
+ root.find(j.CallExpression, {
15
+ callee: {
16
+ type: "MemberExpression",
17
+ property: { name: "findOneById" },
18
+ },
19
+ }).forEach((path) => {
20
+ if (path.node.callee.type !== "MemberExpression" ||
21
+ path.node.arguments.length < 1) {
22
+ return;
23
+ }
24
+ const args = path.node.arguments;
25
+ // Two forms:
26
+ // manager.findOneById(Entity, id) — 2 args
27
+ // repository.findOneById(id) — 1 arg
28
+ path.node.callee.property = j.identifier("findOneBy");
29
+ if (args.length >= 2) {
30
+ // manager.findOneById(Entity, id) → manager.findOneBy(Entity, { id: id })
31
+ const idArg = args[1];
32
+ path.node.arguments = [
33
+ args[0],
34
+ j.objectExpression([
35
+ j.property("init", j.identifier("id"), idArg),
36
+ ]),
37
+ ];
38
+ }
39
+ else {
40
+ // repository.findOneById(id) → repository.findOneBy({ id: id })
41
+ const idArg = args[0];
42
+ path.node.arguments = [
43
+ j.objectExpression([
44
+ j.property("init", j.identifier("id"), idArg),
45
+ ]),
46
+ ];
47
+ }
48
+ hasChanges = true;
49
+ });
50
+ return hasChanges ? root.toSource() : undefined;
51
+ };
52
+ exports.repositoryFindOneById = repositoryFindOneById;
53
+ exports.fn = exports.repositoryFindOneById;
54
+ exports.default = exports.fn;
55
+ //# sourceMappingURL=repository-find-one-by-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-find-one-by-id.js","sourceRoot":"","sources":["../../../src/transforms/v1/repository-find-one-by-id.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAGf,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GACpB,kEAAkE,CAAA;AAE/D,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC9D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,MAAM,EAAE;YACJ,IAAI,EAAE,kBAAkB;YACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;SACpC;KACJ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IACI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,kBAAkB;YAC5C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAChC,CAA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
+ /**
8
+ * Upgrades dependencies in a single package.json file for TypeORM v1.
9
+ */
10
+ export declare const upgradeDependencies: (filePath: string, dry: boolean) => DependencyReport;
11
+ /**
12
+ * Finds all package.json files in the given paths (non-recursive for
13
+ * the given directories, but checks common monorepo patterns).
14
+ */
15
+ export declare const findPackageJsonFiles: (paths: string[]) => string[];
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.findPackageJsonFiles = exports.upgradeDependencies = void 0;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
+ const semver_1 = __importDefault(require("semver"));
10
+ /** Packages to replace (old → new package name + version). */
11
+ const replacements = {
12
+ sqlite3: { replacement: "better-sqlite3", version: "^12.8.0" },
13
+ mysql: { replacement: "mysql2", version: "^3.20.0" },
14
+ };
15
+ /** TypeORM v1 target version. */
16
+ const TYPEORM_VERSION = "^1.0.0-beta.1";
17
+ /** Minimum supported versions from TypeORM v1 peerDependencies. */
18
+ const minimumVersions = {
19
+ typeorm: TYPEORM_VERSION,
20
+ mongodb: "^7.0.0",
21
+ mysql2: "^3.15.3",
22
+ mssql: "^12.0.0",
23
+ "better-sqlite3": "^12.0.0",
24
+ "@google-cloud/spanner": "^8.0.0",
25
+ redis: "^5.0.0",
26
+ ioredis: "^5.0.4",
27
+ "typeorm-aurora-data-api-driver": "^3.0.0",
28
+ };
29
+ /** Packages that are incompatible with TypeORM v1 (hard errors). */
30
+ const incompatiblePackages = {
31
+ "typeorm-typedi-extensions": "`typeorm-typedi-extensions` is incompatible with TypeORM v1 — the IoC container system (`useContainer`) was removed. See migration guide.",
32
+ "typeorm-routing-controllers-extensions": "`typeorm-routing-controllers-extensions` is incompatible with TypeORM v1 — the IoC container system (`useContainer`) was removed. See migration guide.",
33
+ };
34
+ /** Minimum required Node.js version for TypeORM v1. */
35
+ const MIN_NODE_VERSION = "20.0.0";
36
+ /**
37
+ * Upgrades dependencies in a single package.json file for TypeORM v1.
38
+ */
39
+ const upgradeDependencies = (filePath, dry) => {
40
+ const report = {
41
+ file: filePath,
42
+ changes: [],
43
+ warnings: [],
44
+ errors: [],
45
+ };
46
+ const raw = node_fs_1.default.readFileSync(filePath, "utf8");
47
+ const pkg = JSON.parse(raw);
48
+ let modified = false;
49
+ const depSections = [
50
+ "dependencies",
51
+ "devDependencies",
52
+ "peerDependencies",
53
+ "optionalDependencies",
54
+ ];
55
+ // Replace deprecated packages
56
+ for (const [oldPkg, { replacement, version }] of Object.entries(replacements)) {
57
+ for (const section of depSections) {
58
+ if (pkg[section]?.[oldPkg]) {
59
+ delete pkg[section][oldPkg];
60
+ if (!pkg[section][replacement]) {
61
+ pkg[section][replacement] = version;
62
+ report.changes.push(`${section}: replaced \`${oldPkg}\` with \`${replacement}@${version}\``);
63
+ }
64
+ else {
65
+ report.changes.push(`${section}: removed \`${oldPkg}\` (${replacement} already present)`);
66
+ }
67
+ modified = true;
68
+ }
69
+ }
70
+ }
71
+ // Bump versions below minimum
72
+ for (const [pkgName, minRange] of Object.entries(minimumVersions)) {
73
+ for (const section of depSections) {
74
+ const current = pkg[section]?.[pkgName];
75
+ if (!current)
76
+ continue;
77
+ const currentMin = semver_1.default.minVersion(current);
78
+ const requiredMin = semver_1.default.minVersion(minRange);
79
+ if (currentMin &&
80
+ requiredMin &&
81
+ semver_1.default.lt(currentMin, requiredMin)) {
82
+ pkg[section][pkgName] = minRange;
83
+ report.changes.push(`${section}: bumped \`${pkgName}\` from \`${current}\` to \`${minRange}\``);
84
+ modified = true;
85
+ }
86
+ }
87
+ }
88
+ // Check for incompatible packages (hard errors)
89
+ for (const [pkgName, message] of Object.entries(incompatiblePackages)) {
90
+ for (const section of depSections) {
91
+ if (pkg[section]?.[pkgName]) {
92
+ report.errors.push(message);
93
+ break;
94
+ }
95
+ }
96
+ }
97
+ // Check Node.js engine requirement
98
+ const engines = pkg.engines?.node;
99
+ if (engines) {
100
+ const currentMin = semver_1.default.minVersion(engines);
101
+ if (currentMin && semver_1.default.lt(currentMin, MIN_NODE_VERSION)) {
102
+ report.warnings.push(`\`engines.node\` is \`${engines}\` — TypeORM v1 requires Node.js ${MIN_NODE_VERSION}+. Update your engines field.`);
103
+ }
104
+ }
105
+ // Check for dotenv (soft warning)
106
+ for (const section of depSections) {
107
+ if (pkg[section]?.dotenv) {
108
+ report.warnings.push(`\`dotenv\` detected — TypeORM v1 no longer auto-loads \`.env\` files. Make sure your app loads environment variables itself (e.g. via \`dotenv/config\` import).`);
109
+ break;
110
+ }
111
+ }
112
+ if (modified && !dry) {
113
+ // Preserve original formatting (detect indent)
114
+ const indent = detectIndent(raw);
115
+ node_fs_1.default.writeFileSync(filePath, JSON.stringify(pkg, null, indent) + "\n", "utf8");
116
+ }
117
+ return report;
118
+ };
119
+ exports.upgradeDependencies = upgradeDependencies;
120
+ /**
121
+ * Finds all package.json files in the given paths (non-recursive for
122
+ * the given directories, but checks common monorepo patterns).
123
+ */
124
+ const findPackageJsonFiles = (paths) => {
125
+ const results = [];
126
+ for (const p of paths) {
127
+ const stat = node_fs_1.default.statSync(p, { throwIfNoEntry: false });
128
+ if (!stat)
129
+ continue;
130
+ if (stat.isFile() && node_path_1.default.basename(p) === "package.json") {
131
+ results.push(p);
132
+ continue;
133
+ }
134
+ if (stat.isDirectory()) {
135
+ // Check root package.json
136
+ const rootPkg = node_path_1.default.join(p, "package.json");
137
+ if (node_fs_1.default.existsSync(rootPkg))
138
+ results.push(rootPkg);
139
+ // Check packages/*/package.json (monorepo)
140
+ const packagesDir = node_path_1.default.join(p, "packages");
141
+ if (node_fs_1.default.existsSync(packagesDir) &&
142
+ node_fs_1.default.statSync(packagesDir).isDirectory()) {
143
+ for (const entry of node_fs_1.default.readdirSync(packagesDir, {
144
+ withFileTypes: true,
145
+ })) {
146
+ if (!entry.isDirectory())
147
+ continue;
148
+ const pkgFile = node_path_1.default.join(packagesDir, entry.name, "package.json");
149
+ if (node_fs_1.default.existsSync(pkgFile))
150
+ results.push(pkgFile);
151
+ }
152
+ }
153
+ }
154
+ }
155
+ return [...new Set(results)];
156
+ };
157
+ exports.findPackageJsonFiles = findPackageJsonFiles;
158
+ /** Detect indentation from a JSON string. */
159
+ const detectIndent = (json) => {
160
+ const match = json.match(/^( +)"/m);
161
+ return match ? match[1].length : 2;
162
+ };
163
+ //# sourceMappingURL=upgrade-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-dependencies.js","sourceRoot":"","sources":["../../../src/transforms/v1/upgrade-dependencies.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAwB;AACxB,0DAA4B;AAC5B,oDAA2B;AAS3B,8DAA8D;AAC9D,MAAM,YAAY,GAA6D;IAC3E,OAAO,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE;IAC9D,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE;CACvD,CAAA;AAED,iCAAiC;AACjC,MAAM,eAAe,GAAG,eAAe,CAAA;AAEvC,mEAAmE;AACnE,MAAM,eAAe,GAA2B;IAC5C,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,QAAQ;IACjB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,SAAS;IAC3B,uBAAuB,EAAE,QAAQ;IACjC,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,QAAQ;IACjB,gCAAgC,EAAE,QAAQ;CAC7C,CAAA;AAED,oEAAoE;AACpE,MAAM,oBAAoB,GAA2B;IACjD,2BAA2B,EACvB,2IAA2I;IAC/I,wCAAwC,EACpC,wJAAwJ;CAC/J,CAAA;AAED,uDAAuD;AACvD,MAAM,gBAAgB,GAAG,QAAQ,CAAA;AAEjC;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAC/B,QA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,CAAC,CAAC,CAAC,CAAC,CAAA;AACtC,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { API, FileInfo } from "jscodeshift";
2
+ export declare const name: string;
3
+ export declare const description = "remove `useContainer()` and `getFromContainer()` calls";
4
+ export declare const manual = true;
5
+ export declare const useContainer: (file: FileInfo, api: API) => string | undefined;
6
+ export declare const fn: (file: FileInfo, api: API) => string | undefined;
7
+ export default fn;