@trpc/upgrade 11.23.0 → 11.23.1-canary.14.507382d73

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/dist/bin.mjs CHANGED
@@ -12,7 +12,7 @@ import { promisify } from "node:util";
12
12
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
13
13
  //#endregion
14
14
  //#region package.json
15
- var version = "11.23.0";
15
+ var version = "11.23.1-canary.14.507382d73";
16
16
  //#endregion
17
17
  //#region src/lib/ast/scanners.ts
18
18
  function getProgram() {
@@ -79,6 +79,13 @@ const utilMap = {
79
79
  getData: ["getQueryData", "queryKey"],
80
80
  getInfiniteData: ["getQueryData", "infiniteQueryKey"]
81
81
  };
82
+ /**
83
+ * Codemod that rewrites `@trpc/react-query` hook calls, such as
84
+ * `trpc.post.byId.useQuery()`, to TanStack Query hooks with
85
+ * `@trpc/tanstack-react-query` options.
86
+ *
87
+ * @see https://trpc.io/docs/client/tanstack-react-query/migrating#codemod-migration
88
+ */
82
89
  function transform(file, api, options) {
83
90
  const { trpcImportName } = options;
84
91
  if (!trpcImportName) throw new Error("trpcImportName is required");
@@ -3,6 +3,13 @@ import { API, FileInfo, Options } from "jscodeshift";
3
3
  interface TransformOptions extends Options {
4
4
  trpcImportName?: string;
5
5
  }
6
+ /**
7
+ * Codemod that rewrites `@trpc/react-query` hook calls, such as
8
+ * `trpc.post.byId.useQuery()`, to TanStack Query hooks with
9
+ * `@trpc/tanstack-react-query` options.
10
+ *
11
+ * @see https://trpc.io/docs/client/tanstack-react-query/migrating#codemod-migration
12
+ */
6
13
  export default function transform(file: FileInfo, api: API, options: TransformOptions): string | undefined;
7
14
  export declare const parser = "tsx";
8
15
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"hooksToOptions.d.cts","names":[],"sources":["../../src/transforms/hooksToOptions.ts"],"mappings":";;UAgBU,yBAAyB;EACjC;;wBA6CsB,UACtB,MAAM,UACN,KAAK,KACL,SAAS;qBA6XE"}
1
+ {"version":3,"file":"hooksToOptions.d.cts","names":[],"sources":["../../src/transforms/hooksToOptions.ts"],"mappings":";;UAgBU,yBAAyB;EACjC;;;;;;;;;wBAoDsB,UACtB,MAAM,UACN,KAAK,KACL,SAAS;qBA6XE"}
@@ -3,6 +3,12 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#region src/transforms/provider.ts
6
+ /**
7
+ * Codemod that replaces `createTRPCReact` with `createTRPCContext` from
8
+ * `@trpc/tanstack-react-query`.
9
+ *
10
+ * @see https://trpc.io/docs/client/tanstack-react-query/migrating#codemod-migration
11
+ */
6
12
  function transform(file, api, options) {
7
13
  const { trpcImportName } = options;
8
14
  let routerName = void 0;
@@ -3,6 +3,12 @@ import { API, FileInfo, Options } from "jscodeshift";
3
3
  interface TransformOptions extends Options {
4
4
  trpcImportName?: string;
5
5
  }
6
+ /**
7
+ * Codemod that replaces `createTRPCReact` with `createTRPCContext` from
8
+ * `@trpc/tanstack-react-query`.
9
+ *
10
+ * @see https://trpc.io/docs/client/tanstack-react-query/migrating#codemod-migration
11
+ */
6
12
  export default function transform(file: FileInfo, api: API, options: TransformOptions): string | undefined;
7
13
  export declare const parser = "tsx";
8
14
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.cts","names":[],"sources":["../../src/transforms/provider.ts"],"mappings":";;UAEU,yBAAyB;EACjC;;wBAGsB,UACtB,MAAM,UACN,KAAK,KACL,SAAS;qBAwIE"}
1
+ {"version":3,"file":"provider.d.cts","names":[],"sources":["../../src/transforms/provider.ts"],"mappings":";;UAEU,yBAAyB;EACjC;;;;;;;;wBASsB,UACtB,MAAM,UACN,KAAK,KACL,SAAS;qBAwIE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/upgrade",
3
- "version": "11.23.0",
3
+ "version": "11.23.1-canary.14.507382d73",
4
4
  "description": "Upgrade scripts for tRPC",
5
5
  "author": "juliusmarminge",
6
6
  "license": "MIT",
@@ -39,10 +39,10 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@tanstack/react-query": "^5.105.0",
42
- "@trpc/client": "11.23.0",
43
- "@trpc/react-query": "11.23.0",
44
- "@trpc/server": "11.23.0",
45
- "@trpc/tanstack-react-query": "11.23.0",
42
+ "@trpc/client": "11.23.1-canary.14.507382d73",
43
+ "@trpc/react-query": "11.23.1-canary.14.507382d73",
44
+ "@trpc/server": "11.23.1-canary.14.507382d73",
45
+ "@trpc/tanstack-react-query": "11.23.1-canary.14.507382d73",
46
46
  "@types/jscodeshift": "17.3.0",
47
47
  "@types/node": "^24.13.4",
48
48
  "oxfmt": "^0.75.0",
@@ -57,5 +57,5 @@
57
57
  "funding": [
58
58
  "https://trpc.io/sponsor"
59
59
  ],
60
- "gitHead": "c3c5ebb95499dc8e91b639013c22d695be8c3cf8"
60
+ "gitHead": "507382d73fde2e52b31bd108a79a1d092ed2f5e9"
61
61
  }
@@ -60,6 +60,13 @@ const utilMap = {
60
60
  } as const;
61
61
  type ProxyMethod = keyof typeof utilMap;
62
62
 
63
+ /**
64
+ * Codemod that rewrites `@trpc/react-query` hook calls, such as
65
+ * `trpc.post.byId.useQuery()`, to TanStack Query hooks with
66
+ * `@trpc/tanstack-react-query` options.
67
+ *
68
+ * @see https://trpc.io/docs/client/tanstack-react-query/migrating#codemod-migration
69
+ */
63
70
  export default function transform(
64
71
  file: FileInfo,
65
72
  api: API,
@@ -4,6 +4,12 @@ interface TransformOptions extends Options {
4
4
  trpcImportName?: string;
5
5
  }
6
6
 
7
+ /**
8
+ * Codemod that replaces `createTRPCReact` with `createTRPCContext` from
9
+ * `@trpc/tanstack-react-query`.
10
+ *
11
+ * @see https://trpc.io/docs/client/tanstack-react-query/migrating#codemod-migration
12
+ */
7
13
  export default function transform(
8
14
  file: FileInfo,
9
15
  api: API,