@kubb/core 4.1.4 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/URLPath-8WVzHBnA.cjs +134 -0
  2. package/dist/URLPath-8WVzHBnA.cjs.map +1 -0
  3. package/dist/URLPath-BYceu_vY.js +117 -0
  4. package/dist/URLPath-BYceu_vY.js.map +1 -0
  5. package/dist/{acorn-Cg_eXN51.cjs → acorn-BAVXZMtK.cjs} +17 -21
  6. package/dist/{acorn-Cg_eXN51.cjs.map → acorn-BAVXZMtK.cjs.map} +1 -1
  7. package/dist/{acorn-Z0oy0vSt.js → acorn-D-VhIOLw.js} +17 -21
  8. package/dist/{acorn-Z0oy0vSt.js.map → acorn-D-VhIOLw.js.map} +1 -1
  9. package/dist/{angular-nBly58h0.cjs → angular-Bp0XO9db.cjs} +24 -29
  10. package/dist/{angular-nBly58h0.cjs.map → angular-Bp0XO9db.cjs.map} +1 -1
  11. package/dist/{angular-BUlb_iaU.js → angular-Czhp4eq5.js} +24 -29
  12. package/dist/{angular-BUlb_iaU.js.map → angular-Czhp4eq5.js.map} +1 -1
  13. package/dist/{babel-DfXTN9QX.js → babel-DCR_B4Qn.js} +27 -37
  14. package/dist/{babel-DfXTN9QX.js.map → babel-DCR_B4Qn.js.map} +1 -1
  15. package/dist/{babel-5qXjvTGO.cjs → babel-NI0v59ga.cjs} +27 -37
  16. package/dist/{babel-5qXjvTGO.cjs.map → babel-NI0v59ga.cjs.map} +1 -1
  17. package/dist/casing-BSeq_teY.js +100 -0
  18. package/dist/casing-BSeq_teY.js.map +1 -0
  19. package/dist/casing-CP-9GGdK.cjs +112 -0
  20. package/dist/casing-CP-9GGdK.cjs.map +1 -0
  21. package/dist/{chunk-kPDogv7o.js → chunk-1SJ2vVWa.js} +1 -1
  22. package/dist/{estree-DyiFjXDy.cjs → estree-C3BZPlpU.cjs} +49 -64
  23. package/dist/{estree-DyiFjXDy.cjs.map → estree-C3BZPlpU.cjs.map} +1 -1
  24. package/dist/{estree-Bt3vRtV3.js → estree-DU2NummP.js} +49 -64
  25. package/dist/{estree-Bt3vRtV3.js.map → estree-DU2NummP.js.map} +1 -1
  26. package/dist/{flow-DdtBrX0O.cjs → flow-CWUBUkoi.cjs} +978 -1038
  27. package/dist/{flow-DdtBrX0O.cjs.map → flow-CWUBUkoi.cjs.map} +1 -1
  28. package/dist/{flow-Bb8_yYns.js → flow-JiEbweKj.js} +978 -1038
  29. package/dist/{flow-Bb8_yYns.js.map → flow-JiEbweKj.js.map} +1 -1
  30. package/dist/{fs-BNC5Fj6t.js → fs-BIPMUfpW.js} +3 -4
  31. package/dist/{fs-BNC5Fj6t.js.map → fs-BIPMUfpW.js.map} +1 -1
  32. package/dist/{fs-Bi2kuxAm.cjs → fs-RSVoUw3S.cjs} +2 -3
  33. package/dist/{fs-Bi2kuxAm.cjs.map → fs-RSVoUw3S.cjs.map} +1 -1
  34. package/dist/fs.cjs +1 -1
  35. package/dist/fs.d.cts +1 -1
  36. package/dist/fs.d.ts +1 -1
  37. package/dist/fs.js +2 -2
  38. package/dist/{glimmer-BuCRLjbI.cjs → glimmer-CX9OqG1j.cjs} +27 -41
  39. package/dist/{glimmer-BuCRLjbI.cjs.map → glimmer-CX9OqG1j.cjs.map} +1 -1
  40. package/dist/{glimmer-By8WZPkK.js → glimmer-t9nWn9aE.js} +27 -41
  41. package/dist/{glimmer-By8WZPkK.js.map → glimmer-t9nWn9aE.js.map} +1 -1
  42. package/dist/{graphql-DsrNefXx.js → graphql-DjErlIi5.js} +16 -20
  43. package/dist/{graphql-DsrNefXx.js.map → graphql-DjErlIi5.js.map} +1 -1
  44. package/dist/{graphql-TN0hv-fx.cjs → graphql-GOxQAKxM.cjs} +16 -20
  45. package/dist/{graphql-TN0hv-fx.cjs.map → graphql-GOxQAKxM.cjs.map} +1 -1
  46. package/dist/hooks.cjs +29 -0
  47. package/dist/hooks.cjs.map +1 -0
  48. package/dist/hooks.d.cts +16 -0
  49. package/dist/hooks.d.ts +16 -0
  50. package/dist/hooks.js +25 -0
  51. package/dist/hooks.js.map +1 -0
  52. package/dist/{html-1W4-2_9J.cjs → html-CWrdYAhQ.cjs} +26 -27
  53. package/dist/{html-1W4-2_9J.cjs.map → html-CWrdYAhQ.cjs.map} +1 -1
  54. package/dist/{html-Y5KDc150.js → html-_apcbx34.js} +26 -27
  55. package/dist/{html-Y5KDc150.js.map → html-_apcbx34.js.map} +1 -1
  56. package/dist/{index-CGJ3tdk-.d.ts → index-BTe91LHd.d.ts} +7 -2
  57. package/dist/{index-CWX6_-da.d.cts → index-BmQIxvw0.d.cts} +5 -2
  58. package/dist/index.cjs +383 -30
  59. package/dist/index.cjs.map +1 -1
  60. package/dist/index.d.cts +43 -10
  61. package/dist/index.d.ts +43 -10
  62. package/dist/index.js +376 -23
  63. package/dist/index.js.map +1 -1
  64. package/dist/{logger-OWS6fqk0.d.cts → logger-BA-za85-.d.ts} +2 -2
  65. package/dist/{logger-DBJsdlpZ.cjs → logger-BXL0YCrv.cjs} +8 -12
  66. package/dist/{logger-DBJsdlpZ.cjs.map → logger-BXL0YCrv.cjs.map} +1 -1
  67. package/dist/{logger-BKPT4rkB.js → logger-CDxSrFkR.js} +10 -14
  68. package/dist/{logger-BKPT4rkB.js.map → logger-CDxSrFkR.js.map} +1 -1
  69. package/dist/{logger-B-4AXUmB.d.ts → logger-DpoDtxfo.d.cts} +2 -2
  70. package/dist/logger.cjs +1 -1
  71. package/dist/logger.d.cts +1 -1
  72. package/dist/logger.d.ts +1 -1
  73. package/dist/logger.js +2 -2
  74. package/dist/{markdown-Drl4Cbq5.js → markdown-ckUc3Q6q.js} +25 -29
  75. package/dist/{markdown-Drl4Cbq5.js.map → markdown-ckUc3Q6q.js.map} +1 -1
  76. package/dist/{markdown-Bltb-uzO.cjs → markdown-pzqiRmft.cjs} +25 -29
  77. package/dist/{markdown-Bltb-uzO.cjs.map → markdown-pzqiRmft.cjs.map} +1 -1
  78. package/dist/{meriyah-Cz9whwp-.js → meriyah-BjnGqpUs.js} +21 -29
  79. package/dist/{meriyah-Cz9whwp-.js.map → meriyah-BjnGqpUs.js.map} +1 -1
  80. package/dist/{meriyah-CdG8HPS2.cjs → meriyah-D_x7itbT.cjs} +21 -29
  81. package/dist/{meriyah-CdG8HPS2.cjs.map → meriyah-D_x7itbT.cjs.map} +1 -1
  82. package/dist/mocks.cjs +87 -144
  83. package/dist/mocks.cjs.map +1 -1
  84. package/dist/mocks.d.cts +4 -3
  85. package/dist/mocks.d.ts +4 -3
  86. package/dist/mocks.js +83 -141
  87. package/dist/mocks.js.map +1 -1
  88. package/dist/{postcss-B7n9zUIy.cjs → postcss-B_c2wbFu.cjs} +41 -54
  89. package/dist/{postcss-B7n9zUIy.cjs.map → postcss-B_c2wbFu.cjs.map} +1 -1
  90. package/dist/{postcss-Dfx_9buT.js → postcss-v7BP6SZ-.js} +41 -54
  91. package/dist/{postcss-Dfx_9buT.js.map → postcss-v7BP6SZ-.js.map} +1 -1
  92. package/dist/{prompt-BMs_Y-vT.js → prompt-DBVnG4Me.js} +30 -32
  93. package/dist/{prompt-BMs_Y-vT.js.map → prompt-DBVnG4Me.js.map} +1 -1
  94. package/dist/{prompt-BXlYKArM.cjs → prompt-DgONOpPH.cjs} +29 -31
  95. package/dist/{prompt-BXlYKArM.cjs.map → prompt-DgONOpPH.cjs.map} +1 -1
  96. package/dist/{transformers-DZ22lE-S.cjs → transformers-BH0KLJJP.cjs} +130 -248
  97. package/dist/transformers-BH0KLJJP.cjs.map +1 -0
  98. package/dist/{transformers-BllSzdDt.js → transformers-DzHGqYO2.js} +130 -236
  99. package/dist/transformers-DzHGqYO2.js.map +1 -0
  100. package/dist/transformers.cjs +4 -3
  101. package/dist/transformers.js +2 -1
  102. package/dist/types-BzI9JlV8.d.ts +5 -0
  103. package/dist/types-C3ea5qNG.d.cts +5 -0
  104. package/dist/{PluginManager-BSUDeUfP.d.ts → types-DNxlynJr.d.cts} +187 -246
  105. package/dist/{PluginManager-a3RiDAFC.d.cts → types-DPeNK0FO.d.ts} +187 -246
  106. package/dist/{typescript-Evf8GXVW.cjs → typescript-6kMN6Wqz.cjs} +100 -152
  107. package/dist/{typescript-Evf8GXVW.cjs.map → typescript-6kMN6Wqz.cjs.map} +1 -1
  108. package/dist/{typescript-C8iCxnaF.js → typescript-B_IBfKSe.js} +101 -153
  109. package/dist/{typescript-C8iCxnaF.js.map → typescript-B_IBfKSe.js.map} +1 -1
  110. package/dist/typescript-C5hce4HG.cjs +4 -0
  111. package/dist/typescript-Cas1XcNz.js +3 -0
  112. package/dist/utils.cjs +165 -20
  113. package/dist/utils.cjs.map +1 -0
  114. package/dist/utils.d.cts +136 -5
  115. package/dist/utils.d.ts +136 -5
  116. package/dist/utils.js +156 -5
  117. package/dist/utils.js.map +1 -0
  118. package/dist/{write-O9QWtBJ_.js → write-CxO1CDML.js} +2 -2
  119. package/dist/{write-O9QWtBJ_.js.map → write-CxO1CDML.js.map} +1 -1
  120. package/dist/{yaml-Bi_nSoU_.js → yaml-BfWM_B73.js} +141 -157
  121. package/dist/{yaml-Bi_nSoU_.js.map → yaml-BfWM_B73.js.map} +1 -1
  122. package/dist/{yaml-B2qeXFgu.cjs → yaml-DZs6MhV1.cjs} +141 -157
  123. package/dist/{yaml-B2qeXFgu.cjs.map → yaml-DZs6MhV1.cjs.map} +1 -1
  124. package/package.json +15 -3
  125. package/src/FileManager.ts +34 -302
  126. package/src/PluginManager.ts +9 -8
  127. package/src/__snapshots__/barrel.json +5 -5
  128. package/src/build.ts +19 -5
  129. package/src/hooks/index.ts +3 -0
  130. package/src/hooks/useMode.ts +8 -0
  131. package/src/hooks/usePlugin.ts +8 -0
  132. package/src/hooks/usePluginManager.ts +8 -0
  133. package/src/index.ts +1 -2
  134. package/src/mocks/index.ts +4 -3
  135. package/src/plugin.ts +1 -1
  136. package/src/types.ts +4 -1
  137. package/src/utils/TreeNode.ts +3 -3
  138. package/src/utils/index.ts +2 -4
  139. package/dist/FileManager-B0V0rX5Z.js +0 -881
  140. package/dist/FileManager-B0V0rX5Z.js.map +0 -1
  141. package/dist/FileManager-COJW0Zp4.cjs +0 -1003
  142. package/dist/FileManager-COJW0Zp4.cjs.map +0 -1
  143. package/dist/index-B7KKQHG8.d.cts +0 -179
  144. package/dist/index-BhFFCWR1.d.ts +0 -179
  145. package/dist/transformers-BllSzdDt.js.map +0 -1
  146. package/dist/transformers-DZ22lE-S.cjs.map +0 -1
  147. package/dist/typescript-BY9-7pw9.js +0 -3
  148. package/dist/typescript-PxlX-TH7.cjs +0 -4
  149. package/src/utils/parser.ts +0 -199
