@kubb/ast 5.23.2 → 5.23.4
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/{constants-Ckeonm-D.js → constants-BTTus9ee.js} +1 -1
- package/dist/{constants-Ckeonm-D.js.map → constants-BTTus9ee.js.map} +1 -1
- package/dist/{constants-CquR083U.cjs → constants-DztHlVmY.cjs} +1 -1
- package/dist/{constants-CquR083U.cjs.map → constants-DztHlVmY.cjs.map} +1 -1
- package/dist/factory.cjs +3 -3
- package/dist/factory.d.cts +4 -4
- package/dist/factory.d.ts +4 -4
- package/dist/factory.js +3 -3
- package/dist/{file-xJnBQPGq.d.ts → file-B269mZh4.d.cts} +96 -40
- package/dist/file-Bq2GPaxh.js +427 -0
- package/dist/file-Bq2GPaxh.js.map +1 -0
- package/dist/file-C4pqV8yl.cjs +469 -0
- package/dist/file-C4pqV8yl.cjs.map +1 -0
- package/dist/{file-CvlMAp_d.js → file-D_ih0x7q.js} +32 -19
- package/dist/file-D_ih0x7q.js.map +1 -0
- package/dist/{file-Dd50jPkH.cjs → file-DiPZBLSP.cjs} +32 -19
- package/dist/file-DiPZBLSP.cjs.map +1 -0
- package/dist/{file-BVqSiSvV.d.cts → file-oLlejzZV.d.ts} +96 -40
- package/dist/file.cjs +5 -2
- package/dist/file.d.cts +2 -2
- package/dist/file.d.ts +2 -2
- package/dist/file.js +3 -1
- package/dist/{graph-BcwFCvei.js → graph-BUEOBomo.js} +5 -5
- package/dist/{graph-BcwFCvei.js.map → graph-BUEOBomo.js.map} +1 -1
- package/dist/{graph-DcIY6tQb.cjs → graph-CFJ4wzFR.cjs} +5 -5
- package/dist/{graph-DcIY6tQb.cjs.map → graph-CFJ4wzFR.cjs.map} +1 -1
- package/dist/graph.cjs +1 -1
- package/dist/graph.d.cts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/graph.js +1 -1
- package/dist/{guards-COVJE6TU.cjs → guards-4drgx10i.cjs} +1 -1
- package/dist/{guards-COVJE6TU.cjs.map → guards-4drgx10i.cjs.map} +1 -1
- package/dist/{guards-DlJkKsT1.js → guards-DKw4uwc5.js} +1 -1
- package/dist/{guards-DlJkKsT1.js.map → guards-DKw4uwc5.js.map} +1 -1
- package/dist/{guards-D-h9R_sV.d.ts → guards-RCnH6re9.d.ts} +1 -1
- package/dist/{guards-B8qDgSaT.d.cts → guards-u-dAAtl8.d.cts} +1 -1
- package/dist/{http-DwboM6pK.js → http-CAWf6TAJ.js} +2 -2
- package/dist/http-CAWf6TAJ.js.map +1 -0
- package/dist/{http-Bm5lhVK4.cjs → http-Dv8py6wh.cjs} +2 -2
- package/dist/http-Dv8py6wh.cjs.map +1 -0
- package/dist/http.cjs +2 -2
- package/dist/http.d.cts +2 -2
- package/dist/http.d.ts +2 -2
- package/dist/http.js +2 -2
- package/dist/{index-eGkM4FE9.d.ts → index-2TMYDLjK.d.ts} +1 -1
- package/dist/index-6-ZZCX9W.d.ts +24 -0
- package/dist/index-B2nnOQjf.d.cts +24 -0
- package/dist/{index-Csf8xsCc.d.cts → index-BgFaJtnv.d.ts} +11 -5
- package/dist/index-Bj7a0aSM.d.cts +5 -0
- package/dist/{index-DKJdlX1l.d.cts → index-Bw2oMIM1.d.cts} +4 -4
- package/dist/{index-Bb1kqq8H.d.cts → index-C1za72gL.d.cts} +1 -1
- package/dist/index-CW-ztJjd.d.ts +5 -0
- package/dist/{index-CoRdlrVx.d.ts → index-DF7CbpYW.d.ts} +3 -3
- package/dist/{index-CwLhqYbA.d.cts → index-D_WLsIMP.d.cts} +2 -2
- package/dist/{index-Dp50LM3a.d.ts → index-DbAnYRRM.d.ts} +1 -1
- package/dist/{index-cpjUxIik.d.ts → index-DbQ-J072.d.cts} +11 -5
- package/dist/{index-CFH4ZC7q.d.ts → index-DfRcRYF2.d.ts} +1 -1
- package/dist/{index-DU_jYpBt.d.cts → index-DpnCCtXt.d.cts} +1 -1
- package/dist/{index-BSf-ETQP.d.ts → index-DzHcy3vy.d.ts} +2 -2
- package/dist/{index-W6yFx0sy.d.ts → index-UwSVys3m.d.ts} +4 -4
- package/dist/{index-BVuX3-Th.d.cts → index-c9FD2S5f.d.cts} +3 -3
- package/dist/{index-DYDha-3I.d.cts → index-sdprVPKQ.d.cts} +1 -1
- package/dist/index.cjs +16 -16
- package/dist/index.d.cts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.js +16 -16
- package/dist/{json-DURdtz9A.cjs → json-CCWMgzJZ.cjs} +2 -2
- package/dist/{json-DURdtz9A.cjs.map → json-CCWMgzJZ.cjs.map} +1 -1
- package/dist/{json-DH7_lcWm.js → json-DyDtIZTj.js} +2 -2
- package/dist/{json-DH7_lcWm.js.map → json-DyDtIZTj.js.map} +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.d.cts +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/json.js +1 -1
- package/dist/{macro-4N8vHE-2.js → macro-9WouvtZe.js} +2 -2
- package/dist/{macro-4N8vHE-2.js.map → macro-9WouvtZe.js.map} +1 -1
- package/dist/{macro-V_cNODx2.cjs → macro-BEwfGNu1.cjs} +2 -2
- package/dist/{macro-V_cNODx2.cjs.map → macro-BEwfGNu1.cjs.map} +1 -1
- package/dist/macro.cjs +1 -1
- package/dist/macro.d.cts +1 -1
- package/dist/macro.d.ts +1 -1
- package/dist/macro.js +1 -1
- package/dist/{mediaType-D8uIO8sG.cjs → mediaType-BbIfudh0.cjs} +1 -1
- package/dist/{mediaType-D8uIO8sG.cjs.map → mediaType-BbIfudh0.cjs.map} +1 -1
- package/dist/{mediaType-CRjggmoG.js → mediaType-DXQCNYdM.js} +1 -1
- package/dist/{mediaType-CRjggmoG.js.map → mediaType-DXQCNYdM.js.map} +1 -1
- package/dist/mediaType.cjs +1 -1
- package/dist/mediaType.d.cts +1 -1
- package/dist/mediaType.d.ts +1 -1
- package/dist/mediaType.js +1 -1
- package/dist/{node-Djh-mZB2.js → node-DtuO3zr8.js} +4 -4
- package/dist/{node-Djh-mZB2.js.map → node-DtuO3zr8.js.map} +1 -1
- package/dist/{node-DjcETnc8.cjs → node-vTrAIz3e.cjs} +4 -4
- package/dist/{node-DjcETnc8.cjs.map → node-vTrAIz3e.cjs.map} +1 -1
- package/dist/node.cjs +4 -4
- package/dist/node.d.cts +3 -3
- package/dist/node.d.ts +3 -3
- package/dist/node.js +4 -4
- package/dist/{nodeText-DVVDZQjF.js → nodeText-BSYvDZOH.js} +2 -2
- package/dist/{nodeText-DVVDZQjF.js.map → nodeText-BSYvDZOH.js.map} +1 -1
- package/dist/{nodeText-DRb_rVd1.cjs → nodeText-CZ7wgxu9.cjs} +2 -2
- package/dist/{nodeText-DRb_rVd1.cjs.map → nodeText-CZ7wgxu9.cjs.map} +1 -1
- package/dist/{nodes-CWMa9xhW.js → nodes-ClL1C158.js} +5 -5
- package/dist/nodes-ClL1C158.js.map +1 -0
- package/dist/{nodes-BB60Bq2H.cjs → nodes-DEQjVliP.cjs} +5 -5
- package/dist/nodes-DEQjVliP.cjs.map +1 -0
- package/dist/{operation-X7chCdL2.d.cts → operation-AFw8tzIN.d.cts} +22 -6
- package/dist/{operation-BgRyVS7z.d.ts → operation-Cu4XSaJQ.d.ts} +22 -6
- package/dist/{optionality-D-zqzVMH.cjs → optionality-C-qULYxo.cjs} +1 -1
- package/dist/{optionality-D-zqzVMH.cjs.map → optionality-C-qULYxo.cjs.map} +1 -1
- package/dist/{optionality-DISn8ytP.js → optionality-FkRredTC.js} +1 -1
- package/dist/{optionality-DISn8ytP.js.map → optionality-FkRredTC.js.map} +1 -1
- package/dist/{promise-RpnEev9D.js → promise-B3YkZ4C8.js} +1 -1
- package/dist/{promise-RpnEev9D.js.map → promise-B3YkZ4C8.js.map} +1 -1
- package/dist/{promise-BOdlgT0N.cjs → promise-DScaykew.cjs} +1 -1
- package/dist/{promise-BOdlgT0N.cjs.map → promise-DScaykew.cjs.map} +1 -1
- package/dist/{ref-P0ZLT1Bg.cjs → ref-Bh5Xo8T7.cjs} +4 -4
- package/dist/{ref-P0ZLT1Bg.cjs.map → ref-Bh5Xo8T7.cjs.map} +1 -1
- package/dist/{ref-Bu7PoHar.js → ref-DPqeS8K1.js} +4 -4
- package/dist/{ref-Bu7PoHar.js.map → ref-DPqeS8K1.js.map} +1 -1
- package/dist/ref.cjs +2 -2
- package/dist/ref.d.cts +1 -1
- package/dist/ref.d.ts +1 -1
- package/dist/ref.js +2 -2
- package/dist/{refs-YCV3CznS.js → refs-Bgf8_9Ui.js} +2 -2
- package/dist/{refs-YCV3CznS.js.map → refs-Bgf8_9Ui.js.map} +1 -1
- package/dist/{refs-CYHpRlQo.cjs → refs-rmr2LFV1.cjs} +2 -2
- package/dist/{refs-CYHpRlQo.cjs.map → refs-rmr2LFV1.cjs.map} +1 -1
- package/dist/{schema-DloctnMm.js → schema-4UcdIPQ2.js} +7 -7
- package/dist/{schema-DloctnMm.js.map → schema-4UcdIPQ2.js.map} +1 -1
- package/dist/{schema-BIErWqgc.cjs → schema-DuCY4lCG.cjs} +7 -7
- package/dist/{schema-BIErWqgc.cjs.map → schema-DuCY4lCG.cjs.map} +1 -1
- package/dist/{schema-hxMlgCrV.cjs → schema-gSjYgaCl.cjs} +2 -2
- package/dist/schema-gSjYgaCl.cjs.map +1 -0
- package/dist/{schema-2ZAQk7qE.js → schema-tH14gE6i.js} +2 -2
- package/dist/schema-tH14gE6i.js.map +1 -0
- package/dist/schema.cjs +5 -5
- package/dist/schema.d.cts +4 -4
- package/dist/schema.d.ts +4 -4
- package/dist/schema.js +5 -5
- package/dist/{visitor-DTrzvA3R.cjs → visitor-Bh1CBAOz.cjs} +4 -5
- package/dist/{visitor-DTrzvA3R.cjs.map → visitor-Bh1CBAOz.cjs.map} +1 -1
- package/dist/{visitor-1TSWTMe1.d.ts → visitor-CpmsR8o5.d.ts} +2 -2
- package/dist/{visitor-CUbaaX8R.d.cts → visitor-DnBK2MNl.d.cts} +2 -2
- package/dist/{visitor-NoQSUQTu.js → visitor-XA0W3OVv.js} +4 -5
- package/dist/{visitor-NoQSUQTu.js.map → visitor-XA0W3OVv.js.map} +1 -1
- package/package.json +1 -1
- package/dist/file-Cg0T6cgz.cjs +0 -319
- package/dist/file-Cg0T6cgz.cjs.map +0 -1
- package/dist/file-CnuL8oUj.js +0 -283
- package/dist/file-CnuL8oUj.js.map +0 -1
- package/dist/file-CvlMAp_d.js.map +0 -1
- package/dist/file-Dd50jPkH.cjs.map +0 -1
- package/dist/http-Bm5lhVK4.cjs.map +0 -1
- package/dist/http-DwboM6pK.js.map +0 -1
- package/dist/index-BWd95onW.d.cts +0 -5
- package/dist/index-BwnMIoLl.d.ts +0 -24
- package/dist/index-DSVef1pp.d.cts +0 -24
- package/dist/index-DaHsMJ_S.d.ts +0 -5
- package/dist/nodes-BB60Bq2H.cjs.map +0 -1
- package/dist/nodes-CWMa9xhW.js.map +0 -1
- package/dist/schema-2ZAQk7qE.js.map +0 -1
- package/dist/schema-hxMlgCrV.cjs.map +0 -1
- /package/dist/{base-IpYuh3ZP.d.cts → base-LhsPvVY1.d.ts} +0 -0
- /package/dist/{base-IpYuh3ZP.d.ts → base-UFBZi-FO.d.cts} +0 -0
- /package/dist/{index-Cc2K3OzU.d.cts → index-C-nsgwuD.d.ts} +0 -0
- /package/dist/{index-Cc2K3OzU.d.ts → index-DR9ahJ-x.d.cts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-
|
|
1
|
+
{"version":3,"file":"constants-BTTus9ee.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import type { SchemaType } from './nodes/schema.ts'\n\n/**\n * Node kind discriminators used by every AST node (for example `node.kind === nodeKinds.text`).\n */\nexport const nodeKinds = {\n input: 'Input',\n operation: 'Operation',\n schema: 'Schema',\n property: 'Property',\n parameter: 'Parameter',\n response: 'Response',\n requestBody: 'RequestBody',\n content: 'Content',\n type: 'Type',\n file: 'File',\n import: 'Import',\n export: 'Export',\n source: 'Source',\n const: 'Const',\n function: 'Function',\n arrowFunction: 'ArrowFunction',\n text: 'Text',\n break: 'Break',\n jsx: 'Jsx',\n} as const\n\n/**\n * Schema type discriminators used by all AST schema nodes.\n *\n * Each value is a stable discriminator across the AST (for example `schema.type === schemaTypes.object`).\n */\nexport const schemaTypes = {\n /**\n * Text value.\n */\n string: 'string',\n /**\n * Floating-point number (`float`, `double`).\n */\n number: 'number',\n /**\n * Whole number (`int32`). Use `bigint` for `int64`.\n */\n integer: 'integer',\n /**\n * 64-bit integer (`int64`). Only used when `integerType` is set to `'bigint'`.\n */\n bigint: 'bigint',\n /**\n * Boolean value.\n */\n boolean: 'boolean',\n /**\n * Explicit null value.\n */\n null: 'null',\n /**\n * Any value (no type restriction).\n */\n any: 'any',\n /**\n * Unknown value (must be narrowed before usage).\n */\n unknown: 'unknown',\n /**\n * No return value (`void`).\n */\n void: 'void',\n /**\n * Object with named properties.\n */\n object: 'object',\n /**\n * Sequential list of items.\n */\n array: 'array',\n /**\n * Fixed-length list with position-specific items.\n */\n tuple: 'tuple',\n /**\n * \"One of\" multiple schema members.\n */\n union: 'union',\n /**\n * \"All of\" multiple schema members.\n */\n intersection: 'intersection',\n /** \"Not\" a single schema member. */\n not: 'not',\n /**\n * Enum schema.\n */\n enum: 'enum',\n /**\n * Reference to another schema.\n */\n ref: 'ref',\n /**\n * Calendar date (for example `2026-03-24`).\n */\n date: 'date',\n /**\n * Date-time value (for example `2026-03-24T09:00:00Z`).\n */\n datetime: 'datetime',\n /**\n * Time-only value (for example `09:00:00`).\n */\n time: 'time',\n /**\n * UUID value.\n */\n uuid: 'uuid',\n /**\n * Email address value.\n */\n email: 'email',\n /**\n * URL value.\n */\n url: 'url',\n /**\n * IPv4 address value.\n */\n ipv4: 'ipv4',\n /**\n * IPv6 address value.\n */\n ipv6: 'ipv6',\n /**\n * Binary/blob value.\n */\n blob: 'blob',\n /**\n * Impossible value (`never`).\n */\n never: 'never',\n} as const satisfies Record<SchemaType, SchemaType>\n"],"mappings":";;;;AAKA,MAAa,YAAY;CACvB,OAAO;CACP,WAAW;CACX,QAAQ;CACR,UAAU;CACV,WAAW;CACX,UAAU;CACV,aAAa;CACb,SAAS;CACT,MAAM;CACN,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,UAAU;CACV,eAAe;CACf,MAAM;CACN,OAAO;CACP,KAAK;AACP;;;;;;AAOA,MAAa,cAAc;;;;CAIzB,QAAQ;;;;CAIR,QAAQ;;;;CAIR,SAAS;;;;CAIT,QAAQ;;;;CAIR,SAAS;;;;CAIT,MAAM;;;;CAIN,KAAK;;;;CAIL,SAAS;;;;CAIT,MAAM;;;;CAIN,QAAQ;;;;CAIR,OAAO;;;;CAIP,OAAO;;;;CAIP,OAAO;;;;CAIP,cAAc;;CAEd,KAAK;;;;CAIL,MAAM;;;;CAIN,KAAK;;;;CAIL,MAAM;;;;CAIN,UAAU;;;;CAIV,MAAM;;;;CAIN,MAAM;;;;CAIN,OAAO;;;;CAIP,KAAK;;;;CAIL,MAAM;;;;CAIN,MAAM;;;;CAIN,MAAM;;;;CAIN,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants-
|
|
1
|
+
{"version":3,"file":"constants-DztHlVmY.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import type { SchemaType } from './nodes/schema.ts'\n\n/**\n * Node kind discriminators used by every AST node (for example `node.kind === nodeKinds.text`).\n */\nexport const nodeKinds = {\n input: 'Input',\n operation: 'Operation',\n schema: 'Schema',\n property: 'Property',\n parameter: 'Parameter',\n response: 'Response',\n requestBody: 'RequestBody',\n content: 'Content',\n type: 'Type',\n file: 'File',\n import: 'Import',\n export: 'Export',\n source: 'Source',\n const: 'Const',\n function: 'Function',\n arrowFunction: 'ArrowFunction',\n text: 'Text',\n break: 'Break',\n jsx: 'Jsx',\n} as const\n\n/**\n * Schema type discriminators used by all AST schema nodes.\n *\n * Each value is a stable discriminator across the AST (for example `schema.type === schemaTypes.object`).\n */\nexport const schemaTypes = {\n /**\n * Text value.\n */\n string: 'string',\n /**\n * Floating-point number (`float`, `double`).\n */\n number: 'number',\n /**\n * Whole number (`int32`). Use `bigint` for `int64`.\n */\n integer: 'integer',\n /**\n * 64-bit integer (`int64`). Only used when `integerType` is set to `'bigint'`.\n */\n bigint: 'bigint',\n /**\n * Boolean value.\n */\n boolean: 'boolean',\n /**\n * Explicit null value.\n */\n null: 'null',\n /**\n * Any value (no type restriction).\n */\n any: 'any',\n /**\n * Unknown value (must be narrowed before usage).\n */\n unknown: 'unknown',\n /**\n * No return value (`void`).\n */\n void: 'void',\n /**\n * Object with named properties.\n */\n object: 'object',\n /**\n * Sequential list of items.\n */\n array: 'array',\n /**\n * Fixed-length list with position-specific items.\n */\n tuple: 'tuple',\n /**\n * \"One of\" multiple schema members.\n */\n union: 'union',\n /**\n * \"All of\" multiple schema members.\n */\n intersection: 'intersection',\n /** \"Not\" a single schema member. */\n not: 'not',\n /**\n * Enum schema.\n */\n enum: 'enum',\n /**\n * Reference to another schema.\n */\n ref: 'ref',\n /**\n * Calendar date (for example `2026-03-24`).\n */\n date: 'date',\n /**\n * Date-time value (for example `2026-03-24T09:00:00Z`).\n */\n datetime: 'datetime',\n /**\n * Time-only value (for example `09:00:00`).\n */\n time: 'time',\n /**\n * UUID value.\n */\n uuid: 'uuid',\n /**\n * Email address value.\n */\n email: 'email',\n /**\n * URL value.\n */\n url: 'url',\n /**\n * IPv4 address value.\n */\n ipv4: 'ipv4',\n /**\n * IPv6 address value.\n */\n ipv6: 'ipv6',\n /**\n * Binary/blob value.\n */\n blob: 'blob',\n /**\n * Impossible value (`never`).\n */\n never: 'never',\n} as const satisfies Record<SchemaType, SchemaType>\n"],"mappings":";;;;AAKA,MAAa,YAAY;CACvB,OAAO;CACP,WAAW;CACX,QAAQ;CACR,UAAU;CACV,WAAW;CACX,UAAU;CACV,aAAa;CACb,SAAS;CACT,MAAM;CACN,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,UAAU;CACV,eAAe;CACf,MAAM;CACN,OAAO;CACP,KAAK;AACP;;;;;;AAOA,MAAa,cAAc;;;;CAIzB,QAAQ;;;;CAIR,QAAQ;;;;CAIR,SAAS;;;;CAIT,QAAQ;;;;CAIR,SAAS;;;;CAIT,MAAM;;;;CAIN,KAAK;;;;CAIL,SAAS;;;;CAIT,MAAM;;;;CAIN,QAAQ;;;;CAIR,OAAO;;;;CAIP,OAAO;;;;CAIP,OAAO;;;;CAIP,cAAc;;CAEd,KAAK;;;;CAIL,MAAM;;;;CAIN,KAAK;;;;CAIL,MAAM;;;;CAIN,UAAU;;;;CAIV,MAAM;;;;CAIN,MAAM;;;;CAIN,OAAO;;;;CAIP,KAAK;;;;CAIL,MAAM;;;;CAIN,MAAM;;;;CAIN,MAAM;;;;CAIN,OAAO;AACT"}
|
package/dist/factory.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_schema = require("./schema-
|
|
3
|
-
const require_file = require("./file-
|
|
4
|
-
const require_nodes = require("./nodes-
|
|
2
|
+
const require_schema = require("./schema-gSjYgaCl.cjs");
|
|
3
|
+
const require_file = require("./file-C4pqV8yl.cjs");
|
|
4
|
+
const require_nodes = require("./nodes-DEQjVliP.cjs");
|
|
5
5
|
exports.createArrowFunction = require_nodes.createArrowFunction;
|
|
6
6
|
exports.createBreak = require_nodes.createBreak;
|
|
7
7
|
exports.createConst = require_nodes.createConst;
|
package/dist/factory.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as createJsx,
|
|
2
|
-
import {
|
|
3
|
-
import { t as Node } from "./index-
|
|
4
|
-
export { Node, type UserFileNode, createArrowFunction, createBreak, createConst, createContent, createExport, createFile, createFunction, createImport, createInput, createJsx, createOperation, createParameter, createProperty, createRequestBody, createResponse, createSchema, createSource, createText, createType };
|
|
1
|
+
import { C as createArrowFunction, D as createJsx, E as createFunction, O as createText, T as createConst, c as Space, d as createFile, f as createImport, i as ImportInput, k as createType, l as UserFileNode, o as ModuleName, p as createSource, t as ExportInput, u as createExport, w as createBreak } from "./file-B269mZh4.cjs";
|
|
2
|
+
import { Q as createProperty, X as createSchema, a as createOperation, d as createRequestBody, h as createParameter, k as createInput, l as createResponse, y as createContent } from "./operation-AFw8tzIN.cjs";
|
|
3
|
+
import { t as Node } from "./index-B2nnOQjf.cjs";
|
|
4
|
+
export { type ExportInput, type ImportInput, type ModuleName, Node, type Space, type UserFileNode, createArrowFunction, createBreak, createConst, createContent, createExport, createFile, createFunction, createImport, createInput, createJsx, createOperation, createParameter, createProperty, createRequestBody, createResponse, createSchema, createSource, createText, createType };
|
package/dist/factory.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as createJsx,
|
|
2
|
-
import {
|
|
3
|
-
import { t as Node } from "./index-
|
|
4
|
-
export { Node, type UserFileNode, createArrowFunction, createBreak, createConst, createContent, createExport, createFile, createFunction, createImport, createInput, createJsx, createOperation, createParameter, createProperty, createRequestBody, createResponse, createSchema, createSource, createText, createType };
|
|
1
|
+
import { C as createArrowFunction, D as createJsx, E as createFunction, O as createText, T as createConst, c as Space, d as createFile, f as createImport, i as ImportInput, k as createType, l as UserFileNode, o as ModuleName, p as createSource, t as ExportInput, u as createExport, w as createBreak } from "./file-oLlejzZV.js";
|
|
2
|
+
import { Q as createProperty, X as createSchema, a as createOperation, d as createRequestBody, h as createParameter, k as createInput, l as createResponse, y as createContent } from "./operation-Cu4XSaJQ.js";
|
|
3
|
+
import { t as Node } from "./index-6-ZZCX9W.js";
|
|
4
|
+
export { type ExportInput, type ImportInput, type ModuleName, Node, type Space, type UserFileNode, createArrowFunction, createBreak, createConst, createContent, createExport, createFile, createFunction, createImport, createInput, createJsx, createOperation, createParameter, createProperty, createRequestBody, createResponse, createSchema, createSource, createText, createType };
|
package/dist/factory.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createSchema } from "./schema-
|
|
2
|
-
import { i as createSource, n as createFile, r as createImport, t as createExport } from "./file-
|
|
3
|
-
import { a as createOperation, c as createContent, d as createConst, f as createFunction, h as createType, i as createParameter, l as createArrowFunction, m as createText, n as createResponse, o as createRequestBody, p as createJsx, r as createProperty, s as createInput, u as createBreak } from "./nodes-
|
|
1
|
+
import { t as createSchema } from "./schema-tH14gE6i.js";
|
|
2
|
+
import { i as createSource, n as createFile, r as createImport, t as createExport } from "./file-Bq2GPaxh.js";
|
|
3
|
+
import { a as createOperation, c as createContent, d as createConst, f as createFunction, h as createType, i as createParameter, l as createArrowFunction, m as createText, n as createResponse, o as createRequestBody, p as createJsx, r as createProperty, s as createInput, u as createBreak } from "./nodes-ClL1C158.js";
|
|
4
4
|
export { createArrowFunction, createBreak, createConst, createContent, createExport, createFile, createFunction, createImport, createInput, createJsx, createOperation, createParameter, createProperty, createRequestBody, createResponse, createSchema, createSource, createText, createType };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BaseNode } from "./base-
|
|
1
|
+
import { t as BaseNode } from "./base-UFBZi-FO.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* JSDoc documentation metadata attached to code declarations.
|
|
4
4
|
*/
|
|
@@ -78,6 +78,14 @@ type TypeNode = BaseNode & {
|
|
|
78
78
|
* Whether the declaration should be exported.
|
|
79
79
|
*/
|
|
80
80
|
export?: boolean | null;
|
|
81
|
+
/**
|
|
82
|
+
* How the declaration is written.
|
|
83
|
+
* - `'type'` declares `type Name = …`
|
|
84
|
+
* - `'interface'` declares `interface Name { … }`, so the body must be an object type
|
|
85
|
+
*
|
|
86
|
+
* @default 'type'
|
|
87
|
+
*/
|
|
88
|
+
syntax?: 'type' | 'interface' | null;
|
|
81
89
|
/**
|
|
82
90
|
* JSDoc documentation metadata.
|
|
83
91
|
*/
|
|
@@ -307,39 +315,61 @@ type ImportName = string | Array<string | {
|
|
|
307
315
|
propertyName: string;
|
|
308
316
|
name?: string;
|
|
309
317
|
}>;
|
|
318
|
+
/**
|
|
319
|
+
* Whether a declaration exists only at compile time (`'type'`) or also at runtime (`'value'`).
|
|
320
|
+
*/
|
|
321
|
+
type Space = 'type' | 'value';
|
|
322
|
+
/**
|
|
323
|
+
* One name an import or export brings across, as in the ECMAScript `ImportEntry` record.
|
|
324
|
+
*/
|
|
325
|
+
type ModuleName = {
|
|
326
|
+
/**
|
|
327
|
+
* Name in the other module: `'default'` for its default export, `'*'` for the whole module.
|
|
328
|
+
*/
|
|
329
|
+
name: string;
|
|
330
|
+
/**
|
|
331
|
+
* Local name for an import, or the exported name for an export.
|
|
332
|
+
*/
|
|
333
|
+
alias?: string | null;
|
|
334
|
+
/**
|
|
335
|
+
* Type or value.
|
|
336
|
+
* @default 'value'
|
|
337
|
+
*/
|
|
338
|
+
space?: Space | null;
|
|
339
|
+
};
|
|
310
340
|
/**
|
|
311
341
|
* Represents a language-agnostic import/dependency declaration.
|
|
312
342
|
*
|
|
313
343
|
* @example Named import (TypeScript: `import { useState } from 'react'`)
|
|
314
344
|
* ```ts
|
|
315
|
-
* createImport({ name:
|
|
345
|
+
* createImport({ names: [{ name: 'useState' }], path: 'react' })
|
|
316
346
|
* ```
|
|
317
347
|
*
|
|
318
348
|
* @example Default import (TypeScript: `import React from 'react'`)
|
|
319
349
|
* ```ts
|
|
320
|
-
* createImport({ name: 'React', path: 'react' })
|
|
350
|
+
* createImport({ names: [{ name: 'default', alias: 'React' }], path: 'react' })
|
|
321
351
|
* ```
|
|
322
352
|
*
|
|
323
353
|
* @example Type-only import (TypeScript: `import type { FC } from 'react'`)
|
|
324
354
|
* ```ts
|
|
325
|
-
* createImport({ name:
|
|
355
|
+
* createImport({ names: [{ name: 'FC', space: 'type' }], path: 'react' })
|
|
326
356
|
* ```
|
|
327
357
|
*
|
|
328
358
|
* @example Namespace import (TypeScript: `import * as React from 'react'`)
|
|
329
359
|
* ```ts
|
|
330
|
-
* createImport({ name: '
|
|
360
|
+
* createImport({ names: [{ name: '*', alias: 'React' }], path: 'react' })
|
|
331
361
|
* ```
|
|
332
362
|
*/
|
|
333
363
|
type ImportNode = BaseNode & {
|
|
334
364
|
kind: 'Import';
|
|
365
|
+
/**
|
|
366
|
+
* The names the import brings in. `ast.file.getNames` also reads the deprecated fields.
|
|
367
|
+
*/
|
|
368
|
+
names?: Array<ModuleName> | null;
|
|
335
369
|
/**
|
|
336
370
|
* Import name(s) to be used.
|
|
337
371
|
*
|
|
338
|
-
* @
|
|
339
|
-
* `['useState']`
|
|
340
|
-
*
|
|
341
|
-
* @example Default import
|
|
342
|
-
* `'React'`
|
|
372
|
+
* @deprecated Use `names`. Removed in Kubb v6.
|
|
343
373
|
*/
|
|
344
374
|
name: ImportName;
|
|
345
375
|
/**
|
|
@@ -351,14 +381,14 @@ type ImportNode = BaseNode & {
|
|
|
351
381
|
path: string;
|
|
352
382
|
/**
|
|
353
383
|
* Add a type-only import prefix.
|
|
354
|
-
*
|
|
355
|
-
*
|
|
384
|
+
*
|
|
385
|
+
* @deprecated Set `space: 'type'` on each name. Removed in Kubb v6.
|
|
356
386
|
*/
|
|
357
387
|
isTypeOnly?: boolean | null;
|
|
358
388
|
/**
|
|
359
389
|
* Import the entire module as a namespace.
|
|
360
|
-
*
|
|
361
|
-
*
|
|
390
|
+
*
|
|
391
|
+
* @deprecated Use `{ name: '*', alias }` in `names`. Removed in Kubb v6.
|
|
362
392
|
*/
|
|
363
393
|
isNameSpace?: boolean | null;
|
|
364
394
|
/**
|
|
@@ -371,34 +401,34 @@ type ImportNode = BaseNode & {
|
|
|
371
401
|
*
|
|
372
402
|
* @example Named export (TypeScript: `export { Pets } from './Pets'`)
|
|
373
403
|
* ```ts
|
|
374
|
-
* createExport({ name:
|
|
404
|
+
* createExport({ names: [{ name: 'Pets' }], path: './Pets' })
|
|
375
405
|
* ```
|
|
376
406
|
*
|
|
377
407
|
* @example Type-only export (TypeScript: `export type { Pet } from './Pet'`)
|
|
378
408
|
* ```ts
|
|
379
|
-
* createExport({ name:
|
|
409
|
+
* createExport({ names: [{ name: 'Pet', space: 'type' }], path: './Pet' })
|
|
380
410
|
* ```
|
|
381
411
|
*
|
|
382
412
|
* @example Wildcard export (TypeScript: `export * from './utils'`)
|
|
383
413
|
* ```ts
|
|
384
|
-
* createExport({ path: './utils' })
|
|
414
|
+
* createExport({ names: [{ name: '*' }], path: './utils' })
|
|
385
415
|
* ```
|
|
386
416
|
*
|
|
387
417
|
* @example Namespace alias (TypeScript: `export * as utils from './utils'`)
|
|
388
418
|
* ```ts
|
|
389
|
-
* createExport({ name: '
|
|
419
|
+
* createExport({ names: [{ name: '*', alias: 'utils' }], path: './utils' })
|
|
390
420
|
* ```
|
|
391
421
|
*/
|
|
392
422
|
type ExportNode = BaseNode & {
|
|
393
423
|
kind: 'Export';
|
|
424
|
+
/**
|
|
425
|
+
* The names the export passes on. `ast.file.getNames` also reads the deprecated fields.
|
|
426
|
+
*/
|
|
427
|
+
names?: Array<ModuleName> | null;
|
|
394
428
|
/**
|
|
395
429
|
* Export name(s) to be used. When omitted, generates a wildcard export.
|
|
396
430
|
*
|
|
397
|
-
* @
|
|
398
|
-
* `['useState']`
|
|
399
|
-
*
|
|
400
|
-
* @example Single export
|
|
401
|
-
* `'React'`
|
|
431
|
+
* @deprecated Use `names`. Removed in Kubb v6.
|
|
402
432
|
*/
|
|
403
433
|
name?: string | Array<string> | null;
|
|
404
434
|
/**
|
|
@@ -410,14 +440,14 @@ type ExportNode = BaseNode & {
|
|
|
410
440
|
path: string;
|
|
411
441
|
/**
|
|
412
442
|
* Add a type-only export prefix.
|
|
413
|
-
*
|
|
414
|
-
*
|
|
443
|
+
*
|
|
444
|
+
* @deprecated Set `space: 'type'` on each name. Removed in Kubb v6.
|
|
415
445
|
*/
|
|
416
446
|
isTypeOnly?: boolean | null;
|
|
417
447
|
/**
|
|
418
448
|
* Export as an aliased namespace.
|
|
419
|
-
*
|
|
420
|
-
*
|
|
449
|
+
*
|
|
450
|
+
* @deprecated Use `{ name: '*', alias }` in `names`. Removed in Kubb v6.
|
|
421
451
|
*/
|
|
422
452
|
asAlias?: boolean | null;
|
|
423
453
|
};
|
|
@@ -426,7 +456,7 @@ type ExportNode = BaseNode & {
|
|
|
426
456
|
*
|
|
427
457
|
* @example Named exportable source
|
|
428
458
|
* ```ts
|
|
429
|
-
* createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')],
|
|
459
|
+
* createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')], export: true })
|
|
430
460
|
* ```
|
|
431
461
|
*
|
|
432
462
|
* @example Inline unnamed code block
|
|
@@ -440,21 +470,37 @@ type SourceNode = BaseNode & {
|
|
|
440
470
|
* Optional name identifying this source (used for deduplication and barrel generation).
|
|
441
471
|
*/
|
|
442
472
|
name?: string | null;
|
|
473
|
+
/**
|
|
474
|
+
* Type or value. When unset, a source whose first node is a `Type` is a type.
|
|
475
|
+
*/
|
|
476
|
+
space?: Space | null;
|
|
443
477
|
/**
|
|
444
478
|
* Mark this source as a type-only export.
|
|
479
|
+
*
|
|
480
|
+
* @deprecated Use `space: 'type'`. Removed in Kubb v6.
|
|
445
481
|
*/
|
|
446
482
|
isTypeOnly?: boolean | null;
|
|
447
483
|
/**
|
|
448
|
-
* Mark this source as an exported declaration. The source text carries its own `export` keyword.
|
|
484
|
+
* Mark this source as an exported declaration, which barrels list. The source text carries its own `export` keyword.
|
|
485
|
+
*/
|
|
486
|
+
export?: boolean | null;
|
|
487
|
+
/**
|
|
488
|
+
* Mark this exported source as the module's default export. Barrels skip it, since they can't re-export it by name.
|
|
489
|
+
*/
|
|
490
|
+
default?: boolean | null;
|
|
491
|
+
/**
|
|
492
|
+
* @deprecated Use `export`. Removed in Kubb v6.
|
|
449
493
|
*/
|
|
450
494
|
isExportable?: boolean | null;
|
|
451
495
|
/**
|
|
452
|
-
*
|
|
496
|
+
* @deprecated Use `export`. Removed in Kubb v6.
|
|
453
497
|
*/
|
|
454
498
|
isIndexable?: boolean | null;
|
|
455
499
|
/**
|
|
456
500
|
* Marks the source as a definition that importing files absorb instead of import. `expression` is
|
|
457
501
|
* the declaration's right-hand side, such as `{ body: Pet }`.
|
|
502
|
+
*
|
|
503
|
+
* @deprecated Set `inline` on the file. Removed in Kubb v6.
|
|
458
504
|
*/
|
|
459
505
|
inline?: {
|
|
460
506
|
expression: string;
|
|
@@ -476,7 +522,7 @@ type SourceNode = BaseNode & {
|
|
|
476
522
|
* const file = createFile({
|
|
477
523
|
* baseName: 'petStore.ts',
|
|
478
524
|
* path: 'src/models/petStore.ts',
|
|
479
|
-
* sources: [createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')],
|
|
525
|
+
* sources: [createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')], export: true })],
|
|
480
526
|
* imports: [createImport({ name: ['z'], path: 'zod' })],
|
|
481
527
|
* exports: [createExport({ name: ['Pet'], path: './petStore' })],
|
|
482
528
|
* })
|
|
@@ -543,37 +589,47 @@ type FileNode<TMeta extends object = object> = BaseNode & {
|
|
|
543
589
|
*
|
|
544
590
|
* Use to emit a real source file shipped inside a package (a template) into the generated
|
|
545
591
|
* folder. When set, `copy` provides the file content and any `sources` nodes are ignored for
|
|
546
|
-
* output; `sources` may still carry `name`/`
|
|
592
|
+
* output; `sources` may still carry `name`/`export` so barrel generation
|
|
547
593
|
* treats the file the same as a rendered one.
|
|
548
594
|
*/
|
|
549
595
|
copy?: string | null;
|
|
596
|
+
/**
|
|
597
|
+
* Marks a file that is never written. Each file that imports from it gets the body of each imported declaration, such as `{ body: Pet }`, in place of its name.
|
|
598
|
+
*/
|
|
599
|
+
inline?: boolean | null;
|
|
600
|
+
};
|
|
601
|
+
type ImportInput = Omit<ImportNode, 'kind' | 'name'> & {
|
|
602
|
+
name?: ImportName;
|
|
550
603
|
};
|
|
604
|
+
type ExportInput = Omit<ExportNode, 'kind'>;
|
|
551
605
|
/**
|
|
552
|
-
* Creates an `ImportNode`
|
|
606
|
+
* Creates an `ImportNode`. A node built from `names` also gets the deprecated fields. A deprecated `name` or
|
|
607
|
+
* `isTypeOnly` that differs from the one `names` gives overrides it, so `{ ...imp, isTypeOnly: true }` still works.
|
|
553
608
|
*
|
|
554
609
|
* @example Named import
|
|
555
610
|
* ```ts
|
|
556
|
-
* createImport({ name:
|
|
611
|
+
* createImport({ names: [{ name: 'useState' }], path: 'react' })
|
|
557
612
|
* // import { useState } from 'react'
|
|
558
613
|
* ```
|
|
559
614
|
*/
|
|
560
|
-
declare
|
|
615
|
+
declare function createImport(input: ImportInput): ImportNode;
|
|
561
616
|
/**
|
|
562
|
-
* Creates an `ExportNode`
|
|
617
|
+
* Creates an `ExportNode`. A node built from `names` also gets the deprecated fields. A deprecated `name` or
|
|
618
|
+
* `isTypeOnly` that differs from the one `names` gives overrides it.
|
|
563
619
|
*
|
|
564
620
|
* @example Named export
|
|
565
621
|
* ```ts
|
|
566
|
-
* createExport({ name:
|
|
622
|
+
* createExport({ names: [{ name: 'Pet' }], path: './Pet' })
|
|
567
623
|
* // export { Pet } from './Pet'
|
|
568
624
|
* ```
|
|
569
625
|
*/
|
|
570
|
-
declare
|
|
626
|
+
declare function createExport(input: ExportInput): ExportNode;
|
|
571
627
|
/**
|
|
572
628
|
* Creates a `SourceNode` representing a fragment of source code within a file.
|
|
573
629
|
*
|
|
574
630
|
* @example
|
|
575
631
|
* ```ts
|
|
576
|
-
* createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')],
|
|
632
|
+
* createSource({ name: 'Pet', nodes: [createText('export type Pet = { id: number }')], export: true })
|
|
577
633
|
* ```
|
|
578
634
|
*/
|
|
579
635
|
declare const createSource: (input: Omit<SourceNode, "kind">) => SourceNode;
|
|
@@ -621,4 +677,4 @@ type UserFileNode<TMeta extends object = object> = Omit<FileNode<TMeta>, 'kind'
|
|
|
621
677
|
* ```
|
|
622
678
|
*/
|
|
623
679
|
declare function createFile<TMeta extends object = object>(input: UserFileNode<TMeta>): FileNode<TMeta>;
|
|
624
|
-
export {
|
|
680
|
+
export { createArrowFunction as C, createJsx as D, createFunction as E, createText as O, TypeNode as S, createConst as T, ConstNode as _, ImportNode as a, JsxNode as b, Space as c, createFile as d, createImport as f, CodeNode as g, BreakNode as h, ImportInput as i, createType as k, UserFileNode as l, ArrowFunctionNode as m, ExportNode as n, ModuleName as o, createSource as p, FileNode as r, SourceNode as s, ExportInput as t, createExport as u, FunctionNode as v, createBreak as w, TextNode as x, JSDocNode as y };
|