@poppinss/ts-exec 1.5.0 → 1.5.2

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.
Files changed (2) hide show
  1. package/build/index.js +4 -2
  2. package/package.json +2 -1
package/build/index.js CHANGED
@@ -190,13 +190,15 @@ var resolve = (specifier, context, nextResolve) => {
190
190
  var load = function load2(url, context, nextLoad) {
191
191
  const { format } = context;
192
192
  debug_default("load file %s, %O", url, context);
193
- if (format && (format === "module-typescript" || format === "commonjs-typescript") || url.endsWith(".tsx") || url.endsWith(".jsx")) {
193
+ const { pathname } = new URL(url);
194
+ if (format && (format === "module-typescript" || format === "commonjs-typescript") || pathname.endsWith(".tsx") || pathname.endsWith(".jsx")) {
194
195
  try {
195
196
  const { source } = nextLoad(url, {
196
197
  ...context,
197
198
  format: "module"
198
199
  });
199
- const { code, map } = transformSync(source.toString(), {
200
+ const sourceText = typeof source === "string" ? source : new TextDecoder("utf-8", { ignoreBOM: true }).decode(source);
201
+ const { code, map } = transformSync(sourceText, {
200
202
  format: format ?? "module-tsx",
201
203
  filename: fileURLToPath2(url),
202
204
  ...swcConfig
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@poppinss/ts-exec",
3
3
  "description": "TypeScript JIT compiler built for correctness and supports legacy/experimental decorators",
4
- "version": "1.5.0",
4
+ "version": "1.5.2",
5
5
  "engines": {
6
6
  "node": ">=24.0.0"
7
7
  },
@@ -43,6 +43,7 @@
43
43
  "@types/node": "^26.6.4",
44
44
  "c8": "^12.0.0",
45
45
  "eslint": "^10.12.0",
46
+ "hot-hook": "^1.0.0",
46
47
  "ipaddr.js": "^2.5.0",
47
48
  "preact": "^11.0.0",
48
49
  "preact-render-to-string": "^6.8.0",