joist-codegen 1.225.2 → 1.226.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/build/codemods/__tests__/v1_226_0_rename_current_txn_knex.test.d.ts +2 -0
- package/build/codemods/__tests__/v1_226_0_rename_current_txn_knex.test.d.ts.map +1 -0
- package/build/codemods/__tests__/v1_226_0_rename_current_txn_knex.test.js +9 -0
- package/build/codemods/__tests__/v1_226_0_rename_current_txn_knex.test.js.map +1 -0
- package/build/codemods/index.d.ts.map +1 -1
- package/build/codemods/index.js +2 -0
- package/build/codemods/index.js.map +1 -1
- package/build/codemods/v1_226_0_rename_current_txn_knex.d.ts +7 -0
- package/build/codemods/v1_226_0_rename_current_txn_knex.d.ts.map +1 -0
- package/build/codemods/v1_226_0_rename_current_txn_knex.js +25 -0
- package/build/codemods/v1_226_0_rename_current_txn_knex.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_226_0_rename_current_txn_knex.test.d.ts","sourceRoot":"","sources":["../../../src/codemods/__tests__/v1_226_0_rename_current_txn_knex.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const testUtils_1 = require("jscodeshift/src/testUtils");
|
|
4
|
+
describe("v1_226_0_rename_current_txn_knex", () => {
|
|
5
|
+
(0, testUtils_1.defineTest)(__dirname, "v1_226_0_rename_current_txn_knex", null, "v1_226_0_rename_current_txn_knex", {
|
|
6
|
+
parser: "ts",
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=v1_226_0_rename_current_txn_knex.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_226_0_rename_current_txn_knex.test.js","sourceRoot":"","sources":["../../../src/codemods/__tests__/v1_226_0_rename_current_txn_knex.test.ts"],"names":[],"mappings":";;AAAA,yDAAuD;AAEvD,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,IAAA,sBAAU,EAAC,SAAS,EAAE,kCAAkC,EAAE,IAAI,EAAE,kCAAkC,EAAE;QAClG,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codemods/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codemods/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOnC,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDtE;AAED,wBAAgB,cAAc,IAAI,MAAM,CAIvC"}
|
package/build/codemods/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const adjustVersion_1 = require("../adjustVersion");
|
|
|
10
10
|
const v1_143_0_rename_derived_async_property_1 = require("./v1_143_0_rename_derived_async_property");
|
|
11
11
|
const v1_148_0_move_codegen_files_1 = require("./v1_148_0_move_codegen_files");
|
|
12
12
|
const v1_151_0_rename_derived_async_reference_1 = require("./v1_151_0_rename_derived_async_reference");
|
|
13
|
+
const v1_226_0_rename_current_txn_knex_1 = require("./v1_226_0_rename_current_txn_knex");
|
|
13
14
|
async function maybeRunTransforms(config) {
|
|
14
15
|
const { default: inquirer } = await import("inquirer");
|
|
15
16
|
const confVersion = config.version;
|
|
@@ -63,6 +64,7 @@ function findApplyableCodemods(prevVersion) {
|
|
|
63
64
|
v1_143_0_rename_derived_async_property_1.v1_143_0_rename_derived_async_property,
|
|
64
65
|
v1_148_0_move_codegen_files_1.v1_148_0_move_codegen_files,
|
|
65
66
|
v1_151_0_rename_derived_async_reference_1.v1_151_0_rename_derived_reference,
|
|
67
|
+
v1_226_0_rename_current_txn_knex_1.v1_226_0_rename_current_txn_knex,
|
|
66
68
|
].filter((t) => semver_1.default.lt(prevVersion, t.version));
|
|
67
69
|
}
|
|
68
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/codemods/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/codemods/index.ts"],"names":[],"mappings":";;;;;AASA,gDAmDC;AAED,wCAIC;AAlED,oDAA4B;AAC5B,oDAAkE;AAGlE,qGAAkG;AAClG,+EAA4E;AAC5E,uGAA8F;AAC9F,yFAAsF;AAE/E,KAAK,UAAU,kBAAkB,CAAC,MAAc;IACrD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IAEnC,yEAAyE;IACzE,qEAAqE;IACrE,IAAI,WAAW,KAAK,OAAO;QAAE,OAAO;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,IAAI,gBAAM,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC;QACxC,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,6CAA6C;QAC7C,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CACT,4BAA4B,WAAW,kBAAkB,IAAI,CAAC,MAAM,gCAAgC,WAAW,GAAG,CACnH,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QAChC,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,6BAA6B;KACvC,CAAC,CAAC;IAEH,iBAAiB;IACjB,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,qBAAqB;IACrB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YAChC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,sBAAsB,GAAG,CAAC,WAAW,GAAG;SAClD,CAAC,CAAC;QACH,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,iCAAiC,WAAW,GAAG,CAAC,CAAC;IAE7D,yEAAyE;IACzE,MAAM,CAAC,OAAO,GAAG,WAAW,CAAC;AAC/B,CAAC;AAED,SAAgB,cAAc;IAC5B,yFAAyF;IACzF,wFAAwF;IACxF,OAAO,IAAA,8CAA8B,EAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,qBAAqB,CAAC,WAAmB;IAChD,OAAO;QACL,+EAAsC;QACtC,yDAA2B;QAC3B,2EAAiC;QACjC,mEAAgC;KACjC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAM,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Transform } from "jscodeshift";
|
|
2
|
+
import { JscodeshiftMod } from "./JscodeshiftMod";
|
|
3
|
+
export declare const v1_226_0_rename_current_txn_knex: JscodeshiftMod;
|
|
4
|
+
/** Find/replace `currentTxnKnex` with `txn` */
|
|
5
|
+
declare const transform: Transform;
|
|
6
|
+
export default transform;
|
|
7
|
+
//# sourceMappingURL=v1_226_0_rename_current_txn_knex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_226_0_rename_current_txn_knex.d.ts","sourceRoot":"","sources":["../../src/codemods/v1_226_0_rename_current_txn_knex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,gCAAgC,gBAK5C,CAAC;AAEF,+CAA+C;AAC/C,QAAA,MAAM,SAAS,EAAE,SAmBhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.v1_226_0_rename_current_txn_knex = void 0;
|
|
4
|
+
const JscodeshiftMod_1 = require("./JscodeshiftMod");
|
|
5
|
+
exports.v1_226_0_rename_current_txn_knex = new JscodeshiftMod_1.JscodeshiftMod("1.226.0", "v1_226_0_rename_current_txn_knex", "Rename `currentTxnKnex` to `txn`", (config) => `src/**/*.ts`);
|
|
6
|
+
/** Find/replace `currentTxnKnex` with `txn` */
|
|
7
|
+
const transform = (file, api) => {
|
|
8
|
+
const j = api.jscodeshift;
|
|
9
|
+
// Find all member expressions where property is 'currentTxnKnex'
|
|
10
|
+
return j(file.source)
|
|
11
|
+
.find(j.MemberExpression, {
|
|
12
|
+
property: { name: "currentTxnKnex" },
|
|
13
|
+
})
|
|
14
|
+
.forEach((path) => {
|
|
15
|
+
// Create new member expression
|
|
16
|
+
const newNode = j.memberExpression(path.node.object, j.identifier("txn"), path.node.computed);
|
|
17
|
+
// If the original node had optional chaining, preserve it
|
|
18
|
+
if (path.node.optional)
|
|
19
|
+
newNode.optional = true;
|
|
20
|
+
j(path).replaceWith(newNode);
|
|
21
|
+
})
|
|
22
|
+
.toSource();
|
|
23
|
+
};
|
|
24
|
+
exports.default = transform;
|
|
25
|
+
//# sourceMappingURL=v1_226_0_rename_current_txn_knex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_226_0_rename_current_txn_knex.js","sourceRoot":"","sources":["../../src/codemods/v1_226_0_rename_current_txn_knex.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAErC,QAAA,gCAAgC,GAAG,IAAI,+BAAc,CAChE,SAAS,EACT,kCAAkC,EAClC,kCAAkC,EAClC,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,CAC1B,CAAC;AAEF,+CAA+C;AAC/C,MAAM,SAAS,GAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACzC,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC;IAC1B,iEAAiE;IACjE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;SAClB,IAAI,CAAC,CAAC,CAAC,gBAAgB,EAAE;QACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;KACrC,CAAC;SACD,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,+BAA+B;QAC/B,MAAM,OAAO,GAAG,CAAC,CAAC,gBAAgB,CAChC,IAAI,CAAC,IAAI,CAAC,MAAM,EAChB,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,EACnB,IAAI,CAAC,IAAI,CAAC,QAAQ,CACnB,CAAC;QACF,0DAA0D;QAC1D,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;QAChD,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC;SACD,QAAQ,EAAE,CAAC;AAChB,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joist-codegen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.226.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"change-case": "^4.1.2",
|
|
26
26
|
"fast-glob": "^3.3.2",
|
|
27
27
|
"inquirer": "^9.3.7",
|
|
28
|
-
"joist-utils": "1.
|
|
28
|
+
"joist-utils": "1.226.0",
|
|
29
29
|
"jscodeshift": "^17.1.1",
|
|
30
30
|
"knex": "^3.1.0",
|
|
31
31
|
"pg": "^8.13.1",
|