unplugin-isolated-decl 0.15.1 → 0.15.3

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2024-PRESENT 三咲智子 (https://github.com/sxzz)
3
+ Copyright © 2024-PRESENT Kevin Deng (https://github.com/sxzz)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -178,7 +178,7 @@ Patch `export default` in `.d.cts` to `export =`
178
178
 
179
179
  ## License
180
180
 
181
- [MIT](./LICENSE) License © 2024-PRESENT [三咲智子](https://github.com/sxzz)
181
+ [MIT](./LICENSE) License © 2024-PRESENT [Kevin Deng](https://github.com/sxzz)
182
182
 
183
183
  <!-- Badges -->
184
184
 
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { oxcTransform, swcTransform, tsTransform } from "./transformer-CiAWE027.js";
1
+ import { a as tsTransform, i as swcTransform, r as oxcTransform } from "./transformer-DIxtVpUn.js";
2
2
 
3
3
  export { oxcTransform, swcTransform, tsTransform };
package/dist/esbuild.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-DVArCSR0.js";
1
+ import "./transformer-DIxtVpUn.js";
2
+ import { t as IsolatedDecl } from "./src-DW22l0rB.js";
3
3
 
4
4
  //#region src/esbuild.ts
5
5
  /**
package/dist/farm.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-DVArCSR0.js";
1
+ import "./transformer-DIxtVpUn.js";
2
+ import { t as IsolatedDecl } from "./src-DW22l0rB.js";
3
3
 
4
4
  //#region src/farm.ts
5
5
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-DVArCSR0.js";
1
+ import "./transformer-DIxtVpUn.js";
2
+ import { t as IsolatedDecl } from "./src-DW22l0rB.js";
3
3
 
4
4
  export { IsolatedDecl };
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-DVArCSR0.js";
1
+ import "./transformer-DIxtVpUn.js";
2
+ import { t as IsolatedDecl } from "./src-DW22l0rB.js";
3
3
 
4
4
  //#region src/rolldown.ts
5
5
  /**
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-DVArCSR0.js";
1
+ import "./transformer-DIxtVpUn.js";
2
+ import { t as IsolatedDecl } from "./src-DW22l0rB.js";
3
3
 
4
4
  //#region src/rollup.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { appendMapUrl, generateDtsMap, oxcTransform, swcTransform, tsTransform } from "./transformer-CiAWE027.js";
1
+ import { a as tsTransform, i as swcTransform, n as generateDtsMap, r as oxcTransform, t as appendMapUrl } from "./transformer-DIxtVpUn.js";
2
2
  import path from "node:path";
3
3
  import { mkdir, readFile, writeFile } from "node:fs/promises";
4
4
  import MagicString from "magic-string";
@@ -34,10 +34,9 @@ function resolveEntry(input, userInputBase) {
34
34
  if (typeof input === "string") input = [input];
35
35
  const entryMap = !Array.isArray(input) ? Object.fromEntries(Object.entries(input).map(([k, v]) => [path.resolve(stripExt(v)), k])) : void 0;
36
36
  const arr = Array.isArray(input) && input ? input : Object.values(input);
37
- const inputBase = userInputBase || lowestCommonAncestor(...arr);
38
37
  return {
39
38
  entryMap,
40
- inputBase
39
+ inputBase: userInputBase || lowestCommonAncestor(...arr)
41
40
  };
42
41
  }
43
42
  function endsWithIndex(s) {
@@ -71,10 +70,8 @@ function rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFile
71
70
  const srcId = path.resolve(srcDir, srcIdRel);
72
71
  const importAlias = entryMap?.[stripExt(srcId)];
73
72
  let id;
74
- if (importAlias) {
75
- const resolved = entryFileNames.replaceAll("[name]", stripExt(importAlias));
76
- id = pathRelative(srcDirRel, resolved);
77
- } else id = entryFileNames.replaceAll("[name]", stripExt(srcIdRel));
73
+ if (importAlias) id = pathRelative(srcDirRel, entryFileNames.replaceAll("[name]", stripExt(importAlias)));
74
+ else id = entryFileNames.replaceAll("[name]", stripExt(srcIdRel));
78
75
  let final = path.normalize(path.join(offset, id));
79
76
  if (final !== path.normalize(source.value)) {
80
77
  debug("Patch import in", srcRel, ":", srcIdRel, "->", final);
@@ -382,4 +379,4 @@ function patchCjsDefaultExport(source) {
382
379
  }
383
380
 
384
381
  //#endregion
385
- export { IsolatedDecl };
382
+ export { IsolatedDecl as t };
@@ -40,9 +40,8 @@ async function swcTransform(id, code) {
40
40
  experimental: { emitIsolatedDts: true }
41
41
  }
42
42
  });
43
- const output = JSON.parse(result.output);
44
43
  return {
45
- code: output.__swc_isolated_declarations__,
44
+ code: JSON.parse(result.output).__swc_isolated_declarations__,
46
45
  errors: []
47
46
  };
48
47
  } catch (error) {
@@ -90,8 +89,7 @@ async function tsTransform(id, code, transformOptions, sourceMap) {
90
89
  }
91
90
  function stripMapUrl(code) {
92
91
  const lines = code.split("\n");
93
- const lastLine = lines.at(-1);
94
- if (lastLine?.startsWith("//# sourceMappingURL=")) return lines.slice(0, -1).join("\n");
92
+ if (lines.at(-1)?.startsWith("//# sourceMappingURL=")) return lines.slice(0, -1).join("\n");
95
93
  return code;
96
94
  }
97
95
  function appendMapUrl(map, filename) {
@@ -109,4 +107,4 @@ function generateDtsMap(mappings, src, dts) {
109
107
  }
110
108
 
111
109
  //#endregion
112
- export { appendMapUrl, generateDtsMap, oxcTransform, swcTransform, tsTransform };
110
+ export { tsTransform as a, swcTransform as i, generateDtsMap as n, oxcTransform as r, appendMapUrl as t };
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-DVArCSR0.js";
1
+ import "./transformer-DIxtVpUn.js";
2
+ import { t as IsolatedDecl } from "./src-DW22l0rB.js";
3
3
 
4
4
  //#region src/vite.ts
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-isolated-decl",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "description": "A blazing-fast tool for generating isolated declarations.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "type": "git",
20
20
  "url": "git+https://github.com/unplugin/unplugin-isolated-decl.git"
21
21
  },
22
- "author": "三咲智子 Kevin Deng <sxzz@sxzz.moe>",
22
+ "author": "Kevin Deng <sxzz@sxzz.moe>",
23
23
  "funding": "https://github.com/sponsors/sxzz",
24
24
  "files": [
25
25
  "dist"
@@ -61,38 +61,38 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "debug": "^4.4.1",
65
- "magic-string": "^0.30.17",
66
- "oxc-parser": ">=0.82.1",
67
- "oxc-transform": ">=0.82.1",
68
- "unplugin": "^2.3.6",
69
- "unplugin-utils": "^0.2.5"
64
+ "debug": "^4.4.3",
65
+ "magic-string": "^0.30.21",
66
+ "oxc-parser": ">=0.95.0",
67
+ "oxc-transform": ">=0.95.0",
68
+ "unplugin": "^2.3.10",
69
+ "unplugin-utils": "^0.3.1"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@farmfe/core": "^1.7.11",
73
- "@oxc-project/types": "^0.82.1",
73
+ "@oxc-project/types": "^0.95.0",
74
74
  "@rollup/plugin-alias": "^5.1.1",
75
- "@swc/core": "^1.13.3",
76
- "@sxzz/eslint-config": "^7.1.2",
77
- "@sxzz/prettier-config": "^2.2.3",
78
- "@sxzz/test-utils": "^0.5.9",
75
+ "@swc/core": "^1.13.21",
76
+ "@sxzz/eslint-config": "^7.2.7",
77
+ "@sxzz/prettier-config": "^2.2.4",
78
+ "@sxzz/test-utils": "^0.5.12",
79
79
  "@types/debug": "^4.1.12",
80
- "@types/node": "^24.3.0",
81
- "bumpp": "^10.2.3",
82
- "esbuild": "^0.25.9",
83
- "eslint": "^9.33.0",
80
+ "@types/node": "^24.9.1",
81
+ "bumpp": "^10.3.1",
82
+ "esbuild": "^0.25.11",
83
+ "eslint": "^9.38.0",
84
84
  "fast-glob": "^3.3.3",
85
85
  "prettier": "^3.6.2",
86
- "publint": "^0.3.12",
87
- "rolldown": "^1.0.0-beta.32",
88
- "rollup": "^4.46.2",
89
- "tinyglobby": "^0.2.14",
90
- "tsdown": "^0.14.1",
91
- "tsx": "^4.20.4",
92
- "typescript": "^5.9.2",
93
- "unplugin-oxc": "^0.5.0",
94
- "vite": "^7.1.2",
95
- "vitest": "^3.2.4"
86
+ "publint": "^0.3.15",
87
+ "rolldown": "^1.0.0-beta.44",
88
+ "rollup": "^4.52.5",
89
+ "tinyglobby": "^0.2.15",
90
+ "tsdown": "^0.15.9",
91
+ "tsx": "^4.20.6",
92
+ "typescript": "^5.9.3",
93
+ "unplugin-oxc": "^0.5.3",
94
+ "vite": "^7.1.12",
95
+ "vitest": "^4.0.3"
96
96
  },
97
97
  "engines": {
98
98
  "node": ">=20.18.0"