@kubb/core 4.1.4 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FileManager-COJW0Zp4.cjs → FileManager-DlkY9W5A.cjs} +5 -7
- package/dist/{FileManager-COJW0Zp4.cjs.map → FileManager-DlkY9W5A.cjs.map} +1 -1
- package/dist/{FileManager-B0V0rX5Z.js → FileManager-zlhCXf6A.js} +8 -10
- package/dist/{FileManager-B0V0rX5Z.js.map → FileManager-zlhCXf6A.js.map} +1 -1
- package/dist/{acorn-Z0oy0vSt.js → acorn-B0JdnMwY.js} +17 -21
- package/dist/{acorn-Z0oy0vSt.js.map → acorn-B0JdnMwY.js.map} +1 -1
- package/dist/{acorn-Cg_eXN51.cjs → acorn-DExO7r0H.cjs} +17 -21
- package/dist/{acorn-Cg_eXN51.cjs.map → acorn-DExO7r0H.cjs.map} +1 -1
- package/dist/{angular-nBly58h0.cjs → angular-C2M8l5eL.cjs} +24 -29
- package/dist/{angular-nBly58h0.cjs.map → angular-C2M8l5eL.cjs.map} +1 -1
- package/dist/{angular-BUlb_iaU.js → angular-CmU_K35W.js} +24 -29
- package/dist/{angular-BUlb_iaU.js.map → angular-CmU_K35W.js.map} +1 -1
- package/dist/{babel-5qXjvTGO.cjs → babel-BKn0s9Rj.cjs} +27 -37
- package/dist/{babel-5qXjvTGO.cjs.map → babel-BKn0s9Rj.cjs.map} +1 -1
- package/dist/{babel-DfXTN9QX.js → babel-CfF0c5A9.js} +27 -37
- package/dist/{babel-DfXTN9QX.js.map → babel-CfF0c5A9.js.map} +1 -1
- package/dist/{chunk-kPDogv7o.js → chunk-1SJ2vVWa.js} +1 -1
- package/dist/{estree-Bt3vRtV3.js → estree-B_YMDsR7.js} +49 -64
- package/dist/{estree-Bt3vRtV3.js.map → estree-B_YMDsR7.js.map} +1 -1
- package/dist/{estree-DyiFjXDy.cjs → estree-Br3l79C5.cjs} +49 -64
- package/dist/{estree-DyiFjXDy.cjs.map → estree-Br3l79C5.cjs.map} +1 -1
- package/dist/{flow-DdtBrX0O.cjs → flow-B_3vaVXc.cjs} +978 -1038
- package/dist/{flow-DdtBrX0O.cjs.map → flow-B_3vaVXc.cjs.map} +1 -1
- package/dist/{flow-Bb8_yYns.js → flow-Dc3wao4M.js} +978 -1038
- package/dist/{flow-Bb8_yYns.js.map → flow-Dc3wao4M.js.map} +1 -1
- package/dist/{fs-BNC5Fj6t.js → fs-BIPMUfpW.js} +3 -4
- package/dist/{fs-BNC5Fj6t.js.map → fs-BIPMUfpW.js.map} +1 -1
- package/dist/{fs-Bi2kuxAm.cjs → fs-RSVoUw3S.cjs} +2 -3
- package/dist/{fs-Bi2kuxAm.cjs.map → fs-RSVoUw3S.cjs.map} +1 -1
- package/dist/fs.cjs +1 -1
- package/dist/fs.d.cts +1 -1
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +2 -2
- package/dist/{glimmer-BuCRLjbI.cjs → glimmer-BF35HI3l.cjs} +27 -41
- package/dist/{glimmer-BuCRLjbI.cjs.map → glimmer-BF35HI3l.cjs.map} +1 -1
- package/dist/{glimmer-By8WZPkK.js → glimmer-CwM1XZA1.js} +27 -41
- package/dist/{glimmer-By8WZPkK.js.map → glimmer-CwM1XZA1.js.map} +1 -1
- package/dist/{graphql-TN0hv-fx.cjs → graphql-DhaHiYrP.cjs} +16 -20
- package/dist/{graphql-TN0hv-fx.cjs.map → graphql-DhaHiYrP.cjs.map} +1 -1
- package/dist/{graphql-DsrNefXx.js → graphql-KQQTidk7.js} +16 -20
- package/dist/{graphql-DsrNefXx.js.map → graphql-KQQTidk7.js.map} +1 -1
- package/dist/hooks.cjs +29 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +15 -0
- package/dist/hooks.d.ts +15 -0
- package/dist/hooks.js +25 -0
- package/dist/hooks.js.map +1 -0
- package/dist/{html-1W4-2_9J.cjs → html-B2QWX43c.cjs} +26 -27
- package/dist/{html-1W4-2_9J.cjs.map → html-B2QWX43c.cjs.map} +1 -1
- package/dist/{html-Y5KDc150.js → html-DQoJX7Yj.js} +26 -27
- package/dist/{html-Y5KDc150.js.map → html-DQoJX7Yj.js.map} +1 -1
- package/dist/{index-CGJ3tdk-.d.ts → index-BY_kka8d.d.ts} +7 -2
- package/dist/{index-B7KKQHG8.d.cts → index-CYcjcRdj.d.ts} +5 -5
- package/dist/{index-BhFFCWR1.d.ts → index-DaYv9bst.d.cts} +5 -5
- package/dist/{index-CWX6_-da.d.cts → index-Iq8NJRgc.d.cts} +5 -2
- package/dist/index.cjs +9 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +11 -14
- package/dist/index.js.map +1 -1
- package/dist/{logger-OWS6fqk0.d.cts → logger-BkGPbocD.d.ts} +2 -2
- package/dist/{logger-BKPT4rkB.js → logger-CsQ2EGpR.js} +10 -14
- package/dist/{logger-BKPT4rkB.js.map → logger-CsQ2EGpR.js.map} +1 -1
- package/dist/{logger-B-4AXUmB.d.ts → logger-DpoDtxfo.d.cts} +2 -2
- package/dist/{logger-DBJsdlpZ.cjs → logger-S_t55o9n.cjs} +8 -12
- package/dist/{logger-DBJsdlpZ.cjs.map → logger-S_t55o9n.cjs.map} +1 -1
- package/dist/logger.cjs +1 -1
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +2 -2
- package/dist/{markdown-Drl4Cbq5.js → markdown-CDf4HsAQ.js} +25 -29
- package/dist/{markdown-Drl4Cbq5.js.map → markdown-CDf4HsAQ.js.map} +1 -1
- package/dist/{markdown-Bltb-uzO.cjs → markdown-HXmAlxeH.cjs} +25 -29
- package/dist/{markdown-Bltb-uzO.cjs.map → markdown-HXmAlxeH.cjs.map} +1 -1
- package/dist/{meriyah-CdG8HPS2.cjs → meriyah-CWoiYjq_.cjs} +21 -29
- package/dist/{meriyah-CdG8HPS2.cjs.map → meriyah-CWoiYjq_.cjs.map} +1 -1
- package/dist/{meriyah-Cz9whwp-.js → meriyah-D8fyVkyI.js} +21 -29
- package/dist/{meriyah-Cz9whwp-.js.map → meriyah-D8fyVkyI.js.map} +1 -1
- package/dist/mocks.cjs +81 -138
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +3 -3
- package/dist/mocks.d.ts +3 -3
- package/dist/mocks.js +83 -140
- package/dist/mocks.js.map +1 -1
- package/dist/{postcss-Dfx_9buT.js → postcss-Dqh1XvaI.js} +41 -54
- package/dist/{postcss-Dfx_9buT.js.map → postcss-Dqh1XvaI.js.map} +1 -1
- package/dist/{postcss-B7n9zUIy.cjs → postcss-bESf1Yzf.cjs} +41 -54
- package/dist/{postcss-B7n9zUIy.cjs.map → postcss-bESf1Yzf.cjs.map} +1 -1
- package/dist/{prompt-BMs_Y-vT.js → prompt-C5GR2LPU.js} +30 -32
- package/dist/{prompt-BMs_Y-vT.js.map → prompt-C5GR2LPU.js.map} +1 -1
- package/dist/{prompt-BXlYKArM.cjs → prompt-ZBXNC-aV.cjs} +29 -31
- package/dist/{prompt-BXlYKArM.cjs.map → prompt-ZBXNC-aV.cjs.map} +1 -1
- package/dist/{transformers-BllSzdDt.js → transformers-5BubQvcu.js} +14 -23
- package/dist/{transformers-BllSzdDt.js.map → transformers-5BubQvcu.js.map} +1 -1
- package/dist/{transformers-DZ22lE-S.cjs → transformers-BIx7CVmw.cjs} +12 -21
- package/dist/{transformers-DZ22lE-S.cjs.map → transformers-BIx7CVmw.cjs.map} +1 -1
- package/dist/transformers.cjs +1 -1
- package/dist/transformers.js +1 -1
- package/dist/{PluginManager-BSUDeUfP.d.ts → types-DtokChaW.d.ts} +245 -245
- package/dist/{PluginManager-a3RiDAFC.d.cts → types-IOE1JAFC.d.cts} +245 -245
- package/dist/{typescript-C8iCxnaF.js → typescript-B7n7vRma.js} +101 -153
- package/dist/{typescript-C8iCxnaF.js.map → typescript-B7n7vRma.js.map} +1 -1
- package/dist/{typescript-Evf8GXVW.cjs → typescript-BYxryL2A.cjs} +100 -152
- package/dist/{typescript-Evf8GXVW.cjs.map → typescript-BYxryL2A.cjs.map} +1 -1
- package/dist/typescript-CIdP4XPm.js +3 -0
- package/dist/typescript-CbuCkdxv.cjs +4 -0
- package/dist/utils.cjs +3 -3
- package/dist/utils.d.cts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +4 -4
- package/dist/{write-O9QWtBJ_.js → write-CxO1CDML.js} +2 -2
- package/dist/{write-O9QWtBJ_.js.map → write-CxO1CDML.js.map} +1 -1
- package/dist/{yaml-Bi_nSoU_.js → yaml-BMiF8MYP.js} +141 -157
- package/dist/{yaml-Bi_nSoU_.js.map → yaml-BMiF8MYP.js.map} +1 -1
- package/dist/{yaml-B2qeXFgu.cjs → yaml-DQCs4b_O.cjs} +141 -157
- package/dist/{yaml-B2qeXFgu.cjs.map → yaml-DQCs4b_O.cjs.map} +1 -1
- package/package.json +15 -3
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useMode.ts +8 -0
- package/src/hooks/usePlugin.ts +8 -0
- package/src/hooks/usePluginManager.ts +8 -0
- package/dist/typescript-BY9-7pw9.js +0 -3
- package/dist/typescript-PxlX-TH7.cjs +0 -4
|
@@ -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
|
|
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 {
|
|
91
|
-
//# sourceMappingURL=fs-
|
|
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-
|
|
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
|
|
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-
|
|
141
|
+
//# sourceMappingURL=fs-RSVoUw3S.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-
|
|
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
package/dist/fs.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { clean,
|
|
1
|
+
import { _ as read, b as clean, g as unlink, h as getRelativePath, m as write, p as types_d_exports, t as trimExtName, v as readSync, y as exists } from "./index-Iq8NJRgc.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,
|
|
1
|
+
import { _ as read, b as clean, g as unlink, h as getRelativePath, m as write, p as types_d_exports, t as trimExtName, v as readSync, y as exists } from "./index-BY_kka8d.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 {
|
|
2
|
-
import { write } from "./write-
|
|
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
|
|
247
|
-
var en = [
|
|
246
|
+
var K = new We([
|
|
248
247
|
" ",
|
|
249
248
|
`
|
|
250
249
|
`,
|
|
251
250
|
"\f",
|
|
252
251
|
"\r",
|
|
253
252
|
" "
|
|
254
|
-
]
|
|
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
|
|
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
|
-
})
|
|
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
|
-
|
|
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
|
-
|
|
607
|
-
|
|
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
|
-
|
|
619
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
780
|
+
var us = {
|
|
788
781
|
print: hn,
|
|
789
782
|
massageAstNode: Mr,
|
|
790
783
|
hasPrettierIgnore: Jr,
|
|
791
784
|
getVisitorKeys: Kr,
|
|
792
785
|
embed: zr
|
|
793
|
-
}
|
|
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
|
|
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
|
-
}()
|
|
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
|
-
|
|
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:
|
|
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:
|
|
5383
|
-
end:
|
|
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:
|
|
5390
|
-
end:
|
|
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
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
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-
|
|
7275
|
+
//# sourceMappingURL=glimmer-BF35HI3l.cjs.map
|