tsdown-migrate 0.22.0 → 0.22.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/index.mjs +1 -1
- package/dist/run.mjs +1 -1
- package/dist/{src-1UmSbz5E.mjs → src-C5-uMcw4.mjs} +10 -8
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as migrate } from "./src-
|
|
1
|
+
import { t as migrate } from "./src-C5-uMcw4.mjs";
|
|
2
2
|
export { migrate };
|
package/dist/run.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as name, r as version, t as migrate } from "./src-
|
|
2
|
+
import { n as name, r as version, t as migrate } from "./src-C5-uMcw4.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import consola from "consola";
|
|
5
5
|
import { cac } from "cac";
|
|
@@ -21,7 +21,7 @@ function detectIndentation(jsonText) {
|
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region package.json
|
|
23
23
|
var name = "tsdown-migrate";
|
|
24
|
-
var version = "0.22.
|
|
24
|
+
var version = "0.22.1";
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/utils.ts
|
|
27
27
|
function renameKey(obj, oldKey, newKey, newValue) {
|
|
@@ -99,6 +99,7 @@ const WARNING_MESSAGES = {
|
|
|
99
99
|
const PROPERTY_RENAMES = {
|
|
100
100
|
entryPoints: "entry",
|
|
101
101
|
esbuildPlugins: "plugins",
|
|
102
|
+
outExtension: "outExtensions",
|
|
102
103
|
publicDir: "copy",
|
|
103
104
|
cjsInterop: "cjsDefault"
|
|
104
105
|
};
|
|
@@ -140,20 +141,21 @@ function transformTsupConfig(code, filename) {
|
|
|
140
141
|
const text = node.text();
|
|
141
142
|
edits.push(node.replace(text.replace("/esbuild", "/rolldown")));
|
|
142
143
|
}
|
|
143
|
-
const
|
|
144
|
-
return root.
|
|
144
|
+
const findPropertyIdentifiers = (propName) => {
|
|
145
|
+
return root.findAll({ rule: { any: [{
|
|
145
146
|
kind: "property_identifier",
|
|
146
147
|
regex: `^${propName}$`,
|
|
147
148
|
inside: {
|
|
148
149
|
kind: "pair",
|
|
149
150
|
field: "key"
|
|
150
151
|
}
|
|
151
|
-
}
|
|
152
|
+
}, {
|
|
153
|
+
kind: "property_identifier",
|
|
154
|
+
regex: `^${propName}$`,
|
|
155
|
+
inside: { kind: "method_definition" }
|
|
156
|
+
}] } });
|
|
152
157
|
};
|
|
153
|
-
for (const [oldName, newName] of Object.entries(PROPERTY_RENAMES))
|
|
154
|
-
const propIdentifier = findPropertyIdentifier(oldName);
|
|
155
|
-
if (propIdentifier) edits.push(propIdentifier.replace(newName));
|
|
156
|
-
}
|
|
158
|
+
for (const [oldName, newName] of Object.entries(PROPERTY_RENAMES)) for (const propIdentifier of findPropertyIdentifiers(oldName)) edits.push(propIdentifier.replace(newName));
|
|
157
159
|
const bundleTruePairs = root.findAll({ rule: {
|
|
158
160
|
kind: "pair",
|
|
159
161
|
all: [{ has: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsdown-migrate",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.22.
|
|
4
|
+
"version": "0.22.1",
|
|
5
5
|
"description": "A CLI tool to help migrate your project to tsdown.",
|
|
6
6
|
"author": "Kevin Deng <sxzz@sxzz.moe>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@antfu/ni": "^30.1.0",
|
|
46
|
-
"@ast-grep/napi": "^0.42.
|
|
47
|
-
"ansis": "^4.
|
|
46
|
+
"@ast-grep/napi": "^0.42.3",
|
|
47
|
+
"ansis": "^4.3.0",
|
|
48
48
|
"cac": "^7.0.0",
|
|
49
49
|
"consola": "^3.4.2",
|
|
50
50
|
"diff": "^9.0.0",
|