@@ -70,8 +70,7 @@ function slash(path$1, platform = "linux") {
70
70
  }
71
71
  function getRelativePath(rootDir, filePath, platform = "linux") {
72
72
  if (!rootDir || !filePath) throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ""} ${filePath || ""}`);
73
- const relativePath = relative(rootDir, filePath);
74
- const slashedPath = slash(relativePath, platform);
73
+ const slashedPath = slash(relative(rootDir, filePath), platform);
75
74
  if (slashedPath.startsWith("../")) return slashedPath;
76
75
  return `./${slashedPath}`;
77
76
  }
@@ -87,5 +86,5 @@ function trimExtName(text) {
87
86
  }
88
87
 
89
88
  //#endregion
90
- export { clean, exists, getRelativePath, read, readSync, trimExtName, types_exports, unlink };
91
- //# sourceMappingURL=fs-BNC5Fj6t.js.map
89
+ export { read as a, clean as c, unlink as i, types_exports as n, readSync as o, getRelativePath as r, exists as s, trimExtName as t };
90
+ //# sourceMappingURL=fs-BIPMUfpW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fs-BNC5Fj6t.js","names":["path","reader","path","syncReader","path","path","path"],"sources":["../src/fs/clean.ts","../src/fs/exists.ts","../src/fs/read.ts","../src/fs/unlink.ts","../src/fs/utils.ts","../src/fs/types.ts","../src/fs/index.ts"],"sourcesContent":["import fs from 'fs-extra'\n\nexport async function clean(path: string): Promise<void> {\n return fs.remove(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.pathExists(path)\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.exists()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.pathExistsSync(path)\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function exists(path: string): Promise<boolean> {\n return reader(path)\n}\n\nexport function existsSync(path: string): boolean {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.readFile(path, { encoding: 'utf8' })\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.text()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.readFileSync(path, { encoding: 'utf8' })\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function read(path: string): Promise<string> {\n return reader(path)\n}\n\nexport function readSync(path: string): string {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\n\nexport async function unlink(path: string): Promise<void> {\n return fs.unlink(path)\n}\n","import { normalize, relative } from 'node:path'\n\nfunction slash(path: string, platform: 'windows' | 'mac' | 'linux' = 'linux') {\n const isWindowsPath = /^\\\\\\\\\\?\\\\/.test(path)\n const normalizedPath = normalize(path)\n\n if (['linux', 'mac'].includes(platform) && !isWindowsPath) {\n // linux and mac\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n }\n\n // windows\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n}\n\nexport function getRelativePath(rootDir?: string | null, filePath?: string | null, platform: 'windows' | 'mac' | 'linux' = 'linux'): string {\n if (!rootDir || !filePath) {\n throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ''} ${filePath || ''}`)\n }\n\n const relativePath = relative(rootDir, filePath)\n\n // On Windows, paths are separated with a \"\\\"\n // However, web browsers use \"/\" no matter the platform\n const slashedPath = slash(relativePath, platform)\n\n if (slashedPath.startsWith('../')) {\n return slashedPath\n }\n\n return `./${slashedPath}`\n}\n","type BasePath<T extends string = string> = `${T}/`\n\nexport type Import = {\n /**\n * Import name to be used\n * @example [\"useState\"]\n * @example \"React\"\n */\n name:\n | string\n | Array<\n | string\n | {\n propertyName: string\n name?: string\n }\n >\n /**\n * Path for the import\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n\n isNameSpace?: boolean\n /**\n * When root is set it will get the path with relative getRelativePath(root, path).\n */\n root?: string\n}\n\nexport type Source = {\n name?: string\n value?: string\n isTypeOnly?: boolean\n /**\n * Has const or type 'export'\n * @default false\n */\n isExportable?: boolean\n /**\n * When set, barrel generation will add this\n * @default false\n */\n isIndexable?: boolean\n}\n\nexport type Export = {\n /**\n * Export name to be used.\n * @example [\"useState\"]\n * @example \"React\"\n */\n name?: string | Array<string>\n /**\n * Path for the import.\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n /**\n * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.\n */\n asAlias?: boolean\n}\n\nexport type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`\n\nexport type Mode = 'single' | 'split'\n\n/**\n * Name to be used to dynamicly create the baseName(based on input.path)\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\nexport type BaseName = `${string}.${string}`\n\n/**\n * Path will be full qualified path to a specified file\n */\nexport type Path = string\n\nexport type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`\n\nexport type OptionalPath = Path | undefined | null\n\nexport type File<TMeta extends object = object> = {\n /**\n * Name to be used to create the path\n * Based on UNIX basename, `${name}.extname`\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: BaseName\n /**\n * Path will be full qualified path to a specified file\n */\n path: AdvancedPath<BaseName> | Path\n sources: Array<Source>\n imports?: Array<Import>\n exports?: Array<Export>\n /**\n * Use extra meta, this is getting used to generate the barrel/index files.\n */\n meta?: TMeta\n banner?: string\n footer?: string\n}\n\nexport type ResolvedImport = Import\n\nexport type ResolvedExport = Export\n\nexport type ResolvedFile<TMeta extends object = object> = File<TMeta> & {\n /**\n * @default object-hash\n */\n id: string\n /**\n * Contains the first part of the baseName, generated based on baseName\n * @link https://nodejs.org/api/path.html#pathformatpathobject\n */\n name: string\n extname: Extname\n imports: Array<ResolvedImport>\n exports: Array<ResolvedExport>\n}\n","export { clean } from './clean.ts'\nexport { exists } from './exists.ts'\nexport { read, readSync } from './read.ts'\nexport { unlink } from './unlink.ts'\nexport { getRelativePath } from './utils.ts'\nexport { write } from './write.ts'\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n\nexport * as KubbFile from './types.ts'\n"],"mappings":";;;;;AAEA,eAAsB,MAAM,QAA6B;AACvD,QAAO,GAAG,OAAOA,OAAK;;;;;ACAxB,MAAMC,WAAS,SACb;CACE,MAAM,OAAO,WAAiB;AAC5B,SAAO,GAAG,WAAWC,OAAK;;CAE5B,KAAK,OAAO,WAAiB;AAG3B,SAFa,IAAI,KAAKA,OAAK,CAEf,QAAQ;;CAEvB,EACD,OACD;AAED,MAAMC,eAAa,SACjB;CACE,OAAO,WAAiB;AACtB,SAAO,GAAG,eAAeD,OAAK;;CAEhC,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,OAAO,QAAgC;AAC3D,QAAOD,SAAOC,OAAK;;;;;AC3BrB,MAAM,SAAS,SACb;CACE,MAAM,OAAO,WAAiB;AAC5B,SAAO,GAAG,SAASE,QAAM,EAAE,UAAU,QAAQ,CAAC;;CAEhD,KAAK,OAAO,WAAiB;AAG3B,SAFa,IAAI,KAAKA,OAAK,CAEf,MAAM;;CAErB,EACD,OACD;AAED,MAAM,aAAa,SACjB;CACE,OAAO,WAAiB;AACtB,SAAO,GAAG,aAAaA,QAAM,EAAE,UAAU,QAAQ,CAAC;;CAEpD,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,KAAK,QAA+B;AACxD,QAAO,OAAOA,OAAK;;AAGrB,SAAgB,SAAS,QAAsB;AAC7C,QAAO,WAAWA,OAAK;;;;;AChCzB,eAAsB,OAAO,QAA6B;AACxD,QAAO,GAAG,OAAOC,OAAK;;;;;ACDxB,SAAS,MAAM,QAAc,WAAwC,SAAS;CAC5E,MAAM,gBAAgB,YAAY,KAAKC,OAAK;CAC5C,MAAM,iBAAiB,UAAUA,OAAK;AAEtC,KAAI,CAAC,SAAS,MAAM,CAAC,SAAS,SAAS,IAAI,CAAC,cAE1C,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;AAIjE,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;;AAGjE,SAAgB,gBAAgB,SAAyB,UAA0B,WAAwC,SAAiB;AAC1I,KAAI,CAAC,WAAW,CAAC,SACf,OAAM,IAAI,MAAM,uEAAuE,WAAW,GAAG,GAAG,YAAY,KAAK;CAG3H,MAAM,eAAe,SAAS,SAAS,SAAS;CAIhD,MAAM,cAAc,MAAM,cAAc,SAAS;AAEjD,KAAI,YAAY,WAAW,MAAM,CAC/B,QAAO;AAGT,QAAO,KAAK;;;;;;;;;AEvBd,SAAgB,YAAY,MAAsB;AAChD,QAAO,KAAK,QAAQ,aAAa,GAAG"}
1
+ {"version":3,"file":"fs-BIPMUfpW.js","names":["path","reader","path","syncReader","path","path","path"],"sources":["../src/fs/clean.ts","../src/fs/exists.ts","../src/fs/read.ts","../src/fs/unlink.ts","../src/fs/utils.ts","../src/fs/types.ts","../src/fs/index.ts"],"sourcesContent":["import fs from 'fs-extra'\n\nexport async function clean(path: string): Promise<void> {\n return fs.remove(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.pathExists(path)\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.exists()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.pathExistsSync(path)\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function exists(path: string): Promise<boolean> {\n return reader(path)\n}\n\nexport function existsSync(path: string): boolean {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.readFile(path, { encoding: 'utf8' })\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.text()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.readFileSync(path, { encoding: 'utf8' })\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function read(path: string): Promise<string> {\n return reader(path)\n}\n\nexport function readSync(path: string): string {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\n\nexport async function unlink(path: string): Promise<void> {\n return fs.unlink(path)\n}\n","import { normalize, relative } from 'node:path'\n\nfunction slash(path: string, platform: 'windows' | 'mac' | 'linux' = 'linux') {\n const isWindowsPath = /^\\\\\\\\\\?\\\\/.test(path)\n const normalizedPath = normalize(path)\n\n if (['linux', 'mac'].includes(platform) && !isWindowsPath) {\n // linux and mac\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n }\n\n // windows\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n}\n\nexport function getRelativePath(rootDir?: string | null, filePath?: string | null, platform: 'windows' | 'mac' | 'linux' = 'linux'): string {\n if (!rootDir || !filePath) {\n throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ''} ${filePath || ''}`)\n }\n\n const relativePath = relative(rootDir, filePath)\n\n // On Windows, paths are separated with a \"\\\"\n // However, web browsers use \"/\" no matter the platform\n const slashedPath = slash(relativePath, platform)\n\n if (slashedPath.startsWith('../')) {\n return slashedPath\n }\n\n return `./${slashedPath}`\n}\n","type BasePath<T extends string = string> = `${T}/`\n\nexport type Import = {\n /**\n * Import name to be used\n * @example [\"useState\"]\n * @example \"React\"\n */\n name:\n | string\n | Array<\n | string\n | {\n propertyName: string\n name?: string\n }\n >\n /**\n * Path for the import\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n\n isNameSpace?: boolean\n /**\n * When root is set it will get the path with relative getRelativePath(root, path).\n */\n root?: string\n}\n\nexport type Source = {\n name?: string\n value?: string\n isTypeOnly?: boolean\n /**\n * Has const or type 'export'\n * @default false\n */\n isExportable?: boolean\n /**\n * When set, barrel generation will add this\n * @default false\n */\n isIndexable?: boolean\n}\n\nexport type Export = {\n /**\n * Export name to be used.\n * @example [\"useState\"]\n * @example \"React\"\n */\n name?: string | Array<string>\n /**\n * Path for the import.\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n /**\n * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.\n */\n asAlias?: boolean\n}\n\nexport type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`\n\nexport type Mode = 'single' | 'split'\n\n/**\n * Name to be used to dynamicly create the baseName(based on input.path)\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\nexport type BaseName = `${string}.${string}`\n\n/**\n * Path will be full qualified path to a specified file\n */\nexport type Path = string\n\nexport type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`\n\nexport type OptionalPath = Path | undefined | null\n\nexport type File<TMeta extends object = object> = {\n /**\n * Name to be used to create the path\n * Based on UNIX basename, `${name}.extname`\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: BaseName\n /**\n * Path will be full qualified path to a specified file\n */\n path: AdvancedPath<BaseName> | Path\n sources: Array<Source>\n imports?: Array<Import>\n exports?: Array<Export>\n /**\n * Use extra meta, this is getting used to generate the barrel/index files.\n */\n meta?: TMeta\n banner?: string\n footer?: string\n}\n\nexport type ResolvedImport = Import\n\nexport type ResolvedExport = Export\n\nexport type ResolvedFile<TMeta extends object = object> = File<TMeta> & {\n /**\n * @default object-hash\n */\n id: string\n /**\n * Contains the first part of the baseName, generated based on baseName\n * @link https://nodejs.org/api/path.html#pathformatpathobject\n */\n name: string\n extname: Extname\n imports: Array<ResolvedImport>\n exports: Array<ResolvedExport>\n}\n","export { clean } from './clean.ts'\nexport { exists } from './exists.ts'\nexport { read, readSync } from './read.ts'\nexport { unlink } from './unlink.ts'\nexport { getRelativePath } from './utils.ts'\nexport { write } from './write.ts'\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n\nexport * as KubbFile from './types.ts'\n"],"mappings":";;;;;AAEA,eAAsB,MAAM,QAA6B;AACvD,QAAO,GAAG,OAAOA,OAAK;;;;;ACAxB,MAAMC,WAAS,SACb;CACE,MAAM,OAAO,WAAiB;AAC5B,SAAO,GAAG,WAAWC,OAAK;;CAE5B,KAAK,OAAO,WAAiB;AAG3B,SAFa,IAAI,KAAKA,OAAK,CAEf,QAAQ;;CAEvB,EACD,OACD;AAED,MAAMC,eAAa,SACjB;CACE,OAAO,WAAiB;AACtB,SAAO,GAAG,eAAeD,OAAK;;CAEhC,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,OAAO,QAAgC;AAC3D,QAAOD,SAAOC,OAAK;;;;;AC3BrB,MAAM,SAAS,SACb;CACE,MAAM,OAAO,WAAiB;AAC5B,SAAO,GAAG,SAASE,QAAM,EAAE,UAAU,QAAQ,CAAC;;CAEhD,KAAK,OAAO,WAAiB;AAG3B,SAFa,IAAI,KAAKA,OAAK,CAEf,MAAM;;CAErB,EACD,OACD;AAED,MAAM,aAAa,SACjB;CACE,OAAO,WAAiB;AACtB,SAAO,GAAG,aAAaA,QAAM,EAAE,UAAU,QAAQ,CAAC;;CAEpD,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,KAAK,QAA+B;AACxD,QAAO,OAAOA,OAAK;;AAGrB,SAAgB,SAAS,QAAsB;AAC7C,QAAO,WAAWA,OAAK;;;;;AChCzB,eAAsB,OAAO,QAA6B;AACxD,QAAO,GAAG,OAAOC,OAAK;;;;;ACDxB,SAAS,MAAM,QAAc,WAAwC,SAAS;CAC5E,MAAM,gBAAgB,YAAY,KAAKC,OAAK;CAC5C,MAAM,iBAAiB,UAAUA,OAAK;AAEtC,KAAI,CAAC,SAAS,MAAM,CAAC,SAAS,SAAS,IAAI,CAAC,cAE1C,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;AAIjE,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;;AAGjE,SAAgB,gBAAgB,SAAyB,UAA0B,WAAwC,SAAiB;AAC1I,KAAI,CAAC,WAAW,CAAC,SACf,OAAM,IAAI,MAAM,uEAAuE,WAAW,GAAG,GAAG,YAAY,KAAK;CAO3H,MAAM,cAAc,MAJC,SAAS,SAAS,SAAS,EAIR,SAAS;AAEjD,KAAI,YAAY,WAAW,MAAM,CAC/B,QAAO;AAGT,QAAO,KAAK;;;;;;;;;AEvBd,SAAgB,YAAY,MAAsB;AAChD,QAAO,KAAK,QAAQ,aAAa,GAAG"}
@@ -74,8 +74,7 @@ function slash(path, platform = "linux") {
74
74
  }
