tsx 4.4.0 → 4.5.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/cjs/index.cjs +1 -1
- package/dist/cjs/index.mjs +1 -1
- package/dist/cli.cjs +25 -25
- package/dist/cli.mjs +26 -26
- package/dist/esm/index.cjs +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/{index-a0bec4d2.mjs → index-2da1094b.mjs} +11 -11
- package/dist/{index-bb73d2cd.cjs → index-dd51b218.cjs} +11 -11
- package/dist/loader.cjs +1 -1
- package/dist/loader.mjs +1 -1
- package/dist/package-6736ff06.cjs +1 -0
- package/dist/package-c8af9097.mjs +1 -0
- package/dist/preflight.cjs +1 -1
- package/dist/preflight.mjs +1 -1
- package/dist/repl.cjs +1 -1
- package/dist/repl.mjs +1 -1
- package/package.json +1 -1
- package/dist/package-e15f6aa4.mjs +0 -1
- package/dist/package-f17f0cea.cjs +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=require("path"),S=require("fs"),a=require("module"),l=require("get-tsconfig"),g=require("../source-map.cjs"),m=require("../index-
|
|
1
|
+
"use strict";var u=require("path"),S=require("fs"),a=require("module"),l=require("get-tsconfig"),g=require("../source-map.cjs"),m=require("../index-dd51b218.cjs"),j=require("../resolve-ts-path-3fca13b7.cjs");require("url"),require("esbuild"),require("crypto"),require("os");const E=s=>{if(s.includes("import")||s.includes("export"))try{const[e,n]=m.parseEsm(s);return e.length>0||n.length>0}catch{return!0}return!1},O=/^\.{1,2}\//,P=/\.[cm]?tsx?$/,M=`${u.sep}node_modules${u.sep}`,f=process.env.TSX_TSCONFIG_PATH?{path:u.resolve(process.env.TSX_TSCONFIG_PATH),config:l.parseTsconfig(process.env.TSX_TSCONFIG_PATH)}:l.getTsconfig(),h=f&&l.createFilesMatcher(f),_=f&&l.createPathsMatcher(f),x=g.installSourceMapSupport(),d=a._extensions,q=d[".js"],A=[".cts",".mts",".ts",".tsx",".jsx"],N=[".js",".cjs",".mjs"],y=(s,e)=>{process.send&&process.send({type:"dependency",path:e});const n=A.some(r=>e.endsWith(r)),o=N.some(r=>e.endsWith(r));if(!n&&!o)return q(s,e);let t=S.readFileSync(e,"utf8");if(e.endsWith(".cjs")){const r=m.transformDynamicImport(e,t);r&&(t=x(r))}else if(n||E(t)){const r=m.transformSync(t,e,{tsconfigRaw:h==null?void 0:h(e)});t=x(r)}s._compile(t,e)};[".js",".ts",".tsx",".jsx"].forEach(s=>{d[s]=y}),Object.defineProperty(d,".mjs",{value:y,enumerable:!1});const v=a._resolveFilename.bind(a);a._resolveFilename=(s,e,n,o)=>{var t;const r=s.indexOf("?");if(r!==-1&&(s=s.slice(0,r)),_&&!O.test(s)&&!((t=e==null?void 0:e.filename)!=null&&t.includes(M))){const i=_(s);for(const T of i){const p=F(T,e,n,o);if(p)return p;try{return v(T,e,n,o)}catch{}}}const c=F(s,e,n,o);return c||v(s,e,n,o)};const F=(s,e,n,o)=>{const t=j.resolveTsPath(s);if(e!=null&&e.filename&&P.test(e.filename)&&t)for(const r of t)try{return v(r,e,n,o)}catch(c){const{code:i}=c;if(i!=="MODULE_NOT_FOUND"&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c}};
|
package/dist/cjs/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"path";import y from"fs";import m from"module";import{parseTsconfig as F,getTsconfig as S,createFilesMatcher as j,createPathsMatcher as E}from"get-tsconfig";import{installSourceMapSupport as O}from"../source-map.mjs";import{p as g,t as P,a as M}from"../index-
|
|
1
|
+
import f from"path";import y from"fs";import m from"module";import{parseTsconfig as F,getTsconfig as S,createFilesMatcher as j,createPathsMatcher as E}from"get-tsconfig";import{installSourceMapSupport as O}from"../source-map.mjs";import{p as g,t as P,a as M}from"../index-2da1094b.mjs";import{r as A}from"../resolve-ts-path-eb3847f5.mjs";import"url";import"esbuild";import"crypto";import"os";const N=t=>{if(t.includes("import")||t.includes("export"))try{const[s,r]=g(t);return s.length>0||r.length>0}catch{return!0}return!1},R=/^\.{1,2}\//,b=/\.[cm]?tsx?$/,I=`${f.sep}node_modules${f.sep}`,a=process.env.TSX_TSCONFIG_PATH?{path:f.resolve(process.env.TSX_TSCONFIG_PATH),config:F(process.env.TSX_TSCONFIG_PATH)}:S(),T=a&&j(a),_=a&&E(a),h=O(),l=m._extensions,C=l[".js"],D=[".cts",".mts",".ts",".tsx",".jsx"],G=[".js",".cjs",".mjs"],v=(t,s)=>{process.send&&process.send({type:"dependency",path:s});const r=D.some(e=>s.endsWith(e)),n=G.some(e=>s.endsWith(e));if(!r&&!n)return C(t,s);let o=y.readFileSync(s,"utf8");if(s.endsWith(".cjs")){const e=P(s,o);e&&(o=h(e))}else if(r||N(o)){const e=M(o,s,{tsconfigRaw:T==null?void 0:T(s)});o=h(e)}t._compile(o,s)};[".js",".ts",".tsx",".jsx"].forEach(t=>{l[t]=v}),Object.defineProperty(l,".mjs",{value:v,enumerable:!1});const p=m._resolveFilename.bind(m);m._resolveFilename=(t,s,r,n)=>{var o;const e=t.indexOf("?");if(e!==-1&&(t=t.slice(0,e)),_&&!R.test(t)&&!((o=s==null?void 0:s.filename)!=null&&o.includes(I))){const i=_(t);for(const d of i){const u=x(d,s,r,n);if(u)return u;try{return p(d,s,r,n)}catch{}}}const c=x(t,s,r,n);return c||p(t,s,r,n)};const x=(t,s,r,n)=>{const o=A(t);if(s!=null&&s.filename&&b.test(s.filename)&&o)for(const e of o)try{return p(e,s,r,n)}catch(c){const{code:i}=c;if(i!=="MODULE_NOT_FOUND"&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c}};
|