@dtsx/dtsx 0.11.44 → 0.11.45
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/bin/cli.js +1 -1
- package/dist/{chunk-jbxb317g.js → chunk-05cbfytc.js} +6 -6
- package/dist/{chunk-6mryvpxj.js → chunk-1gy2z5an.js} +5 -5
- package/dist/{chunk-ns44qxdd.js → chunk-2cjs4r5v.js} +4 -4
- package/dist/chunk-3nmjt94q.js +10 -0
- package/dist/{chunk-q45jkpya.js → chunk-3x19egjd.js} +2 -2
- package/dist/chunk-41d5ehn0.js +3 -0
- package/dist/{chunk-9qv34ymq.js → chunk-48jvmndg.js} +2 -2
- package/dist/{chunk-vz4fc70e.js → chunk-4fspqk22.js} +3 -3
- package/dist/chunk-4t1we2h5.js +3 -0
- package/dist/chunk-4vtfqwpq.js +8 -0
- package/dist/{chunk-7krb9b1s.js → chunk-51vf9de8.js} +2 -2
- package/dist/{chunk-8v43ne8p.js → chunk-55yw66ha.js} +3 -3
- package/dist/{chunk-s7k223zx.js → chunk-57xvwm7c.js} +2 -2
- package/dist/{chunk-th9tcxga.js → chunk-587w6ktw.js} +2 -2
- package/dist/{chunk-sqnhxtbk.js → chunk-6gvctv0q.js} +3 -3
- package/dist/{chunk-mjzee617.js → chunk-755bntty.js} +17 -17
- package/dist/{chunk-hnckev96.js → chunk-783erq83.js} +4 -4
- package/dist/{chunk-7ez7gynw.js → chunk-7x4eqjfw.js} +2 -2
- package/dist/chunk-83w2qbmb.js +3 -0
- package/dist/{chunk-gma09qy6.js → chunk-870p7sky.js} +2 -2
- package/dist/{chunk-mhyqvwcg.js → chunk-8c5dzvwk.js} +3 -3
- package/dist/{chunk-3eb0gc0y.js → chunk-8c8pgvxv.js} +1 -1
- package/dist/{chunk-an5ra7tr.js → chunk-8xpkce3g.js} +4 -4
- package/dist/chunk-8zr7m1pk.js +3 -0
- package/dist/{chunk-cgaw8fsn.js → chunk-9knxvphg.js} +3 -3
- package/dist/{chunk-3shq1bjr.js → chunk-a4791583.js} +2 -2
- package/dist/chunk-b3979d26.js +3 -0
- package/dist/{chunk-yqvn592m.js → chunk-b7azvfdn.js} +2 -2
- package/dist/{chunk-4hkf7dda.js → chunk-bv1q1w42.js} +4 -4
- package/dist/{chunk-5aqwt0a0.js → chunk-c94sk67h.js} +4 -4
- package/dist/chunk-cd27mg71.js +3 -0
- package/dist/{chunk-932kxt70.js → chunk-d5q4qfys.js} +4 -4
- package/dist/{chunk-2y5b6hdw.js → chunk-e9x8ywhv.js} +6 -6
- package/dist/{chunk-m3y5knzq.js → chunk-exf6bsbe.js} +5 -5
- package/dist/{chunk-waan03ga.js → chunk-f191378r.js} +11 -11
- package/dist/{chunk-ka22zwye.js → chunk-f3avgz4y.js} +8 -8
- package/dist/chunk-fkdq1x5f.js +31 -0
- package/dist/{chunk-xgf6djk3.js → chunk-g9emajpc.js} +2 -2
- package/dist/{chunk-g4rmn34j.js → chunk-gns23mhj.js} +2 -2
- package/dist/{chunk-mfp35a3b.js → chunk-grpmcw9x.js} +15 -15
- package/dist/{chunk-vgyjw95e.js → chunk-gwsjj23d.js} +4 -4
- package/dist/{chunk-3rwbf45t.js → chunk-hgg4aqvf.js} +2 -2
- package/dist/{chunk-nek63555.js → chunk-hvt855ms.js} +2 -2
- package/dist/chunk-hzy5z7x2.js +5 -0
- package/dist/chunk-j51p30sb.js +7 -0
- package/dist/{chunk-vv8e8pa3.js → chunk-jy5h728q.js} +2 -2
- package/dist/chunk-k0vthrqs.js +4 -0
- package/dist/{chunk-9etacmfx.js → chunk-kthga8ar.js} +3 -3
- package/dist/{chunk-h1xwd278.js → chunk-m14550z9.js} +2 -2
- package/dist/{chunk-2d3nbfth.js → chunk-m29ph3cg.js} +2 -2
- package/dist/{chunk-eptz3q7r.js → chunk-m8rvd58d.js} +4 -4
- package/dist/{chunk-zp93zcn5.js → chunk-mc9kwthm.js} +2 -2
- package/dist/chunk-mvxcxnff.js +3 -0
- package/dist/chunk-nfd9v8ba.js +3 -0
- package/dist/{chunk-6pr23q72.js → chunk-pydpyx8x.js} +2 -2
- package/dist/{chunk-c8s4d7qk.js → chunk-qab5rsk8.js} +6 -6
- package/dist/{chunk-dzdwc2fh.js → chunk-qj2yvdjn.js} +2 -2
- package/dist/{chunk-cjhmmqxd.js → chunk-qkesb95f.js} +2 -2
- package/dist/{chunk-der2ssgq.js → chunk-r2e0r0pd.js} +2 -2
- package/dist/chunk-s013113f.js +3 -0
- package/dist/chunk-s6t0ff96.js +3 -0
- package/dist/chunk-sqa3ke1a.js +3 -0
- package/dist/{chunk-k5wz43yh.js → chunk-srfpcjtn.js} +2 -2
- package/dist/{chunk-59jw51gg.js → chunk-t1js8enq.js} +5 -5
- package/dist/{chunk-rka9z03a.js → chunk-t73v233w.js} +4 -4
- package/dist/chunk-t76htvct.js +3 -0
- package/dist/{chunk-g19c3m7s.js → chunk-t88j01sz.js} +2 -2
- package/dist/chunk-vher6t7j.js +14 -0
- package/dist/{chunk-7x9tawkf.js → chunk-vrfp12ts.js} +2 -2
- package/dist/{chunk-qevb6d6j.js → chunk-vye45h9n.js} +2 -2
- package/dist/{chunk-cynfv4dt.js → chunk-wwjt0p6m.js} +3 -3
- package/dist/{chunk-9hjd6p38.js → chunk-x5z8vprh.js} +2 -2
- package/dist/{chunk-ehgnwdn9.js → chunk-x6ddycvm.js} +2 -2
- package/dist/chunk-x9vpsya2.js +40 -0
- package/dist/chunk-xhgs3gx2.js +4 -0
- package/dist/chunk-xtckj8w1.js +3 -0
- package/dist/{chunk-0cynxv6w.js → chunk-xvk9v148.js} +2 -2
- package/dist/chunk-y9bxeq10.js +3 -0
- package/dist/{chunk-vxghzchm.js → chunk-ybdp7k49.js} +3 -3
- package/dist/{chunk-d0aqaj02.js → chunk-yh04e0n4.js} +2 -2
- package/dist/{chunk-65d3dga1.js → chunk-z82jsz2r.js} +3 -3
- package/dist/{chunk-ptbd3dac.js → chunk-zb48dx6a.js} +2 -2
- package/dist/chunk-zmnb3yg1.js +37 -0
- package/dist/{chunk-njqzhkzy.js → chunk-zwcvtbt4.js} +10 -10
- package/dist/src/augmentation-graph.js +1 -1
- package/dist/src/binding-patterns.js +1 -1
- package/dist/src/branded-types.js +1 -1
- package/dist/src/bundle-linker.js +1 -1
- package/dist/src/bundler.js +1 -1
- package/dist/src/cache.js +1 -1
- package/dist/src/call-signatures.js +1 -1
- package/dist/src/circular.js +1 -1
- package/dist/src/compat.js +1 -1
- package/dist/src/computed-keys.js +1 -1
- package/dist/src/concurrency.js +1 -1
- package/dist/src/config.js +1 -1
- package/dist/src/dangling-refs.js +1 -1
- package/dist/src/declaration-project.js +1 -1
- package/dist/src/declaration-publication.js +1 -1
- package/dist/src/declaration-references.js +1 -1
- package/dist/src/diff.js +1 -1
- package/dist/src/docs.js +1 -1
- package/dist/src/enum-declarations.js +1 -1
- package/dist/src/errors.js +1 -1
- package/dist/src/extractor/directives.js +1 -1
- package/dist/src/extractor/extract.d.ts +1 -1
- package/dist/src/extractor/extract.js +1 -1
- package/dist/src/extractor/scanner.d.ts +4 -4
- package/dist/src/extractor/scanner.js +1 -1
- package/dist/src/extractor.js +1 -1
- package/dist/src/formats.js +1 -1
- package/dist/src/formatter.js +1 -1
- package/dist/src/function-properties.js +1 -1
- package/dist/src/generator.js +1 -1
- package/dist/src/global-types.js +1 -1
- package/dist/src/import-sorter.js +1 -1
- package/dist/src/incremental.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/inferred-imports.js +1 -1
- package/dist/src/initializer-type-spans.d.ts +7 -0
- package/dist/src/initializer-type-spans.js +2 -0
- package/dist/src/json-config.js +1 -1
- package/dist/src/lexical.d.ts +8 -1
- package/dist/src/lexical.js +1 -1
- package/dist/src/logger.js +1 -1
- package/dist/src/lsp.js +1 -1
- package/dist/src/memory.js +1 -1
- package/dist/src/merger.js +1 -1
- package/dist/src/module-graph.js +1 -1
- package/dist/src/module-references.js +1 -1
- package/dist/src/native-checker.js +1 -1
- package/dist/src/native-engine.js +1 -1
- package/dist/src/native-extractor.js +1 -1
- package/dist/src/native-generation.js +1 -1
- package/dist/src/native-project.js +1 -1
- package/dist/src/numeric-literals.d.ts +9 -0
- package/dist/src/numeric-literals.js +2 -0
- package/dist/src/optimizer.js +1 -1
- package/dist/src/output-normalizer.js +1 -1
- package/dist/src/parallel-processor.js +1 -1
- package/dist/src/parameters.js +1 -1
- package/dist/src/parser.js +1 -1
- package/dist/src/plugins/bun.js +1 -1
- package/dist/src/plugins/esbuild.js +1 -1
- package/dist/src/plugins/index.js +1 -1
- package/dist/src/plugins/tsdown.js +1 -1
- package/dist/src/plugins/tsup.js +1 -1
- package/dist/src/plugins/vite.js +1 -1
- package/dist/src/plugins/webpack.js +1 -1
- package/dist/src/plugins.js +1 -1
- package/dist/src/process-source.d.ts +1 -1
- package/dist/src/process-source.js +1 -1
- package/dist/src/processor/cache.js +1 -1
- package/dist/src/processor/comments.js +1 -1
- package/dist/src/processor/declarations.js +1 -1
- package/dist/src/processor/import-usage.js +1 -1
- package/dist/src/processor/imports.js +1 -1
- package/dist/src/processor/index.js +1 -1
- package/dist/src/processor/type-inference.d.ts +2 -9
- package/dist/src/processor/type-inference.js +1 -1
- package/dist/src/processor.js +1 -1
- package/dist/src/profiling.js +1 -1
- package/dist/src/return-type-scope.js +1 -1
- package/dist/src/security.js +1 -1
- package/dist/src/source-cache.js +1 -1
- package/dist/src/sourcemap.js +1 -1
- package/dist/src/stx.js +1 -1
- package/dist/src/syntax-validator.js +1 -1
- package/dist/src/tracking.js +1 -1
- package/dist/src/transformers.js +1 -1
- package/dist/src/tree-shaker.js +1 -1
- package/dist/src/tsconfig.js +1 -1
- package/dist/src/type-mappings.js +1 -1
- package/dist/src/utils.js +1 -1
- package/dist/src/value-inference.js +1 -1
- package/dist/src/vue.js +1 -1
- package/dist/src/watcher.js +1 -1
- package/dist/src/worker-thread.js +1 -1
- package/dist/src/worker.js +1 -1
- package/dist/src/workspace.js +1 -1
- package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
- package/native/darwin-x64/libzig-dtsx.dylib +0 -0
- package/native/freebsd-x64/libzig-dtsx.so +0 -0
- package/native/linux-arm64/libzig-dtsx.so +0 -0
- package/native/linux-x64/libzig-dtsx.so +0 -0
- package/native/windows-x64/zig-dtsx.dll +0 -0
- package/package.json +1 -1
- package/dist/chunk-1hz6j7bq.js +0 -37
- package/dist/chunk-3v0yh5dk.js +0 -3
- package/dist/chunk-4ece5g8t.js +0 -3
- package/dist/chunk-86xvq8km.js +0 -4
- package/dist/chunk-90f37xen.js +0 -3
- package/dist/chunk-976r899s.js +0 -10
- package/dist/chunk-anvhqbw8.js +0 -3
- package/dist/chunk-btmc3e8d.js +0 -3
- package/dist/chunk-d68r83t9.js +0 -3
- package/dist/chunk-erymqkk3.js +0 -14
- package/dist/chunk-hwgxwgsh.js +0 -4
- package/dist/chunk-hyszyzq2.js +0 -3
- package/dist/chunk-m2kzh519.js +0 -3
- package/dist/chunk-madfh88z.js +0 -3
- package/dist/chunk-mhz6xe61.js +0 -7
- package/dist/chunk-nxk4h5hy.js +0 -3
- package/dist/chunk-q4ebd4qe.js +0 -8
- package/dist/chunk-v3n9zzhm.js +0 -5
- package/dist/chunk-x1j88x37.js +0 -38
- package/dist/chunk-xa9vcbjj.js +0 -3
- package/dist/chunk-xb2nr89a.js +0 -3
- package/dist/chunk-ykrdzatr.js +0 -31
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function p(r,t){let e=r.trim();if(e==="string")return{type:"string"};if(e==="number")return{type:"number"};if(e==="boolean")return{type:"boolean"};if(e==="null")return{type:"null"};if(e==="undefined")return{type:"null"};if(e==="any"||e==="unknown")return{};if(e==="never")return{not:{}};if(e==="void")return{type:"null"};if(e==="bigint")return{type:"integer"};if(e==="symbol")return{type:"string",description:"Symbol type"};if(e==="object")return{type:"object"};if(e.startsWith("'")||e.startsWith('"'))return{const:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{const:Number.parseFloat(e)};if(e==="true")return{const:!0};if(e==="false")return{const:!1};let n=e.match(/^(.+)\[\]$/)||e.match(/^Array<(.+)>$/i);if(n)return{type:"array",items:p(n[1],t)};let i=e.match(/^\[(.+)\]$/);if(i){let f=l(i[1],",").map((d)=>p(d.trim(),t));return{type:"array",items:f,minItems:f.length,maxItems:f.length}}if(e.includes("|")){let f=l(e,"|");if(f.length>1){let d=f.filter((a)=>a.trim()!=="null"&&a.trim()!=="undefined");if(f.some((a)=>a.trim()==="null"||a.trim()==="undefined")&&d.length===1){let a=p(d[0],t);if(a.type&&typeof a.type==="string")return{...a,type:[a.type,"null"]};return{oneOf:[a,{type:"null"}]}}return{oneOf:f.map((a)=>p(a.trim(),t))}}}if(e.includes("&")){let f=l(e,"&");if(f.length>1)return{allOf:f.map((d)=>p(d.trim(),t))}}let s=e.match(/^Record<(.+),\s*(.+)>$/i);if(s)return{type:"object",additionalProperties:p(s[2],t)};let o=e.match(/^Promise<(.+)>$/i);if(o)return p(o[1],t);let u=e.match(/^Partial<(.+)>$/i);if(u)return{...p(u[1],t),required:[]};let h=e.match(/^Required<(.+)>$/i);if(h)return p(h[1],t);let c=e.match(/^Readonly<(.+)>$/i);if(c)return p(c[1],t);let y=e.match(/^Pick<(.+),\s*(.+)>$/i);if(y)return p(y[1],t);let b=e.match(/^Omit<(.+),\s*(.+)>$/i);if(b)return p(b[1],t);if(e==="Date")return{type:"string",format:"date-time"};if(/^[A-Z]\w*$/.test(e))return{$ref:`#/$defs/${e}`};return{type:"object"}}function
|
|
2
|
+
function p(r,t){let e=r.trim();if(e==="string")return{type:"string"};if(e==="number")return{type:"number"};if(e==="boolean")return{type:"boolean"};if(e==="null")return{type:"null"};if(e==="undefined")return{type:"null"};if(e==="any"||e==="unknown")return{};if(e==="never")return{not:{}};if(e==="void")return{type:"null"};if(e==="bigint")return{type:"integer"};if(e==="symbol")return{type:"string",description:"Symbol type"};if(e==="object")return{type:"object"};if(e.startsWith("'")||e.startsWith('"'))return{const:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{const:Number.parseFloat(e)};if(e==="true")return{const:!0};if(e==="false")return{const:!1};let n=e.match(/^(.+)\[\]$/)||e.match(/^Array<(.+)>$/i);if(n)return{type:"array",items:p(n[1],t)};let i=e.match(/^\[(.+)\]$/);if(i){let f=l(i[1],",").map((d)=>p(d.trim(),t));return{type:"array",items:f,minItems:f.length,maxItems:f.length}}if(e.includes("|")){let f=l(e,"|");if(f.length>1){let d=f.filter((a)=>a.trim()!=="null"&&a.trim()!=="undefined");if(f.some((a)=>a.trim()==="null"||a.trim()==="undefined")&&d.length===1){let a=p(d[0],t);if(a.type&&typeof a.type==="string")return{...a,type:[a.type,"null"]};return{oneOf:[a,{type:"null"}]}}return{oneOf:f.map((a)=>p(a.trim(),t))}}}if(e.includes("&")){let f=l(e,"&");if(f.length>1)return{allOf:f.map((d)=>p(d.trim(),t))}}let s=e.match(/^Record<(.+),\s*(.+)>$/i);if(s)return{type:"object",additionalProperties:p(s[2],t)};let o=e.match(/^Promise<(.+)>$/i);if(o)return p(o[1],t);let u=e.match(/^Partial<(.+)>$/i);if(u)return{...p(u[1],t),required:[]};let h=e.match(/^Required<(.+)>$/i);if(h)return p(h[1],t);let c=e.match(/^Readonly<(.+)>$/i);if(c)return p(c[1],t);let y=e.match(/^Pick<(.+),\s*(.+)>$/i);if(y)return p(y[1],t);let b=e.match(/^Omit<(.+),\s*(.+)>$/i);if(b)return p(b[1],t);if(e==="Date")return{type:"string",format:"date-time"};if(/^[A-Z]\w*$/.test(e))return{$ref:`#/$defs/${e}`};return{type:"object"}}function Fr(r,t={}){let e=t.indent??2,n=t.jsonSchemaDraft??"2020-12",i={"2020-12":"https://json-schema.org/draft/2020-12/schema","2019-09":"https://json-schema.org/draft/2019-09/schema","draft-07":"http://json-schema.org/draft-07/schema#"}[n],s=new Map,o={$schema:t.includeSchema!==!1?i:void 0,$defs:{}};for(let u of r)if(u.kind==="interface"||u.kind==="type"){let h=N(u,s,t);if(o.$defs)o.$defs[u.name]=h}if(o.$defs&&Object.keys(o.$defs).length===1){let[u,h]=Object.entries(o.$defs)[0];return JSON.stringify({$schema:o.$schema,title:u,...h},null,e)}return JSON.stringify(o,null,e)}function N(r,t,e){let n={type:"object"};if(e.includeDescriptions&&r.leadingComments?.length){let i=v(r.leadingComments);if(i)n.description=i}if(r.members&&r.members.length>0){n.properties={},n.required=[];for(let i of r.members)if(i.name&&i.typeAnnotation){let s=p(i.typeAnnotation,t);if(e.includeDescriptions&&i.leadingComments?.length){let u=v(i.leadingComments);if(u)s.description=u}if(n.properties[i.name]=s,!(i.modifiers?.includes("?")||i.text?.includes("?:")||e.allOptional))n.required.push(i.name)}if(n.required.length===0)delete n.required}else if(r.typeAnnotation)return p(r.typeAnnotation,t);return n}function Br(r,t={}){let e=["import { z } from 'zod'",""];for(let n of r)if(n.kind==="interface"||n.kind==="type"){let i=t.exportName||`${n.name}Schema`,s=x(n,t);if(e.push(`export const ${i} = ${s}`),e.push(""),t.useInfer!==!1)e.push(`export type ${n.name} = z.infer<typeof ${i}>`),e.push("")}return e.join(`
|
|
3
3
|
`)}function x(r,t){if(r.members&&r.members.length>0)return`z.object({
|
|
4
4
|
${r.members.filter((n)=>n.name&&n.typeAnnotation).map((n)=>{let i=m(n.typeAnnotation);if(n.modifiers?.includes("?")||n.text?.includes("?:")||t.allOptional)i=`${i}.optional()`;if(t.includeDescriptions&&n.leadingComments?.length){let o=v(n.leadingComments);if(o)i=`${i}.describe(${JSON.stringify(o)})`}return` ${n.name}: ${i}`}).join(`,
|
|
5
5
|
`)}
|
|
6
|
-
})`;if(r.typeAnnotation)return m(r.typeAnnotation);return"z.unknown()"}function m(r){let t=r.trim();if(t==="string")return"z.string()";if(t==="number")return"z.number()";if(t==="boolean")return"z.boolean()";if(t==="null")return"z.null()";if(t==="undefined")return"z.undefined()";if(t==="any")return"z.any()";if(t==="unknown")return"z.unknown()";if(t==="never")return"z.never()";if(t==="void")return"z.void()";if(t==="bigint")return"z.bigint()";if(t==="symbol")return"z.symbol()";if(t==="Date")return"z.date()";if(t.startsWith("'")||t.startsWith('"'))return`z.literal(${t})`;if(/^-?\d+(\.\d+)?$/.test(t))return`z.literal(${t})`;if(t==="true"||t==="false")return`z.literal(${t})`;let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`z.array(${m(e[1])})`;let n=t.match(/^\[(.+)\]$/);if(n)return`z.tuple([${l(n[1],",").map((b)=>m(b.trim())).join(", ")}])`;if(t.includes("|")){let y=l(t,"|");if(y.length>1){let b=y.filter((a)=>a.trim()!=="null"&&a.trim()!=="undefined"),f=y.some((a)=>a.trim()==="null"),d=y.some((a)=>a.trim()==="undefined");if((f||d)&&b.length===1){let a=m(b[0]);if(f)a=`${a}.nullable()`;if(d)a=`${a}.optional()`;return a}return`z.union([${y.map((a)=>m(a.trim())).join(", ")}])`}}if(t.includes("&")){let y=l(t,"&");if(y.length>1)return y.map((f)=>m(f.trim())).reduce((f,d)=>`${f}.and(${d})`)}let i=t.match(/^Record<(.+),\s*(.+)>$/i);if(i)return`z.record(${m(i[1])}, ${m(i[2])})`;let s=t.match(/^Promise<(.+)>$/i);if(s)return`z.promise(${m(s[1])})`;let o=t.match(/^Map<(.+),\s*(.+)>$/i);if(o)return`z.map(${m(o[1])}, ${m(o[2])})`;let u=t.match(/^Set<(.+)>$/i);if(u)return`z.set(${m(u[1])})`;let h=t.match(/^Partial<(.+)>$/i);if(h)return`${m(h[1])}.partial()`;let c=t.match(/^Required<(.+)>$/i);if(c)return`${m(c[1])}.required()`;if(/^[A-Z]\w*$/.test(t))return`${t}Schema`;return"z.unknown()"}function
|
|
6
|
+
})`;if(r.typeAnnotation)return m(r.typeAnnotation);return"z.unknown()"}function m(r){let t=r.trim();if(t==="string")return"z.string()";if(t==="number")return"z.number()";if(t==="boolean")return"z.boolean()";if(t==="null")return"z.null()";if(t==="undefined")return"z.undefined()";if(t==="any")return"z.any()";if(t==="unknown")return"z.unknown()";if(t==="never")return"z.never()";if(t==="void")return"z.void()";if(t==="bigint")return"z.bigint()";if(t==="symbol")return"z.symbol()";if(t==="Date")return"z.date()";if(t.startsWith("'")||t.startsWith('"'))return`z.literal(${t})`;if(/^-?\d+(\.\d+)?$/.test(t))return`z.literal(${t})`;if(t==="true"||t==="false")return`z.literal(${t})`;let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`z.array(${m(e[1])})`;let n=t.match(/^\[(.+)\]$/);if(n)return`z.tuple([${l(n[1],",").map((b)=>m(b.trim())).join(", ")}])`;if(t.includes("|")){let y=l(t,"|");if(y.length>1){let b=y.filter((a)=>a.trim()!=="null"&&a.trim()!=="undefined"),f=y.some((a)=>a.trim()==="null"),d=y.some((a)=>a.trim()==="undefined");if((f||d)&&b.length===1){let a=m(b[0]);if(f)a=`${a}.nullable()`;if(d)a=`${a}.optional()`;return a}return`z.union([${y.map((a)=>m(a.trim())).join(", ")}])`}}if(t.includes("&")){let y=l(t,"&");if(y.length>1)return y.map((f)=>m(f.trim())).reduce((f,d)=>`${f}.and(${d})`)}let i=t.match(/^Record<(.+),\s*(.+)>$/i);if(i)return`z.record(${m(i[1])}, ${m(i[2])})`;let s=t.match(/^Promise<(.+)>$/i);if(s)return`z.promise(${m(s[1])})`;let o=t.match(/^Map<(.+),\s*(.+)>$/i);if(o)return`z.map(${m(o[1])}, ${m(o[2])})`;let u=t.match(/^Set<(.+)>$/i);if(u)return`z.set(${m(u[1])})`;let h=t.match(/^Partial<(.+)>$/i);if(h)return`${m(h[1])}.partial()`;let c=t.match(/^Required<(.+)>$/i);if(c)return`${m(c[1])}.required()`;if(/^[A-Z]\w*$/.test(t))return`${t}Schema`;return"z.unknown()"}function Wr(r,t={}){let e=["import * as v from 'valibot'",""];for(let n of r)if(n.kind==="interface"||n.kind==="type"){let i=t.exportName||`${n.name}Schema`,s=j(n,t);if(e.push(`export const ${i} = ${s}`),e.push(""),t.useInfer!==!1)e.push(`export type ${n.name} = v.InferOutput<typeof ${i}>`),e.push("")}return e.join(`
|
|
7
7
|
`)}function j(r,t){if(r.members&&r.members.length>0)return`v.object({
|
|
8
8
|
${r.members.filter((n)=>n.name&&n.typeAnnotation).map((n)=>{let i=g(n.typeAnnotation);if(n.modifiers?.includes("?")||n.text?.includes("?:")||t.allOptional)i=`v.optional(${i})`;return` ${n.name}: ${i}`}).join(`,
|
|
9
9
|
`)}
|
|
10
|
-
})`;if(r.typeAnnotation)return g(r.typeAnnotation);return"v.unknown()"}function g(r){let t=r.trim();if(t==="string")return"v.string()";if(t==="number")return"v.number()";if(t==="boolean")return"v.boolean()";if(t==="null")return"v.null_()";if(t==="undefined")return"v.undefined_()";if(t==="any")return"v.any()";if(t==="unknown")return"v.unknown()";if(t==="never")return"v.never()";if(t==="void")return"v.void_()";if(t==="bigint")return"v.bigint()";if(t==="symbol")return"v.symbol()";if(t==="Date")return"v.date()";if(t.startsWith("'")||t.startsWith('"'))return`v.literal(${t})`;if(/^-?\d+(\.\d+)?$/.test(t))return`v.literal(${t})`;if(t==="true"||t==="false")return`v.literal(${t})`;let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`v.array(${g(e[1])})`;let n=t.match(/^\[(.+)\]$/);if(n)return`v.tuple([${l(n[1],",").map((o)=>g(o.trim())).join(", ")}])`;if(t.includes("|")){let s=l(t,"|");if(s.length>1){let o=s.filter((c)=>c.trim()!=="null"&&c.trim()!=="undefined"),u=s.some((c)=>c.trim()==="null"),h=s.some((c)=>c.trim()==="undefined");if((u||h)&&o.length===1){let c=g(o[0]);if(u)c=`v.nullable(${c})`;if(h)c=`v.optional(${c})`;return c}return`v.union([${s.map((c)=>g(c.trim())).join(", ")}])`}}if(t.includes("&")){let s=l(t,"&");if(s.length>1)return`v.intersect([${s.map((o)=>g(o.trim())).join(", ")}])`}let i=t.match(/^Record<(.+),\s*(.+)>$/i);if(i)return`v.record(${g(i[1])}, ${g(i[2])})`;if(/^[A-Z]\w*$/.test(t))return`${t}Schema`;return"v.unknown()"}function
|
|
10
|
+
})`;if(r.typeAnnotation)return g(r.typeAnnotation);return"v.unknown()"}function g(r){let t=r.trim();if(t==="string")return"v.string()";if(t==="number")return"v.number()";if(t==="boolean")return"v.boolean()";if(t==="null")return"v.null_()";if(t==="undefined")return"v.undefined_()";if(t==="any")return"v.any()";if(t==="unknown")return"v.unknown()";if(t==="never")return"v.never()";if(t==="void")return"v.void_()";if(t==="bigint")return"v.bigint()";if(t==="symbol")return"v.symbol()";if(t==="Date")return"v.date()";if(t.startsWith("'")||t.startsWith('"'))return`v.literal(${t})`;if(/^-?\d+(\.\d+)?$/.test(t))return`v.literal(${t})`;if(t==="true"||t==="false")return`v.literal(${t})`;let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`v.array(${g(e[1])})`;let n=t.match(/^\[(.+)\]$/);if(n)return`v.tuple([${l(n[1],",").map((o)=>g(o.trim())).join(", ")}])`;if(t.includes("|")){let s=l(t,"|");if(s.length>1){let o=s.filter((c)=>c.trim()!=="null"&&c.trim()!=="undefined"),u=s.some((c)=>c.trim()==="null"),h=s.some((c)=>c.trim()==="undefined");if((u||h)&&o.length===1){let c=g(o[0]);if(u)c=`v.nullable(${c})`;if(h)c=`v.optional(${c})`;return c}return`v.union([${s.map((c)=>g(c.trim())).join(", ")}])`}}if(t.includes("&")){let s=l(t,"&");if(s.length>1)return`v.intersect([${s.map((o)=>g(o.trim())).join(", ")}])`}let i=t.match(/^Record<(.+),\s*(.+)>$/i);if(i)return`v.record(${g(i[1])}, ${g(i[2])})`;if(/^[A-Z]\w*$/.test(t))return`${t}Schema`;return"v.unknown()"}function _r(r,t={}){let e=["import * as t from 'io-ts'",""];for(let n of r)if(n.kind==="interface"||n.kind==="type"){let i=t.exportName||`${n.name}Codec`,s=A(n,t);if(e.push(`export const ${i} = ${s}`),e.push(""),t.useInfer!==!1)e.push(`export type ${n.name} = t.TypeOf<typeof ${i}>`),e.push("")}return e.join(`
|
|
11
11
|
`)}function A(r,t){if(r.members&&r.members.length>0){let e=[],n=[];for(let i of r.members){if(!i.name||!i.typeAnnotation)continue;let s=O(i.typeAnnotation),o=i.modifiers?.includes("?")||i.text?.includes("?:")||t.allOptional,u=` ${i.name}: ${s}`;if(o)n.push(u);else e.push(u)}if(n.length>0)return`t.intersection([
|
|
12
12
|
t.type({
|
|
13
13
|
${e.join(`,
|
|
@@ -20,15 +20,15 @@ ${n.join(`,
|
|
|
20
20
|
])`;return`t.type({
|
|
21
21
|
${e.join(`,
|
|
22
22
|
`)}
|
|
23
|
-
})`}if(r.typeAnnotation)return O(r.typeAnnotation);return"t.unknown"}function O(r){let t=r.trim();if(t==="string")return"t.string";if(t==="number")return"t.number";if(t==="boolean")return"t.boolean";if(t==="null")return"t.null";if(t==="undefined")return"t.undefined";if(t==="any")return"t.unknown";if(t==="unknown")return"t.unknown";if(t==="never")return"t.never";if(t==="void")return"t.void";if(t.startsWith("'")||t.startsWith('"'))return`t.literal(${t})`;if(/^-?\d+(\.\d+)?$/.test(t))return`t.literal(${t})`;if(t==="true"||t==="false")return`t.literal(${t})`;let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`t.array(${O(e[1])})`;let n=t.match(/^\[(.+)\]$/);if(n)return`t.tuple([${l(n[1],",").map((o)=>O(o.trim())).join(", ")}])`;if(t.includes("|")){let s=l(t,"|");if(s.length>1)return`t.union([${s.map((o)=>O(o.trim())).join(", ")}])`}if(t.includes("&")){let s=l(t,"&");if(s.length>1)return`t.intersection([${s.map((o)=>O(o.trim())).join(", ")}])`}let i=t.match(/^Record<(.+),\s*(.+)>$/i);if(i)return`t.record(${O(i[1])}, ${O(i[2])})`;if(/^[A-Z]\w*$/.test(t))return`${t}Codec`;return"t.unknown"}function
|
|
23
|
+
})`}if(r.typeAnnotation)return O(r.typeAnnotation);return"t.unknown"}function O(r){let t=r.trim();if(t==="string")return"t.string";if(t==="number")return"t.number";if(t==="boolean")return"t.boolean";if(t==="null")return"t.null";if(t==="undefined")return"t.undefined";if(t==="any")return"t.unknown";if(t==="unknown")return"t.unknown";if(t==="never")return"t.never";if(t==="void")return"t.void";if(t.startsWith("'")||t.startsWith('"'))return`t.literal(${t})`;if(/^-?\d+(\.\d+)?$/.test(t))return`t.literal(${t})`;if(t==="true"||t==="false")return`t.literal(${t})`;let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`t.array(${O(e[1])})`;let n=t.match(/^\[(.+)\]$/);if(n)return`t.tuple([${l(n[1],",").map((o)=>O(o.trim())).join(", ")}])`;if(t.includes("|")){let s=l(t,"|");if(s.length>1)return`t.union([${s.map((o)=>O(o.trim())).join(", ")}])`}if(t.includes("&")){let s=l(t,"&");if(s.length>1)return`t.intersection([${s.map((o)=>O(o.trim())).join(", ")}])`}let i=t.match(/^Record<(.+),\s*(.+)>$/i);if(i)return`t.record(${O(i[1])}, ${O(i[2])})`;if(/^[A-Z]\w*$/.test(t))return`${t}Codec`;return"t.unknown"}function jr(r,t={}){let e=["import * as yup from 'yup'",""];for(let n of r)if(n.kind==="interface"||n.kind==="type"){let i=t.exportName||`${n.name}Schema`,s=z(n,t);if(e.push(`export const ${i} = ${s}`),e.push(""),t.useInfer!==!1)e.push(`export type ${n.name} = yup.InferType<typeof ${i}>`),e.push("")}return e.join(`
|
|
24
24
|
`)}function z(r,t){if(r.members&&r.members.length>0)return`yup.object({
|
|
25
25
|
${r.members.filter((n)=>n.name&&n.typeAnnotation).map((n)=>{let i=T(n.typeAnnotation);if(!(n.modifiers?.includes("?")||n.text?.includes("?:")||t.allOptional))i=`${i}.required()`;return` ${n.name}: ${i}`}).join(`,
|
|
26
26
|
`)}
|
|
27
|
-
})`;if(r.typeAnnotation)return T(r.typeAnnotation);return"yup.mixed()"}function T(r){let t=r.trim();if(t==="string")return"yup.string()";if(t==="number")return"yup.number()";if(t==="boolean")return"yup.boolean()";if(t==="Date")return"yup.date()";if(t==="any"||t==="unknown")return"yup.mixed()";let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`yup.array().of(${T(e[1])})`;if(t.includes("|")){let n=l(t,"|");if(n.length>1){let i=n.filter((o)=>o.trim()!=="null"&&o.trim()!=="undefined");if(n.some((o)=>o.trim()==="null"||o.trim()==="undefined")&&i.length===1)return`${T(i[0])}.nullable()`}}if(/^[A-Z]\w*$/.test(t))return`${t}Schema`;return"yup.mixed()"}function
|
|
27
|
+
})`;if(r.typeAnnotation)return T(r.typeAnnotation);return"yup.mixed()"}function T(r){let t=r.trim();if(t==="string")return"yup.string()";if(t==="number")return"yup.number()";if(t==="boolean")return"yup.boolean()";if(t==="Date")return"yup.date()";if(t==="any"||t==="unknown")return"yup.mixed()";let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`yup.array().of(${T(e[1])})`;if(t.includes("|")){let n=l(t,"|");if(n.length>1){let i=n.filter((o)=>o.trim()!=="null"&&o.trim()!=="undefined");if(n.some((o)=>o.trim()==="null"||o.trim()==="undefined")&&i.length===1)return`${T(i[0])}.nullable()`}}if(/^[A-Z]\w*$/.test(t))return`${t}Schema`;return"yup.mixed()"}function Gr(r,t={}){let e=["import { type } from 'arktype'",""];for(let n of r)if(n.kind==="interface"||n.kind==="type"){let i=t.exportName||n.name,s=w(n,t);if(e.push(`export const ${i} = ${s}`),e.push(""),t.useInfer!==!1)e.push(`export type ${n.name}Type = typeof ${i}.infer`),e.push("")}return e.join(`
|
|
28
28
|
`)}function w(r,t){if(r.members&&r.members.length>0)return`type({
|
|
29
29
|
${r.members.filter((n)=>n.name&&n.typeAnnotation).map((n)=>{let i=S(n.typeAnnotation);return` ${n.modifiers?.includes("?")||n.text?.includes("?:")||t.allOptional?`'${n.name}?'`:`${n.name}`}: ${i}`}).join(`,
|
|
30
30
|
`)}
|
|
31
|
-
})`;if(r.typeAnnotation)return`type(${S(r.typeAnnotation)})`;return"type('unknown')"}function S(r){let t=r.trim();if(t==="string")return"'string'";if(t==="number")return"'number'";if(t==="boolean")return"'boolean'";if(t==="null")return"'null'";if(t==="undefined")return"'undefined'";if(t==="bigint")return"'bigint'";if(t==="symbol")return"'symbol'";if(t==="Date")return"'Date'";if(t==="any"||t==="unknown")return"'unknown'";let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`${S(e[1])}.array()`;if(t.includes("|")){let n=l(t,"|");if(n.length>1)return`'${n.map((i)=>i.trim()).join(" | ")}'`}if(t.startsWith("'")||t.startsWith('"'))return`'${t}'`;return`'${t}'`}function l(r,t){let e=[],n="",i=0;for(let s=0;s<r.length;s++){let o=r[s];if(o==="<"||o==="("||o==="["||o==="{")i++,n+=o;else if(o===">"||o===")"||o==="]"||o==="}")i--,n+=o;else if(i===0&&r.slice(s,s+t.length)===t)e.push(n.trim()),n="",s+=t.length-1;else n+=o}if(n.trim())e.push(n.trim());return e}function v(r){for(let t of r){let e=t.replace(/^\/\*\*|\*\/$/g,"").replace(/^\s*\*\s?/gm,"").replace(/@\w.*/g,"").trim();if(e)return e}return null}function
|
|
31
|
+
})`;if(r.typeAnnotation)return`type(${S(r.typeAnnotation)})`;return"type('unknown')"}function S(r){let t=r.trim();if(t==="string")return"'string'";if(t==="number")return"'number'";if(t==="boolean")return"'boolean'";if(t==="null")return"'null'";if(t==="undefined")return"'undefined'";if(t==="bigint")return"'bigint'";if(t==="symbol")return"'symbol'";if(t==="Date")return"'Date'";if(t==="any"||t==="unknown")return"'unknown'";let e=t.match(/^(.+)\[\]$/)||t.match(/^Array<(.+)>$/i);if(e)return`${S(e[1])}.array()`;if(t.includes("|")){let n=l(t,"|");if(n.length>1)return`'${n.map((i)=>i.trim()).join(" | ")}'`}if(t.startsWith("'")||t.startsWith('"'))return`'${t}'`;return`'${t}'`}function l(r,t){let e=[],n="",i=0;for(let s=0;s<r.length;s++){let o=r[s];if(o==="<"||o==="("||o==="["||o==="{")i++,n+=o;else if(o===">"||o===")"||o==="]"||o==="}")i--,n+=o;else if(i===0&&r.slice(s,s+t.length)===t)e.push(n.trim()),n="",s+=t.length-1;else n+=o}if(n.trim())e.push(n.trim());return e}function v(r){for(let t of r){let e=t.replace(/^\/\*\*|\*\/$/g,"").replace(/^\s*\*\s?/gm,"").replace(/@\w.*/g,"").trim();if(e)return e}return null}function _s(r,t){switch(t.format){case"json-schema":return Fr(r,t);case"zod":return Br(r,t);case"valibot":return Wr(r,t);case"io-ts":return _r(r,t);case"yup":return jr(r,t);case"arktype":return Gr(r,t);case"dts":default:return r.map((e)=>e.text).join(`
|
|
32
32
|
|
|
33
|
-
`)}}function
|
|
34
|
-
export{
|
|
33
|
+
`)}}function js(r){switch(r){case"json-schema":return".schema.json";case"zod":case"valibot":case"io-ts":case"yup":case"arktype":return".schema.ts";case"dts":default:return".d.ts"}}
|
|
34
|
+
export{Fr,Br,Wr,_r,jr,Gr,_s,js};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{y,le,Mt,u}from"./chunk-jy5h728q.js";import{G}from"./chunk-srfpcjtn.js";import{L,N}from"./chunk-755bntty.js";import{O,I}from"./chunk-exf6bsbe.js";import{r}from"./chunk-sqa3ke1a.js";import{Re}from"./chunk-hvt855ms.js";import{e,M}from"./chunk-x5z8vprh.js";import{Oe,D,Nn,X}from"./chunk-s6t0ff96.js";import{Dn}from"./chunk-grpmcw9x.js";import{et,kt}from"./chunk-m14550z9.js";import{A}from"./chunk-f191378r.js";import{De,oe,Y,Pe}from"./chunk-t1js8enq.js";import{tt,J,re,Tt,At,Dt,Pt}from"./chunk-vher6t7j.js";import{ne,$e}from"./chunk-41d5ehn0.js";import{Qe,Et}from"./chunk-e9x8ywhv.js";import{te}from"./chunk-pydpyx8x.js";import{On,rt}from"./chunk-xtckj8w1.js";import{K,Ee}from"./chunk-b3979d26.js";import{Xe}from"./chunk-zwcvtbt4.js";import{Ae}from"./chunk-8c5dzvwk.js";import{l}from"./chunk-3nmjt94q.js";import{ie,Rt}from"./chunk-gns23mhj.js";import{mkdir as ye}from"fs/promises";import{availableParallelism as Se}from"os";import{basename as fe,dirname as pe,relative as z,resolve as ee}from"path";var Z=new WeakMap,ce=new WeakMap;function se(d){let a=Z.get(d);if(!a)a=Oe(d),Z.set(d,a),a.catch(()=>Z.delete(d));return a}async function de(d,a,t,f,h,g=J){let o=fe(d)||"output.d.ts",w=z(pe(d),a),R=`${o}.map`,j=t.lastIndexOf(`
|
|
3
|
+
${tt()}`),p=j===-1?t:t.slice(0,j),b=Dt(p,o,w,f),C=`${d}.map`;return await g(C,JSON.stringify(b)),e.debug(` Generated source map: ${z(h,C)}`),R}async function s(d){let a=Date.now(),t={...A,...d};if(t.logLevel)M(t.logLevel);else if(t.verbose)M("debug");let f=new Ae;if(t.plugins&&t.plugins.length>0){for(let n of t.plugins)f.register(n),e.debug(`Registered plugin: ${n.name}`);t=await f.runOnStart(t)}if(t.moduleSpecifierMode!==void 0&&t.moduleSpecifierMode!=="preserve"&&t.moduleSpecifierMode!=="node")throw Error("moduleSpecifierMode must be preserve or node");if(K(t.engine,"engine"),await ne(t),t.isolatedDeclarations===void 0)t.isolatedDeclarations=await re(t);let h=t.typeMappings?ie(t.typeMappings):void 0,g=null,o={generationMode:t.isolatedDeclarations?"isolated":"semantic",filesProcessed:0,filesGenerated:0,filesFailed:0,filesValidated:0,validationErrors:0,declarationsFound:0,importsProcessed:0,exportsProcessed:0,durationMs:0,errors:[]},w=0;e.debug("Starting DTS generation..."),e.debug(`Using ${o.generationMode} declaration generation path`),e.debug("Config:",t);let R=await De(t,()=>se(t)),j=R.entryFiles,p=[...R.files],{resolver:b,reachability:C}=R;if(ce.set(t,new Set(p)),t.incremental){let n=R.getResolutionFingerprint();if(!t.isolatedDeclarations){let i=new Set(p),m=new Map;for(let S of p){let P=await u(S);m.set(S,rt(P));for(let U of D(P,{includeImports:!0})){let F=b(U.specifier,S).resolved;if(F&&!F.split(/[/\\]/).includes("node_modules")&&!i.has(F))i.add(F),m.set(F,rt(await u(F)))}}let c=[...m].sort(([S],[P])=>S.localeCompare(P));n=JSON.stringify([n,c])}if(g=new et(t,n),t.clearCache){if(e.debug("Clearing build cache..."),!t.dryRun)g.clear()}else if(g.load()){let m=g.getStats();e.debug(`Loaded build cache with ${m.entries} entries`)}else e.debug("No existing build cache found, starting fresh");if(!t.dryRun)kt(t.cwd)}if(g&&!t.dryRun){let n=g.prune(new Set(p),t.cwd);if(n>0)e.debug(`Pruned ${n} deleted files from cache`)}if(e.debug(`Found ${p.length} TypeScript files`),t.progress&&p.length>0){let n=t.parallel?"parallel":"sequential";e.info(`Processing ${p.length} files (${n})...`)}let W=new Map,k=new Map,v=async(n,i,m="lf")=>{k.set(n,{content:i,lineEnding:m})},E=async(n,i)=>{let m;try{let c=Y(n,t),S=async(x)=>{if(!t.diff)return;try{let B=await u(c),H=At(B,x,z(t.cwd,c));if(H)e.info(`
|
|
4
|
+
${H}`);else e.debug(`[no changes] ${c}`)}catch{e.info(`[new file] ${z(t.cwd,c)}`)}},P=(x)=>{if(!t.validate)return 0;let B=Tt(x,c);if(B.isValid)return e.debug(`[validation] ${c} - OK`),0;e.warn(`[validation] ${z(t.cwd,c)} has ${B.errors.length} error(s):`);for(let H of B.errors){let ae=` Line ${H.line}:${H.column}`;if(H.code)ae+=` [${H.code}]`;if(ae+=` - ${H.message}`,e.warn(ae),H.suggestion)e.warn(` Suggestion: ${H.suggestion}`)}return B.errors.length},U=(x)=>{e.info(`[dry-run] Would generate: ${c}`),e.debug("--- Content preview ---"),e.debug(x.slice(0,500)+(x.length>500?`
|
|
5
|
+
...`:"")),e.debug("--- End preview ---")};if(g){let x=g.getCachedIfValid(n,t.cwd);if(x){if(t.bundle)W.set(n,x);await S(x);let B=P(x);if(t.dryRun)U(x);else{if(t.declarationMap)m=i??await u(n),await de(c,n,x,m,t.cwd,v);await v(c,x,t.lineEnding)}return e.debug(`[cached] ${z(t.cwd,c)}`),{success:!0,file:n,declarationCount:0,importCount:0,exportCount:0,cached:!0,validationErrorCount:B}}}m=i??await u(n);let{content:F,declarationCount:he,importCount:we,exportCount:Ce}=await ge(n,m,t,f,h,R.augmentationImports.get(n));if(t.bundle)W.set(n,F);let V=F;if(t.prettier||t.indentStyle||t.indentSize){let x=await te(V,{usePrettier:t.prettier,builtIn:{indentSize:t.indentSize||2,useTabs:t.indentStyle==="tabs",normalizeWhitespace:!0,sortImports:!0,trailingNewline:!0}},c);V=x.content;for(let B of x.warnings??[])e.warn(`[format] ${B}`)}if(t.declarationMap){let x=`${fe(c)||"output.d.ts"}.map`;V=Pt(V,x)}await S(V);let be=P(V);if(t.dryRun)U(V);else{if(t.declarationMap&&m)await de(c,n,V,m,t.cwd,v);if(await v(c,V,t.lineEnding),g&&m)g.update(n,m,V,t.cwd);e.debug(`Generated: ${c}`)}return{success:!0,file:n,declarationCount:he,importCount:we,exportCount:Ce,validationErrorCount:be}}catch(c){let S=Qe(c,n,m);if(t.plugins&&t.plugins.length>0)await f.runOnError(c instanceof Error?c:Error(String(c)),n,m||"");return{success:!1,file:n,declarationCount:0,importCount:0,exportCount:0,dtsError:S,validationErrorCount:0}}},T=t.parallel||t.parallel!==!1&&p.length>=10,q=G(t.concurrency,Se?.()??8),_=new Map;if(T&&p.length>1){let n=p.map(async(i)=>{try{let m=await u(i);return{file:i,source:m}}catch{return{file:i,source:null}}});for(let i of await Promise.all(n))if(i.source!==null)_.set(i.file,i.source)}let Q=(n)=>{if(o.filesProcessed++,n.success){if(n.cached)w++;else o.filesGenerated++,o.declarationsFound+=n.declarationCount,o.importsProcessed+=n.importCount,o.exportsProcessed+=n.exportCount;if(t.validate){if(o.filesValidated++,n.validationErrorCount)o.validationErrors+=n.validationErrorCount}}else if(o.filesFailed++,n.dtsError){o.errors.push(n.dtsError);let i=Et(n.dtsError);if(t.continueOnError)e.warn(i);else throw e.error(i),Error(n.dtsError.message)}};if(T)for(let n=0;n<p.length;n+=q){let i=p.slice(n,n+q),m=await Promise.all(i.map((c)=>E(c,_.get(c))));for(let c of m)Q(c);if(t.progress){let c=Math.round(o.filesProcessed/p.length*100);e.info(`[${o.filesProcessed}/${p.length}] ${c}%`)}}else for(let n of p){let i=await E(n);if(Q(i),t.progress){let m=Math.round(o.filesProcessed/p.length*100),c=i.cached?"[cached]":"";e.info(`[${o.filesProcessed}/${p.length}] ${m}% - ${z(t.cwd,n)} ${c}`)}}if(!t.bundle){let n=[];if(C)for(let i of C.unresolved)n.push({from:i.from,specifier:i.specifier,reason:"missing"});if(t.autoIncludeReExports===!1&&p.length>0){let i=new Set(p);for(let m of p){let c;try{c=await u(m)}catch{continue}for(let S of D(c)){let P=b(S.specifier,m);if(!P.isRelative)continue;if(!P.resolved)n.push({from:m,specifier:S.specifier,reason:"missing"});else if(!/\.d\.(?:ts|mts|cts)$/.test(P.resolved)&&!i.has(P.resolved))n.push({from:m,specifier:S.specifier,reason:"not-emitted"})}}}if(n.length>0){let i=[];i.push(`Found ${n.length} re-export(s) pointing at siblings that won't be in the output:`);for(let c of n){let S=z(t.cwd,c.from);if(c.reason==="missing")i.push(` ${S} \u2192 '${c.specifier}' (path not found on disk)`);else i.push(` ${S} \u2192 '${c.specifier}' (resolved but not in entrypoints; set autoIncludeReExports: true or add to entrypoints)`)}let m=i.join(`
|
|
6
|
+
`);if(t.failOnUnresolvedReExport)throw Error(m);e.warn(m),e.warn('Generated .d.ts files reference modules that were not emitted \u2014 consumers will see "has no exported member" errors.')}}if(t.bundle&&(o.filesGenerated>0||w>0)&&j.length>0)try{e.debug("Bundling declarations...");let n=j.length===1&&!!t.bundleOutput;for(let i of j){let m=await X([i],{includeImports:!0,resolveSpecifier:b}),c=new Set;for(let F of m.reachable){if(F.endsWith(".d.ts"))continue;if(F.includes("node_modules"))continue;c.add(F)}let S=p.filter((F)=>c.has(F));if(!S.includes(i))S.push(i);let P=Dn(i,S,W,{cwd:t.cwd,keepComments:t.keepComments});for(let F of new Set(P.warnings))e.warn(`[bundle] ${F}`);let U=n?ee(t.cwd,t.outdir,t.bundleOutput):Y(i,t);if(t.dryRun)e.info(`[dry-run] Would bundle ${P.files.length} files to: ${z(t.cwd,U)}`);else await v(U,P.content,t.lineEnding),e.debug(`Prepared ${P.files.length} bundled files for: ${z(t.cwd,U)}`);if(n)break}}catch(n){let i=n instanceof Error?n.message:String(n);throw e.error(`Bundle failed: ${i}`),n}if(!t.dryRun)await $e(t,k);if(g&&!t.dryRun)g.save(),e.debug("Saved build cache");if(o.durationMs=Date.now()-a,t.stats)if(t.outputFormat==="json")console.log(JSON.stringify(o,null,2));else{if(e.info(`
|
|
7
|
+
--- Generation Statistics ---`),e.info(`Files processed: ${o.filesProcessed}`),e.info(`Files generated: ${o.filesGenerated}`),w>0)e.info(`Files cached: ${w}`);if(o.filesFailed>0)e.info(`Files failed: ${o.filesFailed}`);if(e.info(`Declarations found: ${o.declarationsFound}`),e.info(`Imports processed: ${o.importsProcessed}`),e.info(`Exports processed: ${o.exportsProcessed}`),o.filesValidated>0){if(e.info(`Files validated: ${o.filesValidated}`),o.validationErrors>0)e.info(`Validation errors: ${o.validationErrors}`)}if(e.info(`Duration: ${o.durationMs}ms`),o.errors.length>0){e.info(`
|
|
8
|
+
Errors:`);for(let n of o.errors){let i=` - ${n.file}`;if(n.location)i+=`:${n.location.line}:${n.location.column}`;if(n.code)i+=` [${n.code}]`;if(i+=`: ${n.message}`,e.info(i),n.suggestion)e.info(` Suggestion: ${n.suggestion}`)}}e.info(`-----------------------------
|
|
9
|
+
`)}if(t.plugins&&t.plugins.length>0)await f.runOnEnd(o);return e.debug("DTS generation complete!"),o}async function ve(d,a,t){let f=await se(t),h=Pe(a,t,f,ce.get(t));return Nn(d,(g)=>h(g).emittedSpecifier)}async function uo(d,a){Z.delete(a),ce.delete(a);let t=await se(a),f=await X([d],{includeImports:!0,resolveSpecifier:t}),h=await Re([...f.sources.keys()],t,a.isolatedDeclarations??!1,f.sources);return(await me(d,a,void 0,h.get(ee(d)))).content}async function me(d,a,t,f){let h=await u(d),g=a.typeMappings?ie(a.typeMappings):void 0;return ge(d,h,a,t,g,f)}async function ge(d,a,t,f,h,g){let o=a;if(f)o=await f.runOnBeforeFile(d,a);let w=new Map;if(!t.isolatedDeclarations){let v=await se(t);for(let E of D(o,{includeImports:!0})){let T=v(E.specifier,d).resolved;if(T&&!T.split(/[/\\]/).includes("node_modules"))w.set(E.specifier,await u(T))}}let R=f?.hasDeclarationHooks()?null:Me(o,d,t,w,g);if(R!==null)return ue(R,d,o,t,f,h,xe(R));let j=w.size?On(o,w):void 0,p=r(o,d,t.keepComments,t.isolatedDeclarations??!1,j);if(f)p=await f.runOnDeclarations(d,o,p);let b=0,C=0;for(let v=0;v<p.length;v++){let E=p[v];if(E.kind==="import")b++;if(E.kind==="export"||E.isExported)C++}let k=l(p,{filePath:d,sourceCode:o,declarations:p,augmentationImports:g},t.keepComments,t.importOrder);return ue(k,d,o,t,f,h,{declarationCount:p.length,importCount:b,exportCount:C})}function xe(d){let a=0,t=0,f=0;for(let h of d.split(`
|
|
10
|
+
`)){if(!h||h.startsWith(" ")||h.startsWith("\t")||h.startsWith("}")||h.startsWith("*")||h.startsWith("/"))continue;if(a++,h.startsWith("import "))t++;else if(h.startsWith("export "))f++}return{declarationCount:a,importCount:t,exportCount:f}}function Me(d,a,t,f,h){let g=t.importOrder??["bun"];if(g.length!==1||g[0]!=="bun")return null;let o=L(a)?N(d):O(a)?I(d):d;return Ee(o,{keepComments:t.keepComments??!0,isolatedDeclarations:t.isolatedDeclarations??!1,engine:t.engine,sourceFile:a,inferenceSources:f,augmentationImports:h})}async function ue(d,a,t,f,h,g,o){let w=await ve(d,a,f);if(g)w=Rt(w,g,{filePath:a});if(f.normalizeOutput===!0||f.declarationOrder)w=Xe(w,{lineEnding:"lf",declarationOrder:f.declarationOrder,indent:{style:f.indentStyle??"spaces",size:f.indentSize??2}});if(h)w=await h.runOnAfterFile(a,t,w);return{content:w,...o}}async function fo(d){let a={...A,...d};if(a.logLevel)M(a.logLevel);let t=ee(a.cwd,a.root),f=150,h=5,g=1e4,o={pendingChanges:new Set,debounceTimer:null,isProcessing:!1,errorCount:0,lastErrorTime:0};e.info(`Watching for changes in ${t}...`),e.info(`Press Ctrl+C to stop
|
|
11
|
+
`);try{await s(a),e.info(`[watch] Initial generation complete
|
|
12
|
+
`)}catch(b){let C=b instanceof Error?b.message:String(b);e.error(`[watch] Initial generation failed: ${C}`),e.info(`[watch] Continuing to watch for changes...
|
|
13
|
+
`)}async function w(){if(o.isProcessing||o.pendingChanges.size===0)return;let b=Date.now();if(o.errorCount>=h){if(b-o.lastErrorTime<g){e.warn(`[watch] Too many errors, pausing for ${Math.ceil((g-(b-o.lastErrorTime))/1000)}s...`);return}o.errorCount=0}o.isProcessing=!0;let C=Array.from(o.pendingChanges);o.pendingChanges.clear();let W=new Date().toLocaleTimeString();if(C.length===1)e.info(`
|
|
14
|
+
[${W}] File changed: ${C[0]}`);else e.info(`
|
|
15
|
+
[${W}] ${C.length} files changed`);let k=0,v=0;for(let E of C){let T=ee(t,E);try{let q=a.exclude||[];if(oe(T,q,t)){e.debug(` Skipping excluded file: ${E}`);continue}if(!await le(T).exists()){e.debug(` Skipping deleted file: ${E}`);continue}let Q=Y(T,a),{content:n}=await me(T,a);await ye(pe(Q),{recursive:!0}),await J(Q,n,a.lineEnding),e.info(` \u2713 ${z(a.cwd,Q)}`),k++}catch(q){v++,o.errorCount++,o.lastErrorTime=Date.now();let _=Qe(q,T);if(e.error(` \u2717 ${E}: ${_.message}`),_.suggestion)e.error(` Suggestion: ${_.suggestion}`)}}if(C.length>1)e.info(` Done: ${k} generated, ${v} failed`);if(v===0)o.errorCount=0;if(o.isProcessing=!1,o.pendingChanges.size>0)o.debounceTimer=setTimeout(w,f)}function R(b){if(o.pendingChanges.add(b),o.debounceTimer)clearTimeout(o.debounceTimer);o.debounceTimer=setTimeout(w,f)}let p=Mt([y?"bun":"node","-e",`
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
|
|
18
|
+
const rootPath = '${t}';
|
|
19
|
+
|
|
20
|
+
fs.watch(rootPath, { recursive: true }, (eventType, filename) => {
|
|
21
|
+
if (filename && /.(?:[cm]?[jt]sx?|vue|stx)$/.test(filename) && !/.d.(?:ts|mts|cts)$/.test(filename)) {
|
|
22
|
+
console.log(\`CHANGED:\${filename}\`);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Keep process alive
|
|
27
|
+
setInterval(() => {}, 1000);
|
|
28
|
+
`],{stdout:"pipe",stderr:"inherit"});if(y){let b=p.stdout.getReader(),C=new TextDecoder,W="";while(!0){let{done:k,value:v}=await b.read();if(k)break;W+=C.decode(v,{stream:!0});let E=W.split(`
|
|
29
|
+
`);W=E.pop()||"";for(let T of E)if(T.startsWith("CHANGED:")){let q=T.slice(8);R(q)}}}else{let b=p.stdout,C="";b.on("data",(W)=>{C+=W.toString();let k=C.split(`
|
|
30
|
+
`);C=k.pop()||"";for(let v of k)if(v.startsWith("CHANGED:")){let E=v.slice(8);R(E)}}),await p.exited}}
|
|
31
|
+
export{s,uo,fo};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
2
|
+
function Ie(h){let a="",i=0,e=0;while(i<h.length){let r=h.charCodeAt(i);if(e){if(a+=h[i],r===92&&i+1<h.length){a+=h[i+1],i+=2;continue}if(r===e)e=0;i++;continue}if(r===34){e=r,a+=h[i++];continue}if(r===47&&h.charCodeAt(i+1)===47){i+=2;while(i<h.length&&h.charCodeAt(i)!==10&&h.charCodeAt(i)!==13)i++;continue}if(r===47&&h.charCodeAt(i+1)===42){i+=2;while(i+1<h.length&&!(h.charCodeAt(i)===42&&h.charCodeAt(i+1)===47)){if(h.charCodeAt(i)===10)a+=`
|
|
3
3
|
`;i++}i=Math.min(i+2,h.length);continue}if(r===44){let c=i+1;while(c<h.length){while(c<h.length&&h.charCodeAt(c)<=32)c++;if(h.charCodeAt(c)===47&&h.charCodeAt(c+1)===47){c+=2;while(c<h.length&&h.charCodeAt(c)!==10&&h.charCodeAt(c)!==13)c++;continue}if(h.charCodeAt(c)===47&&h.charCodeAt(c+1)===42){c+=2;while(c+1<h.length&&!(h.charCodeAt(c)===42&&h.charCodeAt(c+1)===47))c++;c=Math.min(c+2,h.length);continue}break}let t=h.charCodeAt(c);if(t===93||t===125){i++;continue}}a+=h[i++]}return a}
|
|
4
|
-
export{
|
|
4
|
+
export{Ie};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
export{
|
|
2
|
+
var yi=[{pattern:/^Promise<void>$/,replacement:"Promise<void>",priority:-1},{pattern:/^Record<string,\s*any>$/,replacement:"Record<string, unknown>",priority:0},{pattern:/^Array<([^<>]+)>$/,replacement:"$1[]",priority:0}],bi=[{pattern:/\bany\b/,replacement:"unknown",global:!0,priority:10},{pattern:/^object$/,replacement:"Record<string, unknown>",priority:10},{pattern:/^Function$/,replacement:"(...args: unknown[]) => unknown",priority:10}],xi=[{pattern:/^(\w+)\[\]$/,replacement:"readonly $1[]",priority:5},{pattern:/^Array<(.+)>$/,replacement:"ReadonlyArray<$1>",priority:5},{pattern:/^Map<(.+),\s*(.+)>$/,replacement:"ReadonlyMap<$1, $2>",priority:5},{pattern:/^Set<(.+)>$/,replacement:"ReadonlySet<$1>",priority:5}],wi=[{pattern:/^Partial<Partial<(.+)>>$/,replacement:"Partial<$1>",priority:5},{pattern:/^Required<Required<(.+)>>$/,replacement:"Required<$1>",priority:5},{pattern:/^Pick<Omit<(.+),\s*(.+)>,\s*(.+)>$/,replacement:"Pick<$1, $3>",priority:5}];function Ci(e){switch(e){case"strict":return bi;case"readonly":return xi;case"simplified":return wi;case"nullable":return[{pattern:/^(.+)\s*\|\s*undefined$/,replacement:"$1 | undefined",priority:5}];case"branded":return[{pattern:/^string$/,replacement:"string",condition:(r)=>r.declarationKind==="variable"&&(r.declarationName?.includes("path")??!1),priority:5}];default:return[]}}var u=/[.*+?^${}()|[\]\\]/g,c=2048;class Pn{rules;compiled=[];cache=new Map;constructor(e={rules:[]}){if(this.rules=[],e.includeDefaults!==!1)this.rules.push(...yi);if(e.presets)for(let r of e.presets)this.rules.push(...Ci(r));this.rules.push(...e.rules),this.rules.sort((r,t)=>(t.priority||0)-(r.priority||0)),this.recompile()}recompile(){let e=Array(this.rules.length);for(let r=0;r<this.rules.length;r++){let t=this.rules[r],i=typeof t.pattern==="string"?new RegExp(t.pattern.replace(u,"\\$&"),t.global?"g":""):t.pattern;e[r]={rule:t,regex:i}}this.compiled=e}map(e,r={}){let i=!r.declarationName&&!r.declarationKind&&!r.filePath&&!r.isReturnType&&!r.isParameterType&&!r.isPropertyType?e:`${e}\x00${r.declarationName??""}\x00${r.declarationKind??""}\x00${r.filePath??""}\x00${r.isReturnType?"r":""}${r.isParameterType?"p":""}${r.isPropertyType?"P":""}`,l=this.cache.get(i);if(l!==void 0)return l;let a=e,o=null;for(let s=0;s<this.compiled.length;s++){let{rule:p,regex:n}=this.compiled[s];if(p.condition){if(!o)o={type:e,...r};if(!p.condition(o))continue}if(n.lastIndex=0,n.test(a)){if(n.lastIndex=0,a=a.replace(n,p.replacement),n.lastIndex=0,!p.global)break}}if(this.cache.size>=c){let s=Math.ceil(c*0.1),p=0;for(let n of this.cache.keys()){if(p++>=s)break;this.cache.delete(n)}}return this.cache.set(i,a),a}mapAll(e,r={}){return e.map((t)=>this.map(t,{...r,type:t}))}addRule(e){this.rules.push(e),this.rules.sort((r,t)=>(t.priority||0)-(r.priority||0)),this.recompile(),this.cache.clear()}removeRules(e){let r=this.rules.length;return this.rules=this.rules.filter((t)=>{let i=typeof t.pattern==="string"?t.pattern:t.pattern.source;if(e instanceof RegExp)e.lastIndex=0;return typeof e==="string"?i!==e:!e.test(i)}),this.recompile(),this.cache.clear(),r-this.rules.length}clearCache(){this.cache.clear()}getRules(){return this.rules}}function ie(e={rules:[]}){return new Pn(e)}var Oo=ie({rules:[]}),Io=ie({rules:[],presets:["strict"]});function Rt(e,r,t={}){return e.replace(/:\s*([^;,)\]}]+)/g,(i,l)=>`: ${r.map(l.trim(),t)}`)}var Lo={makeReadonly:(e)=>{if(e.endsWith("[]"))return`readonly ${e}`;if(e.startsWith("Array<"))return e.replace("Array<","ReadonlyArray<");return e},makeNullable:(e)=>{if(e.includes("| null")||e.includes("| undefined"))return e;return`${e} | null`},makeOptional:(e)=>{if(e.includes("| undefined"))return e;return`${e} | undefined`},makeRequired:(e)=>e.replace(/\s*\|\s*null/g,"").replace(/\s*\|\s*undefined/g,"").trim(),promisify:(e)=>{if(e.startsWith("Promise<"))return e;return`Promise<${e}>`},unpromisify:(e)=>{let r=e.match(/^Promise<(.+)>$/);return r?r[1]:e},arrayify:(e)=>{if(e.endsWith("[]")||e.startsWith("Array<"))return e;return`${e}[]`},unarrayify:(e)=>{if(e.endsWith("[]"))return e.slice(0,-2);let r=e.match(/^(?:Readonly)?Array<(.+)>$/);return r?r[1]:e}};
|
|
3
|
+
export{yi,bi,xi,wi,Ci,Pn,ie,Oo,Io,Rt,Lo};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,d}from"./chunk-
|
|
3
|
-
`,l);l=
|
|
2
|
+
import{t,d}from"./chunk-j51p30sb.js";import{V}from"./chunk-3x19egjd.js";import{jt}from"./chunk-zmnb3yg1.js";import{w}from"./chunk-y9bxeq10.js";import{ae}from"./chunk-s6t0ff96.js";import{relative as O}from"path";function P(n){let y=t(n),c=(l)=>y[l]?n.slice(y[l].start,y[l].end):"",i=c(0)==="export"?1:0;if(c(i++)!=="declare")return;let f;if(c(i)==="module"&&y[i+1]?.kind==="quoted"){if(f=d(c(i+1)),f===void 0)return;i+=2}else if(c(i++)!=="global")return;if(c(i)!=="{")return;let h=y[i].end,S=1;for(i++;i<y.length;i++)if(c(i)==="{")S++;else if(c(i)==="}"&&--S===0)return{specifier:f,body:n.slice(h,y[i].start),start:h,end:y[i].start};return}var te=/^[A-Z_$][\w$]*$/i;function Mo(n){let y=[],c=[],i=0,f=0,h=[],S=!1,l=0,E=n.length,R=(a)=>{let b=n.slice(i,a).trim();if(i=a,!b)return;if(ne(b)){c.push(b);return}y.push({text:b,comments:c}),c=[]};while(l<E){let a=n[l];if(S){if(a==="\\"){l+=2;continue}if(a==="`"){S=!1,l++;continue}if(a==="$"&&n[l+1]==="{"){h.push(f),f++,S=!1,l+=2;continue}l++;continue}if(a==="/"&&n[l+1]==="*"){let b=n.indexOf("*/",l+2);l=b===-1?E:b+2;continue}if(a==="/"&&n[l+1]==="/"){let b=n.indexOf(`
|
|
3
|
+
`,l);l=b===-1?E:b;continue}if(a==="'"||a==='"'){l++;while(l<E&&n[l]!==a&&n[l]!==`
|
|
4
4
|
`){if(n[l]==="\\")l++;l++}l++;continue}if(a==="`"){S=!0,l++;continue}if(a==="("||a==="["||a==="{"){f++,l++;continue}if(a===")"||a==="]"||a==="}"){if(f--,h.length>0&&a==="}"&&f===h[h.length-1])h.pop(),S=!0;l++;continue}if(f===0&&a===";"){R(l+1),l++;continue}if(f===0&&a===`
|
|
5
|
-
`){let
|
|
6
|
-
`,y);y=c===-1?n.length:c;continue}if(n.startsWith("/*",y)){let c=n.indexOf("*/",y+2);if(c===-1)return!0;y=c+2;continue}return!1}return!0}function X(n){let y=[];for(let c of n.split(",")){let i=c.replace(/\/\*[\s\S]*?\*\//g,"").trim().replace(/^type\s+/,"");if(!i)continue;let f=i.match(/^([\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;y.push({local:f[1],exported:f[2]??f[1]})}return y}var
|
|
7
|
-
`).map((v)=>v.trim()).filter((v)=>v.startsWith("///"))),!1;return!0});let S=h.text.replace(/;\s*$/,"").trim(),l=S.startsWith("import")?
|
|
8
|
-
`;while(a<
|
|
9
|
-
`,a),N=k===-1?
|
|
10
|
-
`){if(n[k]==="\\")k++;k++}R+=n.slice(a,k+1),a=k+1,v=x;continue}if(/[A-Z_$]/i.test(x)){let k=a+1;while(k<
|
|
11
|
-
`||!/\s/.test(x))v=x;a++}return R}function
|
|
5
|
+
`){let b=n[l+1];if(b!==void 0&&/[\w$@/]/.test(b))R(l+1);l++;continue}l++}return R(E),y}function ne(n){let y=0;while(y<n.length){while(y<n.length&&/\s/.test(n[y]))y++;if(y>=n.length)return!0;if(n.startsWith("//",y)){let c=n.indexOf(`
|
|
6
|
+
`,y);y=c===-1?n.length:c;continue}if(n.startsWith("/*",y)){let c=n.indexOf("*/",y+2);if(c===-1)return!0;y=c+2;continue}return!1}return!0}function X(n){let y=[];for(let c of n.split(",")){let i=c.replace(/\/\*[\s\S]*?\*\//g,"").trim().replace(/^type\s+/,"");if(!i)continue;let f=i.match(/^([\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;y.push({local:f[1],exported:f[2]??f[1]})}return y}var se=/^(?:export\s+)?(default\s+)?(?:declare\s+)?(abstract\s+)?(class|interface|type|function\s*\*?|enum|const\s+enum|namespace|module|const|let|var|async\s+function)\b\s*([\w$]+)?/;function ie(n,y){let c=n.replace(/^export\s+/,""),i=/^default\s+/.test(c);if(c=c.replace(/^default\s+/,""),i)c=c.replace(/^((?:declare\s+)?(?:abstract\s+)?(?:class|function\s*\*?|async\s+function\s*\*?))\s*(?=[(<{])/,(f,h)=>`${h.trimEnd()} ${y}`);if(/^(?:interface|type)\b/.test(c)||/^declare\b/.test(c))return c;return`declare ${c}`}function q(n,y,c=!1){let i={file:n,declarations:[],declared:new Set,imports:new Map,localExports:new Map,namedReExports:[],starReExports:[],namespaceReExports:[],verbatim:[],augmentations:[],directives:[]},f=c?jt(y,n).map((h)=>({text:h.text,comments:[...h.leadingComments??[]]})):Mo(y);for(let h of f){h.comments=h.comments.filter((b)=>{if(/^\/\/\/\s*</.test(b))return i.directives.push(...b.split(`
|
|
7
|
+
`).map((v)=>v.trim()).filter((v)=>v.startsWith("///"))),!1;return!0});let S=h.text.replace(/;\s*$/,"").trim(),l=S.startsWith("import")?w(S):null;if(l&&!l.isImportEquals){let b=l.source;if(l.defaultName)i.imports.set(l.defaultName,{specifier:b,imported:"default"});if(l.namespaceName)i.imports.set(l.namespaceName,{specifier:b,imported:"*"});for(let v of l.namedItems)i.imports.set(v.name,{specifier:b,imported:/^['"]/.test(v.originalName)?d(v.originalName):v.originalName});continue}if(/^import\s+['"]/.test(S)){i.verbatim.push(h);continue}let E=S.match(/^export\s+(?:type\s+)?\*\s+as\s+([\w$]+)\s+from\s+(['"])([^'"]+)\2/);if(E){i.namespaceReExports.push({specifier:E[3],exported:E[1]});continue}if(E=S.match(/^export\s+(?:type\s+)?\*\s+from\s+(['"])([^'"]+)\1/),E){i.starReExports.push(E[2]);continue}if(E=S.match(/^export\s+(?:type\s+)?\{([\s\S]*)\}\s+from\s+(['"])([^'"]+)\2/),E){for(let b of X(E[1]))i.namedReExports.push({specifier:E[3],imported:b.local,exported:b.exported});continue}if(E=S.match(/^export\s+(?:type\s+)?\{([\s\S]*)\}$/),E){for(let b of X(E[1]))i.localExports.set(b.exported,b.local);continue}if(E=S.match(/^export\s+default\s+([\w$]+)$/),E&&te.test(E[1])){i.localExports.set("default",E[1]);continue}let R=P(S);if(R?.specifier!==void 0&&V(y)){i.augmentations.push({statement:h,specifier:R.specifier,body:R.body});continue}if(/^export\s+as\s+namespace\b/.test(S)||R){i.verbatim.push(h);continue}let a=S.match(se);if(a){let b=!!a[1],v=a[4]??(b?"_default":null);if(v){if(i.declared.add(v),/^export\s/.test(S))i.localExports.set(b?"default":v,v);i.declarations.push({statement:h,name:v,emit:ie(h.text,v)});continue}}i.declarations.push({statement:h,name:null,emit:h.text})}return i}function nt(n,y){if(y.size===0)return n;let c=t(n),i=new Map(c.filter((m)=>m.kind==="literal").map((m)=>[m.start,m.end])),f=(m)=>c[m]?n.slice(c[m].start,c[m].end):"",h=new Map,S=[];for(let m=0;m<c.length;m++){let x=f(m);if(["(","[","{","<"].includes(x))S.push(m);else if([")","]","}",">"].includes(x)&&!(x===">"&&f(m-1)==="=")){let k=S.at(-1);if(k!==void 0&&["()","[]","{}","<>"].includes(f(k)+x))S.pop(),h.set(k,m)}}let l=(m)=>{for(let x=m;x<c.length;x++){if([";",",",")","]","}"].includes(f(x))||f(x)===">"&&f(x-1)!=="=")return x;let k=h.get(x);if(k!==void 0)x=k}return c.length},E=new Set;for(let m=0;m<c.length;m++){let x=h.get(m);if(f(m)!=="<"||x===void 0)continue;let k=["class","interface","type"].includes(f(m-2));if(!k&&f(x+1)!=="(")continue;let N=new Set;for(let u=m+1;u<x;u++){if(u===m+1||f(u-1)===","){while(["const","in","out"].includes(f(u)))u++;if(c[u]?.kind==="word")N.add(f(u))}let D=h.get(u);if(D!==void 0)u=D}let I=l(x+1);if(k&&f(m-2)!=="type")for(let u=x+1;u<c.length;u++){if(f(u)==="{"){I=h.get(u)??I;break}let D=h.get(u);if(D!==void 0)u=D}for(let u=m+1;u<I;u++){let D=f(m-2)==="class"&&u>x&&f(u-1)==="extends";if(N.has(f(u))&&f(u-1)!=="typeof"&&!D)E.add(c[u].start)}}for(let m=0;m<c.length;m++){if(!["namespace","module"].includes(f(m))||c[m+1]?.kind!=="word"||f(m+2)!=="{")continue;let x=h.get(m+2);if(x===void 0)continue;let k=jt(n.slice(c[m+2].end,c[x].start),"bundle-namespace.ts"),N=new Set(k.filter((u)=>["class","interface","type","enum","module","namespace"].includes(u.kind)).map((u)=>u.name)),I=new Set(k.filter((u)=>["class","variable","function","enum","module","namespace"].includes(u.kind)).map((u)=>u.name));for(let u=m+3;u<x;u++)if((f(u-1)==="typeof"?I:N).has(f(u)))E.add(c[u].start)}let R="",a=0,b=n.length,v=`
|
|
8
|
+
`;while(a<b){let m=i.get(a);if(m!==void 0){R+=n.slice(a,m),a=m,v="`";continue}let x=n[a];if(x==="/"&&n[a+1]==="*"){let k=n.indexOf("*/",a+2),N=k===-1?b:k+2;R+=n.slice(a,N),a=N;continue}if(x==="/"&&n[a+1]==="/"){let k=n.indexOf(`
|
|
9
|
+
`,a),N=k===-1?b:k;R+=n.slice(a,N),a=N;continue}if(x==="'"||x==='"'){let k=a+1;while(k<b&&n[k]!==x&&n[k]!==`
|
|
10
|
+
`){if(n[k]==="\\")k++;k++}R+=n.slice(a,k+1),a=k+1,v=x;continue}if(/[A-Z_$]/i.test(x)){let k=a+1;while(k<b&&/[\w$]/.test(n[k]))k++;let N=n.slice(a,k),I=y.get(N);if(I!==void 0&&v!=="."&&!E.has(a)){let u=k;while(u<b&&(n[u]===" "||n[u]==="\t"))u++;let D=(n[u]===":"||n[u]==="?"&&n[u+1]===":")&&/[{;,(\n]/.test(v);R+=D?N:I}else R+=N;v="a",a=k;continue}if(R+=x,x===`
|
|
11
|
+
`||!/\s/.test(x))v=x;a++}return R}function Dn(n,y,c,i){let f=[],h=new Map,S=[n,...y.filter((e)=>e!==n)];for(let e of S){let s=c.get(e);if(s===void 0){f.push(`No declarations were generated for ${O(i.cwd,e)}; it is left out of the bundle`);continue}h.set(e,q(e,s))}let l=(e,s)=>{if(!e.startsWith(".")&&!e.startsWith("/"))return null;let o=ae(e,s).resolved;return o&&h.has(o)?o:null},E=(e)=>e.startsWith(".")||e.startsWith("/"),R=new Set,a=(e)=>{let s=e;for(let o=1;R.has(s);o++)s=`${e}_${o}`;return R.add(s),s},b=new Map;for(let[e,s]of h){let o=new Map;for(let g of s.declared)o.set(g,a(g));b.set(e,o)}let v=new Map,m=(e,s,o)=>{let g=`${e}\x00${s}`,r=v.get(g);if(!r)r=a(o),v.set(g,r);return r},x=new Map,k=new Map,N=new Set,I=new Map,u=!0,D=(e,s,o)=>{let g=l(s,e.file);if(g){if(o==="*")return{kind:"namespace",file:g};let r=L(g).get(o);if(!r&&!u)f.push(`${O(i.cwd,e.file)}: '${o}' is not exported by '${s}'`);return r??null}if(E(s))return f.push(`${O(i.cwd,e.file)}: '${s}' is not part of the bundle`),null;return o==="*"?{kind:"external-namespace",source:s}:{kind:"external",source:s,imported:o}},Y=(e,s)=>{if(e.declared.has(s))return{kind:"local",name:b.get(e.file).get(s)};let o=e.imports.get(s);if(o)return D(e,o.specifier,o.imported);return f.push(`${O(i.cwd,e.file)}: cannot resolve exported name '${s}'`),null};function L(e){let s=x.get(e);if(s)return s;let o=new Map,g=h.get(e);if(!g||N.has(e))return o;N.add(e);let r=new Set;for(let[p,M]of g.localExports){let B=Y(g,M);if(B)o.set(p,B)}for(let p of g.namedReExports){let M=D(g,p.specifier,p.imported);if(M)o.set(p.exported,M)}for(let p of g.namespaceReExports){let M=D(g,p.specifier,"*");if(M)o.set(p.exported,M)}for(let p of g.starReExports){let M=l(p,e);if(M){for(let[B,C]of L(M))if(B!=="default"&&!o.has(B))o.set(B,C);for(let B of k.get(M)??[])r.add(B)}else if(E(p))f.push(`${O(i.cwd,e)}: '${p}' is not part of the bundle`);else r.add(p)}for(let[p,M]of I.get(e)??[])o.set(p,M);return N.delete(e),x.set(e,o),k.set(e,r),o}for(let[e,s]of h)for(let o of s.augmentations){let g=l(o.specifier,e);if(!g)continue;for(let r of q(e,o.body,!0).declared){if(L(g).has(r))continue;let p=I.get(g);if(!p)p=new Map,I.set(g,p);p.set(r,{kind:"local",name:a(r)}),x.clear()}}u=!1,x.clear(),k.clear();let J=new Map,F=[],z=(e,s)=>{switch(e.kind){case"local":return e.name;case"external":return m(e.source,e.imported,e.imported==="default"?s:e.imported);case"external-namespace":return m(e.source,"*",s);case"namespace":return ee(e.file,s)}};function ee(e,s){let o=J.get(e);if(o)return o;let g=a(s);J.set(e,g);let r=[];for(let[p,M]of L(e)){if(p==="default")continue;let B=z(M,p);r.push(B===p?p:`${B} as ${p}`)}if(k.get(e)?.size)f.push(`${O(i.cwd,e)}: 'export * from' an external module cannot be expressed inside namespace '${g}'`);return F.push(`declare namespace ${g} {
|
|
12
12
|
export { ${r.join(", ")} };
|
|
13
|
-
}`),g}let
|
|
13
|
+
}`),g}let Q=[],A=[],H=new Set;for(let[e,s]of h){for(let r of s.directives)H.add(r);let o=new Map;for(let[r,p]of b.get(e))if(r!==p)o.set(r,p);for(let[r,p]of s.imports){if(s.declared.has(r))continue;let M=D(s,p.specifier,p.imported);if(!M)continue;let B=z(M,r);if(B!==r)o.set(r,B)}let g=[];for(let r of s.declarations){if(i.keepComments)g.push(...r.statement.comments);let p=nt(r.emit,o);if(!/[;}]$/.test(p))p+=";";g.push(p)}for(let r of s.verbatim){if(i.keepComments)A.push(...r.comments);let p=P(r.text);if(p){let M=new Map(o);for(let B of q(e,p.body,!0).declared)M.delete(B);A.push(r.text.slice(0,p.start)+nt(p.body,M)+r.text.slice(p.end))}else{let M=t(r.text),B=M[1]?.kind==="quoted"?d(r.text.slice(M[1].start,M[1].end)):void 0;if(B===void 0||!l(B,e))A.push(nt(r.text,o))}}for(let r of s.augmentations){let p=l(r.specifier,e),M=q(e,r.body,!0),B=new Map(o);if(!p){for(let K of M.declared)B.delete(K);let C=P(r.statement.text);if(i.keepComments)A.push(...r.statement.comments);A.push(r.statement.text.slice(0,C.start)+nt(C.body,B)+r.statement.text.slice(C.end));continue}for(let[C,K]of L(p))B.set(C,z(K,C));if(i.keepComments)g.push(...r.statement.comments);for(let C of M.declarations){if(!C.name||!L(p).has(C.name))throw Error(`Cannot link augmentation '${r.specifier}' member '${C.name??C.emit}'`);if(i.keepComments)g.push(...C.statement.comments);g.push(nt(C.emit,B))}}if(g.length>0)Q.push(`// From: ${O(i.cwd,e)}
|
|
14
14
|
${g.join(`
|
|
15
|
-
`)}`)}let
|
|
15
|
+
`)}`)}let U=L(n),Z=[],T=[];for(let[e,s]of U){if(s.kind==="external"){T.push(`export { ${s.imported===e?e:`${s.imported} as ${e}`} } from '${s.source}';`);continue}if(s.kind==="external-namespace"){T.push(`export * as ${e} from '${s.source}';`);continue}let o=z(s,e==="default"?"_default":e);Z.push(o===e?e:`${o} as ${e}`)}for(let e of k.get(n)??[])T.push(`export * from '${e}';`);let G=new Map;for(let[e,s]of v){let[o,g]=e.split("\x00"),r=G.get(o)??{named:[],defaults:[],namespaces:[]};if(G.set(o,r),g==="*")r.namespaces.push(s);else if(g==="default")r.defaults.push(s);else r.named.push(g===s?s:`${g} as ${s}`)}let W=[];for(let[e,s]of[...G].sort(([o],[g])=>o.localeCompare(g))){for(let o of s.defaults)W.push(`import ${o} from '${e}';`);for(let o of s.namespaces)W.push(`import * as ${o} from '${e}';`);if(s.named.length>0)W.push(`import { ${s.named.join(", ")} } from '${e}';`)}let j=[];if(H.size>0)j.push([...H].join(`
|
|
16
16
|
`));if(j.push(`/**
|
|
17
17
|
* Bundled TypeScript declarations
|
|
18
18
|
* Generated from ${h.size} source files
|
|
19
19
|
*/`),W.length>0)j.push(W.join(`
|
|
20
|
-
`));if(j.push(...
|
|
20
|
+
`));if(j.push(...Q),F.length>0)j.push(F.join(`
|
|
21
21
|
`));if(A.length>0)j.push(A.join(`
|
|
22
|
-
`));let
|
|
22
|
+
`));let _=[];if(Z.length>0)_.push(`export { ${Z.join(", ")} };`);if(_.push(...T),_.length===0)_.push("export {};");return j.push(_.join(`
|
|
23
23
|
`)),{content:`${j.join(`
|
|
24
24
|
|
|
25
25
|
`)}
|
|
26
|
-
`,files:[...h.keys()],exportCount:
|
|
27
|
-
export{
|
|
26
|
+
`,files:[...h.keys()],exportCount:U.size,warnings:f}}
|
|
27
|
+
export{Mo,nt,Dn};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
2
|
+
function gt(e,r={}){let{entryPoints:n,keepExported:s=!0,keep:t=[],remove:l=[],shakableKinds:c=["type","interface"],debug:m=!1}=r,p=m?console.log.bind(console,"[tree-shake]"):()=>{},x=new Map;for(let a of e)x.set(a.name,a);let i=ht(e);p("Dependency graph:",Object.fromEntries(Array.from(i.entries()).map(([a,d])=>[a,Array.from(d)])));let o=new Set;if(n&&n.length>0){for(let a of n)if(x.has(a))o.add(a)}else{let a=new Set(c);for(let d of e){if(s&&d.isExported){o.add(d.name);continue}if(k(d.name,t)){o.add(d.name);continue}if(!a.has(d.kind))o.add(d.name)}}if(n&&n.length>0&&t.length>0){for(let a of e)if(k(a.name,t))o.add(a.name)}p("Entry points:",Array.from(o));let f=T(o,i);p("Reachable:",Array.from(f));let u=new Set,g=[];for(let a of e){let d=a.name;if(f.has(d)){u.add(d);continue}if(k(d,l)){g.push(d);continue}if(!c.includes(a.kind)){u.add(d);continue}g.push(d)}p("Keeping:",Array.from(u)),p("Removing:",g);let b=e.filter((a)=>u.has(a.name)),y={totalBefore:e.length,totalAfter:b.length,removedCount:g.length,reductionPercent:e.length>0?Math.round(g.length/e.length*100):0};return{declarations:b,removed:g,dependencyGraph:i,stats:y}}function ht(e){let r=new Map,n=new Set;for(let s=0;s<e.length;s++)n.add(e[s].name);for(let s of e){let t=new Set,l=yt(s);for(let c of l)if(n.has(c)&&c!==s.name)t.add(c);r.set(s.name,t)}return r}function yt(e){let r=new Set;if(e.typeAnnotation)h(e.typeAnnotation,r);if(e.extends)h(e.extends,r);if(e.text)R(e.text,r);if(e.members)for(let n of e.members){let s=yt(n);for(let t of s)r.add(t)}if(e.parameters){for(let n of e.parameters)if(n.type)h(n.type,r)}if(e.returnType)h(e.returnType,r);return r}var E=new Set(["string","number","boolean","object","any","unknown","never","void","null","undefined","symbol","bigint","true","false","Array","Object","String","Number","Boolean","Function","Symbol","Promise","Map","Set","WeakMap","WeakSet","Record","Partial","Required","Readonly","Pick","Omit","Exclude","Extract","NonNullable","Parameters","ReturnType","InstanceType","ConstructorParameters","ThisParameterType","OmitThisParameter","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","keyof","typeof","infer","extends","readonly","const","new"]),S=/\b([A-Z]\w*)\b/g,D=/\btypeof\s+([$A-Z_a-z][$\w]*)/g;function h(e,r){S.lastIndex=0;let n;while((n=S.exec(e))!==null){let s=n[1];if(!E.has(s))r.add(s)}D.lastIndex=0;while((n=D.exec(e))!==null)r.add(n[1])}function R(e,r){h(e,r)}function T(e,r){let n=new Set,s=Array.from(e);while(s.length>0){let t=s.pop();if(n.has(t))continue;n.add(t);let l=r.get(t);if(l){for(let c of l)if(!n.has(c))s.push(c)}}return n}function k(e,r){for(let n of r)if(typeof n==="string"){if(n.includes("*")){if(new RegExp(`^${n.replace(/\*/g,".*").replace(/\?/g,".")}$`).test(e))return!0}else if(e===n)return!0}else if(n.test(e))return!0;return!1}function gr(e,r={}){let n=e.split(`
|
|
3
3
|
`),s=[],t=null;for(let i=0;i<n.length;i++){let o=n[i],f=o.trim();if(!t&&(f===""||f.startsWith("//")))continue;if(!t){let u=f.match(/^(export\s+)?(declare\s+)?(interface|type|enum|class|function|const|let|var)\s+(\w+)/);if(u){let[,g,,b,y]=u;if(t={name:y,kind:b,isExported:!!g,start:i,lines:[o],braceCount:0},t.braceCount+=(o.match(/\{/g)||[]).length,t.braceCount-=(o.match(/\}/g)||[]).length,t.braceCount===0&&(f.endsWith(";")||!f.includes("{")))s.push({name:t.name,kind:t.kind,isExported:t.isExported,start:t.start,end:i,text:t.lines.join(`
|
|
4
4
|
`)}),t=null;continue}}if(t){if(t.lines.push(o),t.braceCount+=(o.match(/\{/g)||[]).length,t.braceCount-=(o.match(/\}/g)||[]).length,t.braceCount<=0&&(f.endsWith("}")||f.endsWith(";")))s.push({name:t.name,kind:t.kind,isExported:t.isExported,start:t.start,end:i,text:t.lines.join(`
|
|
5
|
-
`)}),t=null}}if(s.length===0)return{content:e,removed:[]};let l=s.map((i)=>({name:i.name,kind:i.kind,isExported:i.isExported,text:i.text})),c=
|
|
5
|
+
`)}),t=null}}if(s.length===0)return{content:e,removed:[]};let l=s.map((i)=>({name:i.name,kind:i.kind,isExported:i.isExported,text:i.text})),c=gt(l,r),m=new Set(c.declarations.map((i)=>i.name)),p=new Set;for(let i of s)if(!m.has(i.name))for(let o=i.start;o<=i.end;o++)p.add(o);return{content:n.filter((i,o)=>!p.has(o)).join(`
|
|
6
6
|
`).replace(/\n{3,}/g,`
|
|
7
7
|
|
|
8
|
-
`),removed:c.removed}}function
|
|
9
|
-
export{
|
|
8
|
+
`),removed:c.removed}}function hr(e,r={}){return gt(e,{...r,debug:!1}).removed}function yr(e,r){let n=ht(r),s=n.get(e)||new Set,t=T(new Set([e]),n);t.delete(e);let l=[];for(let[c,m]of n)if(c!==e&&m.has(e))l.push(c);return{directDependencies:Array.from(s),transitiveDependencies:Array.from(t),dependents:l}}function ss(e={}){return{shake:(r)=>gt(r,e),shakeContent:(r)=>gr(r,e),findUnused:(r)=>hr(r,e),analyzeDependencies:(r,n)=>yr(r,n),buildGraph:ht,extractRefs:yt}}
|
|
9
|
+
export{gt,ht,yt,gr,hr,yr,ss};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function d(n,c){let o=1,l=1;for(let i=0;i<c;i++)if(n.charCodeAt(i)===10)o++,l=1;else l++;return{line:o,column:l}}function
|
|
3
|
-
export{
|
|
2
|
+
function d(n,c){let o=1,l=1;for(let i=0;i<c;i++)if(n.charCodeAt(i)===10)o++,l=1;else l++;return{line:o,column:l}}function ke(n){let c=[],o=[],l=[],i={")":"(","]":"[","}":"{"},r=0,m=0,f=-1;for(let e=0;e<n.length;e++){let t=n.charCodeAt(e),s=n.charCodeAt(e+1);if(f!==-1){if(t===42&&s===47)o.push({start:f,end:e+2}),f=-1,e++;continue}if(r){if(t===92)e++;else if(t===r)o.push({start:m,end:e+1}),r=0;continue}if(t===47&&s===42){f=e,e++;continue}if(t===47&&s===47){let u=e;while(e<n.length&&n.charCodeAt(e)!==10)e++;o.push({start:u,end:e});continue}if(t===39||t===34||t===96){r=t,m=e;continue}let a=n[e];if(a==="("||a==="["||a==="{")l.push({char:a,offset:e});else if(i[a]){let u=l.pop();if(!u||u.char!==i[a])c.push({...d(n,e),message:`Unexpected closing delimiter ${a}`,code:"DTSX1004"})}}if(r)c.push({...d(n,m),message:"Unterminated string literal",code:"DTSX1002"});if(f!==-1)c.push({...d(n,f),message:"Unterminated block comment",code:"DTSX1003"});for(let e of l)c.push({...d(n,e.offset),message:`Unclosed delimiter ${e.char}`,code:"DTSX1001"});let p=[[/\b(?:interface|class|enum)\s*(?=[{=])/g,"Declaration name expected"],[/\bfunction\s*(?=\()/g,"Function name expected"],[/\(\s*:/g,"Parameter name expected"]];for(let[e,t]of p)for(let s of n.matchAll(e)){if(o.some((a)=>s.index>=a.start&&s.index<a.end))continue;c.push({...d(n,s.index),message:t,code:"DTSX1005"})}for(let e of n.matchAll(/\btype\s*(?=[{=])/g)){if(o.some((s)=>e.index>=s.start&&e.index<s.end))continue;let t=n.slice(0,e.index).trimEnd();if(t.endsWith("import")||t.endsWith("export"))continue;c.push({...d(n,e.index),message:"Declaration name expected",code:"DTSX1005"})}return c.push(...g(n,o)),c.sort((e,t)=>e.line-t.line||e.column-t.column)}var h=String.raw`(?:[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*|'[^']*'|"[^"]*")`,x=new RegExp(`^(?:type\\s+)?${h}(?:\\s+as\\s+${h})?$`,"u");function g(n,c){let o=[],l=(i)=>c.some((r)=>i>=r.start&&i<r.end);for(let i of n.matchAll(/\b(import|export)\s+(?:type\s+)?\{/g)){let r=i.index;if(l(r))continue;let m=r+i[0].length-1,f=-1;for(let t=m+1;t<n.length;t++){if(l(t))continue;let s=n[t];if(s==="{"){f=-2;break}if(s==="}"){f=t;break}}if(f<0)continue;let p=n.slice(m+1,f);if(!p.trim())continue;let e=m+1;for(let t of p.split(",")){let s=t.trim();if(s){let a=e+t.indexOf(s);if(s.includes(";"))o.push({...d(n,a),message:`Unexpected ';' in ${i[1]} clause \u2014 specifiers are separated by ','`,code:"DTSX1006"});else if(!x.test(s))o.push({...d(n,a),message:`Invalid ${i[1]} specifier '${s}'`,code:"DTSX1006"})}e+=t.length+1}}return o}
|
|
3
|
+
export{ke};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{u}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{u}from"./chunk-jy5h728q.js";import{h}from"./chunk-j51p30sb.js";import{x}from"./chunk-y9bxeq10.js";import{r}from"./chunk-sqa3ke1a.js";import{Me}from"./chunk-k0vthrqs.js";function ia(c){if(!c.includes("declare")||!c.includes("module"))return[];return h(c).filter((d)=>d.category==="augmentation").map((d)=>d.specifier)}function E(c,d){let m=new Set([c]);for(let v of m)for(let p of d(v))m.add(p);return m}async function Re(c,d,m=!1,v){let p=new Map,y=new Map;for(let e of c){let g=v?.get(e)??await u(e);p.set(e,g);let s=ia(g);if(s.length)y.set(e,s)}let M=new Map;if(y.size===0)return M;let l=new Map,b=(e,g)=>{let s=d(e,g);if(s.resolved)return s.resolved;if(!s.isRelative&&!s.isAlias)return`external:${e}`;return};for(let[e,g]of p){let s=r(g,e,!1,m),a=Me(s),f={edges:[],declarations:new Set,augmentations:new Set},w=(n,i,t)=>{let o=b(n.specifier,e);if(!o)return;if(p.has(o))f.edges.push({specifier:n.specifier,target:o,import:i});if(t)f.declarations.add(o)};for(let n of s){if(n.kind!=="import")continue;let i=n.isSideEffect||x(n.text).some((t)=>a.usedItems.has(t));for(let t of h(n.text))w(t,!0,!!i)}for(let n of h(a.referenceText))w(n,!1,!0);for(let n of y.get(e)??[]){let i=b(n,e);if(i)f.augmentations.add(i),f.declarations.add(i)}l.set(e,f)}let R=!0;while(R){R=!1;for(let[e,g]of l){let s=E(e,(a)=>l.get(a)?.declarations??[]);for(let[a,f]of l){if(s.has(a)||!f.augmentations.size||![...f.augmentations].some((t)=>s.has(t)))continue;let w=[e],n=new Map,i=new Set([e]);for(let t of w){if(t===a)break;for(let o of l.get(t).edges){if(i.has(o.target))continue;i.add(o.target),n.set(o.target,{from:t,edge:o}),w.push(o.target)}}if(!n.has(a))continue;for(let t=a;t!==e;){let{from:o,edge:I}=n.get(t),A=l.get(o);if(I.import){let S=M.get(o);if(!S)S=new Set,M.set(o,S);S.add(I.specifier)}if(!A.declarations.has(t))A.declarations.add(t),R=!0;t=o}}}}return M}
|
|
3
|
+
export{ia,Re};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function a(t){return t>=65&&t<=90||t>=97&&t<=122||t===95||t===36||t>127}function i(t){return a(t)||t>=48&&t<=57}function E(t,A){let n=A;for(;;){while(n>=0&&(t.charCodeAt(n)===32||t.charCodeAt(n)===9||t.charCodeAt(n)===10||t.charCodeAt(n)===13))n--;if(n<0)return-1;if(t.charCodeAt(n)===47&&n>0&&t.charCodeAt(n-1)===42){let C=t.lastIndexOf("/*",n-2);if(C===-1)return-1;n=C-1;continue}let H=t.lastIndexOf(`
|
|
3
|
+
`,n)+1,l=p(t,H,n);if(l!==-1){n=l-1;continue}return n}}function p(t,A,n){let H=0;for(let l=A;l<=n;l++){let C=t.charCodeAt(l);if(H){if(C===92){l++;continue}if(C===H)H=0;continue}if(C===39||C===34||C===96){H=C;continue}if(C===47&&l+1<=n&&t.charCodeAt(l+1)===47)return l}return-1}function g(t){return t===61||t===40||t===91||t===33||t===38||t===124||t===63||t===58||t===44||t===59||t===123||t===125||t===94||t===126||t===43||t===45||t===42||t===37||t===60||t===62}function m(t){return t==="return"||t==="typeof"||t==="void"||t==="delete"||t==="throw"||t==="new"||t==="in"||t==="of"||t==="case"||t==="instanceof"||t==="yield"||t==="await"||t==="else"||t==="do"}function T(t,A){let n=[],H=[],l=0,C=!1,f="",s="",u=!0,r=0,d=(e,_=!1)=>{s=f,f=e,u=_};while(r<=A){let e=t.charCodeAt(r);if(C){if(e===92){r+=2;continue}if(e===96)C=!1,d("literal");else if(e===36&&t.charCodeAt(r+1)===123)H.push(l++),C=!1,d("{",!0),r++;r++;continue}if(e===32||e===9||e===10||e===13){r++;continue}if(e===47&&t.charCodeAt(r+1)===47){let _=t.indexOf(`
|
|
4
|
+
`,r+2);r=_===-1?t.length:_+1;continue}if(e===47&&t.charCodeAt(r+1)===42){let _=t.indexOf("*/",r+2);r=_===-1?t.length:_+2;continue}if(e===39||e===34){let _=e;r++;while(r<t.length){let c=t.charCodeAt(r++);if(c===92)r++;else if(c===_)break}d("literal");continue}if(e===96){C=!0,r++;continue}if(a(e)||e===35&&a(t.charCodeAt(r+1))){let _=r++;while(i(t.charCodeAt(r)))r++;let c=t.slice(_,r);d(c,f!=="."&&m(c));continue}if(e===40){let _=s!=="."&&(f==="if"||f==="while"||f==="for"||f==="with"||f==="switch"||f==="catch"||f==="await"&&s==="for");n.push(_),d("(",!0)}else if(e===41){let _=n.pop()??!1;if(r===A)return _;d(")",_)}else if(e===47&&u){r=S(t,r),d("literal");continue}else{if(e===123)l++;else if(e===125){if(l--,H.at(-1)===l)H.pop(),C=!0}d(t[r],e===47||g(e))}r++}return!1}function R(t,A,n){let H=n===void 0?E(t,A-1):n-1;if(H<0)return!0;let l=t.charCodeAt(H);if(l===41)return T(t,H);if(g(l))return!0;if(i(l)){let C=H;while(C>=0&&i(t.charCodeAt(C)))C--;let f=t.charCodeAt(E(t,C));if(f===46||f===35)return!1;return m(t.slice(C+1,H+1))}return!1}function S(t,A){let n=A,H=t.length;n++;let l=!1;while(n<H){let C=t.charCodeAt(n);if(C===92){n+=2;continue}if(l){if(C===93)l=!1;n++;continue}if(C===91){l=!0,n++;continue}if(C===47){n++;break}if(C===10||C===13)break;n++}while(n<H&&i(t.charCodeAt(n)))n++;return n}function we(t,A,n){let H=n===void 0?E(t,A-1):n-1;if(H<0)return!0;let l=t[H];if("=([{,:;!?+-*/%&|^~<".includes(l))return!0;if(l===">"&&t[H-1]==="=")return!0;let C=H;while(C>=0&&i(t.charCodeAt(C)))C--;return["return","throw","yield","await","case","void","typeof","delete","new","else","do"].includes(t.slice(C+1,H+1))}function h(t,A,n,H){let l=t.length;if(t.charCodeAt(A)!==60||A+1>=l)return null;let C=t.charCodeAt(A+1);if(C===62)return{delta:1,end:A+1};if(C===47){let o=A+2;if(t.charCodeAt(o)!==62){if(!a(t.charCodeAt(o)))return null;while(o<l&&(i(t.charCodeAt(o))||".:-".includes(t[o])))o++;while(o<l&&/\s/.test(t[o]))o++}return t.charCodeAt(o)===62?{delta:-1,end:o}:null}if(!a(C))return null;let f=A+2;while(f<l){let o=t.charCodeAt(f);if(!i(o)&&o!==46&&o!==58&&o!==45)break;f++}let s=t.slice(A+1,f),u=t.charCodeAt(f);if(u>32&&u!==62&&u!==47)return null;let r=0,d=0,e=f,_=f;for(;e<l;e++){let o=t.charCodeAt(e);if(d!==0){if(o===92)e++;else if(o===d)d=0,_=e+1;continue}if(o===60&&r>0&&(t[e+1]==="/"||we(t,e,_))){let L=H?H(e):h(t,e,n);if(L){e=L.end,_=e+1;continue}}if(o===47&&r>0){let L=t.charCodeAt(e+1);if(L===47){while(e<l&&t.charCodeAt(e)!==10&&t.charCodeAt(e)!==13)e++;continue}if(L===42){let b=t.indexOf("*/",e+2);if(b===-1)return null;e=b+1;continue}if(R(t,e,_)){e=S(t,e)-1,_=e+1;continue}}if(o===39||o===34||o===96)d=o;else if(o===123)r++;else if(o===125&&r>0)r--;else if(o===60&&r===0)return null;else if(o===62&&r===0)break;if(o>32)_=e+1}if(e>=l)return null;let c=e-1;while(c>A&&t.charCodeAt(c)<=32)c--;if(t.charCodeAt(c)===47)return{delta:0,end:e};return(n?n.get(s)??-1:t.indexOf(`</${s}`,e+1))>e?{delta:1,end:e}:null}function ze(t,A){let n,H=new Map;function l(C){if(H.has(C))return H.get(C);if(!n){n=new Map;let s=t.indexOf("</");while(s!==-1){let u=h(t,s);if(u){let r=s+2;while(r<u.end&&!/\s/.test(t[r]))r++;n.set(t.slice(s+2,r),s)}s=t.indexOf("</",s+2)}}let f=h(t,C,n,l);if(H.set(C,f),f&&t[f.end-1]==="/")A?.add(f.end-1);return f}return l}
|
|
5
|
+
export{a,i,R,S,we,ze};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{a,i,R,S,we,ze}from"./chunk-hzy5z7x2.js";function t(f){let o=[],c=f.length,l=new Set,e=ze(f,l),r=0;function g(){let b=r++;while(r<c){let k=f.charCodeAt(r);if(k===92)r+=2;else if(k===96){o.push({start:b,end:++r,kind:"literal"});return}else if(k===36&&f.charCodeAt(r+1)===123)o.push({start:b,end:r+1,kind:"literal"}),o.push({start:r+1,end:r+2,kind:"punctuation"}),r+=2,p(!0),b=r;else r++}o.push({start:b,end:r,kind:"literal"})}function p(b=!1){let k=0,T=0;while(r<c){let y=r,n=f.charCodeAt(r);if(n===60&&(T>0||f[r+1]!=="/"&&we(f,r,o.at(-1)?.end??0))){let u=e(r);if(u){if(T=Math.max(0,T+u.delta),u.delta<0){r=u.end+1,o.push({start:y,end:r,kind:"literal"});continue}}}if(n===32||n>=9&&n<=13||n>127&&/\s/.test(f[r])){r++;continue}if(n===47){let u=f.charCodeAt(r+1);if(u===47){let s=f.indexOf(`
|
|
3
|
+
`,r+2);r=s===-1?c:s+1;continue}if(u===42){let s=f.indexOf("*/",r+2);r=s===-1?c:s+2;continue}if(!l.has(r)&&R(f,r,o.at(-1)?.end??0)){r=S(f,r),o.push({start:y,end:r,kind:"literal"});continue}}else if(n===96){g();continue}else if(n===34||n===39){r++;let u=!1;while(r<c){let s=f.charCodeAt(r++);if(s===92)r++;else if(s===n){u=!0;break}}o.push({start:y,end:Math.min(r,c),kind:u?"quoted":"literal"});continue}else if(a(n)){while(i(f.charCodeAt(++r)));o.push({start:y,end:r,kind:"word"});continue}if(o.push({start:y,end:++r,kind:"punctuation"}),b){if(n===123)k++;else if(n===125){if(k===0)return;k--}}}}return p(),o}var C,q=[];function m(f){if(f!==C)q=t(f),C=f;return q}function cr(){C=void 0,q=[]}function d(f){let o="",c=f.length-1;for(let l=1;l<c;l++){if(f[l]!=="\\"){o+=f[l];continue}let e=f[++l];if(l>=c)return;switch(e){case`
|
|
4
|
+
`:break;case"\r":if(f[l+1]===`
|
|
5
|
+
`)l++;break;case"n":o+=`
|
|
6
|
+
`;break;case"r":o+="\r";break;case"t":o+="\t";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;case"0":if(/\d/.test(f[l+1]??""))return;o+="\x00";break;case"x":case"u":{let r=e==="u"&&f[l+1]==="{",g=l+(r?2:1),p=r?f.indexOf("}",g):g+(e==="x"?2:4),b=f.slice(g,p);if(p<g||p>c||!/^[\da-f]+$/i.test(b)||r&&b.length>6)return;let k=Number.parseInt(b,16);if(k>1114111)return;o+=String.fromCodePoint(k),l=r?p:p-1;break}default:if(/\d/.test(e))return;o+=e}}return o}function v(f,o){let c=o;for(let l of f){let e=l.charCodeAt(0);if(l===o||l==="\\")c+=`\\${l}`;else if(e<32||e===8232||e===8233||l.length===1&&e>=55296&&e<=57343)c+=`\\u${e.toString(16).padStart(4,"0")}`;else c+=l}return c+o}function Ue(f){let o=t(f),c=(p)=>o[p]?f.slice(o[p].start,o[p].end):"";if(c(0)!=="import")return;let l=c(1)==="type"&&c(2)!=="=",e=l?2:1;if(o[e]?.kind!=="word"||c(e+1)!=="="||c(e+2)!=="require"||c(e+3)!=="("||o[e+4]?.kind!=="quoted"||c(e+5)!==")")return;let r=e+6;if(o.length!==r&&!(o.length===r+1&&c(r)===";"))return;let g=d(c(e+4));if(g===void 0)return;return{name:c(e),source:g,isTypeOnly:l,end:o[o.length-1].end}}function h(f){let o=t(f),c=[],l=new Set,e=(n)=>n>=0&&n<o.length?f.slice(o[n].start,o[n].end):"",r=(n)=>o[n]?.kind==="quoted",g=(n)=>o[n]?.kind==="word",p=[],b=!1,k=0;if(f.includes("declare")&&f.includes("module"))for(let n=0;n<o.length;n++){let u=e(n);if(k===0&&g(n)&&e(n-1)!=="."&&e(n-1)!=="#"){if(u==="export"||u==="import"&&e(n+1)!=="("&&e(n+1)!==".")b=!0;if(u==="declare"&&e(n+1)==="module"&&r(n+2)&&e(n+3)==="{")p.push(n+2)}if(u==="{"||u==="("||u==="[")k++;else if(u==="}"||u===")"||u==="]")k--}function T(n,u=!1){if(e(n)==="*"){if(e(n+1)==="as")return g(n+2)||u&&r(n+2)?n+3:-1;return u?n+1:-1}if(e(n)!=="{")return-1;let s=1;for(let x=n+1;x<o.length;x++)if(e(x)==="{")s++;else if(e(x)==="}"&&--s===0)return x+1;else if(o[x].kind==="literal"||e(x)===";")return-1;return-1}function y(n,u,s,x){let w=o[n];if(!w||w.kind!=="quoted"||l.has(w.start))return;let M=d(f.slice(w.start,w.end));if(M===void 0)return;l.add(w.start),c.push({specifier:M,kind:u,isTypeOnly:s,category:x,start:w.start,end:w.end})}for(let n=0;n<o.length;n++){if(!g(n)||e(n-1)==="."||e(n-1)==="#")continue;let u=e(n),s=n+1;if(u==="export"){let x=e(s)==="type";if(x)s++;let w=e(s)==="*"?e(s+1)==="as"?"export-star-as":"export-star":"export-named",M=T(s,!0);if(M>=0&&e(M)==="from")y(M+1,w,x,"export")}else if(u==="import"){if(r(s)){y(s,"import",!1,"static-import");continue}if(e(s)==="("){if(e(s+2)===")"||e(s+2)===",")y(s+1,"import",!1,"import-type");continue}let x=e(s)==="type"&&e(s+1)!=="from"&&e(s+1)!=="="&&e(s+1)!==",";if(x)s++;if(g(s)){if(s++,e(s)==="="){if(e(s+1)==="require"&&e(s+2)==="("&&e(s+4)===")")y(s+3,"import",x,"static-import");continue}if(e(s)===",")s=T(s+1)}else s=T(s);if(s>=0&&e(s)==="from")y(s+1,"import",x,"static-import")}}if(b&&p.length){for(let n of p)y(n,"import",!0,"augmentation");c.sort((n,u)=>n.start-u.start)}return c}
|
|
7
|
+
export{t,m,cr,d,v,Ue,h};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{spawn as m}from"child_process";import{readFile as i,stat as n,writeFile as p}from"fs/promises";var
|
|
3
|
-
export{
|
|
2
|
+
import{spawn as m}from"child_process";import{readFile as i,stat as n,writeFile as p}from"fs/promises";var y=typeof globalThis.Bun<"u",la=!y&&typeof process<"u"&&!!process.versions?.node,ua=y?"bun":"node";class s{name;_size=-1;constructor(e){this.name=e}async exists(){try{return await n(this.name),!0}catch{return!1}}async text(){return i(this.name,"utf-8")}async arrayBuffer(){let e=await i(this.name);return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}get size(){if(this._size===-1)return-1;return this._size}}class a{pid;stdout;stderr;stdin;exited;process;constructor(e){this.process=e,this.pid=e.pid??0,this.stdout=e.stdout,this.stderr=e.stderr,this.stdin=e.stdin,this.exited=new Promise((r)=>{e.on("exit",(t)=>{r(t??0)}),e.on("error",()=>{r(1)})})}kill(e){this.process.kill(e)}ref(){this.process.ref()}unref(){this.process.unref()}}function le(e){if(y)return globalThis.Bun.file(e);return new s(e)}async function st(e,r){if(y)return globalThis.Bun.write(e,r);let t=typeof r==="string"?r:r instanceof ArrayBuffer?Buffer.from(r):r;return await p(e,t),typeof r==="string"?Buffer.byteLength(r):r.byteLength}function Mt(e,r={}){if(y)return globalThis.Bun.spawn(e,r);let t=Array.isArray(e)?e:[e],[o,...d]=t,l={cwd:r.cwd,env:r.env,stdio:[r.stdin??"pipe",r.stdout??"pipe",r.stderr??"pipe"]},f=m(o,d,l);return new a(f)}async function u(e){if(y)return globalThis.Bun.file(e).text();return i(e,"utf-8")}async function fa(e){if(y)return globalThis.Bun.file(e).exists();try{return await n(e),!0}catch{return!1}}async function da(e,r){await st(e,r)}function pa(){if(y)return{name:"bun",version:globalThis.Bun.version,isBun:!0,isNode:!1};return{name:"node",version:process.versions.node,isBun:!1,isNode:!0}}
|
|
3
|
+
export{y,la,ua,le,st,Mt,u,fa,da,pa};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{a,i}from"./chunk-hzy5z7x2.js";import{b}from"./chunk-05cbfytc.js";import{x}from"./chunk-y9bxeq10.js";function Me(f){let r=new Set,n=[];for(let t of f)if(t.kind==="import")for(let o of x(t.text))r.add(o);else if(t.kind!=="unknown"){if(n.push(t.text),t.kind==="variable"){if(t.typeAnnotation)n.push(t.typeAnnotation);else if(t.value)n.push(b(t,!1))}}let e=n.join(`
|
|
3
|
+
`),s=new Set;for(let t=0;t<e.length;){if(!a(e.charCodeAt(t))){t++;continue}let o=t++;while(t<e.length&&i(e.charCodeAt(t)))t++;let c=e.slice(o,t);if(r.has(c))s.add(c)}return{usedItems:s,referenceText:e}}
|
|
4
|
+
export{Me};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p}from"./chunk-v6fwy63g.js";import{createHash as g}from"crypto";import{mkdir as y,readFile as l,stat as m,writeFile as v}from"fs/promises";import{dirname as C,join as o}from"path";var c="1.0.0",b=".dtsx-cache",d="manifest.json";class
|
|
3
|
-
`)}function
|
|
4
|
-
export{
|
|
2
|
+
import{p}from"./chunk-v6fwy63g.js";import{createHash as g}from"crypto";import{mkdir as y,readFile as l,stat as m,writeFile as v}from"fs/promises";import{dirname as C,join as o}from"path";var c="1.0.0",b=".dtsx-cache",d="manifest.json";class pi{config;manifest=null;dirty=!1;stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0};constructor(t={}){this.config={enabled:t.enabled??!0,cacheDir:t.cacheDir??b,format:t.format??"json",maxAge:t.maxAge??86400000,force:t.force??!1,validateCache:t.validateCache??!0}}async init(){if(!this.config.enabled)return;try{await y(this.config.cacheDir,{recursive:!0}),await this.loadManifest()}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async loadManifest(){let t=o(this.config.cacheDir,d);try{let e=await l(t,"utf-8");if(this.manifest=JSON.parse(e),this.manifest.version!==c){await this.clear();return}this.stats.totalEntries=Object.keys(this.manifest.entries).length}catch{this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()}}}async save(){if(!this.config.enabled||!this.manifest||!this.dirty)return;let t=o(this.config.cacheDir,d);this.manifest.updatedAt=Date.now(),await v(t,JSON.stringify(this.manifest,null,2)),this.dirty=!1}async get(t,e){if(!this.config.enabled||!this.manifest||this.config.force)return this.stats.misses++,null;let s=this.manifest.entries[t];if(!s)return this.stats.misses++,null;if(s.configHash!==e)return this.stats.misses++,null;if(Date.now()-s.cachedAt>this.config.maxAge)return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null;if(this.config.validateCache)try{let a=(await m(t)).mtimeMs;if(a!==s.mtime){let i=await l(t,"utf-8");if(this.hashContent(i)!==s.hash)return this.stats.misses++,null;s.mtime=a,this.dirty=!0}}catch{return this.stats.misses++,delete this.manifest.entries[t],this.dirty=!0,null}if(s.dependencies.length>0){if((await Promise.all(s.dependencies.map(async(a)=>{let i=this.manifest.entries[a];if(!i)return!0;try{return(await m(a)).mtimeMs===i.mtime}catch{return!1}}))).some((a)=>!a))return this.stats.misses++,null}return this.stats.hits++,this.stats.timeSavedMs+=50,this.updateHitRatio(),s}async set(t,e,s,r,a,i){if(!this.config.enabled||!this.manifest)return;let n=Date.now();try{n=(await m(t)).mtimeMs}catch{}let h={filePath:t,hash:this.hashContent(e),mtime:n,declarations:s,dtsContent:r,dependencies:a,cachedAt:Date.now(),configHash:i};if(!(t in this.manifest.entries))this.stats.totalEntries++;this.manifest.entries[t]=h,this.dirty=!0}invalidate(t){if(!this.manifest)return;delete this.manifest.entries[t],this.dirty=!0;for(let[e,s]of Object.entries(this.manifest.entries))if(s.dependencies.includes(t))delete this.manifest.entries[e]}async clear(){this.manifest={version:c,entries:{},createdAt:Date.now(),updatedAt:Date.now()},this.stats={totalEntries:0,hits:0,misses:0,hitRatio:0,sizeBytes:0,timeSavedMs:0},this.dirty=!0,await this.save()}getStats(){return{...this.stats}}hashContent(t){return String(p(t))}updateHitRatio(){let t=this.stats.hits+this.stats.misses;this.stats.hitRatio=t>0?this.stats.hits/t:0}static hashConfig(t){let e={outdir:t.outdir,clean:t.clean,tsconfigPath:t.tsconfigPath};return g("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}}function To(t,e){let s=[],r=[],a=[];return{async needsRebuild(i){return await t.get(i,e)===null},async getCachedDeclarations(i){let n=await t.get(i,e);if(n)return r.push(i),n.declarations;return null},async getCachedDts(i){let n=await t.get(i,e);if(n)return n.dtsContent;return null},async cacheResult(i,n,h,u,f=[]){await t.set(i,n,h,u,f,e),s.push(i)},skip(i){a.push(i)},getResult(){return{rebuilt:s,cached:r,skipped:a,stats:t.getStats()}},async save(){await t.save()}}}async function Ao(t,e=604800000){let s=t.getStats();if(s.totalEntries>1000)return await t.clear(),s.totalEntries;return 0}function Do(t){let e=[];return e.push("Incremental Build Results:"),e.push(` Rebuilt: ${t.rebuilt.length} files`),e.push(` From cache: ${t.cached.length} files`),e.push(` Skipped: ${t.skipped.length} files`),e.push(""),e.push("Cache Statistics:"),e.push(` Total entries: ${t.stats.totalEntries}`),e.push(` Hit ratio: ${(t.stats.hitRatio*100).toFixed(1)}%`),e.push(` Time saved: ~${t.stats.timeSavedMs}ms`),e.join(`
|
|
3
|
+
`)}function Po(t,e){let s=[],r=/import\s+(?:type\s+)?(?:.+(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF])from\s+)?['"]([^'"]+)['"]/g,a;while((a=r.exec(t))!==null){let i=a[1];if(i.startsWith(".")){let n=o(C(e),i);s.push(n),s.push(`${n}.ts`),s.push(`${n}.tsx`),s.push(o(n,"index.ts")),s.push(o(n,"index.tsx"))}}return s}
|
|
4
|
+
export{pi,To,Ao,Do,Po};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p}from"./chunk-v6fwy63g.js";import{existsSync as u,mkdirSync as H,readFileSync as l,renameSync as b,rmdirSync as D,rmSync as C,statSync as g,writeFileSync as S}from"fs";import{join as d,relative as h,resolve as y}from"path";var f=
|
|
2
|
+
import{p}from"./chunk-v6fwy63g.js";import{existsSync as u,mkdirSync as H,readFileSync as l,renameSync as b,rmdirSync as D,rmSync as C,statSync as g,writeFileSync as S}from"fs";import{join as d,relative as h,resolve as y}from"path";var f=25,m=".dtsx-cache",v="manifest.json";function di(t){try{C(d(t,v),{force:!0});try{D(t)}catch{}}catch{}}class et{cacheDir;manifestPath;manifest=null;configHash;constructor(t,n){this.cacheDir=y(t.cwd,t.cacheDir??m),this.manifestPath=d(this.cacheDir,v),this.configHash=this.hashConfig(t,n)}hashConfig(t,n){let s={resolutionContext:n,keepComments:t.keepComments,importOrder:t.importOrder,outputStructure:t.outputStructure,moduleSpecifierMode:t.moduleSpecifierMode??"preserve",root:y(t.cwd,t.root),exclude:t.exclude??[],isolatedDeclarations:t.isolatedDeclarations,declarationMap:t.declarationMap,indentStyle:t.indentStyle,indentSize:t.indentSize,prettier:t.prettier,typeMappings:t.typeMappings?{includeDefaults:t.typeMappings.includeDefaults,presets:t.typeMappings.presets,cacheKey:t.typeMappings.cacheKey,rules:t.typeMappings.rules.map((e)=>({pattern:typeof e.pattern==="string"?{kind:"string",value:e.pattern}:{kind:"regex",source:e.pattern.source,flags:e.pattern.flags},replacement:e.replacement,global:e.global,priority:e.priority,hasCondition:Boolean(e.condition)}))}:void 0,lineEnding:t.lineEnding,normalizeOutput:t.normalizeOutput,declarationOrder:t.declarationOrder,plugins:t.plugins?.map((e)=>({name:e.name,version:e.version,cacheKey:e.cacheKey}))};return String(p(JSON.stringify(s)))}hashString(t){return String(p(t))}load(){try{if(!u(this.manifestPath))return!1;let t=l(this.manifestPath,"utf-8"),n=JSON.parse(t);if(n.version!==f)return!1;if(n.configHash!==this.configHash)return!1;if(!n.entries||typeof n.entries!=="object"||Array.isArray(n.entries))return!1;return this.manifest=n,!0}catch{return!1}}save(){if(!this.manifest)this.manifest={version:f,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};if(this.manifest.updatedAt=Date.now(),!u(this.cacheDir))H(this.cacheDir,{recursive:!0});let t=`${this.manifestPath}.${process.pid}.tmp`;try{S(t,JSON.stringify(this.manifest,null,2)),b(t,this.manifestPath)}finally{if(u(t))C(t,{force:!0})}}needsRegeneration(t,n){return this.getCachedIfValid(t,n)===null}getCached(t,n){return this.getCachedIfValid(t,n)}getCachedIfValid(t,n){if(!this.manifest)return null;let s=h(n,t),e=this.manifest.entries[s];if(!e)return null;if(typeof e.dtsContent!=="string"||typeof e.dtsHash!=="string"||e.configHash!==this.configHash||this.hashString(e.dtsContent)!==e.dtsHash)return null;try{let i=g(t),{mtimeMs:r,ctimeMs:a}=i;if(i.size!==e.sourceSize)return null;if(r!==e.sourceMtime||a!==e.sourceCtime){let o=l(t,"utf-8");if(this.hashString(o)!==e.sourceHash)return null;e.sourceMtime=r,e.sourceCtime=a}return e.dtsContent}catch{return null}}update(t,n,s,e){if(!this.manifest)this.manifest={version:f,configHash:this.configHash,entries:{},createdAt:Date.now(),updatedAt:Date.now()};let i=h(e,t),r,a,o;try{let c=g(t);r=c.mtimeMs,a=c.ctimeMs,o=c.size}catch{r=Date.now(),a=r,o=Buffer.byteLength(n)}this.manifest.entries[i]={sourcePath:i,sourceHash:this.hashString(n),sourceMtime:r,sourceCtime:a,sourceSize:o,dtsContent:s,dtsHash:this.hashString(s),generatedAt:Date.now(),configHash:this.configHash}}remove(t,n){if(!this.manifest)return;let s=h(n,t);delete this.manifest.entries[s]}clear(){this.manifest=null,di(this.cacheDir)}getStats(){if(!this.manifest)return{entries:0,size:0};let t=Object.keys(this.manifest.entries).length,n=0;for(let s of Object.values(this.manifest.entries))n+=s.dtsContent.length;return{entries:t,size:n}}prune(t,n){if(!this.manifest)return 0;let s=0,e=new Set(Array.from(t).map((i)=>h(n,i)));for(let i of Object.keys(this.manifest.entries))if(!e.has(i))delete this.manifest.entries[i],s++;return s}}function kt(t){let n=d(t,".gitignore");try{let s="";if(u(n))s=l(n,"utf-8");if(!s.split(/\r?\n/).some((i)=>i.trim()===m||i.trim()===`${m}/`)){let i=s.trimEnd(),r=`${i}${i?`
|
|
3
3
|
|
|
4
4
|
`:""}# dtsx cache
|
|
5
5
|
${m}/
|
|
6
6
|
`;S(n,r)}}catch{}}
|
|
7
|
-
export{
|
|
7
|
+
export{di,et,kt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{t}from"./chunk-j51p30sb.js";function Ve(e,d){let i=t(e),o=0,r=0;for(let n=0;n<i.length;n++){let l=i[n],s=e.slice(l.start,l.end),c=i[n+1];if(o===0&&s==="function"&&c?.kind==="word"&&e.slice(c.start,c.end)===d)r++;if(["{","(","["].includes(s))o++;else if(["}",")","]"].includes(s))o--}return r}
|
|
3
|
+
export{Ve};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r}from"./chunk-
|
|
2
|
+
import{r}from"./chunk-sqa3ke1a.js";import{l}from"./chunk-3nmjt94q.js";import{existsSync as P,readFileSync as b,unwatchFile as w}from"fs";var Vr;((o)=>{o[o.Error=1]="Error";o[o.Warning=2]="Warning";o[o.Information=3]="Information";o[o.Hint=4]="Hint"})(Vr||={});var Ur;((s)=>{s[s.File=1]="File";s[s.Module=2]="Module";s[s.Namespace=3]="Namespace";s[s.Package=4]="Package";s[s.Class=5]="Class";s[s.Method=6]="Method";s[s.Property=7]="Property";s[s.Field=8]="Field";s[s.Constructor=9]="Constructor";s[s.Enum=10]="Enum";s[s.Interface=11]="Interface";s[s.Function=12]="Function";s[s.Variable=13]="Variable";s[s.Constant=14]="Constant";s[s.String=15]="String";s[s.Number=16]="Number";s[s.Boolean=17]="Boolean";s[s.Array=18]="Array";s[s.Object=19]="Object";s[s.Key=20]="Key";s[s.Null=21]="Null";s[s.EnumMember=22]="EnumMember";s[s.Struct=23]="Struct";s[s.Event=24]="Event";s[s.Operator=25]="Operator";s[s.TypeParameter=26]="TypeParameter"})(Ur||={});var zr;((c)=>{c[c.Text=1]="Text";c[c.Method=2]="Method";c[c.Function=3]="Function";c[c.Constructor=4]="Constructor";c[c.Field=5]="Field";c[c.Variable=6]="Variable";c[c.Class=7]="Class";c[c.Interface=8]="Interface";c[c.Module=9]="Module";c[c.Property=10]="Property";c[c.Unit=11]="Unit";c[c.Value=12]="Value";c[c.Enum=13]="Enum";c[c.Keyword=14]="Keyword";c[c.Snippet=15]="Snippet";c[c.Color=16]="Color";c[c.File=17]="File";c[c.Reference=18]="Reference";c[c.Folder=19]="Folder";c[c.EnumMember=20]="EnumMember";c[c.Constant=21]="Constant";c[c.Struct=22]="Struct";c[c.Event=23]="Event";c[c.Operator=24]="Operator";c[c.TypeParameter=25]="TypeParameter"})(zr||={});var Hr;((n)=>{n[n.Text=1]="Text";n[n.Read=2]="Read";n[n.Write=3]="Write"})(Hr||={});class un{documents=new Map;rootUri=null;config={};messageId=0;watchers=new Map;initialize(t){return this.rootUri=t.rootUri,{capabilities:{textDocumentSync:1,hoverProvider:!0,completionProvider:{triggerCharacters:[".",":","<",'"',"'","/"],resolveProvider:!0},definitionProvider:!0,referencesProvider:!0,renameProvider:{prepareProvider:!0},documentSymbolProvider:!0,workspaceSymbolProvider:!0,codeActionProvider:{codeActionKinds:["quickfix","refactor","source"]},signatureHelpProvider:{triggerCharacters:["(",","],retriggerCharacters:[","]},documentHighlightProvider:!0,documentFormattingProvider:!0,diagnosticProvider:{interFileDependencies:!0,workspaceDiagnostics:!0}}}}didOpen(t){let{uri:e,text:i,version:n}=t.textDocument;this.updateDocument(e,i,n)}didChange(t){let{uri:e,version:i}=t.textDocument,n=t.contentChanges[0]?.text||"";this.updateDocument(e,n,i)}didClose(t){let e=t.textDocument.uri;if(this.documents.delete(e),this.watchers.get(e))w(this.uriToPath(e)),this.watchers.delete(e)}updateDocument(t,e,i){let n=this.uriToPath(t),o=r(e,n,!0);this.documents.set(t,{content:e,version:i,declarations:o})}getDiagnostics(t){let e=this.documents.get(t);if(!e)return[];let i=[];for(let n of e.declarations){if(n.isExported&&n.kind==="variable"&&!n.typeAnnotation)i.push({range:this.getDeclarationRange(n,e.content),severity:2,code:"missing-type",source:"dtsx",message:`Exported variable '${n.name}' should have an explicit type annotation for better declaration generation`});if(n.typeAnnotation==="any"||n.returnType==="any")i.push({range:this.getDeclarationRange(n,e.content),severity:3,code:"any-type",source:"dtsx",message:"Consider using a more specific type instead of 'any'"});if(n.kind==="function"&&n.isExported&&!n.returnType)i.push({range:this.getDeclarationRange(n,e.content),severity:3,code:"missing-return-type",source:"dtsx",message:`Function '${n.name}' should have an explicit return type for better declaration generation`})}return i}hover(t){let e=this.documents.get(t.textDocument.uri);if(!e)return null;let{line:i,character:n}=t.position,a=e.content.split(`
|
|
3
3
|
`)[i]||"",u=a.slice(0,n).match(/[\w$]+$/),d=a.slice(n).match(/^[\w$]+/);if(!u&&!d)return null;let g=(u?.[0]||"")+(d?.[0]||""),f=e.declarations.find((x)=>x.name===g);if(!f)return null;let m=`\`\`\`typescript
|
|
4
4
|
${this.buildSignature(f)}
|
|
5
5
|
\`\`\``;if(f.leadingComments&&f.leadingComments.length>0){let v=f.leadingComments.join(`
|
|
@@ -14,9 +14,9 @@ ${v[1].trim()}`}return{contents:{kind:"markdown",value:m}}}completion(t){let e=t
|
|
|
14
14
|
`)[e.line]||"",a=o.slice(0,e.character).match(/[\w$]+$/),u=o.slice(e.character).match(/^[\w$]+/);if(!a&&!u)return null;return(a?.[0]||"")+(u?.[0]||"")}getWordAtRange(t,e){let i=this.documents.get(t);if(!i)return null;let n=i.content.split(`
|
|
15
15
|
`);if(e.start.line===e.end.line)return n[e.start.line]?.slice(e.start.character,e.end.character)||null;return null}getDeclarationAtPosition(t,e){let i=this.documents.get(t);if(!i)return null;for(let n of i.declarations){let o=this.getDeclarationRange(n,i.content);if(this.positionInRange(e,o))return n}return null}positionInRange(t,e){if(t.line<e.start.line||t.line>e.end.line)return!1;if(t.line===e.start.line&&t.character<e.start.character)return!1;if(t.line===e.end.line&&t.character>e.end.character)return!1;return!0}declarationKindToSymbolKind(t){switch(t){case"function":return 12;case"class":return 5;case"interface":return 11;case"type":return 11;case"enum":return 10;case"variable":return 13;case"const":return 14;case"property":return 7;case"method":return 6;case"module":return 2;case"namespace":return 3;default:return 13}}generateDts(t){let e=this.documents.get(t);if(!e)return null;let i={filePath:this.uriToPath(t),sourceCode:e.content,declarations:e.declarations};return l(e.declarations,i,!0,this.config.importOrder)}buildSignature(t){switch(t.kind){case"function":{let e=t.parameters?.map((o)=>{let a="";if(o.rest)a+="...";if(a+=o.name,o.optional)a+="?";if(o.type)a+=`: ${o.type}`;return a}).join(", ")||"",i=t.generics||"",n=t.returnType?`: ${t.returnType}`:"";return`function ${t.name}${i}(${e})${n}`}case"variable":return`const ${t.name}: ${t.typeAnnotation||"unknown"}`;case"interface":return`interface ${t.name}${t.generics||""}${t.extends?` extends ${t.extends}`:""}`;case"type":return`type ${t.name}${t.generics||""} = ${t.typeAnnotation||"unknown"}`;case"class":return`class ${t.name}${t.generics||""}${t.extends?` extends ${t.extends}`:""}`;case"enum":return`enum ${t.name}`;default:return t.name}}getDeclarationRange(t,e){if(t.start!==void 0&&t.end!==void 0)return{start:this.offsetToPosition(t.start,e),end:this.offsetToPosition(t.end,e)};let i=e.split(`
|
|
16
16
|
`);for(let n=0;n<i.length;n++){let o=i[n].indexOf(t.name);if(o!==-1)return{start:{line:n,character:o},end:{line:n,character:o+t.name.length}}}return{start:{line:0,character:0},end:{line:0,character:0}}}offsetToPosition(t,e){let i=0,n=0;for(let o=0;o<t&&o<e.length;o++)if(e[o]===`
|
|
17
|
-
`)i++,n=0;else n++;return{line:i,character:n}}uriToPath(t){if(t.startsWith("file://"))return decodeURIComponent(t.slice(7));return t}pathToUri(t){return`file://${encodeURIComponent(t).replace(/%2F/g,"/")}`}handleMessage(t){if(t.method==="initialize")return{jsonrpc:"2.0",id:t.id,result:this.initialize(t.params)};if(t.method==="initialized")return null;if(t.method==="shutdown")return{jsonrpc:"2.0",id:t.id,result:null};if(t.method==="exit")process.exit(0);let e=t.params;if(t.method==="textDocument/didOpen")return this.didOpen(e),null;if(t.method==="textDocument/didChange")return this.didChange(e),null;if(t.method==="textDocument/didClose")return this.didClose(e),null;if(t.method==="textDocument/hover")return{jsonrpc:"2.0",id:t.id,result:this.hover(e)};if(t.method==="textDocument/completion")return{jsonrpc:"2.0",id:t.id,result:this.completion(e)};if(t.method==="textDocument/definition")return{jsonrpc:"2.0",id:t.id,result:this.definition(e)};if(t.method==="textDocument/references")return{jsonrpc:"2.0",id:t.id,result:this.references(e)};if(t.method==="textDocument/prepareRename")return{jsonrpc:"2.0",id:t.id,result:this.prepareRename(e)};if(t.method==="textDocument/rename")return{jsonrpc:"2.0",id:t.id,result:this.rename(e)};if(t.method==="textDocument/documentSymbol")return{jsonrpc:"2.0",id:t.id,result:this.documentSymbols(e)};if(t.method==="workspace/symbol")return{jsonrpc:"2.0",id:t.id,result:this.workspaceSymbols(e)};if(t.method==="textDocument/codeAction")return{jsonrpc:"2.0",id:t.id,result:this.codeActions(e)};if(t.method==="textDocument/signatureHelp")return{jsonrpc:"2.0",id:t.id,result:this.signatureHelp(e)};if(t.method==="textDocument/documentHighlight")return{jsonrpc:"2.0",id:t.id,result:this.documentHighlight(e)};if(t.method==="textDocument/formatting")return{jsonrpc:"2.0",id:t.id,result:this.formatting(e)};if(t.method==="textDocument/diagnostic"){let i=e?.textDocument?.uri;return{jsonrpc:"2.0",id:t.id,result:{kind:"full",items:i?this.getDiagnostics(i):[]}}}if(t.id!==void 0)return{jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${t.method}`}};return null}}function
|
|
17
|
+
`)i++,n=0;else n++;return{line:i,character:n}}uriToPath(t){if(t.startsWith("file://"))return decodeURIComponent(t.slice(7));return t}pathToUri(t){return`file://${encodeURIComponent(t).replace(/%2F/g,"/")}`}handleMessage(t){if(t.method==="initialize")return{jsonrpc:"2.0",id:t.id,result:this.initialize(t.params)};if(t.method==="initialized")return null;if(t.method==="shutdown")return{jsonrpc:"2.0",id:t.id,result:null};if(t.method==="exit")process.exit(0);let e=t.params;if(t.method==="textDocument/didOpen")return this.didOpen(e),null;if(t.method==="textDocument/didChange")return this.didChange(e),null;if(t.method==="textDocument/didClose")return this.didClose(e),null;if(t.method==="textDocument/hover")return{jsonrpc:"2.0",id:t.id,result:this.hover(e)};if(t.method==="textDocument/completion")return{jsonrpc:"2.0",id:t.id,result:this.completion(e)};if(t.method==="textDocument/definition")return{jsonrpc:"2.0",id:t.id,result:this.definition(e)};if(t.method==="textDocument/references")return{jsonrpc:"2.0",id:t.id,result:this.references(e)};if(t.method==="textDocument/prepareRename")return{jsonrpc:"2.0",id:t.id,result:this.prepareRename(e)};if(t.method==="textDocument/rename")return{jsonrpc:"2.0",id:t.id,result:this.rename(e)};if(t.method==="textDocument/documentSymbol")return{jsonrpc:"2.0",id:t.id,result:this.documentSymbols(e)};if(t.method==="workspace/symbol")return{jsonrpc:"2.0",id:t.id,result:this.workspaceSymbols(e)};if(t.method==="textDocument/codeAction")return{jsonrpc:"2.0",id:t.id,result:this.codeActions(e)};if(t.method==="textDocument/signatureHelp")return{jsonrpc:"2.0",id:t.id,result:this.signatureHelp(e)};if(t.method==="textDocument/documentHighlight")return{jsonrpc:"2.0",id:t.id,result:this.documentHighlight(e)};if(t.method==="textDocument/formatting")return{jsonrpc:"2.0",id:t.id,result:this.formatting(e)};if(t.method==="textDocument/diagnostic"){let i=e?.textDocument?.uri;return{jsonrpc:"2.0",id:t.id,result:{kind:"full",items:i?this.getDiagnostics(i):[]}}}if(t.id!==void 0)return{jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${t.method}`}};return null}}function Gs(){let t=new un,e="";process.stdin.setEncoding("utf8"),process.stdin.on("data",(i)=>{e+=i;while(!0){let n=e.indexOf(`\r
|
|
18
18
|
\r
|
|
19
19
|
`);if(n===-1)break;let a=e.slice(0,n).match(/Content-Length:\s*(\d+)/i);if(!a){e=e.slice(n+4);continue}let u=Number.parseInt(a[1],10),d=n+4,g=d+u;if(e.length<g)break;let f=e.slice(d,g);e=e.slice(g);try{let p=JSON.parse(f),m=t.handleMessage(p);if(m){let x=JSON.stringify(m),v=Buffer.byteLength(x,"utf8");process.stdout.write(`Content-Length: ${v}\r
|
|
20
20
|
\r
|
|
21
|
-
${x}`)}}catch(p){console.error("Error parsing LSP message:",p)}}})}function
|
|
22
|
-
export{
|
|
21
|
+
${x}`)}}catch(p){console.error("Error parsing LSP message:",p)}}})}function Vs(t,e){return(i)=>{if(!P(i))return;let n=b(i,"utf-8"),o=`file://${i}`;t.didOpen({textDocument:{uri:o,languageId:"typescript",version:1,text:n}});let a=t.getDiagnostics(o);e(o,a)}}
|
|
22
|
+
export{Vr,Ur,zr,Hr,un,Gs,Vs};
|