tsdown-migrate 0.21.0 → 0.21.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 CHANGED
@@ -1,2 +1,2 @@
1
- import { t as migrate } from "./src-Dq4fLgpl.mjs";
1
+ import { t as migrate } from "./src-D5rhbu6C.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-Dq4fLgpl.mjs";
2
+ import { n as name, r as version, t as migrate } from "./src-D5rhbu6C.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.21.0";
24
+ var version = "0.21.1";
25
25
  //#endregion
26
26
  //#region src/utils.ts
27
27
  function renameKey(obj, oldKey, newKey, newValue) {
@@ -92,7 +92,6 @@ const WARNING_MESSAGES = {
92
92
  plugins: "The `plugins` option in tsup is experimental. Please migrate your plugins manually.",
93
93
  splitting: "The `splitting` option is currently unsupported in tsdown. Code splitting is always enabled and cannot be disabled.",
94
94
  metafile: "The `metafile` option is not available in tsdown. Consider using Vite DevTools as an alternative.",
95
- injectStyle: "The `injectStyle` option has not yet been implemented in tsdown.",
96
95
  swc: "The `swc` option is not supported in tsdown. Please use oxc instead.",
97
96
  experimentalDts: "The `experimentalDts` option is not supported in tsdown. Use the `dts` option instead.",
98
97
  legacyOutput: "The `legacyOutput` option is not supported in tsdown."
@@ -191,6 +190,30 @@ function transformTsupConfig(code, filename) {
191
190
  } }]
192
191
  } });
193
192
  for (const node of removeNodeProtocolPairs) edits.push(node.replace("nodeProtocol: 'strip'"));
193
+ const injectStyleTruePairs = root.findAll({ rule: {
194
+ kind: "pair",
195
+ all: [{ has: {
196
+ field: "key",
197
+ kind: "property_identifier",
198
+ regex: "^injectStyle$"
199
+ } }, { has: {
200
+ field: "value",
201
+ kind: "true"
202
+ } }]
203
+ } });
204
+ for (const node of injectStyleTruePairs) edits.push(node.replace("css: { inject: true }"));
205
+ const injectStyleFalsePairs = root.findAll({ rule: {
206
+ kind: "pair",
207
+ all: [{ has: {
208
+ field: "key",
209
+ kind: "property_identifier",
210
+ regex: "^injectStyle$"
211
+ } }, { has: {
212
+ field: "value",
213
+ kind: "false"
214
+ } }]
215
+ } });
216
+ for (const node of injectStyleFalsePairs) edits.push(node.replace(""));
194
217
  const depsProperties = [];
195
218
  for (const [oldName, newName] of Object.entries(DEPS_NAMESPACE_RENAMES)) {
196
219
  const pair = findPropertyPair(oldName);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tsdown-migrate",
3
3
  "type": "module",
4
- "version": "0.21.0",
4
+ "version": "0.21.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",
@@ -42,7 +42,7 @@
42
42
  "node": ">=20.19.0"
43
43
  },
44
44
  "dependencies": {
45
- "@antfu/ni": "^28.2.0",
45
+ "@antfu/ni": "^28.3.0",
46
46
  "@ast-grep/napi": "^0.41.0",
47
47
  "ansis": "^4.2.0",
48
48
  "cac": "^7.0.0",
@@ -52,6 +52,6 @@
52
52
  },
53
53
  "scripts": {
54
54
  "dev": "node ./src/run.ts",
55
- "build": "unrun ../../src/run.ts -c ../../tsdown.config.ts -F ."
55
+ "build": "node -C dev ../../src/run.ts -c ../../tsdown.config.ts -F ."
56
56
  }
57
57
  }