@kubb/core 3.18.2 → 4.0.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-Cluah_Fl.js → FileManager-BDisPxtH.js} +29 -46
- package/dist/FileManager-BDisPxtH.js.map +1 -0
- package/dist/{FileManager-CUd9_ZMA.cjs → FileManager-qDcTVN6G.cjs} +35 -49
- package/dist/FileManager-qDcTVN6G.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-Biw1D1Ce.cjs → acorn-Cg_eXN51.cjs} +15 -37
- package/dist/{acorn-Biw1D1Ce.cjs.map → acorn-Cg_eXN51.cjs.map} +1 -1
- package/dist/{acorn-3HQnxDj2.js → acorn-Z0oy0vSt.js} +15 -37
- package/dist/{acorn-3HQnxDj2.js.map → acorn-Z0oy0vSt.js.map} +1 -1
- package/dist/{angular-n5qYWkcx.js → angular-BUlb_iaU.js} +6 -7
- package/dist/{angular-n5qYWkcx.js.map → angular-BUlb_iaU.js.map} +1 -1
- package/dist/{angular-B3ddRl90.cjs → angular-nBly58h0.cjs} +6 -7
- package/dist/{angular-B3ddRl90.cjs.map → angular-nBly58h0.cjs.map} +1 -1
- package/dist/{babel-BrKqHp9Q.cjs → babel-5qXjvTGO.cjs} +34 -45
- package/dist/{babel-BrKqHp9Q.cjs.map → babel-5qXjvTGO.cjs.map} +1 -1
- package/dist/{babel-mOBF3g2e.js → babel-DfXTN9QX.js} +34 -45
- package/dist/{babel-mOBF3g2e.js.map → babel-DfXTN9QX.js.map} +1 -1
- package/dist/{chunk-DoeelZqw.cjs → chunk-CZg_9w7l.cjs} +3 -1
- package/dist/{chunk-DbvY3SJr.js → chunk-kPDogv7o.js} +3 -1
- package/dist/{estree-QGbwcVbp.js → estree-Bt3vRtV3.js} +6 -9
- package/dist/{estree-QGbwcVbp.js.map → estree-Bt3vRtV3.js.map} +1 -1
- package/dist/{estree-D6ftINJ3.cjs → estree-DyiFjXDy.cjs} +6 -9
- package/dist/{estree-D6ftINJ3.cjs.map → estree-DyiFjXDy.cjs.map} +1 -1
- package/dist/{flow-C1RsRESZ.js → flow-Bb8_yYns.js} +466 -573
- package/dist/{flow-C1RsRESZ.js.map → flow-Bb8_yYns.js.map} +1 -1
- package/dist/{flow-BWEc100n.cjs → flow-DdtBrX0O.cjs} +466 -573
- package/dist/{flow-BWEc100n.cjs.map → flow-DdtBrX0O.cjs.map} +1 -1
- package/dist/{fs-DkMVXz_s.js → fs-BNC5Fj6t.js} +3 -5
- package/dist/{fs-DkMVXz_s.js.map → fs-BNC5Fj6t.js.map} +1 -1
- package/dist/{fs-CeOer54w.cjs → fs-Bi2kuxAm.cjs} +10 -9
- package/dist/{fs-CeOer54w.cjs.map → fs-Bi2kuxAm.cjs.map} +1 -1
- package/dist/fs.cjs +2 -2
- package/dist/fs.d.cts +1 -1
- package/dist/fs.d.ts +1 -1
- package/dist/fs.js +2 -2
- package/dist/{glimmer-CwkHq8v_.cjs → glimmer-BuCRLjbI.cjs} +20 -38
- package/dist/{glimmer-CwkHq8v_.cjs.map → glimmer-BuCRLjbI.cjs.map} +1 -1
- package/dist/{glimmer-DZXQWVfc.js → glimmer-By8WZPkK.js} +20 -38
- package/dist/{glimmer-DZXQWVfc.js.map → glimmer-By8WZPkK.js.map} +1 -1
- package/dist/{graphql-DWNpg5AH.js → graphql-DsrNefXx.js} +3 -4
- package/dist/{graphql-DWNpg5AH.js.map → graphql-DsrNefXx.js.map} +1 -1
- package/dist/{graphql-ftPsRNd8.cjs → graphql-TN0hv-fx.cjs} +3 -4
- package/dist/{graphql-ftPsRNd8.cjs.map → graphql-TN0hv-fx.cjs.map} +1 -1
- package/dist/{html-DMFSHL-z.cjs → html-1W4-2_9J.cjs} +7 -9
- package/dist/{html-DMFSHL-z.cjs.map → html-1W4-2_9J.cjs.map} +1 -1
- package/dist/{html-Lx7YOmUI.js → html-Y5KDc150.js} +7 -9
- package/dist/{html-Lx7YOmUI.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 +42 -44
- 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 +23 -34
- package/dist/index.js.map +1 -1
- package/dist/{logger-M0gDQMDh.js → logger-BKPT4rkB.js} +11 -19
- package/dist/logger-BKPT4rkB.js.map +1 -0
- package/dist/{logger-OgWv9Jyy.cjs → logger-DBJsdlpZ.cjs} +26 -27
- package/dist/logger-DBJsdlpZ.cjs.map +1 -0
- package/dist/logger.cjs +2 -2
- package/dist/logger.js +2 -2
- package/dist/{markdown-BYsFO1cu.cjs → markdown-Bltb-uzO.cjs} +3 -5
- package/dist/{markdown-BYsFO1cu.cjs.map → markdown-Bltb-uzO.cjs.map} +1 -1
- package/dist/{markdown-Dt7fmgWb.js → markdown-Drl4Cbq5.js} +3 -5
- package/dist/{markdown-Dt7fmgWb.js.map → markdown-Drl4Cbq5.js.map} +1 -1
- package/dist/{meriyah-BA-YCwVg.cjs → meriyah-CdG8HPS2.cjs} +3 -5
- package/dist/meriyah-CdG8HPS2.cjs.map +1 -0
- package/dist/{meriyah-CEYm-XS7.js → meriyah-Cz9whwp-.js} +3 -5
- package/dist/meriyah-Cz9whwp-.js.map +1 -0
- package/dist/mocks.cjs +206 -333
- 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 +186 -323
- package/dist/mocks.js.map +1 -1
- package/dist/{postcss-BQcSCAcI.cjs → postcss-B7n9zUIy.cjs} +32 -53
- package/dist/postcss-B7n9zUIy.cjs.map +1 -0
- package/dist/{postcss-CI4qZzdL.js → postcss-Dfx_9buT.js} +32 -53
- package/dist/postcss-Dfx_9buT.js.map +1 -0
- package/dist/{prompt-D3dP3KNu.js → prompt-BMs_Y-vT.js} +5 -8
- package/dist/{prompt-D3dP3KNu.js.map → prompt-BMs_Y-vT.js.map} +1 -1
- package/dist/{prompt-DslNpUPc.cjs → prompt-BXlYKArM.cjs} +14 -13
- package/dist/{prompt-DslNpUPc.cjs.map → prompt-BXlYKArM.cjs.map} +1 -1
- package/dist/{transformers-BL8vcCaM.js → transformers-CXIKOVl0.js} +13 -22
- package/dist/{transformers-BL8vcCaM.js.map → transformers-CXIKOVl0.js.map} +1 -1
- package/dist/{transformers-BUNfHgNe.cjs → transformers-TDFgAyi8.cjs} +15 -23
- package/dist/{transformers-BUNfHgNe.cjs.map → transformers-TDFgAyi8.cjs.map} +1 -1
- package/dist/transformers.cjs +4 -3
- package/dist/transformers.js +1 -1
- package/dist/typescript-BY9-7pw9.js +3 -0
- package/dist/{typescript-eE7YJ2-c.js → typescript-C8iCxnaF.js} +15 -70
- package/dist/{typescript-eE7YJ2-c.js.map → typescript-C8iCxnaF.js.map} +1 -1
- package/dist/{typescript-DDBRxbn7.cjs → typescript-Evf8GXVW.cjs} +15 -70
- package/dist/{typescript-DDBRxbn7.cjs.map → typescript-Evf8GXVW.cjs.map} +1 -1
- package/dist/typescript-PxlX-TH7.cjs +4 -0
- package/dist/utils.cjs +4 -4
- package/dist/utils.d.cts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +4 -4
- package/dist/{write-cvT4uBev.cjs → write-BJfM7G1_.cjs} +11 -10
- package/dist/{write-cvT4uBev.cjs.map → write-BJfM7G1_.cjs.map} +1 -1
- package/dist/{write-CLTPlucv.js → write-O9QWtBJ_.js} +4 -6
- package/dist/{write-CLTPlucv.js.map → write-O9QWtBJ_.js.map} +1 -1
- package/dist/{yaml-v1i11ZlS.cjs → yaml-B2qeXFgu.cjs} +37 -116
- package/dist/yaml-B2qeXFgu.cjs.map +1 -0
- package/dist/{yaml-DZASOrDL.js → yaml-Bi_nSoU_.js} +37 -116
- package/dist/yaml-Bi_nSoU_.js.map +1 -0
- package/package.json +8 -8
- package/src/utils/parser.ts +1 -1
- package/dist/FileManager-CUd9_ZMA.cjs.map +0 -1
- package/dist/FileManager-Cluah_Fl.js.map +0 -1
- package/dist/logger-M0gDQMDh.js.map +0 -1
- package/dist/logger-OgWv9Jyy.cjs.map +0 -1
- package/dist/meriyah-BA-YCwVg.cjs.map +0 -1
- package/dist/meriyah-CEYm-XS7.js.map +0 -1
- package/dist/postcss-BQcSCAcI.cjs.map +0 -1
- package/dist/postcss-CI4qZzdL.js.map +0 -1
- package/dist/typescript-Bq-hjiJ0.js +0 -3
- package/dist/typescript-DvVkagAX.cjs +0 -4
- package/dist/yaml-DZASOrDL.js.map +0 -1
- package/dist/yaml-v1i11ZlS.cjs.map +0 -1
|
@@ -14,8 +14,7 @@ const reader$1 = switcher({
|
|
|
14
14
|
return fs.pathExists(path$1);
|
|
15
15
|
},
|
|
16
16
|
bun: async (path$1) => {
|
|
17
|
-
|
|
18
|
-
return file.exists();
|
|
17
|
+
return Bun.file(path$1).exists();
|
|
19
18
|
}
|
|
20
19
|
}, "node");
|
|
21
20
|
const syncReader$1 = switcher({
|
|
@@ -37,8 +36,7 @@ const reader = switcher({
|
|
|
37
36
|
return fs.readFile(path$1, { encoding: "utf8" });
|
|
38
37
|
},
|
|
39
38
|
bun: async (path$1) => {
|
|
40
|
-
|
|
41
|
-
return file.text();
|
|
39
|
+
return Bun.file(path$1).text();
|
|
42
40
|
}
|
|
43
41
|
}, "node");
|
|
44
42
|
const syncReader = switcher({
|
|
@@ -90,4 +88,4 @@ function trimExtName(text) {
|
|
|
90
88
|
|
|
91
89
|
//#endregion
|
|
92
90
|
export { clean, exists, getRelativePath, read, readSync, trimExtName, types_exports, unlink };
|
|
93
|
-
//# 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,KA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,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,7 +1,10 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const require_chunk = require('./chunk-CZg_9w7l.cjs');
|
|
2
|
+
let node_path = require("node:path");
|
|
3
|
+
node_path = require_chunk.__toESM(node_path);
|
|
4
|
+
let fs_extra = require("fs-extra");
|
|
5
|
+
fs_extra = require_chunk.__toESM(fs_extra);
|
|
6
|
+
let js_runtime = require("js-runtime");
|
|
7
|
+
js_runtime = require_chunk.__toESM(js_runtime);
|
|
5
8
|
|
|
6
9
|
//#region src/fs/clean.ts
|
|
7
10
|
async function clean(path) {
|
|
@@ -15,8 +18,7 @@ const reader$1 = (0, js_runtime.switcher)({
|
|
|
15
18
|
return fs_extra.default.pathExists(path);
|
|
16
19
|
},
|
|
17
20
|
bun: async (path) => {
|
|
18
|
-
|
|
19
|
-
return file.exists();
|
|
21
|
+
return Bun.file(path).exists();
|
|
20
22
|
}
|
|
21
23
|
}, "node");
|
|
22
24
|
const syncReader$1 = (0, js_runtime.switcher)({
|
|
@@ -38,8 +40,7 @@ const reader = (0, js_runtime.switcher)({
|
|
|
38
40
|
return fs_extra.default.readFile(path, { encoding: "utf8" });
|
|
39
41
|
},
|
|
40
42
|
bun: async (path) => {
|
|
41
|
-
|
|
42
|
-
return file.text();
|
|
43
|
+
return Bun.file(path).text();
|
|
43
44
|
}
|
|
44
45
|
}, "node");
|
|
45
46
|
const syncReader = (0, js_runtime.switcher)({
|
|
@@ -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,QA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,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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_fs = require('./fs-
|
|
2
|
-
const require_write = require('./write-
|
|
1
|
+
const require_fs = require('./fs-Bi2kuxAm.cjs');
|
|
2
|
+
const require_write = require('./write-BJfM7G1_.cjs');
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, 'KubbFile', {
|
|
5
5
|
enumerable: true,
|
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-
|
|
2
|
-
import { write } from "./write-
|
|
1
|
+
import { clean, exists, getRelativePath, read, readSync, trimExtName, types_exports, unlink } from "./fs-BNC5Fj6t.js";
|
|
2
|
+
import { write } from "./write-O9QWtBJ_.js";
|
|
3
3
|
|
|
4
4
|
export { types_exports as KubbFile, clean, exists, getRelativePath, read, readSync, trimExtName, unlink, write };
|
|
@@ -310,8 +310,7 @@ function on(e, t = "type") {
|
|
|
310
310
|
}
|
|
311
311
|
return r;
|
|
312
312
|
}
|
|
313
|
-
var
|
|
314
|
-
var Gr = {
|
|
313
|
+
var ln = on({
|
|
315
314
|
Template: ["body"],
|
|
316
315
|
Block: ["body"],
|
|
317
316
|
MustacheStatement: [
|
|
@@ -355,8 +354,7 @@ var Gr = {
|
|
|
355
354
|
UndefinedLiteral: [],
|
|
356
355
|
Hash: ["pairs"],
|
|
357
356
|
HashPair: ["value"]
|
|
358
|
-
};
|
|
359
|
-
var ln = Yr(Gr), Kr = ln;
|
|
357
|
+
}), Kr = ln;
|
|
360
358
|
function St(e) {
|
|
361
359
|
return e.loc.start.offset;
|
|
362
360
|
}
|
|
@@ -2064,7 +2062,7 @@ var In = function() {
|
|
|
2064
2062
|
for (var Ms = function() {
|
|
2065
2063
|
var W;
|
|
2066
2064
|
return W = P.lex() || Lr, typeof W != "number" && (W = k.symbols_[W] || W), W;
|
|
2067
|
-
}, O, Ie, gt, M,
|
|
2065
|
+
}, O, Ie, gt, M, Re, At = {}, he, Z, Dr, pe;;) {
|
|
2068
2066
|
if (gt = g[g.length - 1], this.defaultActions[gt] ? M = this.defaultActions[gt] : ((O === null || typeof O > "u") && (O = Ms()), M = Pt[gt] && Pt[gt][O]), typeof M > "u" || !M.length || !M[0]) {
|
|
2069
2067
|
var qe = "";
|
|
2070
2068
|
pe = [];
|
|
@@ -2106,8 +2104,9 @@ Expecting ` + pe.join(", ") + ", got '" + (this.terminals_[O] || O) + "'" : qe =
|
|
|
2106
2104
|
}
|
|
2107
2105
|
return !0;
|
|
2108
2106
|
}
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2107
|
+
};
|
|
2108
|
+
De.lexer = function() {
|
|
2109
|
+
return {
|
|
2111
2110
|
EOF: 1,
|
|
2112
2111
|
parseError: function(k, g) {
|
|
2113
2112
|
if (this.yy.parser) this.yy.parser.parseError(k, g);
|
|
@@ -2124,8 +2123,7 @@ Expecting ` + pe.join(", ") + ", got '" + (this.terminals_[O] || O) + "'" : qe =
|
|
|
2124
2123
|
input: function() {
|
|
2125
2124
|
var d = this._input[0];
|
|
2126
2125
|
this.yytext += d, this.yyleng++, this.offset++, this.match += d, this.matched += d;
|
|
2127
|
-
|
|
2128
|
-
return k ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), d;
|
|
2126
|
+
return d.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), d;
|
|
2129
2127
|
},
|
|
2130
2128
|
unput: function(d) {
|
|
2131
2129
|
var k = d.length, g = d.split(/(?:\r\n?|\n)/g);
|
|
@@ -2224,15 +2222,13 @@ Expecting ` + pe.join(", ") + ", got '" + (this.terminals_[O] || O) + "'" : qe =
|
|
|
2224
2222
|
});
|
|
2225
2223
|
},
|
|
2226
2224
|
lex: function() {
|
|
2227
|
-
|
|
2228
|
-
return k || this.lex();
|
|
2225
|
+
return this.next() || this.lex();
|
|
2229
2226
|
},
|
|
2230
2227
|
begin: function(k) {
|
|
2231
2228
|
this.conditionStack.push(k);
|
|
2232
2229
|
},
|
|
2233
2230
|
popState: function() {
|
|
2234
|
-
|
|
2235
|
-
return k > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
2231
|
+
return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
2236
2232
|
},
|
|
2237
2233
|
_currentRules: function() {
|
|
2238
2234
|
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
@@ -2420,9 +2416,7 @@ Expecting ` + pe.join(", ") + ", got '" + (this.terminals_[O] || O) + "'" : qe =
|
|
|
2420
2416
|
}
|
|
2421
2417
|
}
|
|
2422
2418
|
};
|
|
2423
|
-
return it;
|
|
2424
2419
|
}();
|
|
2425
|
-
De.lexer = Vs;
|
|
2426
2420
|
function _e() {
|
|
2427
2421
|
this.yy = {};
|
|
2428
2422
|
}
|
|
@@ -2649,9 +2643,9 @@ function Hn(e, t, r) {
|
|
|
2649
2643
|
};
|
|
2650
2644
|
}
|
|
2651
2645
|
function Fn(e, t, r, s, n, i) {
|
|
2652
|
-
var a = s.charAt(3) || s.charAt(2), o = a !== "{" && a !== "&"
|
|
2646
|
+
var a = s.charAt(3) || s.charAt(2), o = a !== "{" && a !== "&";
|
|
2653
2647
|
return {
|
|
2654
|
-
type:
|
|
2648
|
+
type: /\*/.test(s) ? "Decorator" : "MustacheStatement",
|
|
2655
2649
|
path: e,
|
|
2656
2650
|
params: t,
|
|
2657
2651
|
hash: r,
|
|
@@ -2744,12 +2738,11 @@ function Te(e, t) {
|
|
|
2744
2738
|
Se.yy = ks, Se.yy.locInfo = function(s) {
|
|
2745
2739
|
return new ir(t && t.srcName, s);
|
|
2746
2740
|
};
|
|
2747
|
-
|
|
2748
|
-
return r;
|
|
2741
|
+
return Se.parse(e);
|
|
2749
2742
|
}
|
|
2750
2743
|
function ar(e, t) {
|
|
2751
|
-
var r = Te(e, t)
|
|
2752
|
-
return
|
|
2744
|
+
var r = Te(e, t);
|
|
2745
|
+
return new ys(t).accept(r);
|
|
2753
2746
|
}
|
|
2754
2747
|
var Es = {
|
|
2755
2748
|
Aacute: "Á",
|
|
@@ -4927,10 +4920,7 @@ var lr = function() {
|
|
|
4927
4920
|
markupDeclarationOpen: function() {
|
|
4928
4921
|
var n = this.consume();
|
|
4929
4922
|
if (n === "-" && this.peek() === "-") this.consume(), this.transitionTo("commentStart"), this.delegate.beginComment();
|
|
4930
|
-
else
|
|
4931
|
-
var i = n.toUpperCase() + this.input.substring(this.index, this.index + 6).toUpperCase();
|
|
4932
|
-
i === "DOCTYPE" && (this.consume(), this.consume(), this.consume(), this.consume(), this.consume(), this.consume(), this.transitionTo("doctype"), this.delegate.beginDoctype && this.delegate.beginDoctype());
|
|
4933
|
-
}
|
|
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());
|
|
4934
4924
|
},
|
|
4935
4925
|
doctype: function() {
|
|
4936
4926
|
var n = this.consume();
|
|
@@ -5051,8 +5041,7 @@ var lr = function() {
|
|
|
5051
5041
|
_(n) ? (this.consume(), this.transitionTo("beforeAttributeName")) : n === "/" ? (this.consume(), this.transitionTo("selfClosingStartTag")) : n === ">" ? (this.consume(), this.delegate.finishTag(), this.transitionTo("beforeData")) : this.transitionTo("beforeAttributeName");
|
|
5052
5042
|
},
|
|
5053
5043
|
selfClosingStartTag: function() {
|
|
5054
|
-
|
|
5055
|
-
n === ">" ? (this.consume(), this.delegate.markTagAsSelfClosing(), this.delegate.finishTag(), this.transitionTo("beforeData")) : this.transitionTo("beforeAttributeName");
|
|
5044
|
+
this.peek() === ">" ? (this.consume(), this.delegate.markTagAsSelfClosing(), this.delegate.finishTag(), this.transitionTo("beforeData")) : this.transitionTo("beforeAttributeName");
|
|
5056
5045
|
},
|
|
5057
5046
|
endTagOpen: function() {
|
|
5058
5047
|
var n = this.consume();
|
|
@@ -5257,10 +5246,9 @@ function vs(e) {
|
|
|
5257
5246
|
}
|
|
5258
5247
|
vs(Ne.FlushElement);
|
|
5259
5248
|
vs(Ne.GetSymbol);
|
|
5260
|
-
var Xn = !1
|
|
5261
|
-
new RegExp(
|
|
5262
|
-
|
|
5263
|
-
new RegExp(ti.source, "gu");
|
|
5249
|
+
var Xn = !1;
|
|
5250
|
+
new RegExp(/["\x26\xa0]/u.source, "gu");
|
|
5251
|
+
new RegExp(/[&<>\xa0]/u.source, "gu");
|
|
5264
5252
|
var mr = new Set([
|
|
5265
5253
|
"area",
|
|
5266
5254
|
"base",
|
|
@@ -7227,12 +7215,6 @@ function Rs(e, t = {}) {
|
|
|
7227
7215
|
if ((p = t.plugins) != null && p.ast) for (let m of t.plugins.ast) ci(o, m(Ze({}, t, { syntax: hi }, { plugins: void 0 })).visitor);
|
|
7228
7216
|
return o;
|
|
7229
7217
|
}
|
|
7230
|
-
var pi = {
|
|
7231
|
-
resolution: () => Ne.GetStrictKeyword,
|
|
7232
|
-
serialize: () => "Strict",
|
|
7233
|
-
isAngleBracket: !1
|
|
7234
|
-
};
|
|
7235
|
-
({ ...pi });
|
|
7236
7218
|
function fi(e, t) {
|
|
7237
7219
|
let r = /* @__PURE__ */ new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
|
|
7238
7220
|
return Object.assign(r, t);
|
|
@@ -7304,4 +7286,4 @@ exports.default = Do;
|
|
|
7304
7286
|
exports.languages = hs;
|
|
7305
7287
|
exports.parsers = Cr;
|
|
7306
7288
|
exports.printers = vi;
|
|
7307
|
-
//# sourceMappingURL=glimmer-
|
|
7289
|
+
//# sourceMappingURL=glimmer-BuCRLjbI.cjs.map
|