@typeorm/codemod 1.0.0 → 1.0.2
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 +13 -10
- package/dist/cli/print-guide.js +2 -2
- package/dist/cli/print-summary.js +3 -2
- package/dist/cli/print-summary.js.map +1 -1
- package/dist/cli/print-usage.js +2 -1
- package/dist/cli/print-usage.js.map +1 -1
- package/dist/cli/run-transforms.js +181 -79
- package/dist/cli/run-transforms.js.map +1 -1
- package/dist/dependencies/v1.js +23 -9
- package/dist/dependencies/v1.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/transforms/ast-helpers.js +779 -19
- package/dist/transforms/ast-helpers.js.map +1 -1
- package/dist/transforms/stats.js +11 -0
- package/dist/transforms/stats.js.map +1 -1
- package/dist/transforms/todo.js +42 -2
- package/dist/transforms/todo.js.map +1 -1
- package/dist/transforms/v1/column-readonly.js +28 -13
- package/dist/transforms/v1/column-readonly.js.map +1 -1
- package/dist/transforms/v1/column-unsigned-numeric.js +27 -26
- package/dist/transforms/v1/column-unsigned-numeric.js.map +1 -1
- package/dist/transforms/v1/column-width-zerofill.js +2 -1
- package/dist/transforms/v1/column-width-zerofill.js.map +1 -1
- package/dist/transforms/v1/connection-manager.js +82 -0
- package/dist/transforms/v1/connection-manager.js.map +1 -0
- package/dist/transforms/v1/connection-options-reader.js +214 -0
- package/dist/transforms/v1/connection-options-reader.js.map +1 -0
- package/dist/transforms/v1/connection-to-datasource.js +858 -93
- package/dist/transforms/v1/connection-to-datasource.js.map +1 -1
- package/dist/transforms/v1/datasource-expo.js +79 -0
- package/dist/transforms/v1/datasource-expo.js.map +1 -0
- package/dist/transforms/v1/datasource-mongodb.js +103 -64
- package/dist/transforms/v1/datasource-mongodb.js.map +1 -1
- package/dist/transforms/v1/datasource-mssql.js +88 -46
- package/dist/transforms/v1/datasource-mssql.js.map +1 -1
- package/dist/transforms/v1/datasource-mysql-connector.js +25 -6
- package/dist/transforms/v1/datasource-mysql-connector.js.map +1 -1
- package/dist/transforms/v1/datasource-name.js +19 -14
- package/dist/transforms/v1/datasource-name.js.map +1 -1
- package/dist/transforms/v1/datasource-sap.js +51 -26
- package/dist/transforms/v1/datasource-sap.js.map +1 -1
- package/dist/transforms/v1/datasource-sqlite-options.js +48 -13
- package/dist/transforms/v1/datasource-sqlite-options.js.map +1 -1
- package/dist/transforms/v1/datasource-sqlite-type.js +28 -7
- package/dist/transforms/v1/datasource-sqlite-type.js.map +1 -1
- package/dist/transforms/v1/file-logger.js +163 -0
- package/dist/transforms/v1/file-logger.js.map +1 -0
- package/dist/transforms/v1/find-options-join.js +84 -0
- package/dist/transforms/v1/find-options-join.js.map +1 -0
- package/dist/transforms/v1/find-options-lock-modes.js +26 -21
- package/dist/transforms/v1/find-options-lock-modes.js.map +1 -1
- package/dist/transforms/v1/find-options-string-relations.js +75 -9
- package/dist/transforms/v1/find-options-string-relations.js.map +1 -1
- package/dist/transforms/v1/find-options-string-select.js +75 -11
- package/dist/transforms/v1/find-options-string-select.js.map +1 -1
- package/dist/transforms/v1/global-functions.js +150 -64
- package/dist/transforms/v1/global-functions.js.map +1 -1
- package/dist/transforms/v1/index.js +16 -3
- package/dist/transforms/v1/index.js.map +1 -1
- package/dist/transforms/v1/migrations-get-all.js +25 -9
- package/dist/transforms/v1/migrations-get-all.js.map +1 -1
- package/dist/transforms/v1/mongodb-stats.js +21 -11
- package/dist/transforms/v1/mongodb-stats.js.map +1 -1
- package/dist/transforms/v1/mongodb-types.js +59 -2
- package/dist/transforms/v1/mongodb-types.js.map +1 -1
- package/dist/transforms/v1/query-builder-native-parameters.js +2 -0
- package/dist/transforms/v1/query-builder-native-parameters.js.map +1 -1
- package/dist/transforms/v1/query-builder-on-conflict.js +32 -18
- package/dist/transforms/v1/query-builder-on-conflict.js.map +1 -1
- package/dist/transforms/v1/query-builder-or-update.js +8 -4
- package/dist/transforms/v1/query-builder-or-update.js.map +1 -1
- package/dist/transforms/v1/query-builder-print-sql.js +18 -12
- package/dist/transforms/v1/query-builder-print-sql.js.map +1 -1
- package/dist/transforms/v1/query-builder-replace-property-names.js +16 -12
- package/dist/transforms/v1/query-builder-replace-property-names.js.map +1 -1
- package/dist/transforms/v1/query-builder-where-expression.js +29 -12
- package/dist/transforms/v1/query-builder-where-expression.js.map +1 -1
- package/dist/transforms/v1/query-runner-loaded-tables-views.js +1 -6
- package/dist/transforms/v1/query-runner-loaded-tables-views.js.map +1 -1
- package/dist/transforms/v1/relation-count.js +78 -12
- package/dist/transforms/v1/relation-count.js.map +1 -1
- package/dist/transforms/v1/repository-abstract.js +148 -34
- package/dist/transforms/v1/repository-abstract.js.map +1 -1
- package/dist/transforms/v1/repository-exist.js +20 -1
- package/dist/transforms/v1/repository-exist.js.map +1 -1
- package/dist/transforms/v1/repository-find-by-ids.js +67 -27
- package/dist/transforms/v1/repository-find-by-ids.js.map +1 -1
- package/dist/transforms/v1/repository-find-one-by-id.js +6 -0
- package/dist/transforms/v1/repository-find-one-by-id.js.map +1 -1
- package/dist/transforms/v1/use-container.js +65 -15
- package/dist/transforms/v1/use-container.js.map +1 -1
- package/package.json +3 -1
- package/dist/cli/colors.d.ts +0 -7
- package/dist/cli/colors.js +0 -12
- package/dist/cli/colors.js.map +0 -1
- package/dist/cli/error.d.ts +0 -1
- package/dist/cli/error.js +0 -11
- package/dist/cli/error.js.map +0 -1
- package/dist/cli/list-transforms.d.ts +0 -1
- package/dist/cli/parse-args.d.ts +0 -10
- package/dist/cli/print-guide.d.ts +0 -1
- package/dist/cli/print-summary.d.ts +0 -17
- package/dist/cli/print-todos.d.ts +0 -1
- package/dist/cli/print-usage.d.ts +0 -1
- package/dist/cli/run-dependencies.d.ts +0 -6
- package/dist/cli/run-transforms.d.ts +0 -21
- package/dist/cli/run.d.ts +0 -9
- package/dist/dependencies/config.d.ts +0 -24
- package/dist/dependencies/find-package-json.d.ts +0 -5
- package/dist/dependencies/index.d.ts +0 -5
- package/dist/dependencies/upgrade.d.ts +0 -11
- package/dist/dependencies/v1.d.ts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/lib/colors.d.ts +0 -9
- package/dist/lib/error.d.ts +0 -1
- package/dist/lib/format-time.d.ts +0 -1
- package/dist/lib/highlight.d.ts +0 -1
- package/dist/lib/spinner.d.ts +0 -5
- package/dist/transforms/ast-helpers.d.ts +0 -50
- package/dist/transforms/index.d.ts +0 -7
- package/dist/transforms/resolve.d.ts +0 -1
- package/dist/transforms/scan.d.ts +0 -4
- package/dist/transforms/scan.js +0 -33
- package/dist/transforms/scan.js.map +0 -1
- package/dist/transforms/stats.d.ts +0 -11
- package/dist/transforms/todo.d.ts +0 -2
- package/dist/transforms/transformer.d.ts +0 -8
- package/dist/transforms/v1/column-readonly.d.ts +0 -6
- package/dist/transforms/v1/column-unsigned-numeric.d.ts +0 -6
- package/dist/transforms/v1/column-width-zerofill.d.ts +0 -6
- package/dist/transforms/v1/connection-to-datasource.d.ts +0 -6
- package/dist/transforms/v1/datasource-mongodb.d.ts +0 -7
- package/dist/transforms/v1/datasource-mssql-domain.d.ts +0 -7
- package/dist/transforms/v1/datasource-mssql-domain.js +0 -35
- package/dist/transforms/v1/datasource-mssql-domain.js.map +0 -1
- package/dist/transforms/v1/datasource-mssql.d.ts +0 -7
- package/dist/transforms/v1/datasource-mysql-connector.d.ts +0 -6
- package/dist/transforms/v1/datasource-name.d.ts +0 -6
- package/dist/transforms/v1/datasource-sap.d.ts +0 -6
- package/dist/transforms/v1/datasource-sqlite-options.d.ts +0 -6
- package/dist/transforms/v1/datasource-sqlite-type.d.ts +0 -6
- package/dist/transforms/v1/find-options-lock-modes.d.ts +0 -6
- package/dist/transforms/v1/find-options-string-relations.d.ts +0 -6
- package/dist/transforms/v1/find-options-string-select.d.ts +0 -6
- package/dist/transforms/v1/global-functions.d.ts +0 -7
- package/dist/transforms/v1/index.d.ts +0 -40
- package/dist/transforms/v1/migrations-get-all.d.ts +0 -7
- package/dist/transforms/v1/mongodb-stats.d.ts +0 -7
- package/dist/transforms/v1/mongodb-types.d.ts +0 -6
- package/dist/transforms/v1/query-builder-native-parameters.d.ts +0 -6
- package/dist/transforms/v1/query-builder-on-conflict.d.ts +0 -7
- package/dist/transforms/v1/query-builder-or-update.d.ts +0 -6
- package/dist/transforms/v1/query-builder-print-sql.d.ts +0 -7
- package/dist/transforms/v1/query-builder-replace-property-names.d.ts +0 -7
- package/dist/transforms/v1/query-builder-where-expression.d.ts +0 -6
- package/dist/transforms/v1/query-runner-loaded-tables-views.d.ts +0 -7
- package/dist/transforms/v1/relation-count.d.ts +0 -7
- package/dist/transforms/v1/remove-abstract-repository.d.ts +0 -5
- package/dist/transforms/v1/remove-abstract-repository.js +0 -93
- package/dist/transforms/v1/remove-abstract-repository.js.map +0 -1
- package/dist/transforms/v1/remove-connector-package.d.ts +0 -4
- package/dist/transforms/v1/remove-connector-package.js +0 -19
- package/dist/transforms/v1/remove-connector-package.js.map +0 -1
- package/dist/transforms/v1/remove-datasource-name.d.ts +0 -4
- package/dist/transforms/v1/remove-datasource-name.js +0 -56
- package/dist/transforms/v1/remove-datasource-name.js.map +0 -1
- package/dist/transforms/v1/remove-mongodb-options.d.ts +0 -5
- package/dist/transforms/v1/remove-mongodb-options.js +0 -86
- package/dist/transforms/v1/remove-mongodb-options.js.map +0 -1
- package/dist/transforms/v1/remove-relation-count.d.ts +0 -5
- package/dist/transforms/v1/remove-relation-count.js +0 -49
- package/dist/transforms/v1/remove-relation-count.js.map +0 -1
- package/dist/transforms/v1/remove-replace-property-names.d.ts +0 -5
- package/dist/transforms/v1/remove-replace-property-names.js +0 -35
- package/dist/transforms/v1/remove-replace-property-names.js.map +0 -1
- package/dist/transforms/v1/remove-sap-options.d.ts +0 -4
- package/dist/transforms/v1/remove-sap-options.js +0 -54
- package/dist/transforms/v1/remove-sap-options.js.map +0 -1
- package/dist/transforms/v1/remove-unsigned-numeric.d.ts +0 -4
- package/dist/transforms/v1/remove-unsigned-numeric.js +0 -76
- package/dist/transforms/v1/remove-unsigned-numeric.js.map +0 -1
- package/dist/transforms/v1/remove-use-container.d.ts +0 -5
- package/dist/transforms/v1/remove-use-container.js +0 -63
- package/dist/transforms/v1/remove-use-container.js.map +0 -1
- package/dist/transforms/v1/remove-width-zerofill.d.ts +0 -4
- package/dist/transforms/v1/remove-width-zerofill.js +0 -29
- package/dist/transforms/v1/remove-width-zerofill.js.map +0 -1
- package/dist/transforms/v1/rename-connection-to-datasource.d.ts +0 -4
- package/dist/transforms/v1/rename-connection-to-datasource.js +0 -111
- package/dist/transforms/v1/rename-connection-to-datasource.js.map +0 -1
- package/dist/transforms/v1/rename-exist-to-exists.d.ts +0 -4
- package/dist/transforms/v1/rename-exist-to-exists.js +0 -25
- package/dist/transforms/v1/rename-exist-to-exists.js.map +0 -1
- package/dist/transforms/v1/rename-find-by-ids.d.ts +0 -4
- package/dist/transforms/v1/rename-find-by-ids.js +0 -64
- package/dist/transforms/v1/rename-find-by-ids.js.map +0 -1
- package/dist/transforms/v1/rename-get-all-migrations.d.ts +0 -5
- package/dist/transforms/v1/rename-get-all-migrations.js +0 -32
- package/dist/transforms/v1/rename-get-all-migrations.js.map +0 -1
- package/dist/transforms/v1/rename-loaded-tables-views.d.ts +0 -5
- package/dist/transforms/v1/rename-loaded-tables-views.js +0 -48
- package/dist/transforms/v1/rename-loaded-tables-views.js.map +0 -1
- package/dist/transforms/v1/rename-or-update-overload.d.ts +0 -4
- package/dist/transforms/v1/rename-or-update-overload.js +0 -46
- package/dist/transforms/v1/rename-or-update-overload.js.map +0 -1
- package/dist/transforms/v1/rename-print-sql-to-log-query.d.ts +0 -4
- package/dist/transforms/v1/rename-print-sql-to-log-query.js +0 -25
- package/dist/transforms/v1/rename-print-sql-to-log-query.js.map +0 -1
- package/dist/transforms/v1/replace-global-functions.d.ts +0 -5
- package/dist/transforms/v1/replace-global-functions.js +0 -92
- package/dist/transforms/v1/replace-global-functions.js.map +0 -1
- package/dist/transforms/v1/replace-lock-modes.d.ts +0 -4
- package/dist/transforms/v1/replace-lock-modes.js +0 -75
- package/dist/transforms/v1/replace-lock-modes.js.map +0 -1
- package/dist/transforms/v1/replace-mongodb-stats.d.ts +0 -5
- package/dist/transforms/v1/replace-mongodb-stats.js +0 -54
- package/dist/transforms/v1/replace-mongodb-stats.js.map +0 -1
- package/dist/transforms/v1/replace-mongodb-types.d.ts +0 -4
- package/dist/transforms/v1/replace-mongodb-types.js +0 -72
- package/dist/transforms/v1/replace-mongodb-types.js.map +0 -1
- package/dist/transforms/v1/replace-mssql-domain.d.ts +0 -5
- package/dist/transforms/v1/replace-mssql-domain.js +0 -25
- package/dist/transforms/v1/replace-mssql-domain.js.map +0 -1
- package/dist/transforms/v1/replace-on-conflict.d.ts +0 -5
- package/dist/transforms/v1/replace-on-conflict.js +0 -49
- package/dist/transforms/v1/replace-on-conflict.js.map +0 -1
- package/dist/transforms/v1/replace-readonly-column.d.ts +0 -4
- package/dist/transforms/v1/replace-readonly-column.js +0 -28
- package/dist/transforms/v1/replace-readonly-column.js.map +0 -1
- package/dist/transforms/v1/replace-set-native-parameters.d.ts +0 -4
- package/dist/transforms/v1/replace-set-native-parameters.js +0 -25
- package/dist/transforms/v1/replace-set-native-parameters.js.map +0 -1
- package/dist/transforms/v1/replace-sqlite-options.d.ts +0 -4
- package/dist/transforms/v1/replace-sqlite-options.js +0 -29
- package/dist/transforms/v1/replace-sqlite-options.js.map +0 -1
- package/dist/transforms/v1/replace-sqlite-type.d.ts +0 -4
- package/dist/transforms/v1/replace-sqlite-type.js +0 -22
- package/dist/transforms/v1/replace-sqlite-type.js.map +0 -1
- package/dist/transforms/v1/replace-where-expression-type.d.ts +0 -4
- package/dist/transforms/v1/replace-where-expression-type.js +0 -41
- package/dist/transforms/v1/replace-where-expression-type.js.map +0 -1
- package/dist/transforms/v1/repository-abstract.d.ts +0 -7
- package/dist/transforms/v1/repository-exist.d.ts +0 -6
- package/dist/transforms/v1/repository-find-by-ids.d.ts +0 -6
- package/dist/transforms/v1/repository-find-one-by-id.d.ts +0 -6
- package/dist/transforms/v1/upgrade-dependencies.d.ts +0 -15
- package/dist/transforms/v1/upgrade-dependencies.js +0 -163
- package/dist/transforms/v1/upgrade-dependencies.js.map +0 -1
- package/dist/transforms/v1/use-container.d.ts +0 -7
|
@@ -1,35 +0,0 @@
|
|
|
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.datasourceMssqlDomain = 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 `domain` MSSQL option for manual migration";
|
|
13
|
-
exports.manual = true;
|
|
14
|
-
const datasourceMssqlDomain = (file, api) => {
|
|
15
|
-
const j = api.jscodeshift;
|
|
16
|
-
const root = j(file.source);
|
|
17
|
-
if (!(0, ast_helpers_1.fileImportsFrom)(root, j, "typeorm"))
|
|
18
|
-
return undefined;
|
|
19
|
-
let hasChanges = false;
|
|
20
|
-
let hasTodos = false;
|
|
21
|
-
root.find(j.ObjectProperty, {
|
|
22
|
-
key: { type: "Identifier", name: "domain" },
|
|
23
|
-
}).forEach((path) => {
|
|
24
|
-
(0, todo_1.addTodoComment)(path.node, '`domain` was removed — restructure to `authentication: { type: "ntlm", options: { domain: "..." } }`', j);
|
|
25
|
-
hasChanges = true;
|
|
26
|
-
hasTodos = true;
|
|
27
|
-
});
|
|
28
|
-
if (hasTodos)
|
|
29
|
-
stats_1.stats.count.todo(api, exports.name, file);
|
|
30
|
-
return hasChanges ? root.toSource() : undefined;
|
|
31
|
-
};
|
|
32
|
-
exports.datasourceMssqlDomain = datasourceMssqlDomain;
|
|
33
|
-
exports.fn = exports.datasourceMssqlDomain;
|
|
34
|
-
exports.default = exports.fn;
|
|
35
|
-
//# sourceMappingURL=datasource-mssql-domain.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-mssql-domain.js","sourceRoot":"","sources":["../../../src/transforms/v1/datasource-mssql-domain.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAE5B,gDAAgD;AAChD,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,yDAAyD,CAAA;AAChD,QAAA,MAAM,GAAG,IAAI,CAAA;AAEnB,MAAM,qBAAqB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC9D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAE3B,IAAI,CAAC,IAAA,6BAAe,EAAC,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC;QAAE,OAAO,SAAS,CAAA;IAE1D,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,QAAQ,GAAG,KAAK,CAAA;IAEpB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC9C,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,qBAAc,EACV,IAAI,CAAC,IAAI,EACT,sGAAsG,EACtG,CAAC,CACJ,CAAA;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;AAxBY,QAAA,qBAAqB,yBAwBjC;AAEY,QAAA,EAAE,GAAG,6BAAqB,CAAA;AACvC,kBAAe,UAAE,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const name: string;
|
|
3
|
-
export declare const description = "migrate removed MSSQL `domain` option and fix isolation level format";
|
|
4
|
-
export declare const manual = true;
|
|
5
|
-
export declare const datasourceMssql: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
-
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
-
export default fn;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const name: string;
|
|
3
|
-
export declare const description = "remove deprecated `connectorPackage` option from MySQL config";
|
|
4
|
-
export declare const datasourceMysqlConnector: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
-
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
-
export default fn;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const name: string;
|
|
3
|
-
export declare const description = "remove deprecated `name` property from DataSource options";
|
|
4
|
-
export declare const datasourceName: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
-
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
-
export default fn;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const name: string;
|
|
3
|
-
export declare const description = "rename and remove deprecated SAP HANA connection options";
|
|
4
|
-
export declare const datasourceSap: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
-
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
-
export default fn;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,40 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const name: string;
|
|
3
|
-
export declare const description = "rename `WhereExpression` to `WhereExpressionBuilder`";
|
|
4
|
-
export declare const queryBuilderWhereExpression: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
-
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
-
export default fn;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const name: string;
|
|
3
|
-
export declare const description = "flag removed `loadedTables` and `loadedViews` for manual migration to `getTables()` / `getViews()`";
|
|
4
|
-
export declare const manual = true;
|
|
5
|
-
export declare const queryRunnerLoadedTablesViews: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
-
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
-
export default fn;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const name: string;
|
|
3
|
-
export declare const description = "flag removed `@RelationCount` decorator for manual migration";
|
|
4
|
-
export declare const manual = true;
|
|
5
|
-
export declare const relationCount: (file: FileInfo, api: API) => string | undefined;
|
|
6
|
-
export declare const fn: (file: FileInfo, api: API) => string | undefined;
|
|
7
|
-
export default fn;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const description = "replace removed `@EntityRepository` and `AbstractRepository` with TODO";
|
|
3
|
-
export declare const manual = true;
|
|
4
|
-
export declare const removeAbstractRepository: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
-
export default removeAbstractRepository;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeAbstractRepository = exports.manual = exports.description = void 0;
|
|
4
|
-
const todo_1 = require("../todo");
|
|
5
|
-
exports.description = "replace removed `@EntityRepository` and `AbstractRepository` with TODO";
|
|
6
|
-
exports.manual = true;
|
|
7
|
-
const removeAbstractRepository = (file, api) => {
|
|
8
|
-
const j = api.jscodeshift;
|
|
9
|
-
const root = j(file.source);
|
|
10
|
-
let hasChanges = false;
|
|
11
|
-
let hasTodos = false;
|
|
12
|
-
// Find @EntityRepository decorators and add TODO
|
|
13
|
-
root.find(j.Decorator, {
|
|
14
|
-
expression: {
|
|
15
|
-
type: "CallExpression",
|
|
16
|
-
callee: { type: "Identifier", name: "EntityRepository" },
|
|
17
|
-
},
|
|
18
|
-
}).forEach((path) => {
|
|
19
|
-
(0, todo_1.addTodoComment)(path.node, "`@EntityRepository` was removed in TypeORM v1. Use a custom service class with `dataSource.getRepository()`. See migration guide: https://typeorm.io/docs/guides/migration-v1", j);
|
|
20
|
-
hasChanges = true;
|
|
21
|
-
hasTodos = true;
|
|
22
|
-
});
|
|
23
|
-
// Find classes extending AbstractRepository and add TODO
|
|
24
|
-
root.find(j.ClassDeclaration).forEach((path) => {
|
|
25
|
-
const superClass = path.node.superClass;
|
|
26
|
-
if (!superClass)
|
|
27
|
-
return;
|
|
28
|
-
let name = null;
|
|
29
|
-
if (superClass.type === "Identifier") {
|
|
30
|
-
name = superClass.name;
|
|
31
|
-
}
|
|
32
|
-
else if (superClass.type === "MemberExpression" &&
|
|
33
|
-
superClass.property.type === "Identifier") {
|
|
34
|
-
name = superClass.property.name;
|
|
35
|
-
}
|
|
36
|
-
if (name !== "AbstractRepository")
|
|
37
|
-
return;
|
|
38
|
-
(0, todo_1.addTodoComment)(path.node, "`AbstractRepository` was removed in TypeORM v1. Use a custom service class with `dataSource.getRepository()`. See migration guide: https://typeorm.io/docs/guides/migration-v1", j);
|
|
39
|
-
hasChanges = true;
|
|
40
|
-
hasTodos = true;
|
|
41
|
-
});
|
|
42
|
-
// Find getCustomRepository() calls and add TODO
|
|
43
|
-
const addGetCustomRepoTodo = (path) => {
|
|
44
|
-
const message = "`getCustomRepository()` was removed in TypeORM v1. Use a custom service class with `dataSource.getRepository()`. See migration guide: https://typeorm.io/docs/guides/migration-v1";
|
|
45
|
-
const parent = path.parent;
|
|
46
|
-
if (parent.node.type === "ExpressionStatement") {
|
|
47
|
-
(0, todo_1.addTodoComment)(parent.node, message, j);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
(0, todo_1.addTodoComment)(path.node, message, j);
|
|
51
|
-
}
|
|
52
|
-
hasChanges = true;
|
|
53
|
-
hasTodos = true;
|
|
54
|
-
};
|
|
55
|
-
root.find(j.CallExpression, {
|
|
56
|
-
callee: {
|
|
57
|
-
type: "MemberExpression",
|
|
58
|
-
property: { type: "Identifier", name: "getCustomRepository" },
|
|
59
|
-
},
|
|
60
|
-
}).forEach(addGetCustomRepoTodo);
|
|
61
|
-
// Also find standalone getCustomRepository() calls
|
|
62
|
-
root.find(j.CallExpression, {
|
|
63
|
-
callee: { type: "Identifier", name: "getCustomRepository" },
|
|
64
|
-
}).forEach(addGetCustomRepoTodo);
|
|
65
|
-
// Remove imports
|
|
66
|
-
const removedImports = new Set(["EntityRepository", "AbstractRepository"]);
|
|
67
|
-
root.find(j.ImportDeclaration, {
|
|
68
|
-
source: { value: "typeorm" },
|
|
69
|
-
}).forEach((importPath) => {
|
|
70
|
-
const remaining = importPath.node.specifiers?.filter((spec) => {
|
|
71
|
-
if (spec.type === "ImportSpecifier" &&
|
|
72
|
-
spec.imported.type === "Identifier") {
|
|
73
|
-
if (removedImports.has(spec.imported.name)) {
|
|
74
|
-
hasChanges = true;
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
});
|
|
80
|
-
if (remaining?.length === 0) {
|
|
81
|
-
j(importPath).remove();
|
|
82
|
-
}
|
|
83
|
-
else if (remaining) {
|
|
84
|
-
importPath.node.specifiers = remaining;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
if (hasTodos)
|
|
88
|
-
(0, todo_1.reportTodo)("remove-abstract-repository", file, api);
|
|
89
|
-
return hasChanges ? root.toSource() : undefined;
|
|
90
|
-
};
|
|
91
|
-
exports.removeAbstractRepository = removeAbstractRepository;
|
|
92
|
-
exports.default = exports.removeAbstractRepository;
|
|
93
|
-
//# sourceMappingURL=remove-abstract-repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-abstract-repository.js","sourceRoot":"","sources":["../../../src/transforms/v1/remove-abstract-repository.ts"],"names":[],"mappings":";;;AACA,kCAAoD;AAEvC,QAAA,WAAW,GACpB,wEAAwE,CAAA;AAC/D,QAAA,MAAM,GAAG,IAAI,CAAA;AAEnB,MAAM,wBAAwB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IACjE,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAA;IACtB,IAAI,QAAQ,GAAG,KAAK,CAAA;IAEpB,iDAAiD;IACjD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE;QACnB,UAAU,EAAE;YACR,IAAI,EAAE,gBAAgB;YACtB,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,EAAE;SAC3D;KACJ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,IAAA,qBAAc,EACV,IAAI,CAAC,IAAI,EACT,+KAA+K,EAC/K,CAAC,CACJ,CAAA;QACD,UAAU,GAAG,IAAI,CAAA;QACjB,QAAQ,GAAG,IAAI,CAAA;IACnB,CAAC,CAAC,CAAA;IAEF,yDAAyD;IACzD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3C,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA;QACvC,IAAI,CAAC,UAAU;YAAE,OAAM;QAEvB,IAAI,IAAI,GAAkB,IAAI,CAAA;QAC9B,IAAI,UAAU,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACnC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QAC1B,CAAC;aAAM,IACH,UAAU,CAAC,I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|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const description = "remove deprecated `connectorPackage` option from MySQL config";
|
|
3
|
-
export declare const removeConnectorPackage: (file: FileInfo, api: API) => string | undefined;
|
|
4
|
-
export default removeConnectorPackage;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeConnectorPackage = exports.description = void 0;
|
|
4
|
-
exports.description = "remove deprecated `connectorPackage` option from MySQL config";
|
|
5
|
-
const removeConnectorPackage = (file, api) => {
|
|
6
|
-
const j = api.jscodeshift;
|
|
7
|
-
const root = j(file.source);
|
|
8
|
-
let hasChanges = false;
|
|
9
|
-
root.find(j.ObjectProperty, {
|
|
10
|
-
key: { type: "Identifier", name: "connectorPackage" },
|
|
11
|
-
}).forEach((path) => {
|
|
12
|
-
j(path).remove();
|
|
13
|
-
hasChanges = true;
|
|
14
|
-
});
|
|
15
|
-
return hasChanges ? root.toSource() : undefined;
|
|
16
|
-
};
|
|
17
|
-
exports.removeConnectorPackage = removeConnectorPackage;
|
|
18
|
-
exports.default = exports.removeConnectorPackage;
|
|
19
|
-
//# sourceMappingURL=remove-connector-package.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-connector-package.js","sourceRoot":"","sources":["../../../src/transforms/v1/remove-connector-package.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GACpB,+DAA+D,CAAA;AAE5D,MAAM,sBAAsB,GAAG,CAAC,IAAc,EAAE,GAAQ,EAAE,EAAE;IAC/D,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAA;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3B,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,EAAE;KACxD,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;AAbY,QAAA,sBAAsB,0BAalC;AAED,kBAAe,8BAAsB,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const description = "remove deprecated `name` property from DataSource options";
|
|
3
|
-
export declare const removeDatasourceName: (file: FileInfo, api: API) => string | undefined;
|
|
4
|
-
export default removeDatasourceName;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeDatasourceName = exports.description = void 0;
|
|
4
|
-
exports.description = "remove deprecated `name` property from DataSource options";
|
|
5
|
-
const removeDatasourceName = (file, api) => {
|
|
6
|
-
const j = api.jscodeshift;
|
|
7
|
-
const root = j(file.source);
|
|
8
|
-
let hasChanges = false;
|
|
9
|
-
// Look for `name` property inside object literals passed to new DataSource()
|
|
10
|
-
// or DataSource options objects
|
|
11
|
-
root.find(j.NewExpression, {
|
|
12
|
-
callee: { type: "Identifier", name: "DataSource" },
|
|
13
|
-
}).forEach((path) => {
|
|
14
|
-
const arg = path.node.arguments[0];
|
|
15
|
-
if (arg?.type !== "ObjectExpression")
|
|
16
|
-
return;
|
|
17
|
-
const filtered = arg.properties.filter((prop) => {
|
|
18
|
-
if (prop.type === "ObjectProperty" &&
|
|
19
|
-
prop.key.type === "Identifier" &&
|
|
20
|
-
prop.key.name === "name") {
|
|
21
|
-
hasChanges = true;
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
});
|
|
26
|
-
if (filtered.length !== arg.properties.length) {
|
|
27
|
-
arg.properties = filtered;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
// Also handle standalone objects with `type` and `name` properties
|
|
31
|
-
// (likely DataSource options assigned to variables)
|
|
32
|
-
root.find(j.ObjectExpression).forEach((path) => {
|
|
33
|
-
const props = path.node.properties;
|
|
34
|
-
const hasType = props.some((p) => p.type === "ObjectProperty" &&
|
|
35
|
-
p.key.type === "Identifier" &&
|
|
36
|
-
p.key.name === "type");
|
|
37
|
-
if (!hasType)
|
|
38
|
-
return;
|
|
39
|
-
const filtered = props.filter((prop) => {
|
|
40
|
-
if (prop.type === "ObjectProperty" &&
|
|
41
|
-
prop.key.type === "Identifier" &&
|
|
42
|
-
prop.key.name === "name") {
|
|
43
|
-
hasChanges = true;
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
return true;
|
|
47
|
-
});
|
|
48
|
-
if (filtered.length !== props.length) {
|
|
49
|
-
path.node.properties = filtered;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return hasChanges ? root.toSource() : undefined;
|
|
53
|
-
};
|
|
54
|
-
exports.removeDatasourceName = removeDatasourceName;
|
|
55
|
-
exports.default = exports.removeDatasourceName;
|
|
56
|
-
//# sourceMappingURL=remove-datasource-name.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-datasource-name.js","sourceRoot":"","sources":["../../../src/transforms/v1/remove-datasource-name.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GACpB,2DAA2D,CAAA;AAExD,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,CA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AG,CAAC,IAAI,KAAK,YAAY;YAC3B,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAC5B,CAAA;QAED,IAAI,CAAC,OAAO;YAAE,OAAM;QAEpB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YACnC,IACI,IAAI,CAAC,IAAI,KAAK,gBAAgB;gBAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY;gBAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,EAC1B,CAAC;gBACC,UAAU,GAAG,IAAI,CAAA;gBACjB,OAAO,KAAK,CAAA;YAChB,CAAC;YACD,OAAO,IAAI,CAAA;QACf,CAAC,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAA;QACnC,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AA7DY,QAAA,oBAAoB,wBA6DhC;AAED,kBAAe,4BAAoB,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const description = "remove and rename deprecated MongoDB connection options";
|
|
3
|
-
export declare const manual = true;
|
|
4
|
-
export declare const removeMongodbOptions: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
-
export default removeMongodbOptions;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeMongodbOptions = exports.manual = exports.description = void 0;
|
|
4
|
-
const todo_1 = require("../todo");
|
|
5
|
-
exports.description = "remove and rename deprecated MongoDB connection options";
|
|
6
|
-
exports.manual = true;
|
|
7
|
-
const removeMongodbOptions = (file, api) => {
|
|
8
|
-
const j = api.jscodeshift;
|
|
9
|
-
const root = j(file.source);
|
|
10
|
-
let hasChanges = false;
|
|
11
|
-
let hasTodos = false;
|
|
12
|
-
const removeProps = new Set([
|
|
13
|
-
"useNewUrlParser",
|
|
14
|
-
"useUnifiedTopology",
|
|
15
|
-
"keepAlive",
|
|
16
|
-
"keepAliveInitialDelay",
|
|
17
|
-
"sslCRL",
|
|
18
|
-
]);
|
|
19
|
-
const simpleRenames = {
|
|
20
|
-
appname: "appName",
|
|
21
|
-
ssl: "tls",
|
|
22
|
-
sslCA: "tlsCAFile",
|
|
23
|
-
sslCert: "tlsCertificateKeyFile",
|
|
24
|
-
sslKey: "tlsCertificateKeyFile",
|
|
25
|
-
sslPass: "tlsCertificateKeyFilePassword",
|
|
26
|
-
};
|
|
27
|
-
const writeConcernProps = new Set([
|
|
28
|
-
"fsync",
|
|
29
|
-
"j",
|
|
30
|
-
"w",
|
|
31
|
-
"wtimeout",
|
|
32
|
-
"wtimeoutMS",
|
|
33
|
-
]);
|
|
34
|
-
// Remove deprecated options
|
|
35
|
-
root.find(j.ObjectProperty).forEach((path) => {
|
|
36
|
-
if (path.node.key.type !== "Identifier" &&
|
|
37
|
-
path.node.key.type !== "StringLiteral") {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const name = path.node.key.type === "Identifier"
|
|
41
|
-
? path.node.key.name
|
|
42
|
-
: path.node.key.value;
|
|
43
|
-
if (removeProps.has(name)) {
|
|
44
|
-
j(path).remove();
|
|
45
|
-
hasChanges = true;
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
// Simple renames
|
|
49
|
-
if (simpleRenames[name]) {
|
|
50
|
-
if (path.node.key.type === "Identifier") {
|
|
51
|
-
path.node.key.name = simpleRenames[name];
|
|
52
|
-
}
|
|
53
|
-
else if (path.node.key.type === "StringLiteral") {
|
|
54
|
-
path.node.key.value = simpleRenames[name];
|
|
55
|
-
}
|
|
56
|
-
hasChanges = true;
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
// sslValidate → tlsAllowInvalidCertificates (inverted boolean — add TODO)
|
|
60
|
-
if (name === "sslValidate") {
|
|
61
|
-
if (path.node.key.type === "Identifier") {
|
|
62
|
-
path.node.key.name = "tlsAllowInvalidCertificates";
|
|
63
|
-
}
|
|
64
|
-
else if (path.node.key.type === "StringLiteral") {
|
|
65
|
-
path.node.key.value = "tlsAllowInvalidCertificates";
|
|
66
|
-
}
|
|
67
|
-
// Add TODO comment about inverted boolean
|
|
68
|
-
(0, todo_1.addTodoComment)(path.node, "`sslValidate` was renamed to `tlsAllowInvalidCertificates` with inverted boolean logic. Review and invert the value.", j);
|
|
69
|
-
hasChanges = true;
|
|
70
|
-
hasTodos = true;
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
// writeConcern-related props → add TODO
|
|
74
|
-
if (writeConcernProps.has(name)) {
|
|
75
|
-
(0, todo_1.addTodoComment)(path.node, `\`${name}\` was removed in TypeORM v1. Migrate to \`writeConcern: { ... }\`. See migration guide: https://typeorm.io/docs/guides/migration-v1`, j);
|
|
76
|
-
hasChanges = true;
|
|
77
|
-
hasTodos = true;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
if (hasTodos)
|
|
81
|
-
(0, todo_1.reportTodo)("remove-mongodb-options", file, api);
|
|
82
|
-
return hasChanges ? root.toSource() : undefined;
|
|
83
|
-
};
|
|
84
|
-
exports.removeMongodbOptions = removeMongodbOptions;
|
|
85
|
-
exports.default = exports.removeMongodbOptions;
|
|
86
|
-
//# sourceMappingURL=remove-mongodb-options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-mongodb-options.js","sourceRoot":"","sources":["../../../src/transforms/v1/remove-mongodb-options.ts"],"names":[],"mappings":";;;AACA,kCAAoD;AAEvC,QAAA,WAAW,GACpB,yDAAyD,CAAA;AAChD,QAAA,MAAM,GAAG,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ACV,IAAI,CAAC,IAAI,EACT,KAAK,IAAI,sIAAsI,EAC/I,CAAC,CACJ,CAAA;YACD,UAAU,GAAG,IAAI,CAAA;YACjB,QAAQ,GAAG,IAAI,CAAA;QACnB,CAAC;IACL,CAAC,CAAC,CAAA;IAEF,IAAI,QAAQ;QAAE,IAAA,iBAAU,EAAC,wBAAwB,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;IAE7D,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACnD,CAAC,CAAA;AA/FY,QAAA,oBAAoB,wBA+FhC;AAED,kBAAe,4BAAoB,CAAA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { API, FileInfo } from "jscodeshift";
|
|
2
|
-
export declare const description = "replace removed `@RelationCount` decorator with TODO";
|
|
3
|
-
export declare const manual = true;
|
|
4
|
-
export declare const removeRelationCount: (file: FileInfo, api: API) => string | undefined;
|
|
5
|
-
export default removeRelationCount;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeRelationCount = exports.manual = exports.description = void 0;
|
|
4
|
-
const todo_1 = require("../todo");
|
|
5
|
-
exports.description = "replace removed `@RelationCount` decorator with TODO";
|
|
6
|
-
exports.manual = true;
|
|
7
|
-
const removeRelationCount = (file, api) => {
|
|
8
|
-
const j = api.jscodeshift;
|
|
9
|
-
const root = j(file.source);
|
|
10
|
-
let hasChanges = false;
|
|
11
|
-
let hasTodos = false;
|
|
12
|
-
// Find @RelationCount decorators and add TODO
|
|
13
|
-
root.find(j.Decorator, {
|
|
14
|
-
expression: {
|
|
15
|
-
type: "CallExpression",
|
|
16
|
-
callee: { type: "Identifier", name: "RelationCount" },
|
|
17
|
-
},
|
|
18
|
-
}).forEach((path) => {
|
|
19
|
-
(0, todo_1.addTodoComment)(path.node, "`@RelationCount` was removed in TypeORM v1. Use `QueryBuilder` with `loadRelationCountAndMap()` instead. See migration guide: https://typeorm.io/docs/guides/migration-v1", j);
|
|
20
|
-
hasChanges = true;
|
|
21
|
-
hasTodos = true;
|
|
22
|
-
});
|
|
23
|
-
// Remove RelationCount import from typeorm
|
|
24
|
-
root.find(j.ImportDeclaration, {
|
|
25
|
-
source: { value: "typeorm" },
|
|
26
|
-
}).forEach((importPath) => {
|
|
27
|
-
const remaining = importPath.node.specifiers?.filter((spec) => {
|
|
28
|
-
if (spec.type === "ImportSpecifier" &&
|
|
29
|
-
spec.imported.type === "Identifier" &&
|
|
30
|
-
spec.imported.name === "RelationCount") {
|
|
31
|
-
hasChanges = true;
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
});
|
|
36
|
-
if (remaining?.length === 0) {
|
|
37
|
-
j(importPath).remove();
|
|
38
|
-
}
|
|
39
|
-
else if (remaining) {
|
|
40
|
-
importPath.node.specifiers = remaining;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
if (hasTodos)
|
|
44
|
-
(0, todo_1.reportTodo)("remove-relation-count", file, api);
|
|
45
|
-
return hasChanges ? root.toSource() : undefined;
|
|
46
|
-
};
|
|
47
|
-
exports.removeRelationCount = removeRelationCount;
|
|
48
|
-
exports.default = exports.removeRelationCount;
|
|
49
|
-
//# sourceMappingURL=remove-relation-count.js.map
|