@kubb/core 4.1.3 → 4.1.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/README.md +15 -16
- package/dist/{FileManager-CkRuIf5a.js → FileManager-B0V0rX5Z.js} +10 -8
- package/dist/FileManager-B0V0rX5Z.js.map +1 -0
- package/dist/{FileManager-C8it6zdT.cjs → FileManager-COJW0Zp4.cjs} +10 -8
- package/dist/FileManager-COJW0Zp4.cjs.map +1 -0
- package/dist/{PluginManager-H8G0i6KS.d.ts → PluginManager-BSUDeUfP.d.ts} +2 -2
- package/dist/{PluginManager-C62HGihR.d.cts → PluginManager-a3RiDAFC.d.cts} +2 -2
- package/dist/{acorn-DExO7r0H.cjs → acorn-Cg_eXN51.cjs} +21 -17
- package/dist/{acorn-DExO7r0H.cjs.map → acorn-Cg_eXN51.cjs.map} +1 -1
- package/dist/{acorn-B0JdnMwY.js → acorn-Z0oy0vSt.js} +21 -17
- package/dist/{acorn-B0JdnMwY.js.map → acorn-Z0oy0vSt.js.map} +1 -1
- package/dist/{angular-CmU_K35W.js → angular-BUlb_iaU.js} +29 -24
- package/dist/{angular-CmU_K35W.js.map → angular-BUlb_iaU.js.map} +1 -1
- package/dist/{angular-C2M8l5eL.cjs → angular-nBly58h0.cjs} +29 -24
- package/dist/{angular-C2M8l5eL.cjs.map → angular-nBly58h0.cjs.map} +1 -1
- package/dist/{babel-BKn0s9Rj.cjs → babel-5qXjvTGO.cjs} +37 -27
- package/dist/{babel-BKn0s9Rj.cjs.map → babel-5qXjvTGO.cjs.map} +1 -1
- package/dist/{babel-CfF0c5A9.js → babel-DfXTN9QX.js} +37 -27
- package/dist/{babel-CfF0c5A9.js.map → babel-DfXTN9QX.js.map} +1 -1
- package/dist/{estree-B_YMDsR7.js → estree-Bt3vRtV3.js} +64 -49
- package/dist/{estree-B_YMDsR7.js.map → estree-Bt3vRtV3.js.map} +1 -1
- package/dist/{estree-Br3l79C5.cjs → estree-DyiFjXDy.cjs} +64 -49
- package/dist/{estree-Br3l79C5.cjs.map → estree-DyiFjXDy.cjs.map} +1 -1
- package/dist/{flow-Dc3wao4M.js → flow-Bb8_yYns.js} +1038 -978
- package/dist/{flow-Dc3wao4M.js.map → flow-Bb8_yYns.js.map} +1 -1
- package/dist/{flow-B_3vaVXc.cjs → flow-DdtBrX0O.cjs} +1038 -978
- package/dist/{flow-B_3vaVXc.cjs.map → flow-DdtBrX0O.cjs.map} +1 -1
- package/dist/{fs-B7JGYSzW.js → fs-BNC5Fj6t.js} +3 -2
- package/dist/{fs-B7JGYSzW.js.map → fs-BNC5Fj6t.js.map} +1 -1
- package/dist/{fs-RSVoUw3S.cjs → fs-Bi2kuxAm.cjs} +3 -2
- package/dist/{fs-RSVoUw3S.cjs.map → fs-Bi2kuxAm.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 +1 -1
- package/dist/{glimmer-BF35HI3l.cjs → glimmer-BuCRLjbI.cjs} +41 -27
- package/dist/{glimmer-BF35HI3l.cjs.map → glimmer-BuCRLjbI.cjs.map} +1 -1
- package/dist/{glimmer-CwM1XZA1.js → glimmer-By8WZPkK.js} +41 -27
- package/dist/{glimmer-CwM1XZA1.js.map → glimmer-By8WZPkK.js.map} +1 -1
- package/dist/{graphql-KQQTidk7.js → graphql-DsrNefXx.js} +20 -16
- package/dist/{graphql-KQQTidk7.js.map → graphql-DsrNefXx.js.map} +1 -1
- package/dist/{graphql-DhaHiYrP.cjs → graphql-TN0hv-fx.cjs} +20 -16
- package/dist/{graphql-DhaHiYrP.cjs.map → graphql-TN0hv-fx.cjs.map} +1 -1
- package/dist/{html-B2QWX43c.cjs → html-1W4-2_9J.cjs} +27 -26
- package/dist/{html-B2QWX43c.cjs.map → html-1W4-2_9J.cjs.map} +1 -1
- package/dist/{html-DQoJX7Yj.js → html-Y5KDc150.js} +27 -26
- package/dist/{html-DQoJX7Yj.js.map → html-Y5KDc150.js.map} +1 -1
- package/dist/{index-DERUIhQK.d.cts → index-B7KKQHG8.d.cts} +3 -3
- package/dist/{index-B428LQ0Z.d.ts → index-BhFFCWR1.d.ts} +3 -3
- package/dist/{index-3smcdUnJ.d.ts → index-CGJ3tdk-.d.ts} +1 -4
- package/dist/{index-Bglrijef.d.cts → index-CWX6_-da.d.cts} +1 -4
- package/dist/index.cjs +12 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/{logger-CibtdnUJ.js → logger-BKPT4rkB.js} +12 -8
- package/dist/{logger-CibtdnUJ.js.map → logger-BKPT4rkB.js.map} +1 -1
- package/dist/{logger-S_t55o9n.cjs → logger-DBJsdlpZ.cjs} +12 -8
- package/dist/{logger-S_t55o9n.cjs.map → logger-DBJsdlpZ.cjs.map} +1 -1
- package/dist/logger.cjs +1 -1
- package/dist/logger.js +1 -1
- package/dist/{markdown-HXmAlxeH.cjs → markdown-Bltb-uzO.cjs} +29 -25
- package/dist/{markdown-HXmAlxeH.cjs.map → markdown-Bltb-uzO.cjs.map} +1 -1
- package/dist/{markdown-CDf4HsAQ.js → markdown-Drl4Cbq5.js} +29 -25
- package/dist/{markdown-CDf4HsAQ.js.map → markdown-Drl4Cbq5.js.map} +1 -1
- package/dist/{meriyah-CWoiYjq_.cjs → meriyah-CdG8HPS2.cjs} +29 -21
- package/dist/{meriyah-CWoiYjq_.cjs.map → meriyah-CdG8HPS2.cjs.map} +1 -1
- package/dist/{meriyah-D8fyVkyI.js → meriyah-Cz9whwp-.js} +29 -21
- package/dist/{meriyah-D8fyVkyI.js.map → meriyah-Cz9whwp-.js.map} +1 -1
- package/dist/mocks.cjs +138 -81
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +2 -2
- package/dist/mocks.d.ts +2 -2
- package/dist/mocks.js +138 -81
- package/dist/mocks.js.map +1 -1
- package/dist/{postcss-bESf1Yzf.cjs → postcss-B7n9zUIy.cjs} +54 -41
- package/dist/{postcss-bESf1Yzf.cjs.map → postcss-B7n9zUIy.cjs.map} +1 -1
- package/dist/{postcss-Dqh1XvaI.js → postcss-Dfx_9buT.js} +54 -41
- package/dist/{postcss-Dqh1XvaI.js.map → postcss-Dfx_9buT.js.map} +1 -1
- package/dist/{prompt-BYM8dl_2.js → prompt-BMs_Y-vT.js} +31 -29
- package/dist/{prompt-BYM8dl_2.js.map → prompt-BMs_Y-vT.js.map} +1 -1
- package/dist/{prompt-ZBXNC-aV.cjs → prompt-BXlYKArM.cjs} +31 -29
- package/dist/{prompt-ZBXNC-aV.cjs.map → prompt-BXlYKArM.cjs.map} +1 -1
- package/dist/{transformers-j70QaKtD.js → transformers-BllSzdDt.js} +21 -12
- package/dist/{transformers-j70QaKtD.js.map → transformers-BllSzdDt.js.map} +1 -1
- package/dist/{transformers-BIx7CVmw.cjs → transformers-DZ22lE-S.cjs} +21 -12
- package/dist/{transformers-BIx7CVmw.cjs.map → transformers-DZ22lE-S.cjs.map} +1 -1
- package/dist/transformers.cjs +1 -1
- package/dist/transformers.js +1 -1
- package/dist/typescript-BY9-7pw9.js +3 -0
- package/dist/{typescript-CKDlnZSX.js → typescript-C8iCxnaF.js} +152 -100
- package/dist/{typescript-CKDlnZSX.js.map → typescript-C8iCxnaF.js.map} +1 -1
- package/dist/{typescript-BYxryL2A.cjs → typescript-Evf8GXVW.cjs} +152 -100
- package/dist/{typescript-BYxryL2A.cjs.map → typescript-Evf8GXVW.cjs.map} +1 -1
- package/dist/typescript-PxlX-TH7.cjs +4 -0
- package/dist/utils.cjs +3 -3
- package/dist/utils.d.cts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +3 -3
- package/dist/{yaml-DQCs4b_O.cjs → yaml-B2qeXFgu.cjs} +157 -141
- package/dist/{yaml-DQCs4b_O.cjs.map → yaml-B2qeXFgu.cjs.map} +1 -1
- package/dist/{yaml-BMiF8MYP.js → yaml-Bi_nSoU_.js} +157 -141
- package/dist/{yaml-BMiF8MYP.js.map → yaml-Bi_nSoU_.js.map} +1 -1
- package/package.json +4 -4
- package/dist/FileManager-C8it6zdT.cjs.map +0 -1
- package/dist/FileManager-CkRuIf5a.js.map +0 -1
- package/dist/typescript-CabSmKb3.js +0 -3
- package/dist/typescript-CbuCkdxv.cjs +0 -4
|
@@ -70,7 +70,8 @@ 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
|
|
73
|
+
const relativePath = relative(rootDir, filePath);
|
|
74
|
+
const slashedPath = slash(relativePath, platform);
|
|
74
75
|
if (slashedPath.startsWith("../")) return slashedPath;
|
|
75
76
|
return `./${slashedPath}`;
|
|
76
77
|
}
|
|
@@ -87,4 +88,4 @@ function trimExtName(text) {
|
|
|
87
88
|
|
|
88
89
|
//#endregion
|
|
89
90
|
export { clean, exists, getRelativePath, read, readSync, trimExtName, types_exports, unlink };
|
|
90
|
-
//# sourceMappingURL=fs-
|
|
91
|
+
//# sourceMappingURL=fs-BNC5Fj6t.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-
|
|
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"}
|
|
@@ -74,7 +74,8 @@ 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
|
|
77
|
+
const relativePath = (0, node_path.relative)(rootDir, filePath);
|
|
78
|
+
const slashedPath = slash(relativePath, platform);
|
|
78
79
|
if (slashedPath.startsWith("../")) return slashedPath;
|
|
79
80
|
return `./${slashedPath}`;
|
|
80
81
|
}
|
|
@@ -138,4 +139,4 @@ Object.defineProperty(exports, 'unlink', {
|
|
|
138
139
|
return unlink;
|
|
139
140
|
}
|
|
140
141
|
});
|
|
141
|
-
//# sourceMappingURL=fs-
|
|
142
|
+
//# sourceMappingURL=fs-Bi2kuxAm.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-
|
|
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"}
|
package/dist/fs.cjs
CHANGED
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-
|
|
1
|
+
import { clean, exists, getRelativePath, read, readSync, trimExtName, types_d_exports, unlink, write } from "./index-CWX6_-da.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-
|
|
1
|
+
import { clean, exists, getRelativePath, read, readSync, trimExtName, types_d_exports, unlink, write } from "./index-CGJ3tdk-.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-
|
|
1
|
+
import { clean, exists, getRelativePath, read, readSync, trimExtName, types_exports, unlink } from "./fs-BNC5Fj6t.js";
|
|
2
2
|
import { write } from "./write-O9QWtBJ_.js";
|
|
3
3
|
|
|
4
4
|
export { types_exports as KubbFile, clean, exists, getRelativePath, read, readSync, trimExtName, unlink, write };
|
|
@@ -243,14 +243,15 @@ var z, We = class {
|
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
245
|
z = /* @__PURE__ */ new WeakMap();
|
|
246
|
-
var
|
|
246
|
+
var Hr = We;
|
|
247
|
+
var en = [
|
|
247
248
|
" ",
|
|
248
249
|
`
|
|
249
250
|
`,
|
|
250
251
|
"\f",
|
|
251
252
|
"\r",
|
|
252
253
|
" "
|
|
253
|
-
]);
|
|
254
|
+
], rn = new Hr(en), K = rn;
|
|
254
255
|
function sn(e) {
|
|
255
256
|
return Array.isArray(e) && e.length > 0;
|
|
256
257
|
}
|
|
@@ -309,7 +310,7 @@ function on(e, t = "type") {
|
|
|
309
310
|
}
|
|
310
311
|
return r;
|
|
311
312
|
}
|
|
312
|
-
var
|
|
313
|
+
var ln = on({
|
|
313
314
|
Template: ["body"],
|
|
314
315
|
Block: ["body"],
|
|
315
316
|
MustacheStatement: [
|
|
@@ -353,7 +354,7 @@ var Kr = on({
|
|
|
353
354
|
UndefinedLiteral: [],
|
|
354
355
|
Hash: ["pairs"],
|
|
355
356
|
HashPair: ["value"]
|
|
356
|
-
});
|
|
357
|
+
}), Kr = ln;
|
|
357
358
|
function St(e) {
|
|
358
359
|
return e.loc.start.offset;
|
|
359
360
|
}
|
|
@@ -591,7 +592,8 @@ function mn(e) {
|
|
|
591
592
|
}
|
|
592
593
|
function be(e) {
|
|
593
594
|
var s;
|
|
594
|
-
|
|
595
|
+
let t = e.trusting ? "{{{" : "{{", r = (s = e.strip) != null && s.open ? "~" : "";
|
|
596
|
+
return [t, r];
|
|
595
597
|
}
|
|
596
598
|
function ye(e) {
|
|
597
599
|
var s;
|
|
@@ -599,9 +601,10 @@ function ye(e) {
|
|
|
599
601
|
return [(s = e.strip) != null && s.close ? "~" : "", t];
|
|
600
602
|
}
|
|
601
603
|
function dn(e) {
|
|
604
|
+
let t = be(e), r = e.openStrip.open ? "~" : "";
|
|
602
605
|
return [
|
|
603
|
-
|
|
604
|
-
|
|
606
|
+
t,
|
|
607
|
+
r,
|
|
605
608
|
"#"
|
|
606
609
|
];
|
|
607
610
|
}
|
|
@@ -610,9 +613,10 @@ function gn(e) {
|
|
|
610
613
|
return [e.openStrip.close ? "~" : "", t];
|
|
611
614
|
}
|
|
612
615
|
function Xr(e) {
|
|
616
|
+
let t = be(e), r = e.closeStrip.open ? "~" : "";
|
|
613
617
|
return [
|
|
614
|
-
|
|
615
|
-
|
|
618
|
+
t,
|
|
619
|
+
r,
|
|
616
620
|
"/"
|
|
617
621
|
];
|
|
618
622
|
}
|
|
@@ -621,7 +625,8 @@ function Zr(e) {
|
|
|
621
625
|
return [e.closeStrip.close ? "~" : "", t];
|
|
622
626
|
}
|
|
623
627
|
function is(e) {
|
|
624
|
-
|
|
628
|
+
let t = be(e), r = e.inverseStrip.open ? "~" : "";
|
|
629
|
+
return [t, r];
|
|
625
630
|
}
|
|
626
631
|
function as(e) {
|
|
627
632
|
let t = ye(e);
|
|
@@ -716,11 +721,13 @@ function Vt(e) {
|
|
|
716
721
|
}
|
|
717
722
|
function Tn(e) {
|
|
718
723
|
e = typeof e == "string" ? e : "";
|
|
719
|
-
|
|
724
|
+
let t = (e.match(/^([^\S\n\r]*[\n\r])+/gu) || [])[0] || "";
|
|
725
|
+
return Vt(t);
|
|
720
726
|
}
|
|
721
727
|
function Nn(e) {
|
|
722
728
|
e = typeof e == "string" ? e : "";
|
|
723
|
-
|
|
729
|
+
let t = (e.match(/([\n\r][^\S\n\r]*)+$/gu) || [])[0] || "";
|
|
730
|
+
return Vt(t);
|
|
724
731
|
}
|
|
725
732
|
function se(e = 0) {
|
|
726
733
|
return Array.from({ length: Math.min(e, ns) }).fill(tt);
|
|
@@ -777,13 +784,13 @@ var An = /* @__PURE__ */ new Set("!\"#%&'()*+,./;<=>@[\\]^`{|}~"), Ln = new Set(
|
|
|
777
784
|
function _n(e) {
|
|
778
785
|
return e.tail.length === 0 && e.original.includes("/") ? e.original : [e.head.original, ...e.tail].map((r, s) => Dn(r, s) ? `[${r}]` : r).join(".");
|
|
779
786
|
}
|
|
780
|
-
var
|
|
787
|
+
var On = {
|
|
781
788
|
print: hn,
|
|
782
789
|
massageAstNode: Mr,
|
|
783
790
|
hasPrettierIgnore: Jr,
|
|
784
791
|
getVisitorKeys: Kr,
|
|
785
792
|
embed: zr
|
|
786
|
-
};
|
|
793
|
+
}, us = On;
|
|
787
794
|
var hs = [{
|
|
788
795
|
name: "Handlebars",
|
|
789
796
|
type: "markup",
|
|
@@ -808,7 +815,7 @@ var ps = console;
|
|
|
808
815
|
function ms(e, t = "unexpected unreachable branch") {
|
|
809
816
|
throw ps.log("unreachable", e), ps.log(`${t} :: ${JSON.stringify(e)} (${e})`), /* @__PURE__ */ new Error("code reached unreachable");
|
|
810
817
|
}
|
|
811
|
-
var
|
|
818
|
+
var In = function() {
|
|
812
819
|
var e = function(it, d, k, g) {
|
|
813
820
|
for (k = k || {}, g = it.length; g--; k[it[g]] = d);
|
|
814
821
|
return k;
|
|
@@ -2414,7 +2421,7 @@ Expecting ` + pe.join(", ") + ", got '" + (this.terminals_[O] || O) + "'" : qe =
|
|
|
2414
2421
|
this.yy = {};
|
|
2415
2422
|
}
|
|
2416
2423
|
return _e.prototype = De, De.Parser = _e, new _e();
|
|
2417
|
-
}();
|
|
2424
|
+
}(), Se = In;
|
|
2418
2425
|
var tr = [
|
|
2419
2426
|
"description",
|
|
2420
2427
|
"fileName",
|
|
@@ -4916,7 +4923,8 @@ var lr = function() {
|
|
|
4916
4923
|
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());
|
|
4917
4924
|
},
|
|
4918
4925
|
doctype: function() {
|
|
4919
|
-
|
|
4926
|
+
var n = this.consume();
|
|
4927
|
+
_(n) && this.transitionTo("beforeDoctypeName");
|
|
4920
4928
|
},
|
|
4921
4929
|
beforeDoctypeName: function() {
|
|
4922
4930
|
var n = this.consume();
|
|
@@ -5340,8 +5348,9 @@ var br = class {
|
|
|
5340
5348
|
}
|
|
5341
5349
|
}, yr = class e {
|
|
5342
5350
|
static synthetic(t) {
|
|
5351
|
+
let r = D.synthetic(t);
|
|
5343
5352
|
return new e({
|
|
5344
|
-
loc:
|
|
5353
|
+
loc: r,
|
|
5345
5354
|
chars: t
|
|
5346
5355
|
});
|
|
5347
5356
|
}
|
|
@@ -5368,15 +5377,17 @@ var br = class {
|
|
|
5368
5377
|
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);
|
|
5369
5378
|
}
|
|
5370
5379
|
static forHbsLoc(t, r) {
|
|
5380
|
+
let s = new mt(t, r.start), n = new mt(t, r.end);
|
|
5371
5381
|
return new oe(t, {
|
|
5372
|
-
start:
|
|
5373
|
-
end:
|
|
5382
|
+
start: s,
|
|
5383
|
+
end: n
|
|
5374
5384
|
}, r).wrap();
|
|
5375
5385
|
}
|
|
5376
5386
|
static forCharPositions(t, r, s) {
|
|
5387
|
+
let n = new Tt(t, r), i = new Tt(t, s);
|
|
5377
5388
|
return new ae(t, {
|
|
5378
|
-
start:
|
|
5379
|
-
end:
|
|
5389
|
+
start: n,
|
|
5390
|
+
end: i
|
|
5380
5391
|
}).wrap();
|
|
5381
5392
|
}
|
|
5382
5393
|
static synthetic(t) {
|
|
@@ -7231,10 +7242,13 @@ function yi(e) {
|
|
|
7231
7242
|
t = Rs(e, bi);
|
|
7232
7243
|
} catch (r) {
|
|
7233
7244
|
let s = Si(r);
|
|
7234
|
-
if (s)
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7245
|
+
if (s) {
|
|
7246
|
+
let n = ki(r);
|
|
7247
|
+
throw qs(n, {
|
|
7248
|
+
loc: s,
|
|
7249
|
+
cause: r
|
|
7250
|
+
});
|
|
7251
|
+
}
|
|
7238
7252
|
throw r;
|
|
7239
7253
|
}
|
|
7240
7254
|
return t;
|
|
@@ -7272,4 +7286,4 @@ exports.default = Do;
|
|
|
7272
7286
|
exports.languages = hs;
|
|
7273
7287
|
exports.parsers = Cr;
|
|
7274
7288
|
exports.printers = vi;
|
|
7275
|
-
//# sourceMappingURL=glimmer-
|
|
7289
|
+
//# sourceMappingURL=glimmer-BuCRLjbI.cjs.map
|