75
75
  function getRelativePath(rootDir, filePath, platform = "linux") {
76
76
  if (!rootDir || !filePath) throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ""} ${filePath || ""}`);
77
- const relativePath = (0, node_path.relative)(rootDir, filePath);
78
- const slashedPath = slash(relativePath, platform);
77
+ const slashedPath = slash((0, node_path.relative)(rootDir, filePath), platform);
79
78
  if (slashedPath.startsWith("../")) return slashedPath;
80
79
  return `./${slashedPath}`;
81
80
  }
@@ -139,4 +138,4 @@ Object.defineProperty(exports, 'unlink', {
139
138
  return unlink;
140
139
  }
141
140
  });
142
- //# sourceMappingURL=fs-Bi2kuxAm.cjs.map
141
+ //# sourceMappingURL=fs-RSVoUw3S.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fs-Bi2kuxAm.cjs","names":["fs","reader","fs","syncReader","fs","fs"],"sources":["../src/fs/clean.ts","../src/fs/exists.ts","../src/fs/read.ts","../src/fs/unlink.ts","../src/fs/utils.ts","../src/fs/types.ts","../src/fs/index.ts"],"sourcesContent":["import fs from 'fs-extra'\n\nexport async function clean(path: string): Promise<void> {\n return fs.remove(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.pathExists(path)\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.exists()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.pathExistsSync(path)\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function exists(path: string): Promise<boolean> {\n return reader(path)\n}\n\nexport function existsSync(path: string): boolean {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.readFile(path, { encoding: 'utf8' })\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.text()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.readFileSync(path, { encoding: 'utf8' })\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function read(path: string): Promise<string> {\n return reader(path)\n}\n\nexport function readSync(path: string): string {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\n\nexport async function unlink(path: string): Promise<void> {\n return fs.unlink(path)\n}\n","import { normalize, relative } from 'node:path'\n\nfunction slash(path: string, platform: 'windows' | 'mac' | 'linux' = 'linux') {\n const isWindowsPath = /^\\\\\\\\\\?\\\\/.test(path)\n const normalizedPath = normalize(path)\n\n if (['linux', 'mac'].includes(platform) && !isWindowsPath) {\n // linux and mac\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n }\n\n // windows\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n}\n\nexport function getRelativePath(rootDir?: string | null, filePath?: string | null, platform: 'windows' | 'mac' | 'linux' = 'linux'): string {\n if (!rootDir || !filePath) {\n throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ''} ${filePath || ''}`)\n }\n\n const relativePath = relative(rootDir, filePath)\n\n // On Windows, paths are separated with a \"\\\"\n // However, web browsers use \"/\" no matter the platform\n const slashedPath = slash(relativePath, platform)\n\n if (slashedPath.startsWith('../')) {\n return slashedPath\n }\n\n return `./${slashedPath}`\n}\n","type BasePath<T extends string = string> = `${T}/`\n\nexport type Import = {\n /**\n * Import name to be used\n * @example [\"useState\"]\n * @example \"React\"\n */\n name:\n | string\n | Array<\n | string\n | {\n propertyName: string\n name?: string\n }\n >\n /**\n * Path for the import\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n\n isNameSpace?: boolean\n /**\n * When root is set it will get the path with relative getRelativePath(root, path).\n */\n root?: string\n}\n\nexport type Source = {\n name?: string\n value?: string\n isTypeOnly?: boolean\n /**\n * Has const or type 'export'\n * @default false\n */\n isExportable?: boolean\n /**\n * When set, barrel generation will add this\n * @default false\n */\n isIndexable?: boolean\n}\n\nexport type Export = {\n /**\n * Export name to be used.\n * @example [\"useState\"]\n * @example \"React\"\n */\n name?: string | Array<string>\n /**\n * Path for the import.\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n /**\n * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.\n */\n asAlias?: boolean\n}\n\nexport type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`\n\nexport type Mode = 'single' | 'split'\n\n/**\n * Name to be used to dynamicly create the baseName(based on input.path)\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\nexport type BaseName = `${string}.${string}`\n\n/**\n * Path will be full qualified path to a specified file\n */\nexport type Path = string\n\nexport type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`\n\nexport type OptionalPath = Path | undefined | null\n\nexport type File<TMeta extends object = object> = {\n /**\n * Name to be used to create the path\n * Based on UNIX basename, `${name}.extname`\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: BaseName\n /**\n * Path will be full qualified path to a specified file\n */\n path: AdvancedPath<BaseName> | Path\n sources: Array<Source>\n imports?: Array<Import>\n exports?: Array<Export>\n /**\n * Use extra meta, this is getting used to generate the barrel/index files.\n */\n meta?: TMeta\n banner?: string\n footer?: string\n}\n\nexport type ResolvedImport = Import\n\nexport type ResolvedExport = Export\n\nexport type ResolvedFile<TMeta extends object = object> = File<TMeta> & {\n /**\n * @default object-hash\n */\n id: string\n /**\n * Contains the first part of the baseName, generated based on baseName\n * @link https://nodejs.org/api/path.html#pathformatpathobject\n */\n name: string\n extname: Extname\n imports: Array<ResolvedImport>\n exports: Array<ResolvedExport>\n}\n","export { clean } from './clean.ts'\nexport { exists } from './exists.ts'\nexport { read, readSync } from './read.ts'\nexport { unlink } from './unlink.ts'\nexport { getRelativePath } from './utils.ts'\nexport { write } from './write.ts'\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n\nexport * as KubbFile from './types.ts'\n"],"mappings":";;;;;;;;;AAEA,eAAsB,MAAM,MAA6B;AACvD,QAAOA,iBAAG,OAAO,KAAK;;;;;ACAxB,MAAMC,oCACJ;CACE,MAAM,OAAO,SAAiB;AAC5B,SAAOC,iBAAG,WAAW,KAAK;;CAE5B,KAAK,OAAO,SAAiB;AAG3B,SAFa,IAAI,KAAK,KAAK,CAEf,QAAQ;;CAEvB,EACD,OACD;AAED,MAAMC,wCACJ;CACE,OAAO,SAAiB;AACtB,SAAOD,iBAAG,eAAe,KAAK;;CAEhC,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,OAAO,MAAgC;AAC3D,QAAOD,SAAO,KAAK;;;;;AC3BrB,MAAM,kCACJ;CACE,MAAM,OAAO,SAAiB;AAC5B,SAAOG,iBAAG,SAAS,MAAM,EAAE,UAAU,QAAQ,CAAC;;CAEhD,KAAK,OAAO,SAAiB;AAG3B,SAFa,IAAI,KAAK,KAAK,CAEf,MAAM;;CAErB,EACD,OACD;AAED,MAAM,sCACJ;CACE,OAAO,SAAiB;AACtB,SAAOA,iBAAG,aAAa,MAAM,EAAE,UAAU,QAAQ,CAAC;;CAEpD,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,KAAK,MAA+B;AACxD,QAAO,OAAO,KAAK;;AAGrB,SAAgB,SAAS,MAAsB;AAC7C,QAAO,WAAW,KAAK;;;;;AChCzB,eAAsB,OAAO,MAA6B;AACxD,QAAOC,iBAAG,OAAO,KAAK;;;;;ACDxB,SAAS,MAAM,MAAc,WAAwC,SAAS;CAC5E,MAAM,gBAAgB,YAAY,KAAK,KAAK;CAC5C,MAAM,0CAA2B,KAAK;AAEtC,KAAI,CAAC,SAAS,MAAM,CAAC,SAAS,SAAS,IAAI,CAAC,cAE1C,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;AAIjE,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;;AAGjE,SAAgB,gBAAgB,SAAyB,UAA0B,WAAwC,SAAiB;AAC1I,KAAI,CAAC,WAAW,CAAC,SACf,OAAM,IAAI,MAAM,uEAAuE,WAAW,GAAG,GAAG,YAAY,KAAK;CAG3H,MAAM,uCAAwB,SAAS,SAAS;CAIhD,MAAM,cAAc,MAAM,cAAc,SAAS;AAEjD,KAAI,YAAY,WAAW,MAAM,CAC/B,QAAO;AAGT,QAAO,KAAK;;;;;;;;;AEvBd,SAAgB,YAAY,MAAsB;AAChD,QAAO,KAAK,QAAQ,aAAa,GAAG"}
1
+ {"version":3,"file":"fs-RSVoUw3S.cjs","names":["fs","reader","fs","syncReader","fs","fs"],"sources":["../src/fs/clean.ts","../src/fs/exists.ts","../src/fs/read.ts","../src/fs/unlink.ts","../src/fs/utils.ts","../src/fs/types.ts","../src/fs/index.ts"],"sourcesContent":["import fs from 'fs-extra'\n\nexport async function clean(path: string): Promise<void> {\n return fs.remove(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.pathExists(path)\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.exists()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.pathExistsSync(path)\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function exists(path: string): Promise<boolean> {\n return reader(path)\n}\n\nexport function existsSync(path: string): boolean {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\nimport { switcher } from 'js-runtime'\n\nconst reader = switcher(\n {\n node: async (path: string) => {\n return fs.readFile(path, { encoding: 'utf8' })\n },\n bun: async (path: string) => {\n const file = Bun.file(path)\n\n return file.text()\n },\n },\n 'node',\n)\n\nconst syncReader = switcher(\n {\n node: (path: string) => {\n return fs.readFileSync(path, { encoding: 'utf8' })\n },\n bun: () => {\n throw new Error('Bun cannot read sync')\n },\n },\n 'node',\n)\n\nexport async function read(path: string): Promise<string> {\n return reader(path)\n}\n\nexport function readSync(path: string): string {\n return syncReader(path)\n}\n","import fs from 'fs-extra'\n\nexport async function unlink(path: string): Promise<void> {\n return fs.unlink(path)\n}\n","import { normalize, relative } from 'node:path'\n\nfunction slash(path: string, platform: 'windows' | 'mac' | 'linux' = 'linux') {\n const isWindowsPath = /^\\\\\\\\\\?\\\\/.test(path)\n const normalizedPath = normalize(path)\n\n if (['linux', 'mac'].includes(platform) && !isWindowsPath) {\n // linux and mac\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n }\n\n // windows\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n}\n\nexport function getRelativePath(rootDir?: string | null, filePath?: string | null, platform: 'windows' | 'mac' | 'linux' = 'linux'): string {\n if (!rootDir || !filePath) {\n throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ''} ${filePath || ''}`)\n }\n\n const relativePath = relative(rootDir, filePath)\n\n // On Windows, paths are separated with a \"\\\"\n // However, web browsers use \"/\" no matter the platform\n const slashedPath = slash(relativePath, platform)\n\n if (slashedPath.startsWith('../')) {\n return slashedPath\n }\n\n return `./${slashedPath}`\n}\n","type BasePath<T extends string = string> = `${T}/`\n\nexport type Import = {\n /**\n * Import name to be used\n * @example [\"useState\"]\n * @example \"React\"\n */\n name:\n | string\n | Array<\n | string\n | {\n propertyName: string\n name?: string\n }\n >\n /**\n * Path for the import\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the import, this will result in: `import type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n\n isNameSpace?: boolean\n /**\n * When root is set it will get the path with relative getRelativePath(root, path).\n */\n root?: string\n}\n\nexport type Source = {\n name?: string\n value?: string\n isTypeOnly?: boolean\n /**\n * Has const or type 'export'\n * @default false\n */\n isExportable?: boolean\n /**\n * When set, barrel generation will add this\n * @default false\n */\n isIndexable?: boolean\n}\n\nexport type Export = {\n /**\n * Export name to be used.\n * @example [\"useState\"]\n * @example \"React\"\n */\n name?: string | Array<string>\n /**\n * Path for the import.\n * @example '@kubb/core'\n */\n path: string\n /**\n * Add `type` prefix to the export, this will result in: `export type { Type } from './path'`.\n */\n isTypeOnly?: boolean\n /**\n * Make it possible to override the name, this will result in: `export * as aliasName from './path'`.\n */\n asAlias?: boolean\n}\n\nexport type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`\n\nexport type Mode = 'single' | 'split'\n\n/**\n * Name to be used to dynamicly create the baseName(based on input.path)\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\nexport type BaseName = `${string}.${string}`\n\n/**\n * Path will be full qualified path to a specified file\n */\nexport type Path = string\n\nexport type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`\n\nexport type OptionalPath = Path | undefined | null\n\nexport type File<TMeta extends object = object> = {\n /**\n * Name to be used to create the path\n * Based on UNIX basename, `${name}.extname`\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: BaseName\n /**\n * Path will be full qualified path to a specified file\n */\n path: AdvancedPath<BaseName> | Path\n sources: Array<Source>\n imports?: Array<Import>\n exports?: Array<Export>\n /**\n * Use extra meta, this is getting used to generate the barrel/index files.\n */\n meta?: TMeta\n banner?: string\n footer?: string\n}\n\nexport type ResolvedImport = Import\n\nexport type ResolvedExport = Export\n\nexport type ResolvedFile<TMeta extends object = object> = File<TMeta> & {\n /**\n * @default object-hash\n */\n id: string\n /**\n * Contains the first part of the baseName, generated based on baseName\n * @link https://nodejs.org/api/path.html#pathformatpathobject\n */\n name: string\n extname: Extname\n imports: Array<ResolvedImport>\n exports: Array<ResolvedExport>\n}\n","export { clean } from './clean.ts'\nexport { exists } from './exists.ts'\nexport { read, readSync } from './read.ts'\nexport { unlink } from './unlink.ts'\nexport { getRelativePath } from './utils.ts'\nexport { write } from './write.ts'\n\nexport function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n\nexport * as KubbFile from './types.ts'\n"],"mappings":";;;;;;;;;AAEA,eAAsB,MAAM,MAA6B;AACvD,QAAOA,iBAAG,OAAO,KAAK;;;;;ACAxB,MAAMC,oCACJ;CACE,MAAM,OAAO,SAAiB;AAC5B,SAAOC,iBAAG,WAAW,KAAK;;CAE5B,KAAK,OAAO,SAAiB;AAG3B,SAFa,IAAI,KAAK,KAAK,CAEf,QAAQ;;CAEvB,EACD,OACD;AAED,MAAMC,wCACJ;CACE,OAAO,SAAiB;AACtB,SAAOD,iBAAG,eAAe,KAAK;;CAEhC,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,OAAO,MAAgC;AAC3D,QAAOD,SAAO,KAAK;;;;;AC3BrB,MAAM,kCACJ;CACE,MAAM,OAAO,SAAiB;AAC5B,SAAOG,iBAAG,SAAS,MAAM,EAAE,UAAU,QAAQ,CAAC;;CAEhD,KAAK,OAAO,SAAiB;AAG3B,SAFa,IAAI,KAAK,KAAK,CAEf,MAAM;;CAErB,EACD,OACD;AAED,MAAM,sCACJ;CACE,OAAO,SAAiB;AACtB,SAAOA,iBAAG,aAAa,MAAM,EAAE,UAAU,QAAQ,CAAC;;CAEpD,WAAW;AACT,QAAM,IAAI,MAAM,uBAAuB;;CAE1C,EACD,OACD;AAED,eAAsB,KAAK,MAA+B;AACxD,QAAO,OAAO,KAAK;;AAGrB,SAAgB,SAAS,MAAsB;AAC7C,QAAO,WAAW,KAAK;;;;;AChCzB,eAAsB,OAAO,MAA6B;AACxD,QAAOC,iBAAG,OAAO,KAAK;;;;;ACDxB,SAAS,MAAM,MAAc,WAAwC,SAAS;CAC5E,MAAM,gBAAgB,YAAY,KAAK,KAAK;CAC5C,MAAM,0CAA2B,KAAK;AAEtC,KAAI,CAAC,SAAS,MAAM,CAAC,SAAS,SAAS,IAAI,CAAC,cAE1C,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;AAIjE,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;;AAGjE,SAAgB,gBAAgB,SAAyB,UAA0B,WAAwC,SAAiB;AAC1I,KAAI,CAAC,WAAW,CAAC,SACf,OAAM,IAAI,MAAM,uEAAuE,WAAW,GAAG,GAAG,YAAY,KAAK;CAO3H,MAAM,cAAc,8BAJU,SAAS,SAAS,EAIR,SAAS;AAEjD,KAAI,YAAY,WAAW,MAAM,CAC/B,QAAO;AAGT,QAAO,KAAK;;;;;;;;;AEvBd,SAAgB,YAAY,MAAsB;AAChD,QAAO,KAAK,QAAQ,aAAa,GAAG"}
package/dist/fs.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_fs = require('./fs-Bi2kuxAm.cjs');
1
+ const require_fs = require('./fs-RSVoUw3S.cjs');
2
2
  const require_write = require('./write-BJfM7G1_.cjs');
