@kubb/fabric-core 0.11.7 → 0.12.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/{Fabric-BoTE1-WX.d.cts → Fabric-BbVC650D.d.cts} +86 -15
- package/dist/{Fabric-CWquRFa2.d.ts → Fabric-eh92yS1R.d.ts} +86 -15
- package/dist/Root-BT59jU0W.js +931 -0
- package/dist/Root-BT59jU0W.js.map +1 -0
- package/dist/Root-SC_lWG_q.cjs +1057 -0
- package/dist/Root-SC_lWG_q.cjs.map +1 -0
- package/dist/{defaultParser-CFIT3sEE.cjs → defaultParser-2ym3KiZd.cjs} +3 -4
- package/dist/{defaultParser-CFIT3sEE.cjs.map → defaultParser-2ym3KiZd.cjs.map} +1 -1
- package/dist/{defaultParser-DZ2kzujH.js → defaultParser-DDFR9BTS.js} +2 -2
- package/dist/{defaultParser-DZ2kzujH.js.map → defaultParser-DDFR9BTS.js.map} +1 -1
- package/dist/{getRelativePath-y7WcYR5C.js → getRelativePath-COUEoqbz.js} +11 -2
- package/dist/getRelativePath-COUEoqbz.js.map +1 -0
- package/dist/{getRelativePath-BllDunh0.cjs → getRelativePath-jYLCpluV.cjs} +16 -1
- package/dist/getRelativePath-jYLCpluV.cjs.map +1 -0
- package/dist/index.cjs +129 -448
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -90
- package/dist/index.d.ts +54 -90
- package/dist/index.js +92 -416
- package/dist/index.js.map +1 -1
- package/dist/parsers/typescript.cjs +7 -107
- package/dist/parsers/typescript.d.cts +1 -1
- package/dist/parsers/typescript.d.ts +1 -1
- package/dist/parsers/typescript.js +2 -101
- package/dist/parsers.cjs +7 -8
- package/dist/parsers.cjs.map +1 -1
- package/dist/parsers.d.cts +1 -1
- package/dist/parsers.d.ts +1 -1
- package/dist/parsers.js +3 -3
- package/dist/plugins.cjs +103 -9
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.cts +32 -9
- package/dist/plugins.d.ts +32 -9
- package/dist/plugins.js +96 -3
- package/dist/plugins.js.map +1 -1
- package/dist/types-BI7rICUP.d.cts +31 -0
- package/dist/types-DpITKjSb.d.ts +32 -0
- package/dist/types.cjs +6 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +4 -3
- package/dist/types.d.ts +4 -3
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typescriptParser-DyosyI_A.js +101 -0
- package/dist/typescriptParser-DyosyI_A.js.map +1 -0
- package/dist/typescriptParser-qjzb2pIh.cjs +137 -0
- package/dist/typescriptParser-qjzb2pIh.cjs.map +1 -0
- package/dist/{TreeNode-DomNP5og.d.cts → useNodeTree-CmXKaRqq.d.cts} +10 -3
- package/dist/{TreeNode-C1VnIF0o.d.ts → useNodeTree-DUdlgys5.d.ts} +10 -3
- package/package.json +3 -2
- package/src/Fabric.ts +13 -5
- package/src/KubbFile.ts +3 -11
- package/src/components/App.ts +6 -5
- package/src/components/Br.ts +11 -0
- package/src/components/Const.ts +6 -5
- package/src/components/Dedent.ts +10 -0
- package/src/components/File.ts +21 -16
- package/src/components/Function.ts +17 -13
- package/src/components/Indent.ts +7 -0
- package/src/components/Root.ts +6 -5
- package/src/components/Type.ts +6 -5
- package/src/components/__snapshots__/arrow_function_with_generics.ts +3 -3
- package/src/components/__snapshots__/async_arrow_function.ts +3 -3
- package/src/components/__snapshots__/async_function.ts +2 -2
- package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +2 -2
- package/src/components/__snapshots__/basic_arrow_function.ts +3 -3
- package/src/components/__snapshots__/basic_export.ts +1 -0
- package/src/components/__snapshots__/basic_function.ts +2 -2
- package/src/components/__snapshots__/basic_import.ts +1 -0
- package/src/components/__snapshots__/default_exported_arrow_function.ts +3 -3
- package/src/components/__snapshots__/default_exported_function.ts +2 -2
- package/src/components/__snapshots__/exported_arrow_function.ts +3 -3
- package/src/components/__snapshots__/exported_function.ts +2 -2
- package/src/components/__snapshots__/function_with_JSDoc.ts +2 -2
- package/src/components/__snapshots__/function_with_generics.ts +2 -2
- package/src/components/__snapshots__/function_with_parameters.ts +2 -2
- package/src/components/__snapshots__/function_with_return_type.ts +2 -2
- package/src/components/__snapshots__/matches_with_root_import.ts +1 -0
- package/src/components/__snapshots__/named_export.ts +1 -0
- package/src/components/__snapshots__/named_export_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_import.ts +1 -0
- package/src/components/__snapshots__/named_import_(object).ts +1 -0
- package/src/components/__snapshots__/named_import_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_typed_export.ts +1 -0
- package/src/components/__snapshots__/named_typed_import.ts +1 -0
- package/src/components/__snapshots__/typed_export.ts +1 -0
- package/src/components/__snapshots__/typed_import.ts +1 -0
- package/src/contexts/RenderContext.ts +13 -0
- package/src/createComponent.ts +34 -0
- package/src/index.ts +9 -9
- package/src/intrinsic.ts +143 -0
- package/src/plugins/fsxPlugin/Runtime.ts +96 -0
- package/src/plugins/fsxPlugin/fsxPlugin.ts +45 -0
- package/src/plugins/index.ts +1 -0
- package/src/types.ts +4 -1
- package/dist/TreeNode-CC3a0Bae.js +0 -447
- package/dist/TreeNode-CC3a0Bae.js.map +0 -1
- package/dist/TreeNode-CFchatCw.cjs +0 -494
- package/dist/TreeNode-CFchatCw.cjs.map +0 -1
- package/dist/defineParser-CVCxqqzB.cjs +0 -18
- package/dist/defineParser-CVCxqqzB.cjs.map +0 -1
- package/dist/defineParser-Lco7nlj0.js +0 -13
- package/dist/defineParser-Lco7nlj0.js.map +0 -1
- package/dist/getRelativePath-BllDunh0.cjs.map +0 -1
- package/dist/getRelativePath-y7WcYR5C.js.map +0 -1
- package/dist/parsers/typescript.cjs.map +0 -1
- package/dist/parsers/typescript.js.map +0 -1
- package/dist/types-DYepTJ6F.d.cts +0 -82
- package/dist/types-yNaQHNUB.d.ts +0 -83
- package/src/components/Text.ts +0 -27
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["e","NodeEventEmitter","defaultParser","createFile","trimExtName","TreeNode","e","isFunction"],"sources":["../src/context.ts","../src/composables/useContext.ts","../src/contexts/NodeTreeContext.ts","../src/composables/useNodeTree.ts","../src/contexts/AppContext.ts","../../../node_modules/.pnpm/remeda@2.33.4/node_modules/remeda/dist/isFunction.js","../src/utils/AsyncEventEmitter.ts","../src/FileProcessor.ts","../src/utils/Cache.ts","../src/FileManager.ts","../src/contexts/RootContext.ts","../src/components/Text.ts","../src/components/App.ts","../src/utils/createJSDoc.ts","../src/components/Const.ts","../src/contexts/FileContext.ts","../src/composables/useFile.ts","../src/composables/useFileManager.ts","../src/components/File.ts","../src/components/Function.ts","../src/components/Root.ts","../src/components/Type.ts","../src/composables/useApp.ts","../src/composables/useLifecycle.ts","../src/createFabric.ts"],"sourcesContent":["/**\n * Context type that carries type information about its value\n * This is a branded symbol type that enables type-safe context usage\n */\nexport type Context<T> = symbol & { readonly __type: T }\n\n/**\n * Context stack for tracking the current context values\n *\n * Note: This uses a global Map for simplicity in code generation scenarios.\n * For concurrent runtime execution, consider using AsyncLocalStorage or\n * instance-based context management.\n */\nconst contextStack = new Map<symbol, unknown[]>()\nconst contextDefaults = new Map<symbol, unknown>()\n\n/**\n * Provides a value to descendant components (Vue 3 style)\n *\n * @example\n * ```ts\n * const ThemeKey = Symbol('theme')\n * provide(ThemeKey, { color: 'blue' })\n * ```\n */\nexport function provide<T>(key: symbol | Context<T>, value: T): void {\n if (!contextStack.has(key)) {\n contextStack.set(key, [])\n }\n contextStack.get(key)!.push(value)\n}\n\n/**\n * Injects a value provided by an ancestor component (Vue 3 style)\n *\n * @example\n * ```ts\n * const theme = inject(ThemeKey, { color: 'default' })\n * ```\n */\nexport function inject<T>(key: symbol | Context<T>, defaultValue?: T): T {\n const stack = contextStack.get(key)\n if (!stack || stack.length === 0) {\n if (defaultValue !== undefined) {\n return defaultValue\n }\n const storedDefault = contextDefaults.get(key)\n if (storedDefault !== undefined) {\n return storedDefault as T\n }\n throw new Error(`No value provided for key: ${key.toString()}`)\n }\n return stack[stack.length - 1] as T\n}\n\n/**\n * Unprovides a value (for cleanup)\n * @internal\n */\nexport function unprovide<T>(key: symbol | Context<T>): void {\n const stack = contextStack.get(key)\n if (stack && stack.length > 0) {\n stack.pop()\n }\n}\n\n/**\n * Creates a context key with a default value (React-style compatibility)\n *\n * @example\n * ```ts\n * const ThemeContext = createContext({ color: 'blue' })\n * // ThemeContext is now typed as Context<{ color: string }>\n * const theme = useContext(ThemeContext) // theme is { color: string }\n * ```\n */\nexport function createContext<T>(defaultValue: T): Context<T> {\n const key = Symbol('context') as Context<T>\n contextDefaults.set(key, defaultValue)\n\n return key\n}\n","import type { Context } from '../context.ts'\nimport { inject } from '../context.ts'\n\n/**\n * React-style alias for inject\n *\n * @example\n * ```ts\n * const theme = useContext(ThemeContext) // type is inferred from ThemeContext\n * ```\n */\nexport function useContext<T>(key: Context<T>): T\nexport function useContext<T, TValue = T>(key: Context<T>, defaultValue: TValue): NonNullable<T> | TValue\nexport function useContext<T>(key: Context<T>, defaultValue?: T): T {\n return inject(key, defaultValue)\n}\n","import type { ComponentNode } from '../composables/useNodeTree.ts'\nimport { createContext } from '../context.ts'\nimport type { TreeNode } from '../utils/TreeNode.ts'\n\n/**\n * Context for having the current NodeTree\n */\nexport const NodeTreeContext = createContext<TreeNode<ComponentNode> | null>(null)\n","import { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport type { TreeNode } from '../utils/TreeNode.ts'\nimport { useContext } from './useContext.ts'\n\nexport type ComponentNode = {\n type: string\n props: Record<string, unknown>\n}\n\nexport function useNodeTree(): TreeNode<ComponentNode> | null {\n return useContext(NodeTreeContext)\n}\n","import { createContext } from '../context.ts'\n\nexport type AppContextProps<TMeta extends object = object> = {\n /**\n * Exit (unmount)\n */\n exit: (error?: Error) => void\n meta: TMeta\n}\n\n/**\n * Provides app-level metadata and lifecycle hooks (like `exit`) to\n * components and composables within a Fabric runtime.\n */\nexport const AppContext = createContext<AppContextProps>({\n exit: () => {},\n meta: {},\n})\n","const e=e=>typeof e==`function`;export{e as isFunction};\n//# sourceMappingURL=isFunction.js.map","import { EventEmitter as NodeEventEmitter } from 'node:events'\nimport type { FabricMode } from '../Fabric.ts'\n\ntype Options = {\n mode?: FabricMode\n maxListener?: number\n}\n\nexport class AsyncEventEmitter<TEvents extends Record<string, any>> {\n constructor({ maxListener = 100, mode = 'sequential' }: Options = {}) {\n this.#emitter.setMaxListeners(maxListener)\n this.#mode = mode\n }\n\n #emitter = new NodeEventEmitter()\n #mode: FabricMode\n\n async emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void> {\n const listeners = this.#emitter.listeners(eventName) as Array<(...args: TEvents[TEventName]) => any>\n\n if (listeners.length === 0) {\n return\n }\n\n const errors: Error[] = []\n\n if (this.#mode === 'sequential') {\n // Run listeners one by one, in order\n for (const listener of listeners) {\n try {\n await listener(...eventArgs)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n errors.push(error)\n }\n }\n } else {\n // Run all listeners concurrently\n const promises = listeners.map(async (listener) => {\n try {\n await listener(...eventArgs)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n errors.push(error)\n }\n })\n await Promise.all(promises)\n }\n\n if (errors.length === 1) {\n throw errors[0]\n }\n\n if (errors.length > 1) {\n throw new AggregateError(errors, `Errors in async listeners for \"${eventName}\"`)\n }\n }\n\n on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void {\n this.#emitter.on(eventName, handler as any)\n }\n\n onOnce<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArgs: TEvents[TEventName]) => void): void {\n const wrapper = (...args: TEvents[TEventName]) => {\n this.off(eventName, wrapper)\n handler(...args)\n }\n this.on(eventName, wrapper)\n }\n\n off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void {\n this.#emitter.off(eventName, handler as any)\n }\n\n removeAll(): void {\n this.#emitter.removeAllListeners()\n }\n}\n","import pLimit from 'p-limit'\nimport type { FabricEvents, FabricMode } from './Fabric.ts'\nimport type * as KubbFile from './KubbFile.ts'\nimport { defaultParser } from './parsers/defaultParser.ts'\nimport type { Parser } from './parsers/types.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\n\nexport type ProcessFilesProps = {\n parsers?: Map<KubbFile.Extname, Parser>\n extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>\n dryRun?: boolean\n /**\n * @default 'sequential'\n */\n mode?: FabricMode\n}\n\ntype GetParseOptions = {\n parsers?: Map<KubbFile.Extname, Parser>\n extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>\n}\n\ntype Options = {\n events?: AsyncEventEmitter<FabricEvents>\n}\n\nexport class FileProcessor {\n #limit = pLimit(100)\n events: AsyncEventEmitter<FabricEvents>\n\n constructor({ events = new AsyncEventEmitter<FabricEvents>() }: Options = {}) {\n this.events = events\n\n return this\n }\n\n async parse(file: KubbFile.ResolvedFile, { parsers, extension }: GetParseOptions = {}): Promise<string> {\n const parseExtName = extension?.[file.extname] || undefined\n\n if (!parsers) {\n console.warn('No parsers provided, using default parser. If you want to use a specific parser, please provide it in the options.')\n\n return defaultParser.parse(file, { extname: parseExtName })\n }\n\n if (!file.extname) {\n return defaultParser.parse(file, { extname: parseExtName })\n }\n\n const parser = parsers.get(file.extname)\n\n if (!parser) {\n return defaultParser.parse(file, { extname: parseExtName })\n }\n\n return parser.parse(file, { extname: parseExtName })\n }\n\n async run(\n files: Array<KubbFile.ResolvedFile>,\n { parsers, mode = 'sequential', dryRun, extension }: ProcessFilesProps = {},\n ): Promise<KubbFile.ResolvedFile[]> {\n await this.events.emit('files:processing:start', files)\n\n const total = files.length\n let processed = 0\n\n const processOne = async (resolvedFile: KubbFile.ResolvedFile, index: number) => {\n await this.events.emit('file:processing:start', resolvedFile, index, total)\n\n const source = dryRun ? undefined : await this.parse(resolvedFile, { extension, parsers })\n\n const currentProcessed = ++processed\n const percentage = (currentProcessed / total) * 100\n\n await this.events.emit('file:processing:update', {\n file: resolvedFile,\n source,\n processed: currentProcessed,\n percentage,\n total,\n })\n\n await this.events.emit('file:processing:end', resolvedFile, index, total)\n }\n\n if (mode === 'sequential') {\n async function* asyncFiles() {\n for (let index = 0; index < files.length; index++) {\n yield [files[index], index] as const\n }\n }\n\n for await (const [file, index] of asyncFiles()) {\n if (file) {\n await processOne(file, index)\n }\n }\n } else {\n const promises = files.map((resolvedFile, index) => this.#limit(() => processOne(resolvedFile, index)))\n await Promise.all(promises)\n }\n\n await this.events.emit('files:processing:end', files)\n\n return files\n }\n}\n","export class Cache<T> {\n #buffer = new Map<string, T>()\n\n get(key: string): T | null {\n return this.#buffer.get(key) ?? null\n }\n\n set(key: string, value: T): void {\n this.#buffer.set(key, value)\n }\n\n delete(key: string): void {\n this.#buffer.delete(key)\n }\n\n clear(): void {\n this.#buffer.clear()\n }\n\n keys(): string[] {\n return [...this.#buffer.keys()]\n }\n\n values(): Array<T> {\n return [...this.#buffer.values()]\n }\n\n flush(): void {\n // No-op for base cache\n }\n}\n","import { orderBy } from 'natural-orderby'\nimport { createFile } from './createFile.ts'\nimport type { FabricEvents } from './Fabric.ts'\nimport { FileProcessor, type ProcessFilesProps } from './FileProcessor.ts'\nimport type * as KubbFile from './KubbFile.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\nimport { Cache } from './utils/Cache.ts'\nimport { trimExtName } from './utils/trimExtName.ts'\n\nfunction mergeFile<TMeta extends object = object>(a: KubbFile.File<TMeta>, b: KubbFile.File<TMeta>): KubbFile.File<TMeta> {\n return {\n ...a,\n sources: [...(a.sources || []), ...(b.sources || [])],\n imports: [...(a.imports || []), ...(b.imports || [])],\n exports: [...(a.exports || []), ...(b.exports || [])],\n }\n}\n\ntype Options = {\n events?: AsyncEventEmitter<FabricEvents>\n}\n\nexport class FileManager {\n #cache = new Cache<KubbFile.ResolvedFile>()\n #filesCache: Array<KubbFile.ResolvedFile> | null = null\n events: AsyncEventEmitter<FabricEvents>\n processor: FileProcessor\n\n constructor({ events = new AsyncEventEmitter<FabricEvents>() }: Options = {}) {\n this.processor = new FileProcessor({ events })\n\n this.events = events\n return this\n }\n\n #resolvePath(file: KubbFile.File): KubbFile.File {\n this.events.emit('file:resolve:path', file)\n\n return file\n }\n\n #resolveName(file: KubbFile.File): KubbFile.File {\n this.events.emit('file:resolve:name', file)\n\n return file\n }\n\n add(...files: Array<KubbFile.File>): Array<KubbFile.ResolvedFile> {\n const resolvedFiles: Array<KubbFile.ResolvedFile> = []\n\n const mergedFiles = new Map<string, KubbFile.File>()\n\n files.forEach((file) => {\n const existing = mergedFiles.get(file.path)\n if (existing) {\n mergedFiles.set(file.path, mergeFile(existing, file))\n } else {\n mergedFiles.set(file.path, file)\n }\n })\n\n for (let file of mergedFiles.values()) {\n file = this.#resolveName(file)\n file = this.#resolvePath(file)\n\n const resolvedFile = createFile(file)\n\n this.#cache.set(resolvedFile.path, resolvedFile)\n this.flush()\n\n resolvedFiles.push(resolvedFile)\n }\n\n this.events.emit('files:added', resolvedFiles)\n\n return resolvedFiles\n }\n\n upsert(...files: Array<KubbFile.File>): Array<KubbFile.ResolvedFile> {\n const resolvedFiles: Array<KubbFile.ResolvedFile> = []\n\n const mergedFiles = new Map<string, KubbFile.File>()\n\n files.forEach((file) => {\n const existing = mergedFiles.get(file.path)\n if (existing) {\n mergedFiles.set(file.path, mergeFile(existing, file))\n } else {\n mergedFiles.set(file.path, file)\n }\n })\n\n for (let file of mergedFiles.values()) {\n const existing = this.#cache.get(file.path)\n\n file = this.#resolveName(file)\n file = this.#resolvePath(file)\n\n const merged = existing ? mergeFile(existing, file) : file\n const resolvedFile = createFile(merged)\n\n this.#cache.set(resolvedFile.path, resolvedFile)\n this.flush()\n\n resolvedFiles.push(resolvedFile)\n }\n\n this.events.emit('files:added', resolvedFiles)\n\n return resolvedFiles\n }\n\n flush() {\n this.#filesCache = null\n this.#cache.flush()\n }\n\n getByPath(path: KubbFile.Path): KubbFile.ResolvedFile | null {\n return this.#cache.get(path)\n }\n\n deleteByPath(path: KubbFile.Path): void {\n this.#cache.delete(path)\n this.#filesCache = null\n }\n\n clear(): void {\n this.#cache.clear()\n this.#filesCache = null\n }\n\n get files(): Array<KubbFile.ResolvedFile> {\n if (this.#filesCache) {\n return this.#filesCache\n }\n\n const cachedKeys = this.#cache.keys()\n\n // order by path length and if file is a barrel file\n const keys = orderBy(cachedKeys, [(v) => v.length, (v) => trimExtName(v).endsWith('index')])\n\n const files: Array<KubbFile.ResolvedFile> = []\n\n for (const key of keys) {\n const file = this.#cache.get(key)\n if (file) {\n files.push(file)\n }\n }\n\n this.#filesCache = files\n\n return files\n }\n\n //TODO add test and check if write of FileManager contains the newly added file\n async write(options: ProcessFilesProps): Promise<KubbFile.ResolvedFile[]> {\n await this.events.emit('files:writing:start', this.files)\n\n const resolvedFiles = await this.processor.run(this.files, options)\n\n this.clear()\n\n await this.events.emit('files:writing:end', resolvedFiles)\n\n return resolvedFiles\n }\n}\n","import type { ComponentNode } from '../composables/useNodeTree.ts'\nimport { createContext } from '../context.ts'\nimport { FileManager } from '../FileManager.ts'\nimport { TreeNode } from '../utils/TreeNode.ts'\n\nexport type RootContextProps = {\n /**\n * Exit (unmount) the whole app.\n */\n exit: (error?: Error) => void\n /**\n * TreeNode representing the tree structure of the app.\n */\n treeNode: TreeNode<ComponentNode>\n /**\n * FileManager instance for managing files within the app.\n */\n fileManager: FileManager\n}\n\n/**\n * Context providing root-level functionalities such as exit hook, tree node structure, and file management.\n * Define in the `render` helper of the runtime.\n */\nexport const RootContext = createContext<RootContextProps>({\n exit: () => {},\n treeNode: new TreeNode({ type: 'Root', props: {} }),\n fileManager: new FileManager(),\n})\n","type Props = {\n /**\n * Children nodes.\n */\n children?: string | (() => string | Array<string> | undefined)\n}\n\n/**\n * Generates a text node from string or function returning string/array of strings.\n */\nexport function Text({ children }: Props): string {\n if (!children) {\n return ''\n }\n\n if (typeof children === 'string') {\n return children\n }\n\n const value = children()\n\n if (Array.isArray(value)) {\n return value.join('\\n')\n }\n\n return value || ''\n}\n","import { useContext } from '../composables/useContext.ts'\nimport { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { AppContext } from '../contexts/AppContext.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { RootContext } from '../contexts/RootContext.ts'\nimport { Text } from './Text.ts'\n\nexport type AppProps<TMeta extends Object = Object> = {\n /**\n * Metadata associated with the App.\n */\n meta?: TMeta\n /**\n * Children nodes.\n */\n children?: string | (() => string | Array<string>)\n}\n\n/**\n * App container containing the AppContext carrying `meta` and an `exit` hook.\n */\nexport function App<TMeta extends Object = Object>({ children, ...props }: AppProps<TMeta>): string {\n const { meta = {} } = props\n\n const { exit } = useContext(RootContext)\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'App', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n provide(AppContext, { exit, meta })\n\n return Text({ children })\n}\n\nApp.displayName = 'KubbApp'\n","/**\n * Create JSDoc comment block from comments array\n */\nexport function createJSDoc({ comments }: { comments: string[] }): string {\n if (!comments || comments.length === 0) return ''\n\n const lines = comments\n .flatMap((c) => String(c ?? '').split(/\\r?\\n/))\n .map((l) => l.replace(/\\*\\//g, '*\\\\/').replace(/\\r/g, ''))\n .filter((l) => l.trim().length > 0)\n\n if (lines.length === 0) return ''\n\n return ['/**', ...lines.map((l) => ` * ${l}`), ' */'].join('\\n')\n}\n","import { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport type { JSDoc } from '../types.ts'\nimport { createJSDoc } from '../utils/createJSDoc.ts'\nimport { Text } from './Text.ts'\n\nexport type ConstProps = {\n /**\n * Name of the const\n */\n name: string\n /**\n * Does this type need to be exported.\n */\n export?: boolean\n /**\n * Type to make the const being typed\n */\n type?: string\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n /**\n * Use of `const` assertions\n */\n asConst?: boolean\n /**\n * Children nodes.\n */\n children?: string\n}\n\n/**\n * Generates a TypeScript constant declaration.\n */\nexport function Const({ children, ...props }: ConstProps): string {\n const { name, export: canExport, type, JSDoc, asConst } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'Const', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n let result = ''\n\n if (JSDoc?.comments) {\n result += createJSDoc({ comments: JSDoc.comments })\n result += '\\n'\n }\n\n if (canExport) {\n result += 'export '\n }\n\n result += `const ${name}`\n\n if (type) {\n result += `: ${type}`\n }\n\n result += ` = ${children ? children : ''}`\n\n if (asConst) {\n result += ' as const'\n }\n\n return Text({ children: result })\n}\n\nConst.displayName = 'KubbConst'\n","import { createContext } from '../context.ts'\nimport type * as KubbFile from '../KubbFile.ts'\n\n/**\n * Provides app-level metadata and lifecycle hooks (like `exit`) to\n * components and composables within a Fabric runtime.\n */\nexport const FileContext = createContext<KubbFile.ResolvedFile | null>(null)\n","import { FileContext } from '../contexts/FileContext.ts'\nimport type * as KubbFile from '../KubbFile.ts'\nimport { useContext } from './useContext.ts'\n\n/**\n * `useFile` will return the current FileCollector for registering files.\n *\n * Throws when no FileCollector is present in context — ensure a Fabric that\n * provides a FileCollector is mounted before calling this hook.\n */\nexport function useFile(): KubbFile.ResolvedFile | null {\n return useContext(FileContext)\n}\n","import { RootContext } from '../contexts/RootContext.ts'\nimport type { FileManager } from '../FileManager.ts'\nimport { useContext } from './useContext.ts'\n\nexport function useFileManager(): FileManager {\n const { fileManager } = useContext(RootContext)\n\n return fileManager\n}\n","import { useFile } from '../composables/useFile.ts'\nimport { useFileManager } from '../composables/useFileManager.ts'\nimport { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { FileContext } from '../contexts/FileContext.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport type { KubbFile } from '../types.ts'\nimport { Text } from './Text.ts'\n\nexport type FileProps<TMeta extends object = object> = {\n /**\n * Name to be used to dynamically create the baseName(based on input.path).\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: KubbFile.BaseName\n /**\n * Path will be full qualified path to a specified file.\n */\n path: KubbFile.Path\n meta?: TMeta\n banner?: string\n footer?: string\n /**\n * Children nodes.\n */\n children?: string | (() => string | Array<string>)\n}\n\n/**\n * Adds files to the FileManager\n */\nexport function File<TMeta extends object = object>({ children, ...props }: FileProps<TMeta>): string {\n const { baseName, path, meta = {}, footer, banner } = props\n\n const fileManager = useFileManager()\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'File', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n const file: KubbFile.File = {\n baseName,\n path,\n meta,\n banner,\n footer,\n sources: [],\n imports: [],\n exports: [],\n }\n\n const [resolvedFile] = fileManager.add(file)\n provide(FileContext, resolvedFile)\n\n return Text({ children })\n}\n\ntype FileSourceProps = Omit<KubbFile.Source, 'value'> & {\n /**\n * Children nodes.\n */\n children?: string | (() => string | Array<string>)\n}\n\n/**\n * FileSource - for adding source code to a file\n *\n * Returns the provided children string so the fsx renderer can collect it.\n */\nexport function FileSource({ children, ...props }: FileSourceProps): string {\n const { name, isExportable, isIndexable, isTypeOnly } = props\n\n const nodeTree = useNodeTree()\n const file = useFile()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'FileSource', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n if (file) {\n file.sources.push({\n name,\n isExportable,\n isIndexable,\n isTypeOnly,\n value: Text({ children }),\n })\n }\n\n return Text({ children })\n}\n\nexport type FileExportProps = KubbFile.Export\n\n/**\n * FileExport - for adding exports to a file\n *\n * No-op function used by renderers to record exports.\n */\nexport function FileExport(props: FileExportProps): string {\n const { name, path, isTypeOnly, asAlias } = props\n\n const nodeTree = useNodeTree()\n const file = useFile()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'FileExport', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n if (file) {\n file.exports.push({\n name,\n path,\n asAlias,\n isTypeOnly,\n })\n }\n\n return Text({ children: '' })\n}\n\nexport type FileImportProps = KubbFile.Import\n\n/**\n * FileImport - for adding imports to a file\n *\n * No-op function used by renderers to record imports.\n */\nexport function FileImport(props: FileImportProps): string {\n const { name, path, root, isNameSpace, isTypeOnly } = props\n\n const nodeTree = useNodeTree()\n const file = useFile()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'FileImport', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n if (file) {\n file.imports.push({\n name,\n path,\n root,\n isNameSpace,\n isTypeOnly,\n })\n }\n\n return Text({ children: '' })\n}\n\nFile.Source = FileSource\nFile.Import = FileImport\nFile.Export = FileExport\n","import { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport type { JSDoc } from '../types.ts'\nimport { createJSDoc } from '../utils/createJSDoc.ts'\nimport { Text } from './Text.ts'\n\ntype Props = {\n /**\n * Name of the function.\n */\n name: string\n /**\n * Add default when export is being used\n */\n default?: boolean\n /**\n * Parameters/options/props that need to be used.\n */\n params?: string\n /**\n * Does this function need to be exported.\n */\n export?: boolean\n /**\n * Does the function has async/promise behaviour.\n * This will also add `Promise<returnType>` as the returnType.\n */\n async?: boolean\n /**\n * Generics that needs to be added for TypeScript.\n */\n generics?: string | string[]\n /**\n * ReturnType(see async for adding Promise type).\n */\n returnType?: string\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n /**\n * Children nodes.\n */\n children?: string\n}\n\n/**\n * Generates a TypeScript function declaration.\n */\nexport function Function({ children, ...props }: Props): string {\n const { name, default: isDefault, export: canExport, async, generics, params, returnType, JSDoc } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'Function', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n const parts: string[] = []\n\n if (JSDoc?.comments) {\n parts.push(createJSDoc({ comments: JSDoc.comments }))\n parts.push('\\n')\n }\n\n if (canExport) {\n parts.push('export ')\n }\n\n if (isDefault) {\n parts.push('default ')\n }\n\n if (async) {\n parts.push('async ')\n }\n\n parts.push(`function ${name}`)\n\n if (generics) {\n parts.push('<')\n parts.push(Array.isArray(generics) ? generics.join(', ').trim() : generics)\n parts.push('>')\n }\n\n parts.push(`(${params || ''})`)\n\n if (returnType && !async) {\n parts.push(`: ${returnType}`)\n }\n\n if (returnType && async) {\n parts.push(`: Promise<${returnType}>`)\n }\n\n parts.push(' {')\n\n if (children) {\n return Text({ children: `${parts.join('')}${' '}${'\\n'}${children}${' '}${'\\n'}}` })\n }\n\n return Text({ children: `${parts.join('')}}` })\n}\n\nFunction.displayName = 'KubbFunction'\n\ntype ArrowFunctionProps = Props & {\n /**\n * Create Arrow function in one line\n */\n singleLine?: boolean\n}\n\n/**\n * ArrowFunction\n *\n * Builds an arrow function declaration string for the fsx renderer. Supports\n * the same options as `Function`. Use `singleLine` to produce a one-line\n * arrow expression.\n */\nfunction ArrowFunction({ children, ...props }: ArrowFunctionProps): string {\n const { name, default: isDefault, export: canExport, async, generics, params, returnType, JSDoc, singleLine } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'ArrowFunction', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n const parts: string[] = []\n\n if (JSDoc?.comments) {\n parts.push(createJSDoc({ comments: JSDoc.comments }))\n parts.push('\\n')\n }\n\n if (canExport) {\n parts.push('export ')\n }\n\n if (isDefault) {\n parts.push('default ')\n }\n\n parts.push(`const ${name} = `)\n\n if (async) {\n parts.push('async ')\n }\n\n if (generics) {\n parts.push('<')\n parts.push(Array.isArray(generics) ? generics.join(', ').trim() : generics)\n parts.push('>')\n }\n\n parts.push(`(${params || ''})`)\n\n if (returnType && !async) {\n parts.push(`: ${returnType}`)\n }\n\n if (returnType && async) {\n parts.push(`: Promise<${returnType}>`)\n }\n\n if (singleLine) {\n parts.push(` => ${children || ''}\\n`)\n return Text({ children: parts.join('') })\n }\n\n if (children) {\n return Text({ children: `${parts.join('')} => {${' '}${'\\n'}${children}${' '}${'\\n'}}${'\\n'}` })\n }\n\n return Text({ children: `${parts.join('')} => {}\\n` })\n}\n\nArrowFunction.displayName = 'KubbArrowFunction'\nFunction.Arrow = ArrowFunction\n","import type { ComponentNode } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { RootContext } from '../contexts/RootContext.ts'\nimport type { FileManager } from '../FileManager.ts'\nimport type { TreeNode } from '../utils/TreeNode.ts'\nimport { Text } from './Text.ts'\n\nexport type RootProps = {\n /**\n * Exit (unmount) the whole app.\n */\n onExit: (error?: Error) => void\n /**\n * Error hook receiving runtime exceptions.\n */\n onError: (error: Error) => void\n /**\n * TreeNode representing the tree structure of the app.\n */\n treeNode: TreeNode<ComponentNode>\n /**\n * FileManager instance for managing files within the app.\n */\n fileManager: FileManager\n /**\n * Children nodes.\n */\n children?: string | (() => string | Array<string> | undefined)\n}\n\n/**\n * This component provides the root behavior for the Fabric runtime.\n */\nexport function Root({ onError, onExit, treeNode, fileManager, children }: RootProps): string {\n provide(RootContext, { exit: onExit, treeNode, fileManager })\n provide(NodeTreeContext, treeNode)\n\n try {\n return Text({ children })\n } catch (e) {\n if (e instanceof Error) {\n onError?.(e)\n }\n return ''\n }\n}\n\nRoot.displayName = 'KubbRoot'\n","import { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport type { JSDoc } from '../types.ts'\nimport { createJSDoc } from '../utils/createJSDoc.ts'\nimport { Text } from './Text.ts'\n\nexport type TypeProps = {\n /**\n * Name of the type, this needs to start with a capital letter.\n */\n name: string\n /**\n * Does this type need to be exported.\n */\n export?: boolean\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n /**\n * Children nodes.\n */\n children?: string\n}\n\n/**\n * Generates a TypeScript type declaration.\n */\nexport function Type({ children, ...props }: TypeProps): string {\n const { name, export: canExport, JSDoc } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'Type', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n if (name.charAt(0).toUpperCase() !== name.charAt(0)) {\n throw new Error('Name should start with a capital letter (see TypeScript types)')\n }\n\n let result = ''\n\n if (JSDoc?.comments) {\n result += createJSDoc({ comments: JSDoc.comments })\n result += '\\n'\n }\n\n if (canExport) {\n result += 'export '\n }\n\n result += `type ${name} = ${children || ''}`\n\n return Text({ children: result })\n}\n\nType.displayName = 'KubbType'\n","import { AppContext, type AppContextProps } from '../contexts/AppContext.ts'\nimport { useContext } from './useContext.ts'\n\n/**\n * `useApp` will return the current App with meta and exit function.\n *\n * Throws an error when there is no AppContext available.\n */\nexport function useApp<TMeta extends object = object>(): AppContextProps<TMeta> {\n return useContext(AppContext) as AppContextProps<TMeta>\n}\n","import { RootContext } from '../contexts/RootContext.ts'\nimport { useContext } from './useContext.ts'\n\n/**\n * `useLifecycle` will return some helpers to exit/restart the generation.\n *\n * This hook reads the RootContext and exposes lifecycle helpers (like `exit`)\n * for consumers to programmatically stop generation or perform teardown.\n */\nexport function useLifecycle() {\n const { exit } = useContext(RootContext)\n\n return {\n exit,\n }\n}\n","import { isFunction } from 'remeda'\nimport type { Fabric, FabricConfig, FabricContext, FabricEvents, FabricOptions } from './Fabric.ts'\nimport { FileManager } from './FileManager.ts'\nimport type * as KubbFile from './KubbFile.ts'\nimport type { Parser } from './parsers/types.ts'\nimport type { Plugin } from './plugins/types.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\n\n/**\n * Creates a new Fabric instance\n *\n * @example\n * const fabric = createFabric()\n * fabric.use(myPlugin())\n */\nexport function createFabric<T extends FabricOptions>(config: FabricConfig<T> = { mode: 'sequential' } as FabricConfig<T>): Fabric<T> {\n const events = new AsyncEventEmitter<FabricEvents>()\n const installedPlugins = new Set<Plugin<any>>()\n const installedParsers = new Map<KubbFile.Extname, Parser<any>>()\n const installedParserNames = new Set<string>()\n const fileManager = new FileManager({ events })\n\n const context: FabricContext<T> = {\n get files() {\n return fileManager.files\n },\n async addFile(...files) {\n await fileManager.add(...files)\n },\n config,\n fileManager,\n installedPlugins,\n installedParsers,\n on: events.on.bind(events),\n off: events.off.bind(events),\n onOnce: events.onOnce.bind(events),\n removeAll: events.removeAll.bind(events),\n emit: events.emit.bind(events),\n } as FabricContext<T>\n\n const fabric: Fabric<T> = {\n context,\n get files() {\n return fileManager.files\n },\n async addFile(...files) {\n await fileManager.add(...files)\n },\n async upsertFile(...files) {\n await fileManager.upsert(...files)\n },\n async use(pluginOrParser, ...options) {\n if (pluginOrParser.type === 'plugin') {\n if (installedPlugins.has(pluginOrParser)) {\n console.warn(`Plugin \"${pluginOrParser.name}\" already applied.`)\n } else {\n installedPlugins.add(pluginOrParser)\n }\n\n if (isFunction(pluginOrParser.inject)) {\n const injecter = pluginOrParser.inject\n\n const injected = (injecter as any)(context, ...options)\n Object.assign(fabric, injected)\n }\n }\n\n if (pluginOrParser.type === 'parser') {\n if (installedParserNames.has(pluginOrParser.name)) {\n console.warn(`Parser \"${pluginOrParser.name}\" already applied.`)\n } else {\n installedParserNames.add(pluginOrParser.name)\n }\n\n if (pluginOrParser.extNames) {\n for (const extName of pluginOrParser.extNames) {\n const existing = installedParsers.get(extName)\n if (existing && existing.name !== pluginOrParser.name) {\n console.warn(`Parser \"${pluginOrParser.name}\" is overriding parser \"${existing.name}\" for extension \"${extName}\".`)\n }\n installedParsers.set(extName, pluginOrParser)\n }\n }\n }\n\n if (isFunction(pluginOrParser.install)) {\n const installer = pluginOrParser.install\n\n await (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,oBAAoB;QAEhE,sBAAqB,IAAI,eAAe,KAAK;AAG/C,QAAI,eAAe,SACjB,MAAK,MAAM,WAAW,eAAe,UAAU;KAC7C,MAAM,WAAW,iBAAiB,IAAI,QAAQ;AAC9C,SAAI,YAAY,SAAS,SAAS,eAAe,KAC/C,SAAQ,KAAK,WAAW,eAAe,KAAK,0BAA0B,SAAS,KAAK,mBAAmB,QAAQ,IAAI;AAErH,sBAAiB,IAAI,SAAS,eAAe;;;AAKnD,OAAIA,EAAW,eAAe,QAAQ,EAAE;IACtC,MAAM,YAAY,eAAe;AAEjC,UAAO,UAAkB,SAAS,GAAG,QAAQ;;AAG/C,UAAO;;EAEV;AAED,QAAO"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["inject","NodeTreeContext","createContext","e","createComponent","RootContext","NodeTreeContext","createComponent","createIntrinsic","createComponent","NodeTreeContext","createComponent","createIntrinsic","createContext","RootContext","createComponent","NodeTreeContext","renderIntrinsic","print","createExport","createImport","createComponent","createIntrinsic","createComponent","NodeTreeContext","createComponent","NodeTreeContext","RootContext","AsyncEventEmitter","FileManager","isFunction"],"sources":["../src/composables/useContext.ts","../src/composables/useNodeTree.ts","../src/contexts/AppContext.ts","../../../node_modules/.pnpm/remeda@2.33.4/node_modules/remeda/dist/isFunction.js","../src/components/App.ts","../src/components/Br.ts","../src/utils/createJSDoc.ts","../src/components/Const.ts","../src/components/Dedent.ts","../src/contexts/FileContext.ts","../src/composables/useFile.ts","../src/composables/useFileManager.ts","../src/components/File.ts","../src/components/Indent.ts","../src/components/Function.ts","../src/components/Type.ts","../src/composables/useApp.ts","../src/composables/useLifecycle.ts","../src/createFabric.ts"],"sourcesContent":["import type { Context } from '../context.ts'\nimport { inject } from '../context.ts'\n\n/**\n * React-style alias for inject\n *\n * @example\n * ```ts\n * const theme = useContext(ThemeContext) // type is inferred from ThemeContext\n * ```\n */\nexport function useContext<T>(key: Context<T>): T\nexport function useContext<T, TValue = T>(key: Context<T>, defaultValue: TValue): NonNullable<T> | TValue\nexport function useContext<T>(key: Context<T>, defaultValue?: T): T {\n return inject(key, defaultValue)\n}\n","import { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport type { TreeNode } from '../utils/TreeNode.ts'\nimport { useContext } from './useContext.ts'\n\nexport type ComponentNode = {\n type: string\n props: Record<string, unknown>\n}\n\nexport function useNodeTree(): TreeNode<ComponentNode> | null {\n return useContext(NodeTreeContext)\n}\n","import { createContext } from '../context.ts'\n\nexport type AppContextProps<TMeta extends object = object> = {\n /**\n * Exit (unmount)\n */\n exit: (error?: Error) => void\n meta: TMeta\n}\n\n/**\n * Provides app-level metadata and lifecycle hooks (like `exit`) to\n * components and composables within a Fabric runtime.\n */\nexport const AppContext = createContext<AppContextProps>({\n exit: () => {},\n meta: {},\n})\n","const e=e=>typeof e==`function`;export{e as isFunction};\n//# sourceMappingURL=isFunction.js.map","import { useContext } from '../composables/useContext.ts'\nimport { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { AppContext } from '../contexts/AppContext.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { RootContext } from '../contexts/RootContext.ts'\nimport { createComponent } from '../createComponent.ts'\nimport type { FabricNode } from '../Fabric.ts'\n\nexport type AppProps<TMeta extends Object = Object> = {\n /**\n * Metadata associated with the App.\n */\n meta?: TMeta\n /**\n * Children nodes.\n */\n children?: FabricNode\n}\n\n/**\n * App container containing the AppContext carrying `meta` and an `exit` hook.\n */\nexport const App = createComponent('App', ({ children, ...props }: AppProps) => {\n const { meta = {} } = props\n\n const { exit } = useContext(RootContext)\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'App', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n provide(AppContext, { exit, meta })\n\n return children\n})\n\nApp.displayName = 'KubbApp'\n","import { createComponent } from '../createComponent.ts'\nimport { createIntrinsic } from '../intrinsic.ts'\n\n/**\n * Generates a line break in the output.\n */\nexport const Br = createComponent('br', () => {\n return createIntrinsic('br')\n})\n\nBr.displayName = 'Br'\n","/**\n * Create JSDoc comment block from comments array\n */\nexport function createJSDoc({ comments }: { comments: string[] }): string {\n if (!comments || comments.length === 0) return ''\n\n const lines = comments\n .flatMap((c) => String(c ?? '').split(/\\r?\\n/))\n .map((l) => l.replace(/\\*\\//g, '*\\\\/').replace(/\\r/g, ''))\n .filter((l) => l.trim().length > 0)\n\n if (lines.length === 0) return ''\n\n return ['/**', ...lines.map((l) => ` * ${l}`), ' */'].join('\\n')\n}\n","import { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { createComponent } from '../createComponent.ts'\nimport type { FabricNode } from '../Fabric.ts'\nimport type { JSDoc } from '../types.ts'\nimport { createJSDoc } from '../utils/createJSDoc.ts'\n\nexport type ConstProps = {\n /**\n * Name of the const\n */\n name: string\n /**\n * Does this type need to be exported.\n */\n export?: boolean\n /**\n * Type to make the const being typed\n */\n type?: string\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n /**\n * Use of `const` assertions\n */\n asConst?: boolean\n /**\n * Children nodes.\n */\n children?: FabricNode\n}\n\n/**\n * Generates a TypeScript constant declaration.\n */\nexport const Const = createComponent('Const', ({ children, ...props }: ConstProps) => {\n const { name, export: canExport, type, JSDoc, asConst } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'Const', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n let result = ''\n\n if (JSDoc?.comments) {\n result += createJSDoc({ comments: JSDoc.comments })\n result += '\\n'\n }\n\n if (canExport) {\n result += 'export '\n }\n\n result += `const ${name}`\n\n if (type) {\n result += `: ${type}`\n }\n\n result += ` = ${children ? children : ''}`\n\n if (asConst) {\n result += ' as const'\n }\n\n return result\n})\n\nConst.displayName = 'KubbConst'\n","import { createComponent } from '../createComponent.ts'\nimport { createIntrinsic } from '../intrinsic.ts'\n\n/**\n * Dedent component for reducing indentation level in rendered output.\n */\nexport const Dedent = createComponent('dedent', () => {\n return createIntrinsic('dedent')\n})\nDedent.displayName = 'Dedent'\n","import { createContext } from '../context.ts'\nimport type * as KubbFile from '../KubbFile.ts'\n\n/**\n * Provides app-level metadata and lifecycle hooks (like `exit`) to\n * components and composables within a Fabric runtime.\n */\nexport const FileContext = createContext<KubbFile.ResolvedFile | null>(null)\n","import { FileContext } from '../contexts/FileContext.ts'\nimport type * as KubbFile from '../KubbFile.ts'\nimport { useContext } from './useContext.ts'\n\n/**\n * `useFile` will return the current FileCollector for registering files.\n *\n * Throws when no FileCollector is present in context — ensure a Fabric that\n * provides a FileCollector is mounted before calling this hook.\n */\nexport function useFile(): KubbFile.ResolvedFile | null {\n return useContext(FileContext)\n}\n","import { RootContext } from '../contexts/RootContext.ts'\nimport type { FileManager } from '../FileManager.ts'\nimport { useContext } from './useContext.ts'\n\nexport function useFileManager(): FileManager {\n const { fileManager } = useContext(RootContext)\n\n return fileManager\n}\n","import { useFile } from '../composables/useFile.ts'\nimport { useFileManager } from '../composables/useFileManager.ts'\nimport { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { FileContext } from '../contexts/FileContext.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { type ComponentBuilder, createComponent } from '../createComponent.ts'\nimport type { FabricNode } from '../Fabric.ts'\nimport { renderIntrinsic } from '../intrinsic.ts'\nimport { createExport, createImport, print } from '../parsers/typescriptParser.ts'\nimport type { KubbFile } from '../types.ts'\n\nexport type FileProps<TMeta extends object = object> = {\n /**\n * Name to be used to dynamically create the baseName(based on input.path).\n * Based on UNIX basename\n * @link https://nodejs.org/api/path.html#pathbasenamepath-suffix\n */\n baseName: KubbFile.BaseName\n /**\n * Path will be full qualified path to a specified file.\n */\n path: KubbFile.Path\n meta?: TMeta\n banner?: string\n footer?: string\n /**\n * Children nodes.\n */\n children?: FabricNode\n}\n\n/**\n * Adds files to the FileManager\n */\nexport const File = createComponent('File', ({ children, ...props }: FileProps) => {\n const { baseName, path, meta = {}, footer, banner } = props\n\n const fileManager = useFileManager()\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'File', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n const file: KubbFile.File = {\n baseName,\n path,\n meta,\n banner,\n footer,\n sources: [],\n imports: [],\n exports: [],\n }\n\n const [resolvedFile] = fileManager.add(file)\n provide(FileContext, resolvedFile)\n\n return children\n}) as ComponentBuilder<FileProps<object>> & { Source: typeof FileSource; Import: typeof FileImport; Export: typeof FileExport }\n\ntype FileSourceProps = Omit<KubbFile.Source, 'value'> & {\n /**\n * Children nodes.\n */\n children?: FabricNode\n}\n\n/**\n * FileSource - for adding source code to a file\n *\n * Returns the provided children string so the fsx renderer can collect it.\n */\nexport const FileSource = createComponent('FileSource', ({ children, ...props }: FileSourceProps) => {\n const { name, isExportable, isIndexable, isTypeOnly } = props\n\n const nodeTree = useNodeTree()\n const file = useFile()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'FileSource', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n const value = renderIntrinsic(children)\n\n if (file) {\n file.sources.push({\n name,\n isExportable,\n isIndexable,\n isTypeOnly,\n value,\n })\n }\n\n return value\n})\n\nexport type FileExportProps = KubbFile.Export\n\n/**\n * FileExport - for adding exports to a file\n *\n * No-op function used by renderers to record exports.\n */\nexport const FileExport = createComponent('FileExport', (props: FileExportProps) => {\n const { name, path, isTypeOnly, asAlias } = props\n\n const nodeTree = useNodeTree()\n const file = useFile()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'FileExport', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n if (file) {\n file.exports.push({\n name,\n path,\n asAlias,\n isTypeOnly,\n })\n }\n\n return print(createExport({ name, path, isTypeOnly, asAlias }))\n})\n\nexport type FileImportProps = KubbFile.Import\n\n/**\n * FileImport - for adding imports to a file\n *\n * No-op function used by renderers to record imports.\n */\nexport const FileImport = createComponent('FileImport', (props: FileImportProps) => {\n const { name, path, root, isNameSpace, isTypeOnly } = props\n\n const nodeTree = useNodeTree()\n const file = useFile()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'FileImport', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n if (file) {\n file.imports.push({\n name,\n path,\n root,\n isNameSpace,\n isTypeOnly,\n })\n }\n\n return print(createImport({ name, path, root, isNameSpace, isTypeOnly }))\n})\n\nFile.Source = FileSource\nFile.Import = FileImport\nFile.Export = FileExport\n","import { createComponent } from '../createComponent.ts'\nimport { createIntrinsic } from '../intrinsic.ts'\n\nexport const Indent = createComponent('indent', () => {\n return createIntrinsic('indent')\n})\nIndent.displayName = 'Indent'\n","import { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { type ComponentBuilder, createComponent } from '../createComponent.ts'\nimport type { FabricNode } from '../Fabric.ts'\nimport type { JSDoc } from '../types.ts'\nimport { createJSDoc } from '../utils/createJSDoc.ts'\nimport { Br } from './Br.ts'\nimport { Dedent } from './Dedent.ts'\nimport { Indent } from './Indent.ts'\n\ntype FunctionProps = {\n /**\n * Name of the function.\n */\n name: string\n /**\n * Add default when export is being used\n */\n default?: boolean\n /**\n * Parameters/options/props that need to be used.\n */\n params?: string\n /**\n * Does this function need to be exported.\n */\n export?: boolean\n /**\n * Does the function has async/promise behaviour.\n * This will also add `Promise<returnType>` as the returnType.\n */\n async?: boolean\n /**\n * Generics that needs to be added for TypeScript.\n */\n generics?: string | string[]\n /**\n * ReturnType(see async for adding Promise type).\n */\n returnType?: string\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n /**\n * Children nodes.\n */\n children?: FabricNode\n}\n\n/**\n * Generates a TypeScript function declaration.\n */\nexport const Function = createComponent('Function', ({ children, ...props }: FunctionProps) => {\n const { name, default: isDefault, export: canExport, async, generics, params, returnType, JSDoc } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'Function', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n const parts: string[] = []\n\n if (JSDoc?.comments) {\n parts.push(createJSDoc({ comments: JSDoc.comments }))\n parts.push('\\n')\n }\n\n if (canExport) {\n parts.push('export ')\n }\n\n if (isDefault) {\n parts.push('default ')\n }\n\n if (async) {\n parts.push('async ')\n }\n\n parts.push(`function ${name}`)\n\n if (generics) {\n parts.push('<')\n parts.push(Array.isArray(generics) ? generics.join(', ').trim() : generics)\n parts.push('>')\n }\n\n parts.push(`(${params || ''})`)\n\n if (returnType && !async) {\n parts.push(`: ${returnType}`)\n }\n\n if (returnType && async) {\n parts.push(`: Promise<${returnType}>`)\n }\n\n parts.push(' {')\n\n if (children) {\n return [parts.join(''), Br(), Indent(), children, Br(), Dedent(), '}']\n }\n\n return [parts.join(''), '}']\n}) as ComponentBuilder<FunctionProps> & { Arrow: typeof ArrowFunction }\n\nFunction.displayName = 'KubbFunction'\n\ntype ArrowFunctionProps = FunctionProps & {\n /**\n * Create Arrow function in one line\n */\n singleLine?: boolean\n}\n\n/**\n * ArrowFunction\n *\n * Builds an arrow function declaration string for the fsx renderer. Supports\n * the same options as `Function`. Use `singleLine` to produce a one-line\n * arrow expression.\n */\nconst ArrowFunction = createComponent('ArrowFunction', ({ children, ...props }: ArrowFunctionProps) => {\n const { name, default: isDefault, export: canExport, async, generics, params, returnType, JSDoc, singleLine } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'ArrowFunction', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n const parts: string[] = []\n\n if (JSDoc?.comments) {\n parts.push(createJSDoc({ comments: JSDoc.comments }))\n parts.push('\\n')\n }\n\n if (canExport) {\n parts.push('export ')\n }\n\n if (isDefault) {\n parts.push('default ')\n }\n\n parts.push(`const ${name} = `)\n\n if (async) {\n parts.push('async ')\n }\n\n if (generics) {\n parts.push('<')\n parts.push(Array.isArray(generics) ? generics.join(', ').trim() : generics)\n parts.push('>')\n }\n\n parts.push(`(${params || ''})`)\n\n if (returnType && !async) {\n parts.push(`: ${returnType}`)\n }\n\n if (returnType && async) {\n parts.push(`: Promise<${returnType}>`)\n }\n\n if (singleLine) {\n parts.push(` => ${children || ''}\\n`)\n return parts.join('')\n }\n\n if (children) {\n return [parts.join(''), ' => {', Br(), Indent(), children, Br(), Dedent(), '}']\n }\n\n return [parts.join(''), ' => {}']\n})\n\nArrowFunction.displayName = 'KubbArrowFunction'\nFunction.Arrow = ArrowFunction\n","import { useNodeTree } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { createComponent } from '../createComponent.ts'\nimport type { FabricNode } from '../Fabric.ts'\nimport type { JSDoc } from '../types.ts'\nimport { createJSDoc } from '../utils/createJSDoc.ts'\n\nexport type TypeProps = {\n /**\n * Name of the type, this needs to start with a capital letter.\n */\n name: string\n /**\n * Does this type need to be exported.\n */\n export?: boolean\n /**\n * Options for JSdocs.\n */\n JSDoc?: JSDoc\n /**\n * Children nodes.\n */\n children?: FabricNode\n}\n\n/**\n * Generates a TypeScript type declaration.\n */\nexport const Type = createComponent('Type', ({ children, ...props }: TypeProps) => {\n const { name, export: canExport, JSDoc } = props\n\n const nodeTree = useNodeTree()\n\n if (nodeTree) {\n const childTree = nodeTree.addChild({ type: 'Type', props })\n\n provide(NodeTreeContext, childTree)\n }\n\n if (name.charAt(0).toUpperCase() !== name.charAt(0)) {\n throw new Error('Name should start with a capital letter (see TypeScript types)')\n }\n\n let result = ''\n\n if (JSDoc?.comments) {\n result += createJSDoc({ comments: JSDoc.comments })\n result += '\\n'\n }\n\n if (canExport) {\n result += 'export '\n }\n\n result += `type ${name} = ${children || ''}`\n\n return result\n})\n\nType.displayName = 'KubbType'\n","import { AppContext, type AppContextProps } from '../contexts/AppContext.ts'\nimport { useContext } from './useContext.ts'\n\n/**\n * `useApp` will return the current App with meta and exit function.\n *\n * Throws an error when there is no AppContext available.\n */\nexport function useApp<TMeta extends object = object>(): AppContextProps<TMeta> {\n return useContext(AppContext) as AppContextProps<TMeta>\n}\n","import { RootContext } from '../contexts/RootContext.ts'\nimport { useContext } from './useContext.ts'\n\n/**\n * `useLifecycle` will return some helpers to exit/restart the generation.\n *\n * This hook reads the RootContext and exposes lifecycle helpers (like `exit`)\n * for consumers to programmatically stop generation or perform teardown.\n */\nexport function useLifecycle() {\n const { exit } = useContext(RootContext)\n\n return {\n exit,\n }\n}\n","import { isFunction } from 'remeda'\nimport type { Fabric, FabricConfig, FabricContext, FabricEvents, FabricOptions } from './Fabric.ts'\nimport { FileManager } from './FileManager.ts'\nimport type * as KubbFile from './KubbFile.ts'\nimport type { Parser } from './parsers/types.ts'\nimport type { Plugin } from './plugins/types.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\n\n/**\n * Creates a new Fabric instance\n *\n * @example\n * const fabric = createFabric()\n * fabric.use(myPlugin())\n */\nexport function createFabric<T extends FabricOptions>(config: FabricConfig<T> = { mode: 'sequential' } as FabricConfig<T>): Fabric<T> {\n const events = new AsyncEventEmitter<FabricEvents>()\n const installedPlugins = new Set<Plugin<any>>()\n const installedParsers = new Map<KubbFile.Extname, Parser<any>>()\n const installedParserNames = new Set<string>()\n const fileManager = new FileManager({ events })\n\n const context: FabricContext<T> = {\n get files() {\n return fileManager.files\n },\n async addFile(...files) {\n await fileManager.add(...files)\n },\n config,\n fileManager,\n installedPlugins,\n installedParsers,\n on: events.on.bind(events),\n off: events.off.bind(events),\n onOnce: events.onOnce.bind(events),\n removeAll: events.removeAll.bind(events),\n emit: events.emit.bind(events),\n } as FabricContext<T>\n\n const fabric: Fabric<T> = {\n context,\n get files() {\n return fileManager.files\n },\n async addFile(...files) {\n await fileManager.add(...files)\n },\n async upsertFile(...files) {\n await fileManager.upsert(...files)\n },\n async use(pluginOrParser, ...options) {\n if (pluginOrParser.type === 'plugin') {\n if (installedPlugins.has(pluginOrParser)) {\n console.warn(`Plugin \"${pluginOrParser.name}\" already applied.`)\n } else {\n installedPlugins.add(pluginOrParser)\n }\n\n if (isFunction(pluginOrParser.inject)) {\n const injecter = pluginOrParser.inject\n\n const injected = (injecter as any)(context, ...options)\n Object.assign(fabric, injected)\n }\n }\n\n if (pluginOrParser.type === 'parser') {\n if (installedParserNames.has(pluginOrParser.name)) {\n console.warn(`Parser \"${pluginOrParser.name}\" already applied.`)\n } else {\n installedParserNames.add(pluginOrParser.name)\n }\n\n if (pluginOrParser.extNames) {\n for (const extName of pluginOrParser.extNames) {\n const existing = installedParsers.get(extName)\n if (existing && existing.name !== pluginOrParser.name) {\n console.warn(`Parser \"${pluginOrParser.name}\" is overriding parser \"${existing.name}\" for extension \"${extName}\".`)\n }\n installedParsers.set(extName, pluginOrParser)\n }\n }\n }\n\n if (isFunction(pluginOrParser.install)) {\n const installer = pluginOrParser.install\n\n await (installer as any)(context, ...options)\n }\n\n return fabric\n },\n } as Fabric<T>\n\n return fabric\n}\n"],"x_google_ignoreList":[3],"mappings":";;;;;AAaA,SAAgB,WAAc,KAAiB,cAAqB;AAClE,QAAOA,oBAAO,KAAK,aAAa;;;;;ACLlC,SAAgB,cAA8C;AAC5D,QAAO,WAAWC,6BAAgB;;;;;;;;;ACIpC,MAAa,aAAaC,2BAA+B;CACvD,YAAY;CACZ,MAAM,EAAE;CACT,CAAC;;;;ACjBF,MAAM,KAAE,QAAG,OAAOC,OAAG;;;;;;;ACuBrB,MAAa,MAAMC,6BAAgB,QAAQ,EAAE,UAAU,GAAG,YAAsB;CAC9E,MAAM,EAAE,OAAO,EAAE,KAAK;CAEtB,MAAM,EAAE,SAAS,WAAWC,yBAAY;CAExC,MAAM,WAAW,aAAa;AAE9B,KAAI,SAGF,sBAAQC,8BAFU,SAAS,SAAS;EAAE,MAAM;EAAO;EAAO,CAAC,CAExB;AAGrC,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AS,eAAe,KAC/C,SAAQ,KAAK,WAAW,eAAe,KAAK,0BAA0B,SAAS,KAAK,mBAAmB,QAAQ,IAAI;AAErH,sBAAiB,IAAI,SAAS,eAAe;;;AAKnD,OAAIA,EAAW,eAAe,QAAQ,EAAE;IACtC,MAAM,YAAY,eAAe;AAEjC,UAAO,UAAkB,SAAS,GAAG,QAAQ;;AAG/C,UAAO;;EAEV;AAED,QAAO"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { A as Path, D as File$1, M as Source, N as __name, O as Import, T as Export, _ as inject, b as FileManager, c as FabricOptions, d as renderIndent, f as renderIntrinsic, g as createContext, h as Context, j as ResolvedFile, n as FabricComponent, p as RenderContext, r as FabricConfig, s as FabricNode, t as Fabric, v as provide, w as BaseName, x as FileProcessor, y as unprovide } from "./Fabric-BbVC650D.cjs";
|
|
2
|
+
import { n as useNodeTree, r as TreeNode, t as ComponentNode } from "./useNodeTree-CmXKaRqq.cjs";
|
|
3
|
+
import { n as RootContext, t as JSDoc } from "./types-BI7rICUP.cjs";
|
|
4
4
|
|
|
5
|
+
//#region src/createComponent.d.ts
|
|
6
|
+
type MakeChildrenOptional<T extends object> = T extends {
|
|
7
|
+
children?: any;
|
|
8
|
+
} ? Omit<T, 'children'> & Partial<Pick<T, 'children'>> : T;
|
|
9
|
+
type ComponentBuilder<T extends object> = {
|
|
10
|
+
(...args: unknown extends T ? [] : {} extends Omit<T, 'children'> ? [props?: MakeChildrenOptional<T>] : [props: MakeChildrenOptional<T>]): FabricComponent<T>;
|
|
11
|
+
displayName?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
declare function createComponent<TProps extends object>(type: string, Component: (props: TProps) => FabricNode): ComponentBuilder<TProps>;
|
|
14
|
+
//#endregion
|
|
5
15
|
//#region src/components/App.d.ts
|
|
6
16
|
type AppProps<TMeta extends Object = Object> = {
|
|
7
17
|
/**
|
|
@@ -11,18 +21,18 @@ type AppProps<TMeta extends Object = Object> = {
|
|
|
11
21
|
/**
|
|
12
22
|
* Children nodes.
|
|
13
23
|
*/
|
|
14
|
-
children?:
|
|
24
|
+
children?: FabricNode;
|
|
15
25
|
};
|
|
16
26
|
/**
|
|
17
27
|
* App container containing the AppContext carrying `meta` and an `exit` hook.
|
|
18
28
|
*/
|
|
19
|
-
declare
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
declare const App: ComponentBuilder<AppProps<Object>>;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/Br.d.ts
|
|
32
|
+
/**
|
|
33
|
+
* Generates a line break in the output.
|
|
34
|
+
*/
|
|
35
|
+
declare const Br: ComponentBuilder<object>;
|
|
26
36
|
//#endregion
|
|
27
37
|
//#region src/components/Const.d.ts
|
|
28
38
|
type ConstProps = {
|
|
@@ -49,18 +59,18 @@ type ConstProps = {
|
|
|
49
59
|
/**
|
|
50
60
|
* Children nodes.
|
|
51
61
|
*/
|
|
52
|
-
children?:
|
|
62
|
+
children?: FabricNode;
|
|
53
63
|
};
|
|
54
64
|
/**
|
|
55
65
|
* Generates a TypeScript constant declaration.
|
|
56
66
|
*/
|
|
57
|
-
declare
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
declare const Const: ComponentBuilder<ConstProps>;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/Dedent.d.ts
|
|
70
|
+
/**
|
|
71
|
+
* Dedent component for reducing indentation level in rendered output.
|
|
72
|
+
*/
|
|
73
|
+
declare const Dedent: ComponentBuilder<object>;
|
|
64
74
|
//#endregion
|
|
65
75
|
//#region src/components/File.d.ts
|
|
66
76
|
type FileProps<TMeta extends object = object> = {
|
|
@@ -80,52 +90,43 @@ type FileProps<TMeta extends object = object> = {
|
|
|
80
90
|
/**
|
|
81
91
|
* Children nodes.
|
|
82
92
|
*/
|
|
83
|
-
children?:
|
|
93
|
+
children?: FabricNode;
|
|
84
94
|
};
|
|
85
95
|
/**
|
|
86
96
|
* Adds files to the FileManager
|
|
87
97
|
*/
|
|
88
|
-
declare
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var Source: typeof FileSource;
|
|
94
|
-
var Import: typeof FileImport;
|
|
95
|
-
var Export: typeof FileExport;
|
|
96
|
-
}
|
|
98
|
+
declare const File: ComponentBuilder<FileProps<object>> & {
|
|
99
|
+
Source: typeof FileSource;
|
|
100
|
+
Import: typeof FileImport;
|
|
101
|
+
Export: typeof FileExport;
|
|
102
|
+
};
|
|
97
103
|
type FileSourceProps = Omit<Source, 'value'> & {
|
|
98
104
|
/**
|
|
99
105
|
* Children nodes.
|
|
100
106
|
*/
|
|
101
|
-
children?:
|
|
107
|
+
children?: FabricNode;
|
|
102
108
|
};
|
|
103
109
|
/**
|
|
104
110
|
* FileSource - for adding source code to a file
|
|
105
111
|
*
|
|
106
112
|
* Returns the provided children string so the fsx renderer can collect it.
|
|
107
113
|
*/
|
|
108
|
-
declare
|
|
109
|
-
children,
|
|
110
|
-
...props
|
|
111
|
-
}: FileSourceProps): string;
|
|
112
|
-
type FileExportProps = Export;
|
|
114
|
+
declare const FileSource: ComponentBuilder<FileSourceProps>;
|
|
113
115
|
/**
|
|
114
116
|
* FileExport - for adding exports to a file
|
|
115
117
|
*
|
|
116
118
|
* No-op function used by renderers to record exports.
|
|
117
119
|
*/
|
|
118
|
-
declare
|
|
119
|
-
type FileImportProps = Import;
|
|
120
|
+
declare const FileExport: ComponentBuilder<Export>;
|
|
120
121
|
/**
|
|
121
122
|
* FileImport - for adding imports to a file
|
|
122
123
|
*
|
|
123
124
|
* No-op function used by renderers to record imports.
|
|
124
125
|
*/
|
|
125
|
-
declare
|
|
126
|
+
declare const FileImport: ComponentBuilder<Import>;
|
|
126
127
|
//#endregion
|
|
127
128
|
//#region src/components/Function.d.ts
|
|
128
|
-
type
|
|
129
|
+
type FunctionProps = {
|
|
129
130
|
/**
|
|
130
131
|
* Name of the function.
|
|
131
132
|
*/
|
|
@@ -162,20 +163,15 @@ type Props$1 = {
|
|
|
162
163
|
/**
|
|
163
164
|
* Children nodes.
|
|
164
165
|
*/
|
|
165
|
-
children?:
|
|
166
|
+
children?: FabricNode;
|
|
166
167
|
};
|
|
167
168
|
/**
|
|
168
169
|
* Generates a TypeScript function declaration.
|
|
169
170
|
*/
|
|
170
|
-
declare
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
declare namespace Function {
|
|
175
|
-
var displayName: string;
|
|
176
|
-
var Arrow: typeof ArrowFunction;
|
|
177
|
-
}
|
|
178
|
-
type ArrowFunctionProps = Props$1 & {
|
|
171
|
+
declare const Function: ComponentBuilder<FunctionProps> & {
|
|
172
|
+
Arrow: typeof ArrowFunction;
|
|
173
|
+
};
|
|
174
|
+
type ArrowFunctionProps = FunctionProps & {
|
|
179
175
|
/**
|
|
180
176
|
* Create Arrow function in one line
|
|
181
177
|
*/
|
|
@@ -188,13 +184,10 @@ type ArrowFunctionProps = Props$1 & {
|
|
|
188
184
|
* the same options as `Function`. Use `singleLine` to produce a one-line
|
|
189
185
|
* arrow expression.
|
|
190
186
|
*/
|
|
191
|
-
declare
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
declare namespace ArrowFunction {
|
|
196
|
-
var displayName: string;
|
|
197
|
-
}
|
|
187
|
+
declare const ArrowFunction: ComponentBuilder<ArrowFunctionProps>;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/components/Indent.d.ts
|
|
190
|
+
declare const Indent: ComponentBuilder<object>;
|
|
198
191
|
//#endregion
|
|
199
192
|
//#region src/components/Root.d.ts
|
|
200
193
|
type RootProps = {
|
|
@@ -217,35 +210,12 @@ type RootProps = {
|
|
|
217
210
|
/**
|
|
218
211
|
* Children nodes.
|
|
219
212
|
*/
|
|
220
|
-
children?:
|
|
213
|
+
children?: FabricNode;
|
|
221
214
|
};
|
|
222
215
|
/**
|
|
223
216
|
* This component provides the root behavior for the Fabric runtime.
|
|
224
217
|
*/
|
|
225
|
-
declare
|
|
226
|
-
onError,
|
|
227
|
-
onExit,
|
|
228
|
-
treeNode,
|
|
229
|
-
fileManager,
|
|
230
|
-
children
|
|
231
|
-
}: RootProps): string;
|
|
232
|
-
declare namespace Root {
|
|
233
|
-
var displayName: string;
|
|
234
|
-
}
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region src/components/Text.d.ts
|
|
237
|
-
type Props = {
|
|
238
|
-
/**
|
|
239
|
-
* Children nodes.
|
|
240
|
-
*/
|
|
241
|
-
children?: string | (() => string | Array<string> | undefined);
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Generates a text node from string or function returning string/array of strings.
|
|
245
|
-
*/
|
|
246
|
-
declare function Text({
|
|
247
|
-
children
|
|
248
|
-
}: Props): string;
|
|
218
|
+
declare const Root: ComponentBuilder<RootProps>;
|
|
249
219
|
//#endregion
|
|
250
220
|
//#region src/components/Type.d.ts
|
|
251
221
|
type TypeProps = {
|
|
@@ -264,18 +234,12 @@ type TypeProps = {
|
|
|
264
234
|
/**
|
|
265
235
|
* Children nodes.
|
|
266
236
|
*/
|
|
267
|
-
children?:
|
|
237
|
+
children?: FabricNode;
|
|
268
238
|
};
|
|
269
239
|
/**
|
|
270
240
|
* Generates a TypeScript type declaration.
|
|
271
241
|
*/
|
|
272
|
-
declare
|
|
273
|
-
children,
|
|
274
|
-
...props
|
|
275
|
-
}: TypeProps): string;
|
|
276
|
-
declare namespace Type {
|
|
277
|
-
var displayName: string;
|
|
278
|
-
}
|
|
242
|
+
declare const Type: ComponentBuilder<TypeProps>;
|
|
279
243
|
//#endregion
|
|
280
244
|
//#region src/contexts/AppContext.d.ts
|
|
281
245
|
type AppContextProps<TMeta extends object = object> = {
|
|
@@ -376,5 +340,5 @@ declare function createJSDoc({
|
|
|
376
340
|
//#region src/utils/getRelativePath.d.ts
|
|
377
341
|
declare function getRelativePath(rootDir?: string | null, filePath?: string | null, platform?: 'windows' | 'mac' | 'linux'): string;
|
|
378
342
|
//#endregion
|
|
379
|
-
export { App, AppContext,
|
|
343
|
+
export { App, AppContext, Br, Const, Dedent, File, FileContext, FileManager, FileProcessor, Function, Indent, NodeTreeContext, RenderContext, Root, RootContext, TreeNode, Type, createComponent, createContext, createFabric, createFile, createJSDoc, getRelativePath, inject, provide, renderIndent, renderIntrinsic, unprovide, useApp, useContext, useFile, useFileManager, useLifecycle, useNodeTree };
|
|
380
344
|
//# sourceMappingURL=index.d.cts.map
|