tsx 4.5.1 → 4.6.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 +27 -27
- package/dist/cli.mjs +27 -27
- package/dist/client-2f0df4a6.cjs +1 -0
- package/dist/client-e665d820.mjs +1 -0
- package/dist/esm/index.cjs +5 -13
- package/dist/esm/index.mjs +5 -13
- package/dist/get-pipe-path-86e97fc9.cjs +1 -0
- package/dist/get-pipe-path-b74d9893.mjs +1 -0
- package/dist/{index-dd51b218.cjs → index-5d1f01e6.cjs} +14 -14
- package/dist/{index-2da1094b.mjs → index-bd1ceb03.mjs} +14 -14
- package/dist/loader.cjs +1 -1
- package/dist/loader.mjs +1 -1
- package/dist/node-features-6a939068.mjs +1 -0
- package/dist/node-features-92fd0e3b.cjs +1 -0
- package/dist/package-126ef1cf.mjs +1 -0
- package/dist/package-48ff69ab.cjs +1 -0
- package/dist/preflight.cjs +1 -1
- package/dist/preflight.mjs +1 -1
- package/dist/repl.cjs +3 -3
- package/dist/repl.mjs +3 -3
- package/dist/temporary-directory-04b36185.mjs +1 -0
- package/dist/temporary-directory-2a027842.cjs +1 -0
- package/package.json +1 -1
- package/dist/node-features-32913946.mjs +0 -1
- package/dist/node-features-fa497138.cjs +0 -1
- package/dist/package-6736ff06.cjs +0 -1
- package/dist/package-c8af9097.mjs +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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}};
|
package/dist/cjs/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import f from"path";import
|
|
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}};
|