3
3
 
4
4
  Object.defineProperty(exports, 'KubbFile', {
package/dist/fs.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { clean, exists, getRelativePath, read, readSync, trimExtName, types_d_exports, unlink, write } from "./index-CWX6_-da.cjs";
1
+ import { c as types_d_exports, d as unlink, f as read, h as clean, l as write, m as exists, p as readSync, t as trimExtName, u as getRelativePath } from "./index-BmQIxvw0.cjs";
2
2
  export { types_d_exports as KubbFile, clean, exists, getRelativePath, read, readSync, trimExtName, unlink, write };
package/dist/fs.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { clean, exists, getRelativePath, read, readSync, trimExtName, types_d_exports, unlink, write } from "./index-CGJ3tdk-.js";
1
+ import { c as types_d_exports, d as unlink, f as read, h as clean, l as write, m as exists, p as readSync, t as trimExtName, u as getRelativePath } from "./index-BTe91LHd.js";
2
2
  export { types_d_exports as KubbFile, clean, exists, getRelativePath, read, readSync, trimExtName, unlink, write };
package/dist/fs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { clean, exists, getRelativePath, read, readSync, trimExtName, types_exports, unlink } from "./fs-BNC5Fj6t.js";
2
- import { write } from "./write-O9QWtBJ_.js";
1
+ import { a as read, c as clean, i as unlink, n as types_exports, o as readSync, r as getRelativePath, s as exists, t as trimExtName } from "./fs-BIPMUfpW.js";
2
+ import { t as write } from "./write-CxO1CDML.js";
3
3
 
4
4
  export { types_exports as KubbFile, clean, exists, getRelativePath, read, readSync, trimExtName, unlink, write };
@@ -243,15 +243,14 @@ var z, We = class {
243
243
  }
244
244
  };
245
245
  z = /* @__PURE__ */ new WeakMap();
246
- var Hr = We;
247
- var en = [
246
+ var K = new We([
248
247
  " ",
249
248
  `
250
249
  `,
251
250
  "\f",
252
251
  "\r",
253
252
  " "
254
- ], rn = new Hr(en), K = rn;
253
+ ]);
255
254
  function sn(e) {
256
255
  return Array.isArray(e) && e.length > 0;
257
256
  }
@@ -310,7 +309,7 @@ function on(e, t = "type") {
310
309
  }
311
310
  return r;
312
311
  }
