@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,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.transforms = exports.migrationGuide = exports.description = void 0;
|
|
37
|
+
const columnReadonly = __importStar(require("./column-readonly"));
|
|
38
|
+
const columnUnsignedNumeric = __importStar(require("./column-unsigned-numeric"));
|
|
39
|
+
const columnWidthZerofill = __importStar(require("./column-width-zerofill"));
|
|
40
|
+
const connectionToDataSource = __importStar(require("./connection-to-datasource"));
|
|
41
|
+
const datasourceMongodb = __importStar(require("./datasource-mongodb"));
|
|
42
|
+
const datasourceMssql = __importStar(require("./datasource-mssql"));
|
|
43
|
+
const datasourceMysqlConnector = __importStar(require("./datasource-mysql-connector"));
|
|
44
|
+
const datasourceName = __importStar(require("./datasource-name"));
|
|
45
|
+
const datasourceSap = __importStar(require("./datasource-sap"));
|
|
46
|
+
const datasourceSqliteOptions = __importStar(require("./datasource-sqlite-options"));
|
|
47
|
+
const datasourceSqliteType = __importStar(require("./datasource-sqlite-type"));
|
|
48
|
+
const findOptionsLockModes = __importStar(require("./find-options-lock-modes"));
|
|
49
|
+
const findOptionsStringRelations = __importStar(require("./find-options-string-relations"));
|
|
50
|
+
const findOptionsStringSelect = __importStar(require("./find-options-string-select"));
|
|
51
|
+
const globalFunctions = __importStar(require("./global-functions"));
|
|
52
|
+
const migrationsGetAll = __importStar(require("./migrations-get-all"));
|
|
53
|
+
const mongodbStats = __importStar(require("./mongodb-stats"));
|
|
54
|
+
const mongodbTypes = __importStar(require("./mongodb-types"));
|
|
55
|
+
const queryBuilderNativeParameters = __importStar(require("./query-builder-native-parameters"));
|
|
56
|
+
const queryBuilderOnConflict = __importStar(require("./query-builder-on-conflict"));
|
|
57
|
+
const queryBuilderOrUpdate = __importStar(require("./query-builder-or-update"));
|
|
58
|
+
const queryBuilderPrintSql = __importStar(require("./query-builder-print-sql"));
|
|
59
|
+
const queryBuilderReplacePropertyNames = __importStar(require("./query-builder-replace-property-names"));
|
|
60
|
+
const queryBuilderWhereExpression = __importStar(require("./query-builder-where-expression"));
|
|
61
|
+
const queryRunnerLoadedTablesViews = __importStar(require("./query-runner-loaded-tables-views"));
|
|
62
|
+
const relationCount = __importStar(require("./relation-count"));
|
|
63
|
+
const repositoryAbstract = __importStar(require("./repository-abstract"));
|
|
64
|
+
const repositoryExist = __importStar(require("./repository-exist"));
|
|
65
|
+
const repositoryFindByIds = __importStar(require("./repository-find-by-ids"));
|
|
66
|
+
const repositoryFindOneById = __importStar(require("./repository-find-one-by-id"));
|
|
67
|
+
const useContainer = __importStar(require("./use-container"));
|
|
68
|
+
const transformer_1 = require("../transformer");
|
|
69
|
+
exports.description = "Migrate from v0.3.x to v1.0";
|
|
70
|
+
exports.migrationGuide = "https://typeorm.io/docs/guides/migration-v1";
|
|
71
|
+
/**
|
|
72
|
+
* Ordered list of v1 transforms. Order matters — connection renames
|
|
73
|
+
* must run first so subsequent transforms see DataSource, not Connection.
|
|
74
|
+
*/
|
|
75
|
+
exports.transforms = [
|
|
76
|
+
connectionToDataSource,
|
|
77
|
+
globalFunctions,
|
|
78
|
+
repositoryFindByIds,
|
|
79
|
+
repositoryFindOneById,
|
|
80
|
+
repositoryExist,
|
|
81
|
+
queryBuilderPrintSql,
|
|
82
|
+
migrationsGetAll,
|
|
83
|
+
queryBuilderNativeParameters,
|
|
84
|
+
queryBuilderWhereExpression,
|
|
85
|
+
columnReadonly,
|
|
86
|
+
columnWidthZerofill,
|
|
87
|
+
datasourceSqliteType,
|
|
88
|
+
findOptionsLockModes,
|
|
89
|
+
useContainer,
|
|
90
|
+
datasourceMysqlConnector,
|
|
91
|
+
datasourceSqliteOptions,
|
|
92
|
+
datasourceMongodb,
|
|
93
|
+
mongodbStats,
|
|
94
|
+
mongodbTypes,
|
|
95
|
+
datasourceMssql,
|
|
96
|
+
datasourceSap,
|
|
97
|
+
datasourceName,
|
|
98
|
+
columnUnsignedNumeric,
|
|
99
|
+
repositoryAbstract,
|
|
100
|
+
relationCount,
|
|
101
|
+
queryBuilderOnConflict,
|
|
102
|
+
queryBuilderOrUpdate,
|
|
103
|
+
queryRunnerLoadedTablesViews,
|
|
104
|
+
queryBuilderReplacePropertyNames,
|
|
105
|
+
findOptionsStringSelect,
|
|
106
|
+
findOptionsStringRelations,
|
|
107
|
+
];
|
|
108
|
+
exports.default = (0, transformer_1.transformer)(exports.transforms);
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transforms/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAmD;AACnD,iFAAkE;AAClE,6EAA8D;AAC9D,mFAAoE;AACpE,wEAAyD;AACzD,oEAAqD;AACrD,uFAAwE;AACxE,kEAAmD;AACnD,gEAAiD;AACjD,qFAAsE;AACtE,+EAAgE;AAChE,gFAAiE;AACjE,4FAA6E;AAC7E,sFAAuE;AACvE,oEAAqD;AACrD,uEAAwD;AACxD,8DAA+C;AAC/C,8DAA+C;AAC/C,gGAAiF;AACjF,oFAAqE;AACrE,gFAAiE;AACjE,gFAAiE;AACjE,yGAA0F;AAC1F,8FAA+E;AAC/E,iGAAkF;AAClF,gEAAiD;AACjD,0EAA2D;AAC3D,oEAAqD;AACrD,8EAA+D;AAC/D,mFAAoE;AACpE,8DAA+C;AAC/C,gDAA4C;AAE/B,QAAA,WAAW,GAAG,6BAA6B,CAAA;AAC3C,QAAA,cAAc,GAAG,6CAA6C,CAAA;AAE3E;;;GAGG;AACU,QAAA,UAAU,GAAG;IACtB,sBAAsB;IACtB,eAAe;IACf,mBAAmB;IACnB,qBAAqB;IACrB,eAAe;IACf,oBAAoB;IACpB,gBAAgB;IAChB,4BAA4B;IAC5B,2BAA2B;IAC3B,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,YAAY;IACZ,wBAAwB;IACxB,uBAAuB;IACvB,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,aAAa;IACb,cAAc;IACd,qBAAqB;IACrB,kBAAkB;IAClB,aAAa;IACb,sBAAsB;IACtB,oBAAoB;IACpB,4BAA4B;IAC5B,gCAAgC;IAChC,uBAAuB;IACvB,0BAA0B;CAC7B,CAAA;AAED,kBAAe,IAAA,yBAAW,EAAC,kBAAU,CAAC,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 `getAllMigrations()` for manual migration";
|
|
4
|
+
export declare const manual = true;
|
|
5
|
+
export declare const migrationsGetAll: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
+
export default fn;
|
|
@@ -0,0 +1,39 @@
|
|
|
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.migrationsGetAll = exports.manual = exports.description = exports.name = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const todo_1 = require("../todo");
|
|
9
|
+
const stats_1 = require("../stats");
|
|
10
|
+
exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
|
|
11
|
+
exports.description = "flag removed `getAllMigrations()` for manual migration";
|
|
12
|
+
exports.manual = true;
|
|
13
|
+
const migrationsGetAll = (file, api) => {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
let hasChanges = false;
|
|
17
|
+
root.find(j.CallExpression, {
|
|
18
|
+
callee: {
|
|
19
|
+
type: "MemberExpression",
|
|
20
|
+
property: { name: "getAllMigrations" },
|
|
21
|
+
},
|
|
22
|
+
}).forEach((path) => {
|
|
23
|
+
// Add a TODO comment before the statement
|
|
24
|
+
const statement = j(path).closest(j.ExpressionStatement);
|
|
25
|
+
if (statement.length > 0) {
|
|
26
|
+
statement.forEach((stmtPath) => {
|
|
27
|
+
(0, todo_1.addTodoComment)(stmtPath.node, "`getAllMigrations()` was removed — use `getPendingMigrations()`, `getExecutedMigrations()`, or `dataSource.migrations` instead", j);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
hasChanges = true;
|
|
31
|
+
});
|
|
32
|
+
if (hasChanges)
|
|
33
|
+
stats_1.stats.count.todo(api, exports.name, file);
|
|
34
|
+
return hasChanges ? root.toSource() : undefined;
|
|
35
|
+
};
|
|
36
|
+
exports.migrationsGetAll = migrationsGetAll;
|
|
37
|
+
exports.fn = exports.migrationsGetAll;
|
|
38
|
+
exports.default = exports.fn;
|
|
39
|
+
//# sourceMappingURL=migrations-get-all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations-get-all.js","sourceRoot":"","sources":["../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AAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AA5BY,QAAA,gBAAgB,oBA4B5B;AAEY,QAAA,EAAE,GAAG,wBAAgB,CAAA;AAClC,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 removed `stats()` for manual migration";
|
|
4
|
+
export declare const manual = true;
|
|
5
|
+
export declare const mongodbStats: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
+
export default fn;
|
|
@@ -0,0 +1,52 @@
|
|
|
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.mongodbStats = exports.manual = exports.description = exports.name = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const todo_1 = require("../todo");
|
|
9
|
+
const stats_1 = require("../stats");
|
|
10
|
+
exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
|
|
11
|
+
exports.description = "flag removed `stats()` for manual migration";
|
|
12
|
+
exports.manual = true;
|
|
13
|
+
const mongodbStats = (file, api) => {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
let hasChanges = false;
|
|
17
|
+
let hasTodos = false;
|
|
18
|
+
const message = "`stats()` was removed — use the MongoDB driver directly";
|
|
19
|
+
// Find .stats() calls
|
|
20
|
+
root.find(j.CallExpression, {
|
|
21
|
+
callee: {
|
|
22
|
+
type: "MemberExpression",
|
|
23
|
+
property: { type: "Identifier", name: "stats" },
|
|
24
|
+
},
|
|
25
|
+
}).forEach((path) => {
|
|
26
|
+
const parentNode = path.parent.node;
|
|
27
|
+
if (parentNode.type === "ExpressionStatement") {
|
|
28
|
+
(0, todo_1.addTodoComment)(parentNode, message, j);
|
|
29
|
+
}
|
|
30
|
+
else if (parentNode.type === "AwaitExpression") {
|
|
31
|
+
const grandparentNode = path.parent.parent.node;
|
|
32
|
+
if (grandparentNode.type === "ExpressionStatement") {
|
|
33
|
+
(0, todo_1.addTodoComment)(grandparentNode, message, j);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
(0, todo_1.addTodoComment)(path.node, message, j);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
(0, todo_1.addTodoComment)(path.node, message, j);
|
|
41
|
+
}
|
|
42
|
+
hasChanges = true;
|
|
43
|
+
hasTodos = true;
|
|
44
|
+
});
|
|
45
|
+
if (hasTodos)
|
|
46
|
+
stats_1.stats.count.todo(api, exports.name, file);
|
|
47
|
+
return hasChanges ? root.toSource() : undefined;
|
|
48
|
+
};
|
|
49
|
+
exports.mongodbStats = mongodbStats;
|
|
50
|
+
exports.fn = exports.mongodbStats;
|
|
51
|
+
exports.default = exports.fn;
|
|
52
|
+
//# sourceMappingURL=mongodb-stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongodb-stats.js","sourceRoot":"","sources":["../../../src/transforms/v1/mongodb-stats.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,kCAAwC;AACxC,oCAAgC;AAEnB,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GAAG,6CAA6C,CAAA;AAC3D,QAAA,MAAM,GAAG,IAAI,CAAA;AAEnB,MAAM,YAAY,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IACrD,MAAM,CAAC,GAAG,GAAG,CA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;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;AAnCY,QAAA,YAAY,gBAmCxB;AAEY,QAAA,EAAE,GAAG,oBAAY,CAAA;AAC9B,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 = "move `ObjectId` import from `typeorm` to `mongodb`";
|
|
4
|
+
export declare const mongodbTypes: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export default fn;
|
|
@@ -0,0 +1,84 @@
|
|
|
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.mongodbTypes = 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 = "move `ObjectId` import from `typeorm` to `mongodb`";
|
|
10
|
+
const addToExistingImport = (existing, movedSpecifiers) => {
|
|
11
|
+
const existingNames = new Set(existing.node.specifiers
|
|
12
|
+
?.filter((s) => s.type === "ImportSpecifier" &&
|
|
13
|
+
s.imported.type === "Identifier")
|
|
14
|
+
.map((s) => s.imported.name) ?? []);
|
|
15
|
+
for (const spec of movedSpecifiers) {
|
|
16
|
+
if (!existingNames.has(spec.imported.name)) {
|
|
17
|
+
existing.node.specifiers?.push(spec);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const createNewImport = (j, root, importPath, movedSpecifiers) => {
|
|
22
|
+
const newImport = j.importDeclaration(movedSpecifiers, j.stringLiteral("mongodb"));
|
|
23
|
+
if (importPath.node.importKind === "type") {
|
|
24
|
+
newImport.importKind = "type";
|
|
25
|
+
}
|
|
26
|
+
const allImports = root.find(j.ImportDeclaration);
|
|
27
|
+
if (allImports.length > 0) {
|
|
28
|
+
const lastImport = allImports.at(-1).get();
|
|
29
|
+
j(lastImport).insertAfter(newImport);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
root.find(j.Program).forEach((p) => {
|
|
33
|
+
p.node.body.unshift(newImport);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const mongodbTypes = (file, api) => {
|
|
38
|
+
const j = api.jscodeshift;
|
|
39
|
+
const root = j(file.source);
|
|
40
|
+
let hasChanges = false;
|
|
41
|
+
const movedTypes = new Set(["ObjectId"]);
|
|
42
|
+
root.find(j.ImportDeclaration, {
|
|
43
|
+
source: { value: "typeorm" },
|
|
44
|
+
}).forEach((importPath) => {
|
|
45
|
+
const movedSpecifiers = [];
|
|
46
|
+
const remaining = importPath.node.specifiers?.filter((spec) => {
|
|
47
|
+
if (spec.type === "ImportSpecifier" &&
|
|
48
|
+
spec.imported.type === "Identifier" &&
|
|
49
|
+
movedTypes.has(spec.imported.name)) {
|
|
50
|
+
movedSpecifiers.push(spec);
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return true;
|
|
54
|
+
});
|
|
55
|
+
if (movedSpecifiers.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
hasChanges = true;
|
|
58
|
+
// Update or remove the typeorm import
|
|
59
|
+
if (remaining?.length === 0) {
|
|
60
|
+
j(importPath).remove();
|
|
61
|
+
}
|
|
62
|
+
else if (remaining) {
|
|
63
|
+
importPath.node.specifiers = remaining;
|
|
64
|
+
}
|
|
65
|
+
// Check if there's already a mongodb import
|
|
66
|
+
const existingMongoImport = root.find(j.ImportDeclaration, {
|
|
67
|
+
source: { value: "mongodb" },
|
|
68
|
+
});
|
|
69
|
+
if (existingMongoImport.length > 0) {
|
|
70
|
+
const mongoImport = existingMongoImport
|
|
71
|
+
.at(0)
|
|
72
|
+
.get();
|
|
73
|
+
addToExistingImport(mongoImport, movedSpecifiers);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
createNewImport(j, root, importPath, movedSpecifiers);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return hasChanges ? root.toSource() : undefined;
|
|
80
|
+
};
|
|
81
|
+
exports.mongodbTypes = mongodbTypes;
|
|
82
|
+
exports.fn = exports.mongodbTypes;
|
|
83
|
+
exports.default = exports.fn;
|
|
84
|
+
//# sourceMappingURL=mongodb-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongodb-types.js","sourceRoot":"","sources":["../../../src/transforms/v1/mongodb-types.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAWf,QAAA,IAAI,GAAG,mBAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,mBAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAC1D,QAAA,WAAW,GAAG,oDAAoD,CAAA;AAE/E,MAAM,mBAAmB,GAAG,CACxB,QAAoC,EACpC,eAAkC,EACpC,EAAE;IACA,MAAM,aAAa,GAAG,IAAI,GAAG,CACzB,QAAQ,CAAC,IAAI,CAAC,UAAU;QACpB,EAAE,MAAM,CACJ,CAAC,CAAC,EAAwB,EAAE,CACxB,CAAC,CAAC,IAAI,KAAK,iBAAiB;QAC5B,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CACvC;SACA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CACzC,CAAA;IAED,KAAK,MAAM,IAAI,IAAI,eAAe,EAA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M,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,WAAW,GAA+B,mBAAmB;iBAC9D,EAAE,CAAC,CAAC,CAAC;iBACL,GAAG,EAAE,CAAA;YACV,mBAAmB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAA;QACrD,CAAC;aAAM,CAAC;YACJ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,CAAA;QACzD,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAlDY,QAAA,YAAY,gBAkDxB;AAEY,QAAA,EAAE,GAAG,oBAAY,CAAA;AAC9B,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 `setNativeParameters()` to `setParameters()`";
|
|
4
|
+
export declare const queryBuilderNativeParameters: (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.queryBuilderNativeParameters = 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 `setNativeParameters()` to `setParameters()`";
|
|
11
|
+
const queryBuilderNativeParameters = (file, api) => {
|
|
12
|
+
const j = api.jscodeshift;
|
|
13
|
+
const root = j(file.source);
|
|
14
|
+
const hasChanges = (0, ast_helpers_1.renameMemberMethod)(root, j, "setNativeParameters", "setParameters");
|
|
15
|
+
return hasChanges ? root.toSource() : undefined;
|
|
16
|
+
};
|
|
17
|
+
exports.queryBuilderNativeParameters = queryBuilderNativeParameters;
|
|
18
|
+
exports.fn = exports.queryBuilderNativeParameters;
|
|
19
|
+
exports.default = exports.fn;
|
|
20
|
+
//# sourceMappingURL=query-builder-native-parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder-native-parameters.js","sourceRoot":"","sources":["../../../src/transforms/v1/query-builder-native-parameters.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,qDAAqD,CAAA;AAEzE,MAAM,4BAA4B,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IACrE,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAE3B,MAAM,UAAU,GAAG,IAAA,gCAAkB,EACjC,IAAI,EACJ,CAAC,EACD,qBAAqB,EACrB,eAAe,CAClB,CAAA;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AAZY,QAAA,4BAA4B,gCAYxC;AAEY,QAAA,EAAE,GAAG,oCAA4B,CAAA;AAC9C,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 removed `onConflict()` for manual migration to `orIgnore()` / `orUpdate()`";
|
|
4
|
+
export declare const manual = true;
|
|
5
|
+
export declare const queryBuilderOnConflict: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
+
export default fn;
|
|
@@ -0,0 +1,56 @@
|
|
|
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.queryBuilderOnConflict = 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 `onConflict()` for manual migration to `orIgnore()` / `orUpdate()`";
|
|
13
|
+
exports.manual = true;
|
|
14
|
+
const queryBuilderOnConflict = (file, api) => {
|
|
15
|
+
const j = api.jscodeshift;
|
|
16
|
+
const root = j(file.source);
|
|
17
|
+
let hasChanges = false;
|
|
18
|
+
let hasTodos = false;
|
|
19
|
+
root.find(j.CallExpression, {
|
|
20
|
+
callee: {
|
|
21
|
+
type: "MemberExpression",
|
|
22
|
+
property: { type: "Identifier", name: "onConflict" },
|
|
23
|
+
},
|
|
24
|
+
}).forEach((path) => {
|
|
25
|
+
const arg = path.node.arguments[0];
|
|
26
|
+
const argValue = arg ? (0, ast_helpers_1.getStringValue)(arg) : null;
|
|
27
|
+
if (argValue && /DO\s+NOTHING/i.test(argValue)) {
|
|
28
|
+
// Replace .onConflict("DO NOTHING") with .orIgnore()
|
|
29
|
+
if (path.node.callee.type === "MemberExpression") {
|
|
30
|
+
path.node.callee.property = j.identifier("orIgnore");
|
|
31
|
+
path.node.arguments = [];
|
|
32
|
+
hasChanges = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Add a TODO comment
|
|
37
|
+
const message = "`onConflict()` was removed — use `orIgnore()` or `orUpdate()` instead";
|
|
38
|
+
const parentNode = path.parent.node;
|
|
39
|
+
if (parentNode.type === "ExpressionStatement") {
|
|
40
|
+
(0, todo_1.addTodoComment)(parentNode, message, j);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
(0, todo_1.addTodoComment)(path.node, message, j);
|
|
44
|
+
}
|
|
45
|
+
hasChanges = true;
|
|
46
|
+
hasTodos = true;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
if (hasTodos)
|
|
50
|
+
stats_1.stats.count.todo(api, exports.name, file);
|
|
51
|
+
return hasChanges ? root.toSource() : undefined;
|
|
52
|
+
};
|
|
53
|
+
exports.queryBuilderOnConflict = queryBuilderOnConflict;
|
|
54
|
+
exports.fn = exports.queryBuilderOnConflict;
|
|
55
|
+
exports.default = exports.fn;
|
|
56
|
+
//# sourceMappingURL=query-builder-on-conflict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder-on-conflict.js","sourceRoot":"","sources":["../../../src/transforms/v1/query-builder-on-conflict.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAA+C;AAC/C,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,iFAAiF,CAAA;AACxE,QAAA,MAAM,GAAG,IAAI,CAAA;AAEnB,MAAM,sBAAsB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC/D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IA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C,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;YACzC,CAAC;YACD,UAAU,GAAG,IAAI,CAAA;YACjB,QAAQ,GAAG,IAAI,CAAA;QACnB,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,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;AAxCY,QAAA,sBAAsB,0BAwClC;AAEY,QAAA,EAAE,GAAG,8BAAsB,CAAA;AACxC,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 object-style `orUpdate()` with array-style signature";
|
|
4
|
+
export declare const queryBuilderOrUpdate: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export default fn;
|
|
@@ -0,0 +1,56 @@
|
|
|
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.queryBuilderOrUpdate = 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 object-style `orUpdate()` with array-style signature";
|
|
10
|
+
const queryBuilderOrUpdate = (file, api) => {
|
|
11
|
+
const j = api.jscodeshift;
|
|
12
|
+
const root = j(file.source);
|
|
13
|
+
let hasChanges = false;
|
|
14
|
+
// Find .orUpdate({ conflict_target: [...], overwrite: [...] })
|
|
15
|
+
root.find(j.CallExpression, {
|
|
16
|
+
callee: {
|
|
17
|
+
type: "MemberExpression",
|
|
18
|
+
property: { type: "Identifier", name: "orUpdate" },
|
|
19
|
+
},
|
|
20
|
+
}).forEach((path) => {
|
|
21
|
+
const args = path.node.arguments;
|
|
22
|
+
if (args.length !== 1)
|
|
23
|
+
return;
|
|
24
|
+
const arg = args[0];
|
|
25
|
+
if (arg.type !== "ObjectExpression")
|
|
26
|
+
return;
|
|
27
|
+
let conflictTarget = null;
|
|
28
|
+
let overwrite = null;
|
|
29
|
+
for (const prop of arg.properties) {
|
|
30
|
+
if (prop.type !== "ObjectProperty")
|
|
31
|
+
continue;
|
|
32
|
+
if (prop.key.type !== "Identifier")
|
|
33
|
+
continue;
|
|
34
|
+
if (prop.key.name === "conflict_target") {
|
|
35
|
+
conflictTarget = prop.value;
|
|
36
|
+
}
|
|
37
|
+
else if (prop.key.name === "overwrite") {
|
|
38
|
+
overwrite = prop.value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!conflictTarget || !overwrite)
|
|
42
|
+
return;
|
|
43
|
+
// Transform to .orUpdate([overwrite], [conflict_target])
|
|
44
|
+
// Values are always expressions at runtime (array literals from object properties)
|
|
45
|
+
path.node.arguments = [
|
|
46
|
+
overwrite,
|
|
47
|
+
conflictTarget,
|
|
48
|
+
];
|
|
49
|
+
hasChanges = true;
|
|
50
|
+
});
|
|
51
|
+
return hasChanges ? root.toSource() : undefined;
|
|
52
|
+
};
|
|
53
|
+
exports.queryBuilderOrUpdate = queryBuilderOrUpdate;
|
|
54
|
+
exports.fn = exports.queryBuilderOrUpdate;
|
|
55
|
+
exports.default = exports.fn;
|
|
56
|
+
//# sourceMappingURL=query-builder-or-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder-or-update.js","sourceRoot":"","sources":["../../../src/transforms/v1/query-builder-or-update.ts"],"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IAAI,CAAC,KAAK,CAAA;YAC/B,CAAC;iBAAM,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBACvC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAA;YAC1B,CAAC;QACL,CAAC;QAED,IAAI,CAAC,cAAc,IAAI,CAAC,SAAS;YAAE,OAAM;QAEzC,yDAAyD;QACzD,mFAAmF;QACnF,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG;YAClB,SAAS;YACT,cAAc;SACa,CAAA;QAC/B,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;AA5CY,QAAA,oBAAoB,wBA4ChC;AAEY,QAAA,EAAE,GAAG,4BAAoB,CAAA;AACtC,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 removed `printSql()` for manual migration to `getSql()` / `getQueryAndParameters()`";
|
|
4
|
+
export declare const manual = true;
|
|
5
|
+
export declare const queryBuilderPrintSql: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
+
export default fn;
|
|
@@ -0,0 +1,49 @@
|
|
|
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.queryBuilderPrintSql = exports.manual = exports.description = exports.name = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const todo_1 = require("../todo");
|
|
9
|
+
const stats_1 = require("../stats");
|
|
10
|
+
exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
|
|
11
|
+
exports.description = "flag removed `printSql()` for manual migration to `getSql()` / `getQueryAndParameters()`";
|
|
12
|
+
exports.manual = true;
|
|
13
|
+
const queryBuilderPrintSql = (file, api) => {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
let hasChanges = false;
|
|
17
|
+
let hasTodos = false;
|
|
18
|
+
const message = "`printSql()` was removed — use `getSql()` or `getQueryAndParameters()` to inspect SQL";
|
|
19
|
+
root.find(j.CallExpression, {
|
|
20
|
+
callee: {
|
|
21
|
+
type: "MemberExpression",
|
|
22
|
+
property: { name: "printSql" },
|
|
23
|
+
},
|
|
24
|
+
}).forEach((path) => {
|
|
25
|
+
// Walk up to find the enclosing ExpressionStatement
|
|
26
|
+
let current = path.parent;
|
|
27
|
+
while (current) {
|
|
28
|
+
const node = current.node;
|
|
29
|
+
if (node.type === "ExpressionStatement") {
|
|
30
|
+
(0, todo_1.addTodoComment)(node, message, j);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
if (node.type === "VariableDeclaration") {
|
|
34
|
+
(0, todo_1.addTodoComment)(node, message, j);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
current = current.parent;
|
|
38
|
+
}
|
|
39
|
+
hasChanges = true;
|
|
40
|
+
hasTodos = true;
|
|
41
|
+
});
|
|
42
|
+
if (hasTodos)
|
|
43
|
+
stats_1.stats.count.todo(api, exports.name, file);
|
|
44
|
+
return hasChanges ? root.toSource() : undefined;
|
|
45
|
+
};
|
|
46
|
+
exports.queryBuilderPrintSql = queryBuilderPrintSql;
|
|
47
|
+
exports.fn = exports.queryBuilderPrintSql;
|
|
48
|
+
exports.default = exports.fn;
|
|
49
|
+
//# sourceMappingURL=query-builder-print-sql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder-print-sql.js","sourceRoot":"","sources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OAAO,GAAG,OAAO,CAAC,MAAM,CAAA;QAC5B,CAAC;QACD,UAAU,GAAG,IAAI,CAAA;QACjB,QAAQ,GAAG,IAAI,CAAA;IACnB,CAAC,CAAC,CAAA;IAEF,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;AApCY,QAAA,oBAAoB,wBAoChC;AAEY,QAAA,EAAE,GAAG,4BAAoB,CAAA;AACtC,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 removed `replacePropertyNames` override for manual review";
|
|
4
|
+
export declare const manual = true;
|
|
5
|
+
export declare const queryBuilderReplacePropertyNames: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
+
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
+
export default fn;
|
|
@@ -0,0 +1,42 @@
|
|
|
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.queryBuilderReplacePropertyNames = exports.manual = exports.description = exports.name = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const todo_1 = require("../todo");
|
|
9
|
+
const stats_1 = require("../stats");
|
|
10
|
+
exports.name = node_path_1.default.basename(__filename, node_path_1.default.extname(__filename));
|
|
11
|
+
exports.description = "flag removed `replacePropertyNames` override for manual review";
|
|
12
|
+
exports.manual = true;
|
|
13
|
+
const queryBuilderReplacePropertyNames = (file, api) => {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
let hasChanges = false;
|
|
17
|
+
let hasTodos = false;
|
|
18
|
+
// Find method declarations named replacePropertyNames in classes
|
|
19
|
+
const message = "`replacePropertyNames` was removed — property name replacement is now handled internally";
|
|
20
|
+
root.find(j.ClassMethod, {
|
|
21
|
+
key: { type: "Identifier", name: "replacePropertyNames" },
|
|
22
|
+
}).forEach((path) => {
|
|
23
|
+
(0, todo_1.addTodoComment)(path.node, message, j);
|
|
24
|
+
hasChanges = true;
|
|
25
|
+
hasTodos = true;
|
|
26
|
+
});
|
|
27
|
+
// Also check for MethodDefinition (alternative AST representation)
|
|
28
|
+
root.find(j.MethodDefinition, {
|
|
29
|
+
key: { type: "Identifier", name: "replacePropertyNames" },
|
|
30
|
+
}).forEach((path) => {
|
|
31
|
+
(0, todo_1.addTodoComment)(path.node, message, j);
|
|
32
|
+
hasChanges = true;
|
|
33
|
+
hasTodos = true;
|
|
34
|
+
});
|
|
35
|
+
if (hasTodos)
|
|
36
|
+
stats_1.stats.count.todo(api, exports.name, file);
|
|
37
|
+
return hasChanges ? root.toSource() : undefined;
|
|
38
|
+
};
|
|
39
|
+
exports.queryBuilderReplacePropertyNames = queryBuilderReplacePropertyNames;
|
|
40
|
+
exports.fn = exports.queryBuilderReplacePropertyNames;
|
|
41
|
+
exports.default = exports.fn;
|
|
42
|
+
//# sourceMappingURL=query-builder-replace-property-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-builder-replace-property-names.js","sourceRoot":"","sources":["../../../src/transforms/v1/query-builder-replace-property-names.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,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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