@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.
- package/README.md +59 -0
- package/dist/cli/colors.d.ts +7 -0
- package/dist/cli/colors.js +12 -0
- package/dist/cli/colors.js.map +1 -0
- package/dist/cli/error.d.ts +1 -0
- package/dist/cli/error.js +11 -0
- package/dist/cli/error.js.map +1 -0
- package/dist/cli/list-transforms.d.ts +1 -0
- package/dist/cli/list-transforms.js +27 -0
- package/dist/cli/list-transforms.js.map +1 -0
- package/dist/cli/parse-args.d.ts +10 -0
- package/dist/cli/parse-args.js +52 -0
- package/dist/cli/parse-args.js.map +1 -0
- package/dist/cli/print-guide.d.ts +1 -0
- package/dist/cli/print-guide.js +15 -0
- package/dist/cli/print-guide.js.map +1 -0
- package/dist/cli/print-summary.d.ts +17 -0
- package/dist/cli/print-summary.js +70 -0
- package/dist/cli/print-summary.js.map +1 -0
- package/dist/cli/print-todos.d.ts +1 -0
- package/dist/cli/print-todos.js +13 -0
- package/dist/cli/print-todos.js.map +1 -0
- package/dist/cli/print-usage.d.ts +1 -0
- package/dist/cli/print-usage.js +31 -0
- package/dist/cli/print-usage.js.map +1 -0
- package/dist/cli/run-dependencies.d.ts +6 -0
- package/dist/cli/run-dependencies.js +45 -0
- package/dist/cli/run-dependencies.js.map +1 -0
- package/dist/cli/run-transforms.d.ts +21 -0
- package/dist/cli/run-transforms.js +119 -0
- package/dist/cli/run-transforms.js.map +1 -0
- package/dist/cli/run.d.ts +9 -0
- package/dist/cli/run.js +30 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/dependencies/config.d.ts +24 -0
- package/dist/dependencies/config.js +3 -0
- package/dist/dependencies/config.js.map +1 -0
- package/dist/dependencies/find-package-json.d.ts +5 -0
- package/dist/dependencies/find-package-json.js +34 -0
- package/dist/dependencies/find-package-json.js.map +1 -0
- package/dist/dependencies/index.d.ts +5 -0
- package/dist/dependencies/index.js +14 -0
- package/dist/dependencies/index.js.map +1 -0
- package/dist/dependencies/upgrade.d.ts +11 -0
- package/dist/dependencies/upgrade.js +128 -0
- package/dist/dependencies/upgrade.js.map +1 -0
- package/dist/dependencies/v1.d.ts +2 -0
- package/dist/dependencies/v1.js +32 -0
- package/dist/dependencies/v1.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/colors.d.ts +9 -0
- package/dist/lib/colors.js +14 -0
- package/dist/lib/colors.js.map +1 -0
- package/dist/lib/error.d.ts +1 -0
- package/dist/lib/error.js +11 -0
- package/dist/lib/error.js.map +1 -0
- package/dist/lib/format-time.d.ts +1 -0
- package/dist/lib/format-time.js +12 -0
- package/dist/lib/format-time.js.map +1 -0
- package/dist/lib/highlight.d.ts +1 -0
- package/dist/lib/highlight.js +7 -0
- package/dist/lib/highlight.js.map +1 -0
- package/dist/lib/spinner.d.ts +5 -0
- package/dist/lib/spinner.js +39 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/transforms/ast-helpers.d.ts +50 -0
- package/dist/transforms/ast-helpers.js +153 -0
- package/dist/transforms/ast-helpers.js.map +1 -0
- package/dist/transforms/index.d.ts +7 -0
- package/dist/transforms/index.js +41 -0
- package/dist/transforms/index.js.map +1 -0
- package/dist/transforms/resolve.d.ts +1 -0
- package/dist/transforms/resolve.js +28 -0
- package/dist/transforms/resolve.js.map +1 -0
- package/dist/transforms/scan.d.ts +4 -0
- package/dist/transforms/scan.js +33 -0
- package/dist/transforms/scan.js.map +1 -0
- package/dist/transforms/stats.d.ts +11 -0
- package/dist/transforms/stats.js +42 -0
- package/dist/transforms/stats.js.map +1 -0
- package/dist/transforms/todo.d.ts +2 -0
- package/dist/transforms/todo.js +10 -0
- package/dist/transforms/todo.js.map +1 -0
- package/dist/transforms/transformer.d.ts +8 -0
- package/dist/transforms/transformer.js +19 -0
- package/dist/transforms/transformer.js.map +1 -0
- package/dist/transforms/v1/column-readonly.d.ts +6 -0
- package/dist/transforms/v1/column-readonly.js +37 -0
- package/dist/transforms/v1/column-readonly.js.map +1 -0
- package/dist/transforms/v1/column-unsigned-numeric.d.ts +6 -0
- package/dist/transforms/v1/column-unsigned-numeric.js +65 -0
- package/dist/transforms/v1/column-unsigned-numeric.js.map +1 -0
- package/dist/transforms/v1/column-width-zerofill.d.ts +6 -0
- package/dist/transforms/v1/column-width-zerofill.js +26 -0
- package/dist/transforms/v1/column-width-zerofill.js.map +1 -0
- package/dist/transforms/v1/connection-to-datasource.d.ts +6 -0
- package/dist/transforms/v1/connection-to-datasource.js +205 -0
- package/dist/transforms/v1/connection-to-datasource.js.map +1 -0
- package/dist/transforms/v1/datasource-mongodb.d.ts +7 -0
- package/dist/transforms/v1/datasource-mongodb.js +96 -0
- package/dist/transforms/v1/datasource-mongodb.js.map +1 -0
- package/dist/transforms/v1/datasource-mssql-domain.d.ts +7 -0
- package/dist/transforms/v1/datasource-mssql-domain.js +35 -0
- package/dist/transforms/v1/datasource-mssql-domain.js.map +1 -0
- package/dist/transforms/v1/datasource-mssql.d.ts +7 -0
- package/dist/transforms/v1/datasource-mssql.js +82 -0
- package/dist/transforms/v1/datasource-mssql.js.map +1 -0
- package/dist/transforms/v1/datasource-mysql-connector.d.ts +6 -0
- package/dist/transforms/v1/datasource-mysql-connector.js +25 -0
- package/dist/transforms/v1/datasource-mysql-connector.js.map +1 -0
- package/dist/transforms/v1/datasource-name.d.ts +6 -0
- package/dist/transforms/v1/datasource-name.js +46 -0
- package/dist/transforms/v1/datasource-name.js.map +1 -0
- package/dist/transforms/v1/datasource-sap.d.ts +6 -0
- package/dist/transforms/v1/datasource-sap.js +63 -0
- package/dist/transforms/v1/datasource-sap.js.map +1 -0
- package/dist/transforms/v1/datasource-sqlite-options.d.ts +6 -0
- package/dist/transforms/v1/datasource-sqlite-options.js +35 -0
- package/dist/transforms/v1/datasource-sqlite-options.js.map +1 -0
- package/dist/transforms/v1/datasource-sqlite-type.d.ts +6 -0
- package/dist/transforms/v1/datasource-sqlite-type.js +28 -0
- package/dist/transforms/v1/datasource-sqlite-type.js.map +1 -0
- package/dist/transforms/v1/find-options-lock-modes.d.ts +6 -0
- package/dist/transforms/v1/find-options-lock-modes.js +81 -0
- package/dist/transforms/v1/find-options-lock-modes.js.map +1 -0
- package/dist/transforms/v1/find-options-string-relations.d.ts +6 -0
- package/dist/transforms/v1/find-options-string-relations.js +69 -0
- package/dist/transforms/v1/find-options-string-relations.js.map +1 -0
- package/dist/transforms/v1/find-options-string-select.d.ts +6 -0
- package/dist/transforms/v1/find-options-string-select.js +36 -0
- package/dist/transforms/v1/find-options-string-select.js.map +1 -0
- package/dist/transforms/v1/global-functions.d.ts +7 -0
- package/dist/transforms/v1/global-functions.js +98 -0
- package/dist/transforms/v1/global-functions.js.map +1 -0
- package/dist/transforms/v1/index.d.ts +40 -0
- package/dist/transforms/v1/index.js +109 -0
- package/dist/transforms/v1/index.js.map +1 -0
- package/dist/transforms/v1/migrations-get-all.d.ts +7 -0
- package/dist/transforms/v1/migrations-get-all.js +39 -0
- package/dist/transforms/v1/migrations-get-all.js.map +1 -0
- package/dist/transforms/v1/mongodb-stats.d.ts +7 -0
- package/dist/transforms/v1/mongodb-stats.js +52 -0
- package/dist/transforms/v1/mongodb-stats.js.map +1 -0
- package/dist/transforms/v1/mongodb-types.d.ts +6 -0
- package/dist/transforms/v1/mongodb-types.js +84 -0
- package/dist/transforms/v1/mongodb-types.js.map +1 -0
- package/dist/transforms/v1/query-builder-native-parameters.d.ts +6 -0
- package/dist/transforms/v1/query-builder-native-parameters.js +20 -0
- package/dist/transforms/v1/query-builder-native-parameters.js.map +1 -0
- package/dist/transforms/v1/query-builder-on-conflict.d.ts +7 -0
- package/dist/transforms/v1/query-builder-on-conflict.js +56 -0
- package/dist/transforms/v1/query-builder-on-conflict.js.map +1 -0
- package/dist/transforms/v1/query-builder-or-update.d.ts +6 -0
- package/dist/transforms/v1/query-builder-or-update.js +56 -0
- package/dist/transforms/v1/query-builder-or-update.js.map +1 -0
- package/dist/transforms/v1/query-builder-print-sql.d.ts +7 -0
- package/dist/transforms/v1/query-builder-print-sql.js +49 -0
- package/dist/transforms/v1/query-builder-print-sql.js.map +1 -0
- package/dist/transforms/v1/query-builder-replace-property-names.d.ts +7 -0
- package/dist/transforms/v1/query-builder-replace-property-names.js +42 -0
- package/dist/transforms/v1/query-builder-replace-property-names.js.map +1 -0
- package/dist/transforms/v1/query-builder-where-expression.d.ts +6 -0
- package/dist/transforms/v1/query-builder-where-expression.js +39 -0
- package/dist/transforms/v1/query-builder-where-expression.js.map +1 -0
- package/dist/transforms/v1/query-runner-loaded-tables-views.d.ts +7 -0
- package/dist/transforms/v1/query-runner-loaded-tables-views.js +54 -0
- package/dist/transforms/v1/query-runner-loaded-tables-views.js.map +1 -0
- package/dist/transforms/v1/relation-count.d.ts +7 -0
- package/dist/transforms/v1/relation-count.js +41 -0
- package/dist/transforms/v1/relation-count.js.map +1 -0
- package/dist/transforms/v1/remove-abstract-repository.d.ts +5 -0
- package/dist/transforms/v1/remove-abstract-repository.js +93 -0
- package/dist/transforms/v1/remove-abstract-repository.js.map +1 -0
- package/dist/transforms/v1/remove-connector-package.d.ts +4 -0
- package/dist/transforms/v1/remove-connector-package.js +19 -0
- package/dist/transforms/v1/remove-connector-package.js.map +1 -0
- package/dist/transforms/v1/remove-datasource-name.d.ts +4 -0
- package/dist/transforms/v1/remove-datasource-name.js +56 -0
- package/dist/transforms/v1/remove-datasource-name.js.map +1 -0
- package/dist/transforms/v1/remove-mongodb-options.d.ts +5 -0
- package/dist/transforms/v1/remove-mongodb-options.js +86 -0
- package/dist/transforms/v1/remove-mongodb-options.js.map +1 -0
- package/dist/transforms/v1/remove-relation-count.d.ts +5 -0
- package/dist/transforms/v1/remove-relation-count.js +49 -0
- package/dist/transforms/v1/remove-relation-count.js.map +1 -0
- package/dist/transforms/v1/remove-replace-property-names.d.ts +5 -0
- package/dist/transforms/v1/remove-replace-property-names.js +35 -0
- package/dist/transforms/v1/remove-replace-property-names.js.map +1 -0
- package/dist/transforms/v1/remove-sap-options.d.ts +4 -0
- package/dist/transforms/v1/remove-sap-options.js +54 -0
- package/dist/transforms/v1/remove-sap-options.js.map +1 -0
- package/dist/transforms/v1/remove-unsigned-numeric.d.ts +4 -0
- package/dist/transforms/v1/remove-unsigned-numeric.js +76 -0
- package/dist/transforms/v1/remove-unsigned-numeric.js.map +1 -0
- package/dist/transforms/v1/remove-use-container.d.ts +5 -0
- package/dist/transforms/v1/remove-use-container.js +63 -0
- package/dist/transforms/v1/remove-use-container.js.map +1 -0
- package/dist/transforms/v1/remove-width-zerofill.d.ts +4 -0
- package/dist/transforms/v1/remove-width-zerofill.js +29 -0
- package/dist/transforms/v1/remove-width-zerofill.js.map +1 -0
- package/dist/transforms/v1/rename-connection-to-datasource.d.ts +4 -0
- package/dist/transforms/v1/rename-connection-to-datasource.js +111 -0
- package/dist/transforms/v1/rename-connection-to-datasource.js.map +1 -0
- package/dist/transforms/v1/rename-exist-to-exists.d.ts +4 -0
- package/dist/transforms/v1/rename-exist-to-exists.js +25 -0
- package/dist/transforms/v1/rename-exist-to-exists.js.map +1 -0
- package/dist/transforms/v1/rename-find-by-ids.d.ts +4 -0
- package/dist/transforms/v1/rename-find-by-ids.js +64 -0
- package/dist/transforms/v1/rename-find-by-ids.js.map +1 -0
- package/dist/transforms/v1/rename-get-all-migrations.d.ts +5 -0
- package/dist/transforms/v1/rename-get-all-migrations.js +32 -0
- package/dist/transforms/v1/rename-get-all-migrations.js.map +1 -0
- package/dist/transforms/v1/rename-loaded-tables-views.d.ts +5 -0
- package/dist/transforms/v1/rename-loaded-tables-views.js +48 -0
- package/dist/transforms/v1/rename-loaded-tables-views.js.map +1 -0
- package/dist/transforms/v1/rename-or-update-overload.d.ts +4 -0
- package/dist/transforms/v1/rename-or-update-overload.js +46 -0
- package/dist/transforms/v1/rename-or-update-overload.js.map +1 -0
- package/dist/transforms/v1/rename-print-sql-to-log-query.d.ts +4 -0
- package/dist/transforms/v1/rename-print-sql-to-log-query.js +25 -0
- package/dist/transforms/v1/rename-print-sql-to-log-query.js.map +1 -0
- package/dist/transforms/v1/replace-global-functions.d.ts +5 -0
- package/dist/transforms/v1/replace-global-functions.js +92 -0
- package/dist/transforms/v1/replace-global-functions.js.map +1 -0
- package/dist/transforms/v1/replace-lock-modes.d.ts +4 -0
- package/dist/transforms/v1/replace-lock-modes.js +75 -0
- package/dist/transforms/v1/replace-lock-modes.js.map +1 -0
- package/dist/transforms/v1/replace-mongodb-stats.d.ts +5 -0
- package/dist/transforms/v1/replace-mongodb-stats.js +54 -0
- package/dist/transforms/v1/replace-mongodb-stats.js.map +1 -0
- package/dist/transforms/v1/replace-mongodb-types.d.ts +4 -0
- package/dist/transforms/v1/replace-mongodb-types.js +72 -0
- package/dist/transforms/v1/replace-mongodb-types.js.map +1 -0
- package/dist/transforms/v1/replace-mssql-domain.d.ts +5 -0
- package/dist/transforms/v1/replace-mssql-domain.js +25 -0
- package/dist/transforms/v1/replace-mssql-domain.js.map +1 -0
- package/dist/transforms/v1/replace-on-conflict.d.ts +5 -0
- package/dist/transforms/v1/replace-on-conflict.js +49 -0
- package/dist/transforms/v1/replace-on-conflict.js.map +1 -0
- package/dist/transforms/v1/replace-readonly-column.d.ts +4 -0
- package/dist/transforms/v1/replace-readonly-column.js +28 -0
- package/dist/transforms/v1/replace-readonly-column.js.map +1 -0
- package/dist/transforms/v1/replace-set-native-parameters.d.ts +4 -0
- package/dist/transforms/v1/replace-set-native-parameters.js +25 -0
- package/dist/transforms/v1/replace-set-native-parameters.js.map +1 -0
- package/dist/transforms/v1/replace-sqlite-options.d.ts +4 -0
- package/dist/transforms/v1/replace-sqlite-options.js +29 -0
- package/dist/transforms/v1/replace-sqlite-options.js.map +1 -0
- package/dist/transforms/v1/replace-sqlite-type.d.ts +4 -0
- package/dist/transforms/v1/replace-sqlite-type.js +22 -0
- package/dist/transforms/v1/replace-sqlite-type.js.map +1 -0
- package/dist/transforms/v1/replace-where-expression-type.d.ts +4 -0
- package/dist/transforms/v1/replace-where-expression-type.js +41 -0
- package/dist/transforms/v1/replace-where-expression-type.js.map +1 -0
- package/dist/transforms/v1/repository-abstract.d.ts +7 -0
- package/dist/transforms/v1/repository-abstract.js +83 -0
- package/dist/transforms/v1/repository-abstract.js.map +1 -0
- package/dist/transforms/v1/repository-exist.d.ts +6 -0
- package/dist/transforms/v1/repository-exist.js +20 -0
- package/dist/transforms/v1/repository-exist.js.map +1 -0
- package/dist/transforms/v1/repository-find-by-ids.d.ts +6 -0
- package/dist/transforms/v1/repository-find-by-ids.js +74 -0
- package/dist/transforms/v1/repository-find-by-ids.js.map +1 -0
- package/dist/transforms/v1/repository-find-one-by-id.d.ts +6 -0
- package/dist/transforms/v1/repository-find-one-by-id.js +55 -0
- package/dist/transforms/v1/repository-find-one-by-id.js.map +1 -0
- package/dist/transforms/v1/upgrade-dependencies.d.ts +15 -0
- package/dist/transforms/v1/upgrade-dependencies.js +163 -0
- package/dist/transforms/v1/upgrade-dependencies.js.map +1 -0
- package/dist/transforms/v1/use-container.d.ts +7 -0
- package/dist/transforms/v1/use-container.js +54 -0
- package/dist/transforms/v1/use-container.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,63 @@
|
|
|
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.datasourceSap = 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 and remove deprecated SAP HANA connection options";
|
|
11
|
+
const datasourceSap = (file, api) => {
|
|
12
|
+
const j = api.jscodeshift;
|
|
13
|
+
const root = j(file.source);
|
|
14
|
+
if (!(0, ast_helpers_1.fileImportsFrom)(root, j, "typeorm"))
|
|
15
|
+
return undefined;
|
|
16
|
+
let hasChanges = false;
|
|
17
|
+
const topLevelRenames = {
|
|
18
|
+
hanaClientDriver: "driver",
|
|
19
|
+
};
|
|
20
|
+
const poolRenames = {
|
|
21
|
+
max: "maxConnectedOrPooled",
|
|
22
|
+
requestTimeout: "maxWaitTimeoutIfPoolExhausted",
|
|
23
|
+
idleTimeout: "maxPooledIdleTime",
|
|
24
|
+
};
|
|
25
|
+
const poolRemoves = new Set(["min", "maxWaitingRequests", "checkInterval"]);
|
|
26
|
+
// Rename top-level options
|
|
27
|
+
root.find(j.ObjectProperty).forEach((path) => {
|
|
28
|
+
if (path.node.key.type !== "Identifier")
|
|
29
|
+
return;
|
|
30
|
+
const name = path.node.key.name;
|
|
31
|
+
// Top-level renames
|
|
32
|
+
if (topLevelRenames[name]) {
|
|
33
|
+
path.node.key.name = topLevelRenames[name];
|
|
34
|
+
hasChanges = true;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Pool property handling — check if inside a pool object
|
|
38
|
+
if (poolRenames[name] || poolRemoves.has(name)) {
|
|
39
|
+
const parent = path.parent;
|
|
40
|
+
if (parent.node.type !== "ObjectExpression")
|
|
41
|
+
return;
|
|
42
|
+
const grandparent = parent.parent;
|
|
43
|
+
if (grandparent.node.type !== "ObjectProperty" ||
|
|
44
|
+
grandparent.node.key.type !== "Identifier" ||
|
|
45
|
+
grandparent.node.key.name !== "pool") {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (poolRemoves.has(name)) {
|
|
49
|
+
j(path).remove();
|
|
50
|
+
hasChanges = true;
|
|
51
|
+
}
|
|
52
|
+
else if (poolRenames[name]) {
|
|
53
|
+
path.node.key.name = poolRenames[name];
|
|
54
|
+
hasChanges = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return hasChanges ? root.toSource() : undefined;
|
|
59
|
+
};
|
|
60
|
+
exports.datasourceSap = datasourceSap;
|
|
61
|
+
exports.fn = exports.datasourceSap;
|
|
62
|
+
exports.default = exports.fn;
|
|
63
|
+
//# sourceMappingURL=datasource-sap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource-sap.js","sourceRoot":"","sources":["../../../src/transforms/v1/datasource-sap.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,0DAA0D,CAAA;AAEvD,MAAM,aAAa,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IACtD,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAE3B,IAAI,CAAC,IAAA,6BAAe,EAAC,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC;QAAE,OAAO,SAAS,CAAA;IAE1D,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,MAAM,eAAe,GAA2B;QAC5C,gBAAgB,EAAE,QAAQ;KAC7B,CAAA;IAED,MAAM,WAAW,GAA2B;QACxC,GAAG,EAAE,sBAAsB;QAC3B,cAAc,EAAE,+BAA+B;QAC/C,WAAW,EAAE,mBAAmB;KACnC,CAAA;IAED,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,oBAAoB,EAAE,eAAe,CAAC,CAAC,CAAA;IAE3E,2BAA2B;IAC3B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY;YAAE,O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ACnD,CAAC,CAAA;AA1DY,QAAA,aAAa,iBA0DzB;AAEY,QAAA,EAAE,GAAG,qBAAa,CAAA;AAC/B,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 `busyTimeout` to `timeout` and remove `flags` in SQLite config";
|
|
4
|
+
export declare const datasourceSqliteOptions: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export default fn;
|
|
@@ -0,0 +1,35 @@
|
|
|
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.datasourceSqliteOptions = 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 = "rename `busyTimeout` to `timeout` and remove `flags` in SQLite config";
|
|
10
|
+
const datasourceSqliteOptions = (file, api) => {
|
|
11
|
+
const j = api.jscodeshift;
|
|
12
|
+
const root = j(file.source);
|
|
13
|
+
let hasChanges = false;
|
|
14
|
+
// Rename busyTimeout → timeout
|
|
15
|
+
root.find(j.ObjectProperty, {
|
|
16
|
+
key: { type: "Identifier", name: "busyTimeout" },
|
|
17
|
+
}).forEach((path) => {
|
|
18
|
+
if (path.node.key.type === "Identifier") {
|
|
19
|
+
path.node.key.name = "timeout";
|
|
20
|
+
hasChanges = true;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
// Remove flags
|
|
24
|
+
root.find(j.ObjectProperty, {
|
|
25
|
+
key: { type: "Identifier", name: "flags" },
|
|
26
|
+
}).forEach((path) => {
|
|
27
|
+
j(path).remove();
|
|
28
|
+
hasChanges = true;
|
|
29
|
+
});
|
|
30
|
+
return hasChanges ? root.toSource() : undefined;
|
|
31
|
+
};
|
|
32
|
+
exports.datasourceSqliteOptions = datasourceSqliteOptions;
|
|
33
|
+
exports.fn = exports.datasourceSqliteOptions;
|
|
34
|
+
exports.default = exports.fn;
|
|
35
|
+
//# sourceMappingURL=datasource-sqlite-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource-sqlite-options.js","sourceRoot":"","sources":["../../../src/transforms/v1/datasource-sqlite-options.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,uEAAuE,CAAA;AAEpE,MAAM,uBAAuB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAChE,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,uBAAuB,2BAwBnC;AAEY,QAAA,EAAE,GAAG,+BAAuB,CAAA;AACzC,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 `sqlite` driver with `better-sqlite3`";
|
|
4
|
+
export declare const datasourceSqliteType: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export default fn;
|
|
@@ -0,0 +1,28 @@
|
|
|
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.datasourceSqliteType = 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 `sqlite` driver with `better-sqlite3`";
|
|
11
|
+
const datasourceSqliteType = (file, api) => {
|
|
12
|
+
const j = api.jscodeshift;
|
|
13
|
+
const root = j(file.source);
|
|
14
|
+
let hasChanges = false;
|
|
15
|
+
// TSX parser uses ObjectProperty (not Property) and StringLiteral
|
|
16
|
+
root.find(j.ObjectProperty, {
|
|
17
|
+
key: { type: "Identifier", name: "type" },
|
|
18
|
+
value: { type: "StringLiteral", value: "sqlite" },
|
|
19
|
+
}).forEach((path) => {
|
|
20
|
+
(0, ast_helpers_1.setStringValue)(path.node.value, "better-sqlite3");
|
|
21
|
+
hasChanges = true;
|
|
22
|
+
});
|
|
23
|
+
return hasChanges ? root.toSource() : undefined;
|
|
24
|
+
};
|
|
25
|
+
exports.datasourceSqliteType = datasourceSqliteType;
|
|
26
|
+
exports.fn = exports.datasourceSqliteType;
|
|
27
|
+
exports.default = exports.fn;
|
|
28
|
+
//# sourceMappingURL=datasource-sqlite-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasource-sqlite-type.js","sourceRoot":"","sources":["../../../src/transforms/v1/datasource-sqlite-type.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAA+C;AAElC,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GAAG,+CAA+C,CAAA;AAEnE,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,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,oBAAoB,wBAehC;AAEY,QAAA,EAAE,GAAG,4BAAoB,CAAA;AACtC,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 deprecated pessimistic lock modes";
|
|
4
|
+
export declare const findOptionsLockModes: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export default fn;
|
|
@@ -0,0 +1,81 @@
|
|
|
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.findOptionsLockModes = 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 deprecated pessimistic lock modes";
|
|
11
|
+
const findOptionsLockModes = (file, api) => {
|
|
12
|
+
const j = api.jscodeshift;
|
|
13
|
+
const root = j(file.source);
|
|
14
|
+
let hasChanges = false;
|
|
15
|
+
const lockModeMap = {
|
|
16
|
+
pessimistic_partial_write: {
|
|
17
|
+
mode: "pessimistic_write",
|
|
18
|
+
onLocked: "skip_locked",
|
|
19
|
+
},
|
|
20
|
+
pessimistic_write_or_fail: {
|
|
21
|
+
mode: "pessimistic_write",
|
|
22
|
+
onLocked: "nowait",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
// Handle .setLock("pessimistic_partial_write") → .setLock("pessimistic_write").setOnLocked("skip_locked")
|
|
26
|
+
root.find(j.CallExpression, {
|
|
27
|
+
callee: {
|
|
28
|
+
type: "MemberExpression",
|
|
29
|
+
property: { name: "setLock" },
|
|
30
|
+
},
|
|
31
|
+
}).forEach((path) => {
|
|
32
|
+
const arg = path.node.arguments[0];
|
|
33
|
+
if (!arg)
|
|
34
|
+
return;
|
|
35
|
+
const value = (0, ast_helpers_1.getStringValue)(arg);
|
|
36
|
+
if (!value || !lockModeMap[value])
|
|
37
|
+
return;
|
|
38
|
+
const replacement = lockModeMap[value];
|
|
39
|
+
// Change the lock mode argument
|
|
40
|
+
(0, ast_helpers_1.setStringValue)(arg, replacement.mode);
|
|
41
|
+
// Wrap in .setOnLocked() call
|
|
42
|
+
const setOnLocked = j.callExpression(j.memberExpression(path.node, j.identifier("setOnLocked")), [j.stringLiteral(replacement.onLocked)]);
|
|
43
|
+
j(path).replaceWith(setOnLocked);
|
|
44
|
+
hasChanges = true;
|
|
45
|
+
});
|
|
46
|
+
// Handle find options: { lock: { mode: "pessimistic_partial_write" } }
|
|
47
|
+
// → { lock: { mode: "pessimistic_write", onLocked: "skip_locked" } }
|
|
48
|
+
root.find(j.ObjectProperty, {
|
|
49
|
+
key: { name: "mode" },
|
|
50
|
+
}).forEach((path) => {
|
|
51
|
+
const value = (0, ast_helpers_1.getStringValue)(path.node.value);
|
|
52
|
+
if (!value || !lockModeMap[value])
|
|
53
|
+
return;
|
|
54
|
+
// Check parent is a lock options object
|
|
55
|
+
if (path.parent.node.type !== "ObjectExpression")
|
|
56
|
+
return;
|
|
57
|
+
const lockObj = path.parent.node;
|
|
58
|
+
const grandparent = path.parent.parent;
|
|
59
|
+
if (grandparent.node.type !== "Property" ||
|
|
60
|
+
grandparent.node.key.type !== "Identifier" ||
|
|
61
|
+
grandparent.node.key.name !== "lock") {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const replacement = lockModeMap[value];
|
|
65
|
+
// Update mode value
|
|
66
|
+
(0, ast_helpers_1.setStringValue)(path.node.value, replacement.mode);
|
|
67
|
+
// Add onLocked property to the lock object
|
|
68
|
+
const hasOnLocked = lockObj.properties.some((p) => p.type === "Property" &&
|
|
69
|
+
p.key.type === "Identifier" &&
|
|
70
|
+
p.key.name === "onLocked");
|
|
71
|
+
if (!hasOnLocked) {
|
|
72
|
+
lockObj.properties.push(j.property("init", j.identifier("onLocked"), j.stringLiteral(replacement.onLocked)));
|
|
73
|
+
}
|
|
74
|
+
hasChanges = true;
|
|
75
|
+
});
|
|
76
|
+
return hasChanges ? root.toSource() : undefined;
|
|
77
|
+
};
|
|
78
|
+
exports.findOptionsLockModes = findOptionsLockModes;
|
|
79
|
+
exports.fn = exports.findOptionsLockModes;
|
|
80
|
+
exports.default = exports.fn;
|
|
81
|
+
//# sourceMappingURL=find-options-lock-modes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-options-lock-modes.js","sourceRoot":"","sources":["../../../src/transforms/v1/find-options-lock-modes.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAA+D;AAElD,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,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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AM,EACN,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,EACxB,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CACxC,CACJ,CAAA;QACL,CAAC;QAED,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;AA5FY,QAAA,oBAAoB,wBA4FhC;AAEY,QAAA,EAAE,GAAG,4BAAoB,CAAA;AACtC,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 string-array `relations` with object syntax";
|
|
4
|
+
export declare const findOptionsStringRelations: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export default fn;
|
|
@@ -0,0 +1,69 @@
|
|
|
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.findOptionsStringRelations = 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 string-array `relations` with object syntax";
|
|
11
|
+
/**
|
|
12
|
+
* Convert an array of dot-path strings into a nested object structure.
|
|
13
|
+
*
|
|
14
|
+
* Example: `["profile", "posts.comments"]` becomes
|
|
15
|
+
* `{ profile: true, posts: { comments: true } }`
|
|
16
|
+
*/
|
|
17
|
+
function convertRelationsArrayToObject(values) {
|
|
18
|
+
const result = {};
|
|
19
|
+
for (const val of values) {
|
|
20
|
+
const parts = val.split(".");
|
|
21
|
+
let current = result;
|
|
22
|
+
for (let i = 0; i < parts.length; i++) {
|
|
23
|
+
const part = parts[i];
|
|
24
|
+
if (i === parts.length - 1) {
|
|
25
|
+
current[part] ??= true;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
if (current[part] === undefined || current[part] === true) {
|
|
29
|
+
current[part] = {};
|
|
30
|
+
}
|
|
31
|
+
current = current[part];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
const findOptionsStringRelations = (file, api) => {
|
|
38
|
+
const j = api.jscodeshift;
|
|
39
|
+
const root = j(file.source);
|
|
40
|
+
let hasChanges = false;
|
|
41
|
+
// Find object properties named "relations" whose value is an array of strings
|
|
42
|
+
root.find(j.ObjectProperty, {
|
|
43
|
+
key: { name: "relations" },
|
|
44
|
+
}).forEach((path) => {
|
|
45
|
+
const value = path.node.value;
|
|
46
|
+
if (value.type !== "ArrayExpression")
|
|
47
|
+
return;
|
|
48
|
+
const strings = value.elements.map((el) => el && (0, ast_helpers_1.getStringValue)(el));
|
|
49
|
+
if (strings.some((s) => s === null || s === undefined))
|
|
50
|
+
return;
|
|
51
|
+
const result = convertRelationsArrayToObject(strings);
|
|
52
|
+
path.node.value = buildObjectExpression(j, result);
|
|
53
|
+
hasChanges = true;
|
|
54
|
+
});
|
|
55
|
+
return hasChanges ? root.toSource() : undefined;
|
|
56
|
+
};
|
|
57
|
+
exports.findOptionsStringRelations = findOptionsStringRelations;
|
|
58
|
+
function buildObjectExpression(j, obj) {
|
|
59
|
+
const properties = Object.entries(obj).map(([key, value]) => {
|
|
60
|
+
if (value === true) {
|
|
61
|
+
return j.property("init", j.identifier(key), j.literal(true));
|
|
62
|
+
}
|
|
63
|
+
return j.property("init", j.identifier(key), buildObjectExpression(j, value));
|
|
64
|
+
});
|
|
65
|
+
return j.objectExpression(properties);
|
|
66
|
+
}
|
|
67
|
+
exports.fn = exports.findOptionsStringRelations;
|
|
68
|
+
exports.default = exports.fn;
|
|
69
|
+
//# sourceMappingURL=find-options-string-relations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-options-string-relations.js","sourceRoot":"","sources":["../../../src/transforms/v1/find-options-string-relations.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAA+C;AAElC,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GAAG,qDAAqD,CAAA;AAMhF;;;;;GAKG;AACH,SAAS,6BAA6B,CAAC,MAAgB;IACnD,MAAM,MAAM,GAAiB,EAAE,CAAA;IAE/B,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAC5B,IAAI,OAAO,GAAiB,MAAM,CAAA;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YACrB,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAA;YAC1B,CAAC;iBAAM,CAAC;gBACJ,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;oBACxD,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAA;gBACtB,CAAC;gBACD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;YAC3B,CAAC;QACL,CAA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AU,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACxD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QACjE,CAAC;QACD,OAAO,CAAC,CAAC,QAAQ,CACb,MAAM,EACN,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EACjB,qBAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,CAClC,CAAA;IACL,CAAC,CAAC,CAAA;IACF,OAAO,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAA;AACzC,CAAC;AAEY,QAAA,EAAE,GAAG,kCAA0B,CAAA;AAC5C,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 string-array `select` with object syntax";
|
|
4
|
+
export declare const findOptionsStringSelect: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export default fn;
|
|
@@ -0,0 +1,36 @@
|
|
|
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.findOptionsStringSelect = 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 string-array `select` with object syntax";
|
|
11
|
+
const findOptionsStringSelect = (file, api) => {
|
|
12
|
+
const j = api.jscodeshift;
|
|
13
|
+
const root = j(file.source);
|
|
14
|
+
let hasChanges = false;
|
|
15
|
+
// Find object properties named "select" whose value is an array of strings
|
|
16
|
+
root.find(j.ObjectProperty, {
|
|
17
|
+
key: { name: "select" },
|
|
18
|
+
}).forEach((path) => {
|
|
19
|
+
const value = path.node.value;
|
|
20
|
+
if (value.type !== "ArrayExpression")
|
|
21
|
+
return;
|
|
22
|
+
const elements = value.elements;
|
|
23
|
+
const strings = elements.map((el) => el && (0, ast_helpers_1.getStringValue)(el));
|
|
24
|
+
if (strings.some((s) => s === null || s === undefined))
|
|
25
|
+
return;
|
|
26
|
+
// Convert ["id", "name"] → { id: true, name: true }
|
|
27
|
+
const properties = strings.map((s) => j.property("init", j.identifier(s), j.literal(true)));
|
|
28
|
+
path.node.value = j.objectExpression(properties);
|
|
29
|
+
hasChanges = true;
|
|
30
|
+
});
|
|
31
|
+
return hasChanges ? root.toSource() : undefined;
|
|
32
|
+
};
|
|
33
|
+
exports.findOptionsStringSelect = findOptionsStringSelect;
|
|
34
|
+
exports.fn = exports.findOptionsStringSelect;
|
|
35
|
+
exports.default = exports.fn;
|
|
36
|
+
//# sourceMappingURL=find-options-string-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-options-string-select.js","sourceRoot":"","sources":["../../../src/transforms/v1/find-options-string-select.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAA+C;AAElC,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GAAG,kDAAkD,CAAA;AAEtE,MAAM,uBAAuB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAChE,MAAM,CAAC,GAAG,GAAG,CAAC,WAA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AEY,QAAA,EAAE,GAAG,+BAAuB,CAAA;AACzC,kBAAe,UAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
+
export declare const name: string;
|
|
3
|
+
export declare const description = "flag deprecated global functions for manual migration to `DataSource` methods";
|
|
4
|
+
export declare const manual = true;
|
|
5
|
+
export declare const globalFunctions: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
+
export default fn;
|
|
@@ -0,0 +1,98 @@
|
|
|
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.globalFunctions = 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 deprecated global functions for manual migration to `DataSource` methods";
|
|
13
|
+
exports.manual = true;
|
|
14
|
+
const globalFunctions = (file, api) => {
|
|
15
|
+
const j = api.jscodeshift;
|
|
16
|
+
const root = j(file.source);
|
|
17
|
+
let hasChanges = false;
|
|
18
|
+
const removedGlobals = new Set([
|
|
19
|
+
"createConnection",
|
|
20
|
+
"createConnections",
|
|
21
|
+
"getConnection",
|
|
22
|
+
"getConnectionManager",
|
|
23
|
+
"getConnectionOptions",
|
|
24
|
+
"getManager",
|
|
25
|
+
"getSqljsManager",
|
|
26
|
+
"getRepository",
|
|
27
|
+
"getTreeRepository",
|
|
28
|
+
"createQueryBuilder",
|
|
29
|
+
"getMongoManager",
|
|
30
|
+
"getMongoRepository",
|
|
31
|
+
]);
|
|
32
|
+
// Simple replacements: getX(args) → dataSource.x(args)
|
|
33
|
+
const simpleReplacements = {
|
|
34
|
+
getManager: "dataSource.manager",
|
|
35
|
+
getRepository: "dataSource.getRepository",
|
|
36
|
+
getTreeRepository: "dataSource.getTreeRepository",
|
|
37
|
+
createQueryBuilder: "dataSource.createQueryBuilder",
|
|
38
|
+
getMongoManager: "dataSource.mongoManager",
|
|
39
|
+
getMongoRepository: "dataSource.getMongoRepository",
|
|
40
|
+
};
|
|
41
|
+
// Replace function calls
|
|
42
|
+
for (const [funcName, replacement] of Object.entries(simpleReplacements)) {
|
|
43
|
+
root.find(j.CallExpression, {
|
|
44
|
+
callee: { type: "Identifier", name: funcName },
|
|
45
|
+
}).forEach((path) => {
|
|
46
|
+
const parts = replacement.split(".");
|
|
47
|
+
if (parts.length === 2 && !replacement.includes("(")) {
|
|
48
|
+
// Property access like dataSource.manager — check if it's called with no args
|
|
49
|
+
if (path.node.arguments.length === 0 &&
|
|
50
|
+
!replacement.includes("get")) {
|
|
51
|
+
// Replace with property access
|
|
52
|
+
j(path).replaceWith(j.memberExpression(j.identifier(parts[0]), j.identifier(parts[1])));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Replace with method call
|
|
56
|
+
j(path).replaceWith(j.callExpression(j.memberExpression(j.identifier(parts[0]), j.identifier(parts[1])), path.node.arguments));
|
|
57
|
+
}
|
|
58
|
+
hasChanges = true;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// getConnection() → dataSource (just a reference)
|
|
63
|
+
root.find(j.CallExpression, {
|
|
64
|
+
callee: { type: "Identifier", name: "getConnection" },
|
|
65
|
+
}).forEach((path) => {
|
|
66
|
+
if (path.node.arguments.length === 0) {
|
|
67
|
+
j(path).replaceWith(j.identifier("dataSource"));
|
|
68
|
+
hasChanges = true;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
// Remove imports of deprecated globals from "typeorm"
|
|
72
|
+
if ((0, ast_helpers_1.removeImportSpecifiers)(root, j, "typeorm", removedGlobals)) {
|
|
73
|
+
hasChanges = true;
|
|
74
|
+
}
|
|
75
|
+
// Add a TODO comment on the first dataSource usage
|
|
76
|
+
if (hasChanges) {
|
|
77
|
+
const firstUsage = root.find(j.Identifier, { name: "dataSource" });
|
|
78
|
+
if (firstUsage.length > 0) {
|
|
79
|
+
let current = firstUsage.paths()[0];
|
|
80
|
+
while (current.parent) {
|
|
81
|
+
const node = current.parent.node;
|
|
82
|
+
if (node.type === "ExpressionStatement" ||
|
|
83
|
+
node.type === "VariableDeclaration" ||
|
|
84
|
+
node.type === "ReturnStatement") {
|
|
85
|
+
(0, todo_1.addTodoComment)(node, "`dataSource` is not defined — inject or import your DataSource instance", j);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
current = current.parent;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
stats_1.stats.count.todo(api, exports.name, file);
|
|
92
|
+
}
|
|
93
|
+
return hasChanges ? root.toSource() : undefined;
|
|
94
|
+
};
|
|
95
|
+
exports.globalFunctions = globalFunctions;
|
|
96
|
+
exports.fn = exports.globalFunctions;
|
|
97
|
+
exports.default = exports.fn;
|
|
98
|
+
//# sourceMappingURL=global-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-functions.js","sourceRoot":"","sources":["../../../src/transforms/v1/global-functions.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,+EAA+E,CAAA;AACtE,QAAA,MAAM,GAAG,IAAI,CAAA;AAEnB,MAAM,eAAe,GAAG,CAAC,IAAc,EAAE,GAAQ,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AU,EAAE,CAAC;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;QAClE,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;YACnC,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;gBACpB,MAAM,IAAI,GAAS,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;gBACtC,IACI,IAAI,CAAC,IAAI,KAAK,qBAAqB;oBACnC,IAAI,CAAC,IAAI,KAAK,qBAAqB;oBACnC,IAAI,CAAC,IAAI,KAAK,iBAAiB,EACjC,CAAC;oBACC,IAAA,qBAAc,EACV,IAAI,EACJ,yEAAyE,EACzE,CAAC,CACJ,CAAA;oBACD,MAAK;gBACT,CAAC;gBACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAA;YAC5B,CAAC;QACL,CAAC;QACD,aAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,YAAI,EAAE,IAAI,CAAC,CAAA;IACrC,CAAC;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AA3GY,QAAA,eAAe,mBA2G3B;AAEY,QAAA,EAAE,GAAG,uBAAe,CAAA;AACjC,kBAAe,UAAE,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as columnReadonly from "./column-readonly";
|
|
2
|
+
import * as columnUnsignedNumeric from "./column-unsigned-numeric";
|
|
3
|
+
import * as columnWidthZerofill from "./column-width-zerofill";
|
|
4
|
+
import * as connectionToDataSource from "./connection-to-datasource";
|
|
5
|
+
import * as datasourceMongodb from "./datasource-mongodb";
|
|
6
|
+
import * as datasourceMssql from "./datasource-mssql";
|
|
7
|
+
import * as datasourceMysqlConnector from "./datasource-mysql-connector";
|
|
8
|
+
import * as datasourceName from "./datasource-name";
|
|
9
|
+
import * as datasourceSap from "./datasource-sap";
|
|
10
|
+
import * as datasourceSqliteOptions from "./datasource-sqlite-options";
|
|
11
|
+
import * as datasourceSqliteType from "./datasource-sqlite-type";
|
|
12
|
+
import * as findOptionsLockModes from "./find-options-lock-modes";
|
|
13
|
+
import * as findOptionsStringRelations from "./find-options-string-relations";
|
|
14
|
+
import * as findOptionsStringSelect from "./find-options-string-select";
|
|
15
|
+
import * as globalFunctions from "./global-functions";
|
|
16
|
+
import * as migrationsGetAll from "./migrations-get-all";
|
|
17
|
+
import * as mongodbStats from "./mongodb-stats";
|
|
18
|
+
import * as mongodbTypes from "./mongodb-types";
|
|
19
|
+
import * as queryBuilderNativeParameters from "./query-builder-native-parameters";
|
|
20
|
+
import * as queryBuilderOnConflict from "./query-builder-on-conflict";
|
|
21
|
+
import * as queryBuilderOrUpdate from "./query-builder-or-update";
|
|
22
|
+
import * as queryBuilderPrintSql from "./query-builder-print-sql";
|
|
23
|
+
import * as queryBuilderReplacePropertyNames from "./query-builder-replace-property-names";
|
|
24
|
+
import * as queryBuilderWhereExpression from "./query-builder-where-expression";
|
|
25
|
+
import * as queryRunnerLoadedTablesViews from "./query-runner-loaded-tables-views";
|
|
26
|
+
import * as relationCount from "./relation-count";
|
|
27
|
+
import * as repositoryAbstract from "./repository-abstract";
|
|
28
|
+
import * as repositoryExist from "./repository-exist";
|
|
29
|
+
import * as repositoryFindByIds from "./repository-find-by-ids";
|
|
30
|
+
import * as repositoryFindOneById from "./repository-find-one-by-id";
|
|
31
|
+
import * as useContainer from "./use-container";
|
|
32
|
+
export declare const description = "Migrate from v0.3.x to v1.0";
|
|
33
|
+
export declare const migrationGuide = "https://typeorm.io/docs/guides/migration-v1";
|
|
34
|
+
/**
|
|
35
|
+
* Ordered list of v1 transforms. Order matters — connection renames
|
|
36
|
+
* must run first so subsequent transforms see DataSource, not Connection.
|
|
37
|
+
*/
|
|
38
|
+
export declare const transforms: (typeof columnReadonly | typeof columnUnsignedNumeric | typeof columnWidthZerofill | typeof connectionToDataSource | typeof datasourceMongodb | typeof datasourceMssql | typeof datasourceMysqlConnector | typeof datasourceName | typeof datasourceSap | typeof datasourceSqliteOptions | typeof datasourceSqliteType | typeof findOptionsLockModes | typeof findOptionsStringRelations | typeof findOptionsStringSelect | typeof globalFunctions | typeof migrationsGetAll | typeof mongodbStats | typeof mongodbTypes | typeof queryBuilderNativeParameters | typeof queryBuilderOnConflict | typeof queryBuilderOrUpdate | typeof queryBuilderPrintSql | typeof queryBuilderReplacePropertyNames | typeof queryBuilderWhereExpression | typeof queryRunnerLoadedTablesViews | typeof relationCount | typeof repositoryAbstract | typeof repositoryExist | typeof repositoryFindByIds | typeof repositoryFindOneById | typeof useContainer)[];
|
|
39
|
+
declare const _default: import("jscodeshift/src/core").Transform;
|
|
40
|
+
export default _default;
|