@kubb/core
Advanced tools
@@ -1,3 +0,3 @@ | ||
import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-B9Q-ztmj.js'; | ||
export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource, p as processFiles } from './FileManager-B9Q-ztmj.js'; | ||
import { P as PluginContext, F as FileManager, a as PluginManager, U as UserConfig, C as Config, I as InputPath, b as PluginFactoryOptions, c as UserPluginWithLifeCycle } from './FileManager-BXCK_2OY.js'; | ||
export { B as BarrelType, d as FileMetaBase, G as GetPluginFactoryOptions, o as Group, e as InputData, O as Output, i as Plugin, f as PluginKey, k as PluginLifecycle, l as PluginLifecycleHooks, m as PluginParameter, j as PluginWithLifeCycle, n as ResolveNameParams, R as ResolvePathParams, h as UserPlugin, g as getSource, p as processFiles } from './FileManager-BXCK_2OY.js'; | ||
import { L as Logger } from './logger-DvbHXjIO.js'; | ||
@@ -4,0 +4,0 @@ import { PossiblePromise } from '@kubb/types'; |
@@ -1,6 +0,6 @@ | ||
import { EventEmitter, createLogger } from './chunk-HTOO3HNK.js'; | ||
import { FileManager, setUniqueName, processFiles, URLPath } from './chunk-44OM74QT.js'; | ||
export { FileManager, getSource, processFiles } from './chunk-44OM74QT.js'; | ||
import { EventEmitter, createLogger } from './chunk-OL5US75J.js'; | ||
import { FileManager, setUniqueName, processFiles, URLPath } from './chunk-7MZNPFPN.js'; | ||
export { FileManager, getSource, processFiles } from './chunk-7MZNPFPN.js'; | ||
import { trim, transformReservedWord } from './chunk-MDXPT7LL.js'; | ||
import './chunk-HBQM723K.js'; | ||
import './chunk-3CLNO5VR.js'; | ||
import { getRelativePath, read, readSync, clean } from '@kubb/fs'; | ||
@@ -160,2 +160,8 @@ import path, { resolve, join } from 'node:path'; | ||
} | ||
getOptions({ pluginKey }) { | ||
const plugins = [...this.plugins]; | ||
plugins.find((plugin) => { | ||
return plugin.key === pluginKey; | ||
}); | ||
} | ||
getFile({ name, mode, extname, pluginKey, options }) { | ||
@@ -162,0 +168,0 @@ const baseName = `${name}${extname}`; |
@@ -1,4 +0,4 @@ | ||
export { LogMapper, createLogger, randomCliColour, randomColour } from './chunk-HTOO3HNK.js'; | ||
import './chunk-HBQM723K.js'; | ||
export { LogMapper, createLogger, randomCliColour, randomColour } from './chunk-OL5US75J.js'; | ||
import './chunk-3CLNO5VR.js'; | ||
//# sourceMappingURL=logger.js.map | ||
//# sourceMappingURL=logger.js.map |
import { ResolvedFile, File } from '@kubb/fs/types'; | ||
import { a as PluginManager } from './FileManager-B9Q-ztmj.js'; | ||
import { a as PluginManager } from './FileManager-BXCK_2OY.js'; | ||
import { L as Logger } from './logger-DvbHXjIO.js'; | ||
@@ -4,0 +4,0 @@ import '@kubb/fs'; |
@@ -1,2 +0,2 @@ | ||
import { getSource, createFile } from './chunk-44OM74QT.js'; | ||
import { getSource, createFile } from './chunk-7MZNPFPN.js'; | ||
import { camelCase, pascalCase } from './chunk-MDXPT7LL.js'; | ||
@@ -3,0 +3,0 @@ import path from 'node:path'; |
@@ -101,3 +101,6 @@ import { PossiblePromise } from '@kubb/types'; | ||
*/ | ||
toTemplateString(replacer?: (pathParam: string) => string): string; | ||
toTemplateString({ prefix, replacer }?: { | ||
prefix?: string; | ||
replacer?: (pathParam: string) => string; | ||
}): string; | ||
getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined; | ||
@@ -104,0 +107,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
export { FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from './chunk-44OM74QT.js'; | ||
export { FunctionParams, URLPath, createFile, createFileExport, createFileImport, createFileParser, getFileParser, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, setUniqueName, timeout } from './chunk-7MZNPFPN.js'; | ||
import './chunk-MDXPT7LL.js'; | ||
//# sourceMappingURL=utils.js.map | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@kubb/core", | ||
"version": "0.0.0-canary-20241214150347", | ||
"version": "0.0.0-canary-20250108203132", | ||
"description": "Generator core", | ||
@@ -83,8 +83,8 @@ "keywords": [ | ||
"p-queue": "^8.0.1", | ||
"remeda": "^2.17.4", | ||
"remeda": "^2.19.0", | ||
"seedrandom": "^3.0.5", | ||
"semver": "^7.6.3", | ||
"@kubb/fs": "0.0.0-canary-20241214150347", | ||
"@kubb/parser-ts": "0.0.0-canary-20241214150347", | ||
"@kubb/types": "0.0.0-canary-20241214150347" | ||
"@kubb/fs": "0.0.0-canary-20250108203132", | ||
"@kubb/parser-ts": "0.0.0-canary-20250108203132", | ||
"@kubb/types": "0.0.0-canary-20250108203132" | ||
}, | ||
@@ -95,3 +95,3 @@ "devDependencies": { | ||
"@types/semver": "^7.5.8", | ||
"consola": "^3.2.3", | ||
"consola": "^3.3.3", | ||
"prettier": "^3.4.2", | ||
@@ -101,4 +101,4 @@ "tinyrainbow": "^1.2.0", | ||
"typescript": "^5.7.2", | ||
"@kubb/config-ts": "0.0.0-canary-20241214150347", | ||
"@kubb/config-tsup": "0.0.0-canary-20241214150347" | ||
"@kubb/config-ts": "0.0.0-canary-20250108203132", | ||
"@kubb/config-tsup": "0.0.0-canary-20250108203132" | ||
}, | ||
@@ -105,0 +105,0 @@ "engines": { |
@@ -205,3 +205,6 @@ import { extname, join, relative } from 'node:path' | ||
return parser.format(source) | ||
return parser.format(source).catch((err) => { | ||
console.warn(err) | ||
return source | ||
}) | ||
} | ||
@@ -208,0 +211,0 @@ |
@@ -68,2 +68,5 @@ import { FileManager } from './FileManager.ts' | ||
} | ||
type GetOptionsProps<TOptions = object> = { | ||
pluginKey: Plugin['key'] | ||
} | ||
@@ -115,2 +118,10 @@ export class PluginManager { | ||
getOptions<TOptions = object>({ pluginKey }: GetOptionsProps<TOptions>) { | ||
const plugins = [...this.plugins] | ||
plugins.find((plugin) => { | ||
return plugin.key === pluginKey | ||
}) | ||
} | ||
getFile<TOptions = object>({ name, mode, extname, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{ pluginKey: Plugin['key'] }> { | ||
@@ -117,0 +128,0 @@ const baseName = `${name}${extname}` as const |
@@ -96,3 +96,3 @@ import path from 'node:path' | ||
name: item.name, | ||
path: options.extname && hasExtname ? `${trimExtName(importPath)}${options.extname}` : trimExtName(importPath), | ||
path: options.extname && hasExtname ? `${trimExtName(importPath)}${options.extname}` : item.root ? trimExtName(importPath) : importPath, | ||
isTypeOnly: item.isTypeOnly, | ||
@@ -99,0 +99,0 @@ }) |
@@ -66,3 +66,3 @@ import { camelCase, isValidVarName } from '../transformers' | ||
const object = { | ||
url: type === 'path' ? this.toURLPath() : this.toTemplateString(replacer), | ||
url: type === 'path' ? this.toURLPath() : this.toTemplateString({ replacer }), | ||
params: this.getParams(), | ||
@@ -92,3 +92,3 @@ } | ||
*/ | ||
toTemplateString(replacer?: (pathParam: string) => string): string { | ||
toTemplateString({ prefix = '', replacer }: { prefix?: string; replacer?: (pathParam: string) => string } = {}): string { | ||
const regex = /{(\w|-)*}/g | ||
@@ -112,3 +112,3 @@ const found = this.path.match(regex) | ||
return `\`${newPath}\`` | ||
return `\`${prefix}${newPath}\`` | ||
} | ||
@@ -115,0 +115,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1510948
4.02%14880
2.27%10
-44.44%3
50%