313
- var ln = on({
312
+ var Kr = on({
314
313
  Template: ["body"],
315
314
  Block: ["body"],
316
315
  MustacheStatement: [
@@ -354,7 +353,7 @@ var ln = on({
354
353
  UndefinedLiteral: [],
355
354
  Hash: ["pairs"],
356
355
  HashPair: ["value"]
357
- }), Kr = ln;
356
+ });
358
357
  function St(e) {
359
358
  return e.loc.start.offset;
360
359
  }
@@ -592,8 +591,7 @@ function mn(e) {
592
591
  }
593
592
  function be(e) {
594
593
  var s;
595
- let t = e.trusting ? "{{{" : "{{", r = (s = e.strip) != null && s.open ? "~" : "";
596
- return [t, r];
594
+ return [e.trusting ? "{{{" : "{{", (s = e.strip) != null && s.open ? "~" : ""];
597
595
  }
598
596
  function ye(e) {
599
597
  var s;
@@ -601,10 +599,9 @@ function ye(e) {
601
599
  return [(s = e.strip) != null && s.close ? "~" : "", t];
602
600
  }
603
601
  function dn(e) {
604
- let t = be(e), r = e.openStrip.open ? "~" : "";
605
602
  return [
606
- t,
607
- r,
603
+ be(e),
604
+ e.openStrip.open ? "~" : "",
608
605
  "#"
609
606
  ];
610
607
  }
@@ -613,10 +610,9 @@ function gn(e) {
613
610
  return [e.openStrip.close ? "~" : "", t];
614
611
  }
615
612
  function Xr(e) {
616
- let t = be(e), r = e.closeStrip.open ? "~" : "";
617
613
  return [
618
- t,
619
- r,
614
+ be(e),
615
+ e.closeStrip.open ? "~" : "",
620
616
  "/"
621
617
  ];
622
618
  }
@@ -625,8 +621,7 @@ function Zr(e) {
625
621
  return [e.closeStrip.close ? "~" : "", t];
626
622
  }
627
623
  function is(e) {
628
- let t = be(e), r = e.inverseStrip.open ? "~" : "";
629
- return [t, r];
624
+ return [be(e), e.inverseStrip.open ? "~" : ""];
630
625
  }
631
626
  function as(e) {
632
627
  let t = ye(e);
@@ -721,13 +716,11 @@ function Vt(e) {
721
716
  }
722
717
  function Tn(e) {
723
718
  e = typeof e == "string" ? e : "";
724
- let t = (e.match(/^([^\S\n\r]*[\n\r])+/gu) || [])[0] || "";
725
- return Vt(t);
719
+ return Vt((e.match(/^([^\S\n\r]*[\n\r])+/gu) || [])[0] || "");
726
720
  }
727
721
  function Nn(e) {
728
722
  e = typeof e == "string" ? e : "";
729
- let t = (e.match(/([\n\r][^\S\n\r]*)+$/gu) || [])[0] || "";
730
- return Vt(t);
723
+ return Vt((e.match(/([\n\r][^\S\n\r]*)+$/gu) || [])[0] || "");
731
724
  }
732
725
  function se(e = 0) {
733
726
  return Array.from({ length: Math.min(e, ns) }).fill(tt);
@@ -784,13 +777,13 @@ var An = /* @__PURE__ */ new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"), Ln = new Set(
784
777
  function _n(e) {
785
778
  return e.tail.length === 0 && e.original.includes("/") ? e.original : [e.head.original, ...e.tail].map((r, s) => Dn(r, s) ? `[${r}]` : r).join(".");
786
779
  }
787
- var On = {
780
+ var us = {
788
781
  print: hn,
789
782
  massageAstNode: Mr,
790
783
  hasPrettierIgnore: Jr,
791
784
  getVisitorKeys: Kr,
792
785
  embed: zr
793
- }, us = On;
786
+ };
794
787
  var hs = [{
795
788
  name: "Handlebars",
796
789
  type: "markup",
@@ -815,7 +808,7 @@ var ps = console;
815
808
  function ms(e, t = "unexpected unreachable branch") {
816
809
  throw ps.log("unreachable", e), ps.log(`${t} :: ${JSON.stringify(e)} (${e})`), /* @__PURE__ */ new Error("code reached unreachable");
817
810
  }
818
- var In = function() {
811
+ var Se = function() {
819
812
  var e = function(it, d, k, g) {
820
813
  for (k = k || {}, g = it.length; g--; k[it[g]] = d);
821
814
  return k;
@@ -2421,7 +2414,7 @@ Expecting ` + pe.join(", ") + ", got '" + (this.terminals_[O] || O) + "'" : qe =
2421
2414
  this.yy = {};
2422
2415
  }
2423
2416
  return _e.prototype = De, De.Parser = _e, new _e();
2424
- }(), Se = In;
2417
+ }();
2425
2418
  var tr = [
2426
2419
  "description",
2427
2420
  "fileName",
@@ -4923,8 +4916,7 @@ var lr = function() {
4923
4916
  else n.toUpperCase() + this.input.substring(this.index, this.index + 6).toUpperCase() === "DOCTYPE" && (this.consume(), this.consume(), this.consume(), this.consume(), this.consume(), this.consume(), this.transitionTo("doctype"), this.delegate.beginDoctype && this.delegate.beginDoctype());
4924
4917
  },
4925
4918
  doctype: function() {
4926
- var n = this.consume();
4927
- _(n) && this.transitionTo("beforeDoctypeName");
4919
+ _(this.consume()) && this.transitionTo("beforeDoctypeName");
4928
4920
  },
4929
4921
  beforeDoctypeName: function() {
4930
4922
  var n = this.consume();
@@ -5348,9 +5340,8 @@ var br = class {
5348
5340
  }
5349
5341
  }, yr = class e {
5350
5342
  static synthetic(t) {
5351
- let r = D.synthetic(t);
5352
5343
  return new e({
5353
- loc: r,
5344
+ loc: D.synthetic(t),
5354
5345
  chars: t
5355
5346
  });
5356
5347
  }
@@ -5377,17 +5368,15 @@ var br = class {
5377
5368
  return typeof r == "number" ? e.forCharPositions(t, r, r) : typeof r == "string" ? e.synthetic(r) : Array.isArray(r) ? e.forCharPositions(t, r[0], r[1]) : r === "NonExistent" ? e.NON_EXISTENT : r === "Broken" ? e.broken(ht) : void ms(r);
5378
5369
  }
5379
5370
  static forHbsLoc(t, r) {
5380
- let s = new mt(t, r.start), n = new mt(t, r.end);
5381
5371
  return new oe(t, {
5382
- start: s,
5383
- end: n
5372
+ start: new mt(t, r.start),
5373
+ end: new mt(t, r.end)
5384
5374
  }, r).wrap();
5385
5375
  }
5386
5376
  static forCharPositions(t, r, s) {
5387
- let n = new Tt(t, r), i = new Tt(t, s);
5388
5377
  return new ae(t, {
5389
- start: n,
5390
- end: i
5378
+ start: new Tt(t, r),
5379
+ end: new Tt(t, s)
5391
5380
  }).wrap();
5392
5381
  }
5393
5382
  static synthetic(t) {
@@ -7242,13 +7231,10 @@ function yi(e) {
7242
7231
  t = Rs(e, bi);
7243
7232
  } catch (r) {
7244
7233
  let s = Si(r);
7245
- if (s) {
7246
- let n = ki(r);
7247
- throw qs(n, {
7248
- loc: s,
7249
- cause: r
7250
- });
7251
- }
7234
+ if (s) throw qs(ki(r), {
7235
+ loc: s,
7236
+ cause: r
7237
+ });
7252
7238
  throw r;
7253
7239
  }
7254
7240
  return t;
@@ -7286,4 +7272,4 @@ exports.default = Do;
7286
7272
  exports.languages = hs;
7287
7273
  exports.parsers = Cr;
7288
7274
  exports.printers = vi;
7289
- //# sourceMappingURL=glimmer-BuCRLjbI.cjs.map
7275
+ //# sourceMappingURL=glimmer-CX9OqG1j.cjs.map