tsx 4.5.1 → 4.6.0

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.
@@ -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-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}};
1
+ "use strict";var f=require("path"),g=require("fs"),a=require("module"),l=require("get-tsconfig"),P=require("../source-map.cjs"),m=require("../index-5d1f01e6.cjs"),j=require("../resolve-ts-path-3fca13b7.cjs"),q=require("../client-2f0df4a6.cjs");require("url"),require("esbuild"),require("crypto"),require("os"),require("../temporary-directory-2a027842.cjs"),require("net"),require("../get-pipe-path-86e97fc9.cjs");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}\//,M=/\.[cm]?tsx?$/,A=`${f.sep}node_modules${f.sep}`,u=process.env.TSX_TSCONFIG_PATH?{path:f.resolve(process.env.TSX_TSCONFIG_PATH),config:l.parseTsconfig(process.env.TSX_TSCONFIG_PATH)}:l.getTsconfig(),_=u&&l.createFilesMatcher(u),x=u&&l.createPathsMatcher(u),y=P.installSourceMapSupport(),d=a._extensions,N=d[".js"],R=[".cts",".mts",".ts",".tsx",".jsx"],b=[".js",".cjs",".mjs"];let v;q.connectingToServer.then(s=>{v=s},()=>{});const F=(s,e)=>{v&&v({type:"dependency",path:e});const n=R.some(r=>e.endsWith(r)),o=b.some(r=>e.endsWith(r));if(!n&&!o)return N(s,e);let t=g.readFileSync(e,"utf8");if(e.endsWith(".cjs")){const r=m.transformDynamicImport(e,t);r&&(t=y(r))}else if(n||E(t)){const r=m.transformSync(t,e,{tsconfigRaw:_==null?void 0:_(e)});t=y(r)}s._compile(t,e)};[".js",".ts",".tsx",".jsx"].forEach(s=>{d[s]=F}),Object.defineProperty(d,".mjs",{value:F,enumerable:!1});const T=a._resolveFilename.bind(a);a._resolveFilename=(s,e,n,o)=>{var t;const r=s.indexOf("?");if(r!==-1&&(s=s.slice(0,r)),x&&!O.test(s)&&!((t=e==null?void 0:e.filename)!=null&&t.includes(A))){const i=x(s);for(const h of i){const p=S(h,e,n,o);if(p)return p;try{return T(h,e,n,o)}catch{}}}const c=S(s,e,n,o);return c||T(s,e,n,o)};const S=(s,e,n,o)=>{const t=j.resolveTsPath(s);if(e!=null&&e.filename&&M.test(e.filename)&&t)for(const r of t)try{return T(r,e,n,o)}catch(c){const{code:i}=c;if(i!=="MODULE_NOT_FOUND"&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c}};
@@ -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-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}};
1
+ import f from"path";import F from"fs";import m from"module";import{parseTsconfig as S,getTsconfig as g,createFilesMatcher as j,createPathsMatcher as E}from"get-tsconfig";import{installSourceMapSupport as O}from"../source-map.mjs";import{p as P,t as M,a as A}from"../index-bd1ceb03.mjs";import{r as N}from"../resolve-ts-path-eb3847f5.mjs";import{c as R}from"../client-e665d820.mjs";import"url";import"esbuild";import"crypto";import"os";import"../temporary-directory-04b36185.mjs";import"net";import"../get-pipe-path-b74d9893.mjs";const b=t=>{if(t.includes("import")||t.includes("export"))try{const[s,r]=P(t);return s.length>0||r.length>0}catch{return!0}return!1},I=/^\.{1,2}\//,C=/\.[cm]?tsx?$/,D=`${f.sep}node_modules${f.sep}`,a=process.env.TSX_TSCONFIG_PATH?{path:f.resolve(process.env.TSX_TSCONFIG_PATH),config:S(process.env.TSX_TSCONFIG_PATH)}:g(),h=a&&j(a),_=a&&E(a),v=O(),l=m._extensions,G=l[".js"],H=[".cts",".mts",".ts",".tsx",".jsx"],X=[".js",".cjs",".mjs"];let p;R.then(t=>{p=t},()=>{});const x=(t,s)=>{p&&p({type:"dependency",path:s});const r=H.some(o=>s.endsWith(o)),n=X.some(o=>s.endsWith(o));if(!r&&!n)return G(t,s);let e=F.readFileSync(s,"utf8");if(s.endsWith(".cjs")){const o=M(s,e);o&&(e=v(o))}else if(r||b(e)){const o=A(e,s,{tsconfigRaw:h==null?void 0:h(s)});e=v(o)}t._compile(e,s)};[".js",".ts",".tsx",".jsx"].forEach(t=>{l[t]=x}),Object.defineProperty(l,".mjs",{value:x,enumerable:!1});const d=m._resolveFilename.bind(m);m._resolveFilename=(t,s,r,n)=>{var e;const o=t.indexOf("?");if(o!==-1&&(t=t.slice(0,o)),_&&!I.test(t)&&!((e=s==null?void 0:s.filename)!=null&&e.includes(D))){const i=_(t);for(const u of i){const T=y(u,s,r,n);if(T)return T;try{return d(u,s,r,n)}catch{}}}const c=y(t,s,r,n);return c||d(t,s,r,n)};const y=(t,s,r,n)=>{const e=N(t);if(s!=null&&s.filename&&C.test(s.filename)&&e)for(const o of e)try{return d(o,s,r,n)}catch(c){const{code:i}=c;if(i!=="MODULE_NOT_FOUND"&&i!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c}};