@suspensive/codemods 3.21.1 → 4.0.0-next.1
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/codemods.cjs +2 -2
- package/dist/bin/{transformRunner-CuvDQucY.cjs → transformRunner-Bm8Ge6Vu.cjs} +4 -0
- package/dist/bin/transformRunner.cjs +1 -1
- package/dist/bin/transformRunner.d.cts.map +1 -1
- package/dist/transforms/{createParserFromPath-B3qLmOmq.cjs → createParserFromPath-7qRmKnCS.cjs} +6 -0
- package/dist/transforms/migrate-query-client-consumer-props.cjs +1 -1
- package/dist/transforms/migrate-query-client-consumer-props.d.cts.map +1 -1
- package/dist/transforms/migrate-to-v4.cjs +156 -0
- package/dist/transforms/migrate-to-v4.d.cts +6 -0
- package/dist/transforms/migrate-to-v4.d.cts.map +1 -0
- package/dist/transforms/migrate-with-api.cjs +1 -1
- package/dist/transforms/migrate-with-api.d.cts.map +1 -1
- package/dist/transforms/remove-networkmode.cjs +1 -1
- package/dist/transforms/remove-networkmode.d.cts.map +1 -1
- package/dist/transforms/tanstack-query-import.cjs +39 -21
- package/dist/transforms/tanstack-query-import.d.cts.map +1 -1
- package/package.json +1 -1
package/dist/bin/codemods.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_transformRunner = require("./transformRunner-
|
|
2
|
+
const require_transformRunner = require("./transformRunner-Bm8Ge6Vu.cjs");
|
|
3
3
|
let _commander_js_extra_typings = require("@commander-js/extra-typings");
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@suspensive/codemods";
|
|
6
|
-
var version = "
|
|
6
|
+
var version = "4.0.0-next.1";
|
|
7
7
|
var description = "Codemods for @suspensive.";
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/bin/codemods.ts
|
|
@@ -27,6 +27,10 @@ let prompts = require("prompts");
|
|
|
27
27
|
prompts = __toESM(prompts, 1);
|
|
28
28
|
//#region src/bin/transformRunner.ts
|
|
29
29
|
const TRANSFORMER_INQUIRER_CHOICES = [
|
|
30
|
+
{
|
|
31
|
+
title: "migrate-to-v4",
|
|
32
|
+
description: "Migrates Suspensive v3 APIs to v4"
|
|
33
|
+
},
|
|
30
34
|
{
|
|
31
35
|
title: "tanstack-query-import",
|
|
32
36
|
description: "Migrate imports to @tanstack/react-query in @suspensive/react-query"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_transformRunner = require("./transformRunner-
|
|
2
|
+
const require_transformRunner = require("./transformRunner-Bm8Ge6Vu.cjs");
|
|
3
3
|
exports.jscodeshiftExecutable = require_transformRunner.jscodeshiftExecutable;
|
|
4
4
|
exports.transformRunner = require_transformRunner.transformRunner;
|
|
5
5
|
exports.transformerDirectory = require_transformRunner.transformerDirectory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformRunner.d.cts","names":[],"sources":["../../src/bin/transformRunner.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"transformRunner.d.cts","names":[],"sources":["../../src/bin/transformRunner.ts"],"mappings":";cA+Ba,qBAAA;AAAA,cACA,oBAAA;AAAA,iBAES,eAAA,CAAgB,SAAA,WAAoB,IAAA,WAAe,OAAA;EAAY,GAAA;EAAe,KAAA;AAAA,IAAiB,OAAA"}
|
package/dist/transforms/{createParserFromPath-B3qLmOmq.cjs → createParserFromPath-7qRmKnCS.cjs}
RENAMED
|
@@ -35,6 +35,12 @@ function createParserFromPath(filePath) {
|
|
|
35
35
|
return /\.[mc]?ts$/.test(filePath) ? jscodeshift.default.withParser("ts") : jscodeshift.default.withParser("tsx");
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
|
+
Object.defineProperty(exports, "__toESM", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function() {
|
|
41
|
+
return __toESM;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
38
44
|
Object.defineProperty(exports, "createParserFromPath", {
|
|
39
45
|
enumerable: true,
|
|
40
46
|
get: function() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_createParserFromPath = require("./createParserFromPath-
|
|
1
|
+
const require_createParserFromPath = require("./createParserFromPath-7qRmKnCS.cjs");
|
|
2
2
|
//#region src/transforms/migrate-query-client-consumer-props.ts
|
|
3
3
|
function transform(file) {
|
|
4
4
|
const j = require_createParserFromPath.createParserFromPath(file.path);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-query-client-consumer-props.d.cts","names":[],"sources":["../../src/transforms/migrate-query-client-consumer-props.ts"],"mappings":";;;iBAGwB,SAAA,CAAU,
|
|
1
|
+
{"version":3,"file":"migrate-query-client-consumer-props.d.cts","names":[],"sources":["../../src/transforms/migrate-query-client-consumer-props.ts"],"mappings":";;;iBAGwB,SAAA,CAAU,IAAc,EAAR,QAAQ;AAAA"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
const require_createParserFromPath = require("./createParserFromPath-7qRmKnCS.cjs");
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
let node_path = require("node:path");
|
|
4
|
+
//#region src/transforms/utils/detectTanStackVersion.ts
|
|
5
|
+
const DEFAULT_VERSION = 5;
|
|
6
|
+
let cachedVersion;
|
|
7
|
+
function detectTanStackVersion(startDir = process.cwd()) {
|
|
8
|
+
const override = Number(process.env.SUSPENSIVE_RQ_TARGET);
|
|
9
|
+
if (!isNaN(override)) return override;
|
|
10
|
+
if (cachedVersion !== void 0) return cachedVersion;
|
|
11
|
+
const range = findTanStackRange(startDir);
|
|
12
|
+
if (range === void 0) {
|
|
13
|
+
console.warn(`Could not detect @tanstack/react-query version from package.json. Defaulting to v${DEFAULT_VERSION}.`);
|
|
14
|
+
cachedVersion = DEFAULT_VERSION;
|
|
15
|
+
return cachedVersion;
|
|
16
|
+
}
|
|
17
|
+
const major = parseMajor(range);
|
|
18
|
+
if (major === void 0) {
|
|
19
|
+
console.warn(`Could not parse major version from @tanstack/react-query range "${range}". Defaulting to v${DEFAULT_VERSION}.`);
|
|
20
|
+
cachedVersion = DEFAULT_VERSION;
|
|
21
|
+
return cachedVersion;
|
|
22
|
+
}
|
|
23
|
+
cachedVersion = major;
|
|
24
|
+
return cachedVersion;
|
|
25
|
+
}
|
|
26
|
+
function findTanStackRange(startDir) {
|
|
27
|
+
let current = startDir;
|
|
28
|
+
let parent = (0, node_path.dirname)(current);
|
|
29
|
+
while (parent !== current) {
|
|
30
|
+
const pkgPath = (0, node_path.join)(current, "package.json");
|
|
31
|
+
if ((0, node_fs.existsSync)(pkgPath)) try {
|
|
32
|
+
const raw = (0, node_fs.readFileSync)(pkgPath, "utf8");
|
|
33
|
+
const pkg = JSON.parse(raw);
|
|
34
|
+
const range = pkg.dependencies?.["@tanstack/react-query"] ?? pkg.devDependencies?.["@tanstack/react-query"] ?? pkg.peerDependencies?.["@tanstack/react-query"];
|
|
35
|
+
if (range) return range;
|
|
36
|
+
} catch {}
|
|
37
|
+
current = parent;
|
|
38
|
+
parent = (0, node_path.dirname)(current);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function parseMajor(range) {
|
|
42
|
+
const match = /(\d+)/.exec(range);
|
|
43
|
+
if (!match) return;
|
|
44
|
+
const n = Number(match[1]);
|
|
45
|
+
if (Number.isInteger(n)) return n;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/transforms/migrate-to-v4.ts
|
|
49
|
+
const UNVERSIONED_SOURCE = "@suspensive/react-query";
|
|
50
|
+
const SOURCE_PATTERN = /^@suspensive\/react-query(-\d+)?$/;
|
|
51
|
+
const TANSTACK_TARGET = "@tanstack/react-query";
|
|
52
|
+
const TANSTACK_APIS = [
|
|
53
|
+
"useSuspenseQuery",
|
|
54
|
+
"UseSuspenseQueryResult",
|
|
55
|
+
"UseSuspenseQueryOptions",
|
|
56
|
+
"useSuspenseQueries",
|
|
57
|
+
"SuspenseQueriesResults",
|
|
58
|
+
"SuspenseQueriesOptions",
|
|
59
|
+
"useSuspenseInfiniteQuery",
|
|
60
|
+
"UseSuspenseInfiniteQueryResult",
|
|
61
|
+
"UseSuspenseInfiniteQueryOptions",
|
|
62
|
+
"usePrefetchQuery",
|
|
63
|
+
"usePrefetchInfiniteQuery",
|
|
64
|
+
"queryOptions",
|
|
65
|
+
"infiniteQueryOptions",
|
|
66
|
+
"mutationOptions"
|
|
67
|
+
];
|
|
68
|
+
const DEPRECATED_REMOVED = [
|
|
69
|
+
"SelectedInfiniteOptions",
|
|
70
|
+
"UnSelectedInfiniteOptions",
|
|
71
|
+
"SelectedQueryOptions",
|
|
72
|
+
"UnSelectedQueryOptions"
|
|
73
|
+
];
|
|
74
|
+
function transform(file) {
|
|
75
|
+
const j = require_createParserFromPath.createParserFromPath(file.path);
|
|
76
|
+
const root = j(file.source);
|
|
77
|
+
const versionedTarget = `@suspensive/react-query-${detectTanStackVersion()}`;
|
|
78
|
+
const resolveSuspensiveTarget = (currentSource) => currentSource === UNVERSIONED_SOURCE ? versionedTarget : currentSource;
|
|
79
|
+
root.find(j.ImportDeclaration, { source: { value: (v) => SOURCE_PATTERN.test(v) } }).forEach((path) => {
|
|
80
|
+
const specifiers = path.node.specifiers ?? [];
|
|
81
|
+
const importKind = path.node.importKind;
|
|
82
|
+
const currentSource = path.node.source.value;
|
|
83
|
+
const suspensiveTarget = resolveSuspensiveTarget(currentSource);
|
|
84
|
+
if (specifiers.length === 0) {
|
|
85
|
+
if (currentSource !== suspensiveTarget) path.node.source = j.stringLiteral(suspensiveTarget);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (specifiers.some((s) => s.type === "ImportNamespaceSpecifier" || s.type === "ImportDefaultSpecifier")) {
|
|
89
|
+
if (currentSource !== suspensiveTarget) path.node.source = j.stringLiteral(suspensiveTarget);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const tanstackSpecifiers = [];
|
|
93
|
+
const suspensiveSpecifiers = [];
|
|
94
|
+
for (const spec of specifiers) {
|
|
95
|
+
if (spec.type !== "ImportSpecifier") continue;
|
|
96
|
+
const name = spec.imported.name;
|
|
97
|
+
if (DEPRECATED_REMOVED.includes(name)) continue;
|
|
98
|
+
if (TANSTACK_APIS.includes(name)) tanstackSpecifiers.push(spec);
|
|
99
|
+
else suspensiveSpecifiers.push(spec);
|
|
100
|
+
}
|
|
101
|
+
if (tanstackSpecifiers.length === 0 && suspensiveSpecifiers.length === specifiers.length) {
|
|
102
|
+
if (currentSource !== suspensiveTarget) path.node.source = j.stringLiteral(suspensiveTarget);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (tanstackSpecifiers.length > 0) {
|
|
106
|
+
const tanstackDecl = j.importDeclaration(tanstackSpecifiers, j.stringLiteral(TANSTACK_TARGET));
|
|
107
|
+
if (importKind === "type") tanstackDecl.importKind = "type";
|
|
108
|
+
path.insertBefore(tanstackDecl);
|
|
109
|
+
}
|
|
110
|
+
if (suspensiveSpecifiers.length > 0) {
|
|
111
|
+
const suspensiveDecl = j.importDeclaration(suspensiveSpecifiers, j.stringLiteral(suspensiveTarget));
|
|
112
|
+
if (importKind === "type") suspensiveDecl.importKind = "type";
|
|
113
|
+
path.insertBefore(suspensiveDecl);
|
|
114
|
+
}
|
|
115
|
+
j(path).remove();
|
|
116
|
+
});
|
|
117
|
+
root.find(j.ExportNamedDeclaration, { source: { value: (v) => SOURCE_PATTERN.test(v) } }).forEach((path) => {
|
|
118
|
+
const specifiers = path.node.specifiers;
|
|
119
|
+
const currentSource = path.node.source?.value;
|
|
120
|
+
if (!currentSource) return;
|
|
121
|
+
const suspensiveTarget = resolveSuspensiveTarget(currentSource);
|
|
122
|
+
if (!specifiers || specifiers.length === 0) {
|
|
123
|
+
if (currentSource !== suspensiveTarget) path.node.source = j.stringLiteral(suspensiveTarget);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const tanstackSpecifiers = [];
|
|
127
|
+
const suspensiveSpecifiers = [];
|
|
128
|
+
for (const spec of specifiers) {
|
|
129
|
+
const localName = spec.local?.name ?? "";
|
|
130
|
+
if (DEPRECATED_REMOVED.includes(localName)) continue;
|
|
131
|
+
if (TANSTACK_APIS.includes(localName)) tanstackSpecifiers.push(spec);
|
|
132
|
+
else suspensiveSpecifiers.push(spec);
|
|
133
|
+
}
|
|
134
|
+
if (tanstackSpecifiers.length === 0 && suspensiveSpecifiers.length === specifiers.length) {
|
|
135
|
+
if (currentSource !== suspensiveTarget) path.node.source = j.stringLiteral(suspensiveTarget);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (tanstackSpecifiers.length > 0) {
|
|
139
|
+
const tanstackDecl = j.exportNamedDeclaration(null, tanstackSpecifiers, j.stringLiteral(TANSTACK_TARGET));
|
|
140
|
+
path.insertBefore(tanstackDecl);
|
|
141
|
+
}
|
|
142
|
+
if (suspensiveSpecifiers.length > 0) {
|
|
143
|
+
const suspensiveDecl = j.exportNamedDeclaration(null, suspensiveSpecifiers, j.stringLiteral(suspensiveTarget));
|
|
144
|
+
path.insertBefore(suspensiveDecl);
|
|
145
|
+
}
|
|
146
|
+
j(path).remove();
|
|
147
|
+
});
|
|
148
|
+
root.find(j.ExportAllDeclaration, { source: { value: (v) => SOURCE_PATTERN.test(v) } }).forEach((path) => {
|
|
149
|
+
const currentSource = path.node.source.value;
|
|
150
|
+
const suspensiveTarget = resolveSuspensiveTarget(currentSource);
|
|
151
|
+
if (currentSource !== suspensiveTarget) path.node.source = j.stringLiteral(suspensiveTarget);
|
|
152
|
+
});
|
|
153
|
+
return root.toSource();
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
module.exports = transform;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-to-v4.d.cts","names":[],"sources":["../../src/transforms/migrate-to-v4.ts"],"mappings":";;;iBAgCwB,SAAA,CAAU,IAAc,EAAR,QAAQ;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_createParserFromPath = require("./createParserFromPath-
|
|
1
|
+
const require_createParserFromPath = require("./createParserFromPath-7qRmKnCS.cjs");
|
|
2
2
|
//#region src/transforms/migrate-with-api.ts
|
|
3
3
|
function transformer(file) {
|
|
4
4
|
const j = require_createParserFromPath.createParserFromPath(file.path);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-with-api.d.cts","names":[],"sources":["../../src/transforms/migrate-with-api.ts"],"mappings":";;;iBAGwB,WAAA,CAAY,
|
|
1
|
+
{"version":3,"file":"migrate-with-api.d.cts","names":[],"sources":["../../src/transforms/migrate-with-api.ts"],"mappings":";;;iBAGwB,WAAA,CAAY,IAAc,EAAR,QAAQ;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_createParserFromPath = require("./createParserFromPath-
|
|
1
|
+
const require_createParserFromPath = require("./createParserFromPath-7qRmKnCS.cjs");
|
|
2
2
|
//#region src/transforms/remove-networkmode.ts
|
|
3
3
|
const TARGET_FUNCTIONS = new Set([
|
|
4
4
|
"queryOptions",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-networkmode.d.cts","names":[],"sources":["../../src/transforms/remove-networkmode.ts"],"mappings":";;;iBAYwB,SAAA,CAAU,
|
|
1
|
+
{"version":3,"file":"remove-networkmode.d.cts","names":[],"sources":["../../src/transforms/remove-networkmode.ts"],"mappings":";;;iBAYwB,SAAA,CAAU,IAAc,EAAR,QAAQ;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_createParserFromPath = require("./createParserFromPath-
|
|
1
|
+
const require_createParserFromPath = require("./createParserFromPath-7qRmKnCS.cjs");
|
|
2
2
|
//#region src/transforms/tanstack-query-import.ts
|
|
3
|
-
const
|
|
3
|
+
const TANSTACK_APIS = [
|
|
4
4
|
"useSuspenseQuery",
|
|
5
5
|
"UseSuspenseQueryResult",
|
|
6
6
|
"UseSuspenseQueryOptions",
|
|
@@ -11,8 +11,10 @@ const IMPORT_TO_CHANGE = [
|
|
|
11
11
|
"UseSuspenseInfiniteQueryResult",
|
|
12
12
|
"UseSuspenseInfiniteQueryOptions",
|
|
13
13
|
"usePrefetchQuery",
|
|
14
|
+
"usePrefetchInfiniteQuery",
|
|
14
15
|
"queryOptions",
|
|
15
|
-
"infiniteQueryOptions"
|
|
16
|
+
"infiniteQueryOptions",
|
|
17
|
+
"mutationOptions"
|
|
16
18
|
];
|
|
17
19
|
const REMOVE_DEPRECATED_IMPORTS = [
|
|
18
20
|
"SelectedInfiniteOptions",
|
|
@@ -20,39 +22,55 @@ const REMOVE_DEPRECATED_IMPORTS = [
|
|
|
20
22
|
"SelectedQueryOptions",
|
|
21
23
|
"UnSelectedQueryOptions"
|
|
22
24
|
];
|
|
25
|
+
const SUSPENSIVE_SOURCE_PATTERN = /^@suspensive\/react-query(-\d+)?$/;
|
|
26
|
+
function getClassificationName(specifier) {
|
|
27
|
+
return specifier.imported.name;
|
|
28
|
+
}
|
|
23
29
|
function transform(file) {
|
|
24
30
|
const j = require_createParserFromPath.createParserFromPath(file.path);
|
|
25
31
|
const root = j(file.source);
|
|
26
|
-
root.find(j.ImportDeclaration, { source: { value: (v) =>
|
|
32
|
+
root.find(j.ImportDeclaration, { source: { value: (v) => SUSPENSIVE_SOURCE_PATTERN.test(v) } }).forEach((path) => {
|
|
27
33
|
const importSpecifiers = path.node.specifiers || [];
|
|
28
|
-
const
|
|
29
|
-
const
|
|
34
|
+
const importKind = path.node.importKind;
|
|
35
|
+
const importNamesToChange = [];
|
|
36
|
+
const importsNamesRemained = [];
|
|
37
|
+
for (const specifier of importSpecifiers) {
|
|
38
|
+
if (specifier.type !== "ImportSpecifier") {
|
|
39
|
+
importsNamesRemained.push(specifier);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const name = getClassificationName(specifier);
|
|
43
|
+
if (TANSTACK_APIS.includes(name)) importNamesToChange.push(specifier);
|
|
44
|
+
else if (!REMOVE_DEPRECATED_IMPORTS.includes(name)) importsNamesRemained.push(specifier);
|
|
45
|
+
}
|
|
30
46
|
if (importNamesToChange.length > 0) {
|
|
31
47
|
const newImportStatement = j.importDeclaration(importNamesToChange, j.stringLiteral("@tanstack/react-query"));
|
|
48
|
+
if (importKind === "type") newImportStatement.importKind = "type";
|
|
32
49
|
path.insertBefore(newImportStatement);
|
|
33
50
|
}
|
|
34
51
|
if (importsNamesRemained.length > 0) {
|
|
35
|
-
const
|
|
36
|
-
|
|
52
|
+
const suspensiveRemainImportsStatement = j.importDeclaration(importsNamesRemained, j.stringLiteral(path.node.source.value || "@suspensive/react-query"));
|
|
53
|
+
if (importKind === "type") suspensiveRemainImportsStatement.importKind = "type";
|
|
37
54
|
path.insertBefore(suspensiveRemainImportsStatement);
|
|
38
55
|
}
|
|
39
56
|
j(path).remove();
|
|
40
57
|
});
|
|
41
58
|
root.find(j.ExportNamedDeclaration).forEach((path) => {
|
|
42
|
-
if (path.node.specifiers)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
if (!path.node.specifiers) return;
|
|
60
|
+
const exportSpecifiers = path.node.specifiers;
|
|
61
|
+
const originalSource = path.node.source;
|
|
62
|
+
const exportNamesToChange = exportSpecifiers.filter((specifier) => TANSTACK_APIS.includes(specifier.local?.name ?? ""));
|
|
63
|
+
const exportNamesRemained = exportSpecifiers.filter((specifier) => !TANSTACK_APIS.includes(specifier.local?.name ?? "") && !REMOVE_DEPRECATED_IMPORTS.includes(specifier.local?.name ?? ""));
|
|
64
|
+
if (exportNamesToChange.length > 0) {
|
|
65
|
+
const targetSource = originalSource && SUSPENSIVE_SOURCE_PATTERN.test(originalSource.value) ? j.stringLiteral("@tanstack/react-query") : originalSource;
|
|
66
|
+
const newExportStatement = j.exportNamedDeclaration(null, exportNamesToChange, targetSource);
|
|
67
|
+
path.insertBefore(newExportStatement);
|
|
68
|
+
}
|
|
69
|
+
if (exportNamesRemained.length > 0) {
|
|
70
|
+
const remainingExportStatement = j.exportNamedDeclaration(null, exportNamesRemained, originalSource);
|
|
71
|
+
path.insertBefore(remainingExportStatement);
|
|
55
72
|
}
|
|
73
|
+
j(path).remove();
|
|
56
74
|
});
|
|
57
75
|
REMOVE_DEPRECATED_IMPORTS.forEach((deprecatedType) => {
|
|
58
76
|
root.find(j.TSTypeReference, { typeName: { name: deprecatedType } }).remove();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack-query-import.d.cts","names":[],"sources":["../../src/transforms/tanstack-query-import.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"tanstack-query-import.d.cts","names":[],"sources":["../../src/transforms/tanstack-query-import.ts"],"mappings":";;;iBAiCwB,SAAA,CAAU,IAAc,EAAR,QAAQ;AAAA"}
|