joist-codegen 1.244.3 → 1.245.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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=v1_245_0_upsert_rename.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v1_245_0_upsert_rename.test.d.ts","sourceRoot":"","sources":["../../../src/codemods/__tests__/v1_245_0_upsert_rename.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_245_0_upsert_rename", () => {
5
+ (0, testUtils_1.defineTest)(__dirname, "v1_245_0_upsert_rename", null, "v1_245_0_upsert_rename", {
6
+ parser: "ts",
7
+ });
8
+ });
9
+ //# sourceMappingURL=v1_245_0_upsert_rename.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v1_245_0_upsert_rename.test.js","sourceRoot":"","sources":["../../../src/codemods/__tests__/v1_245_0_upsert_rename.test.ts"],"names":[],"mappings":";;AAAA,yDAAuD;AAEvD,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAA,sBAAU,EAAC,SAAS,EAAE,wBAAwB,EAAE,IAAI,EAAE,wBAAwB,EAAE;QAC9E,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Transform } from "jscodeshift";
2
+ import { JscodeshiftMod } from "./JscodeshiftMod";
3
+ export declare const v1_245_0_upsert_rename: JscodeshiftMod;
4
+ /** Find/replace `createOrUpdatePartial` with `upsert` */
5
+ declare const transform: Transform;
6
+ export default transform;
7
+ //# sourceMappingURL=v1_245_0_upsert_rename.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v1_245_0_upsert_rename.d.ts","sourceRoot":"","sources":["../../src/codemods/v1_245_0_upsert_rename.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,sBAAsB,gBAKlC,CAAC;AAEF,yDAAyD;AACzD,QAAA,MAAM,SAAS,EAAE,SAkBhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.v1_245_0_upsert_rename = void 0;
4
+ const JscodeshiftMod_1 = require("./JscodeshiftMod");
5
+ exports.v1_245_0_upsert_rename = new JscodeshiftMod_1.JscodeshiftMod("1.245.0", "v1_245_0_upsert_rename", "Rename `createOrUpdatePartial` to `upsert`", () => `src/**/*.ts`);
6
+ /** Find/replace `createOrUpdatePartial` with `upsert` */
7
+ const transform = (file, api) => {
8
+ const j = api.jscodeshift;
9
+ return j(file.source)
10
+ .find(j.MemberExpression, {
11
+ property: { name: "createOrUpdatePartial" },
12
+ })
13
+ .forEach((path) => {
14
+ // Create new member expression with 'upsert' identifier
15
+ const newNode = j.memberExpression(path.node.object, j.identifier("upsert"), path.node.computed);
16
+ // If the original node had optional chaining, preserve it
17
+ if (path.node.optional)
18
+ newNode.optional = true;
19
+ j(path).replaceWith(newNode);
20
+ })
21
+ .toSource();
22
+ };
23
+ exports.default = transform;
24
+ //# sourceMappingURL=v1_245_0_upsert_rename.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v1_245_0_upsert_rename.js","sourceRoot":"","sources":["../../src/codemods/v1_245_0_upsert_rename.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAErC,QAAA,sBAAsB,GAAG,IAAI,+BAAc,CACtD,SAAS,EACT,wBAAwB,EACxB,4CAA4C,EAC5C,GAAG,EAAE,CAAC,aAAa,CACpB,CAAC;AAEF,yDAAyD;AACzD,MAAM,SAAS,GAAc,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;IACzC,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,CAAC;IAC1B,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;SAClB,IAAI,CAAC,CAAC,CAAC,gBAAgB,EAAE;QACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE;KAC5C,CAAC;SACD,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAChB,wDAAwD;QACxD,MAAM,OAAO,GAAG,CAAC,CAAC,gBAAgB,CAChC,IAAI,CAAC,IAAI,CAAC,MAAM,EAChB,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,EACtB,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.244.3",
3
+ "version": "1.245.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "change-case": "^4.1.2",
27
27
  "fast-glob": "^3.3.3",
28
28
  "inquirer": "^9.3.7",
29
- "joist-utils": "1.244.3",
29
+ "joist-utils": "1.245.0",
30
30
  "jscodeshift": "^17.3.0",
31
31
  "knex": "^3.1.0",
32
32
  "pg": "^8.15.5",