@kubb/core 5.0.0-alpha.33 → 5.0.0-alpha.35
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/{PluginDriver-BBi_41VF.d.ts → PluginDriver-D8lWvtUg.d.ts} +743 -375
- package/dist/hooks.d.ts +1 -1
- package/dist/index.cjs +1203 -932
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -141
- package/dist/index.js +1220 -942
- package/dist/index.js.map +1 -1
- package/package.json +4 -5
- package/src/FileManager.ts +1 -1
- package/src/FileProcessor.ts +1 -1
- package/src/Kubb.ts +145 -38
- package/src/PluginDriver.ts +318 -40
- package/src/constants.ts +1 -1
- package/src/{build.ts → createKubb.ts} +180 -122
- package/src/createPlugin.ts +1 -0
- package/src/createRenderer.ts +57 -0
- package/src/defineGenerator.ts +57 -84
- package/src/defineLogger.ts +2 -2
- package/src/defineParser.ts +3 -2
- package/src/definePlugin.ts +95 -0
- package/src/defineResolver.ts +1 -1
- package/src/devtools.ts +1 -1
- package/src/index.ts +5 -6
- package/src/renderNode.ts +35 -0
- package/src/types.ts +275 -209
- package/src/utils/TreeNode.ts +1 -1
- package/src/utils/getBarrelFiles.ts +3 -3
- package/src/utils/getFunctionParams.ts +14 -7
- package/src/utils/isInputPath.ts +2 -2
- package/src/utils/packageJSON.ts +2 -3
- package/src/defineConfig.ts +0 -51
- package/src/definePresets.ts +0 -16
- package/src/renderNode.tsx +0 -28
- package/src/utils/getConfigs.ts +0 -16
- package/src/utils/getPreset.ts +0 -78
package/src/defineGenerator.ts
CHANGED
|
@@ -1,121 +1,94 @@
|
|
|
1
1
|
import type { PossiblePromise } from '@internals/utils'
|
|
2
|
-
import type { FileNode, OperationNode, SchemaNode } from '@kubb/ast
|
|
3
|
-
import type {
|
|
4
|
-
import { applyHookResult } from './renderNode.tsx'
|
|
2
|
+
import type { FileNode, OperationNode, SchemaNode } from '@kubb/ast'
|
|
3
|
+
import type { RendererFactory } from './createRenderer.ts'
|
|
5
4
|
import type { GeneratorContext, PluginFactoryOptions } from './types.ts'
|
|
6
5
|
|
|
7
6
|
export type { GeneratorContext } from './types.ts'
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* A generator is a named object with optional `schema`, `operation`, and `operations`
|
|
11
|
-
* methods. Each method
|
|
12
|
-
* giving
|
|
13
|
-
* `
|
|
10
|
+
* methods. Each method receives the AST node as the first argument and a typed
|
|
11
|
+
* `ctx` object as the second, giving access to `ctx.config`, `ctx.resolver`,
|
|
12
|
+
* `ctx.adapter`, `ctx.options`, `ctx.upsertFile`, etc.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Generators that return renderer elements (e.g. JSX) must declare a `renderer`
|
|
15
|
+
* factory so that core knows how to process the output without coupling core
|
|
16
|
+
* to any specific renderer package.
|
|
17
|
+
*
|
|
18
|
+
* Return a renderer element, an array of `FileNode`, or `void` to handle file
|
|
19
|
+
* writing manually via `ctx.upsertFile`.
|
|
18
20
|
*
|
|
19
21
|
* @example
|
|
20
22
|
* ```ts
|
|
23
|
+
* import { jsxRenderer } from '@kubb/renderer-jsx'
|
|
24
|
+
*
|
|
21
25
|
* export const typeGenerator = defineGenerator<PluginTs>({
|
|
22
26
|
* name: 'typescript',
|
|
23
|
-
*
|
|
24
|
-
*
|
|
27
|
+
* renderer: jsxRenderer,
|
|
28
|
+
* schema(node, ctx) {
|
|
29
|
+
* const { adapter, resolver, root, options } = ctx
|
|
25
30
|
* return <File ...><Type node={node} resolver={resolver} /></File>
|
|
26
31
|
* },
|
|
27
|
-
* operation(node,
|
|
32
|
+
* operation(node, ctx) {
|
|
33
|
+
* const { options } = ctx
|
|
28
34
|
* return <File ...><OperationType node={node} /></File>
|
|
29
35
|
* },
|
|
30
36
|
* })
|
|
31
37
|
* ```
|
|
32
38
|
*/
|
|
33
|
-
export type Generator<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
34
|
-
/**
|
|
39
|
+
export type Generator<TOptions extends PluginFactoryOptions = PluginFactoryOptions, TElement = unknown> = {
|
|
40
|
+
/**
|
|
41
|
+
* Used in diagnostic messages and debug output.
|
|
42
|
+
*/
|
|
35
43
|
name: string
|
|
44
|
+
/**
|
|
45
|
+
* Optional renderer factory that produces a {@link Renderer} for each render cycle.
|
|
46
|
+
*
|
|
47
|
+
* Generators that return renderer elements (e.g. JSX via `@kubb/renderer-jsx`) must set this
|
|
48
|
+
* to the matching renderer factory (e.g. `jsxRenderer` from `@kubb/renderer-jsx`).
|
|
49
|
+
*
|
|
50
|
+
* Generators that only return `Array<FileNode>` or `void` do not need to set this.
|
|
51
|
+
*
|
|
52
|
+
* Set `renderer: null` to explicitly opt out of rendering even when the parent plugin
|
|
53
|
+
* declares a `renderer` (overrides the plugin-level fallback).
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { jsxRenderer } from '@kubb/renderer-jsx'
|
|
58
|
+
* export const myGenerator = defineGenerator<PluginTs>({
|
|
59
|
+
* renderer: jsxRenderer,
|
|
60
|
+
* schema(node, ctx) { return <File ...>...</File> },
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
renderer?: RendererFactory<TElement> | null
|
|
36
65
|
/**
|
|
37
66
|
* Called for each schema node in the AST walk.
|
|
38
|
-
* `
|
|
39
|
-
* `options`
|
|
67
|
+
* `ctx` carries the plugin context with `adapter` and `inputNode` guaranteed present,
|
|
68
|
+
* plus `ctx.options` with the per-node resolved options (after exclude/include/override).
|
|
40
69
|
*/
|
|
41
|
-
schema?: (
|
|
70
|
+
schema?: (node: SchemaNode, ctx: GeneratorContext<TOptions>) => PossiblePromise<TElement | Array<FileNode> | void>
|
|
42
71
|
/**
|
|
43
72
|
* Called for each operation node in the AST walk.
|
|
44
|
-
* `
|
|
73
|
+
* `ctx` carries the plugin context with `adapter` and `inputNode` guaranteed present,
|
|
74
|
+
* plus `ctx.options` with the per-node resolved options (after exclude/include/override).
|
|
45
75
|
*/
|
|
46
|
-
operation?: (
|
|
47
|
-
this: GeneratorContext<TOptions>,
|
|
48
|
-
node: OperationNode,
|
|
49
|
-
options: TOptions['resolvedOptions'],
|
|
50
|
-
) => PossiblePromise<KubbReactNode | Array<FileNode> | void>
|
|
76
|
+
operation?: (node: OperationNode, ctx: GeneratorContext<TOptions>) => PossiblePromise<TElement | Array<FileNode> | void>
|
|
51
77
|
/**
|
|
52
78
|
* Called once after all operations have been walked.
|
|
53
|
-
* `
|
|
79
|
+
* `ctx` carries the plugin context with `adapter` and `inputNode` guaranteed present,
|
|
80
|
+
* plus `ctx.options` with the plugin-level options for the batch call.
|
|
54
81
|
*/
|
|
55
|
-
operations?: (
|
|
56
|
-
this: GeneratorContext<TOptions>,
|
|
57
|
-
nodes: Array<OperationNode>,
|
|
58
|
-
options: TOptions['resolvedOptions'],
|
|
59
|
-
) => PossiblePromise<KubbReactNode | Array<FileNode> | void>
|
|
82
|
+
operations?: (nodes: Array<OperationNode>, ctx: GeneratorContext<TOptions>) => PossiblePromise<TElement | Array<FileNode> | void>
|
|
60
83
|
}
|
|
61
84
|
|
|
62
85
|
/**
|
|
63
86
|
* Defines a generator. Returns the object as-is with correct `this` typings.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
87
|
+
* `applyHookResult` handles renderer elements and `File[]` uniformly using
|
|
88
|
+
* the generator's declared `renderer` factory.
|
|
66
89
|
*/
|
|
67
|
-
export function defineGenerator<TOptions extends PluginFactoryOptions = PluginFactoryOptions
|
|
90
|
+
export function defineGenerator<TOptions extends PluginFactoryOptions = PluginFactoryOptions, TElement = unknown>(
|
|
91
|
+
generator: Generator<TOptions, TElement>,
|
|
92
|
+
): Generator<TOptions, TElement> {
|
|
68
93
|
return generator
|
|
69
94
|
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Merges an array of generators into a single generator.
|
|
73
|
-
*
|
|
74
|
-
* The merged generator's `schema`, `operation`, and `operations` methods run
|
|
75
|
-
* the corresponding method from each input generator in sequence, applying each
|
|
76
|
-
* result via `applyHookResult`. This eliminates the need to write the loop
|
|
77
|
-
* manually in each plugin.
|
|
78
|
-
*
|
|
79
|
-
* @param generators - Array of generators to merge into a single generator.
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```ts
|
|
83
|
-
* const merged = mergeGenerators(generators)
|
|
84
|
-
*
|
|
85
|
-
* return {
|
|
86
|
-
* name: pluginName,
|
|
87
|
-
* schema: merged.schema,
|
|
88
|
-
* operation: merged.operation,
|
|
89
|
-
* operations: merged.operations,
|
|
90
|
-
* }
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
export function mergeGenerators<TOptions extends PluginFactoryOptions = PluginFactoryOptions>(generators: Array<Generator<TOptions>>): Generator<TOptions> {
|
|
94
|
-
return {
|
|
95
|
-
name: generators.length > 0 ? generators.map((g) => g.name).join('+') : 'merged',
|
|
96
|
-
async schema(node, options) {
|
|
97
|
-
for (const gen of generators) {
|
|
98
|
-
if (!gen.schema) continue
|
|
99
|
-
const result = await gen.schema.call(this, node, options)
|
|
100
|
-
|
|
101
|
-
await applyHookResult(result, this.driver)
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
async operation(node, options) {
|
|
105
|
-
for (const gen of generators) {
|
|
106
|
-
if (!gen.operation) continue
|
|
107
|
-
const result = await gen.operation.call(this, node, options)
|
|
108
|
-
|
|
109
|
-
await applyHookResult(result, this.driver)
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
async operations(nodes, options) {
|
|
113
|
-
for (const gen of generators) {
|
|
114
|
-
if (!gen.operations) continue
|
|
115
|
-
const result = await gen.operations.call(this, nodes, options)
|
|
116
|
-
|
|
117
|
-
await applyHookResult(result, this.driver)
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
}
|
|
121
|
-
}
|
package/src/defineLogger.ts
CHANGED
|
@@ -7,8 +7,8 @@ import type { Logger, LoggerOptions, UserLogger } from './types.ts'
|
|
|
7
7
|
* export const myLogger = defineLogger({
|
|
8
8
|
* name: 'my-logger',
|
|
9
9
|
* install(context, options) {
|
|
10
|
-
* context.on('info', (message) => console.log('ℹ', message))
|
|
11
|
-
* context.on('error', (error) => console.error('✗', error.message))
|
|
10
|
+
* context.on('kubb:info', (message) => console.log('ℹ', message))
|
|
11
|
+
* context.on('kubb:error', (error) => console.error('✗', error.message))
|
|
12
12
|
* },
|
|
13
13
|
* })
|
|
14
14
|
*/
|
package/src/defineParser.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileNode } from '@kubb/ast
|
|
1
|
+
import type { FileNode } from '@kubb/ast'
|
|
2
2
|
|
|
3
3
|
type PrintOptions = {
|
|
4
4
|
extname?: FileNode['extname']
|
|
@@ -10,7 +10,8 @@ export type Parser<TMeta extends object = any> = {
|
|
|
10
10
|
* File extensions this parser handles.
|
|
11
11
|
* Use `undefined` to create a catch-all fallback parser.
|
|
12
12
|
*
|
|
13
|
-
* @example
|
|
13
|
+
* @example Handled extensions
|
|
14
|
+
* `['.ts', '.js']`
|
|
14
15
|
*/
|
|
15
16
|
extNames: Array<FileNode['extname']> | undefined
|
|
16
17
|
/**
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { KubbHooks } from './Kubb.ts'
|
|
2
|
+
import type { KubbPluginSetupContext, PluginFactoryOptions } from './types.ts'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base hook handlers for all events except `kubb:plugin:setup`.
|
|
6
|
+
* These handlers have identical signatures regardless of the plugin's
|
|
7
|
+
* `PluginFactoryOptions` generic — they are split out so that the
|
|
8
|
+
* interface below only needs to override the one event that depends on
|
|
9
|
+
* the plugin type.
|
|
10
|
+
*/
|
|
11
|
+
type PluginHooksBase = {
|
|
12
|
+
[K in Exclude<keyof KubbHooks, 'kubb:plugin:setup'>]?: (...args: KubbHooks[K]) => void | Promise<void>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Plugin hook handlers.
|
|
17
|
+
*
|
|
18
|
+
* `kubb:plugin:setup` is typed with the plugin's own `PluginFactoryOptions` so
|
|
19
|
+
* `ctx.setResolver`, `ctx.setOptions`, `ctx.options` etc. use the correct types.
|
|
20
|
+
*
|
|
21
|
+
* Uses interface + method shorthand for `kubb:plugin:setup`
|
|
22
|
+
* checking, allowing `PluginHooks<PluginTs>` to be assignable to `PluginHooks`.
|
|
23
|
+
*
|
|
24
|
+
* @template TFactory - The plugin's `PluginFactoryOptions` type.
|
|
25
|
+
*/
|
|
26
|
+
export interface PluginHooks<TFactory extends PluginFactoryOptions = PluginFactoryOptions> extends PluginHooksBase {
|
|
27
|
+
'kubb:plugin:setup'?(ctx: KubbPluginSetupContext<TFactory>): void | Promise<void>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A hook-style plugin object produced by `definePlugin`.
|
|
32
|
+
* Instead of flat lifecycle methods, it groups all handlers under a `hooks:` property
|
|
33
|
+
* (matching Astro's integration naming convention).
|
|
34
|
+
*
|
|
35
|
+
* @template TFactory - The plugin's `PluginFactoryOptions` type.
|
|
36
|
+
*/
|
|
37
|
+
export type HookStylePlugin<TFactory extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
38
|
+
/**
|
|
39
|
+
* Unique name for the plugin, following the same naming convention as `createPlugin`.
|
|
40
|
+
*/
|
|
41
|
+
name: string
|
|
42
|
+
/**
|
|
43
|
+
* Plugins that must be registered before this plugin executes.
|
|
44
|
+
* An error is thrown at startup when any listed dependency is missing.
|
|
45
|
+
*/
|
|
46
|
+
dependencies?: Array<string>
|
|
47
|
+
/**
|
|
48
|
+
* The options passed by the user when calling the plugin factory.
|
|
49
|
+
*/
|
|
50
|
+
options?: TFactory['options']
|
|
51
|
+
/**
|
|
52
|
+
* Lifecycle event handlers for this plugin.
|
|
53
|
+
* Any event from the global `KubbHooks` map can be subscribed to here.
|
|
54
|
+
*/
|
|
55
|
+
hooks: PluginHooks<TFactory>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns `true` when `plugin` is a hook-style plugin created with `definePlugin`.
|
|
60
|
+
*
|
|
61
|
+
* Used by `PluginDriver` to distinguish hook-style plugins from legacy `createPlugin` plugins
|
|
62
|
+
* so it can normalize them and register their handlers on the `AsyncEventEmitter`.
|
|
63
|
+
*/
|
|
64
|
+
export function isHookStylePlugin(plugin: unknown): plugin is HookStylePlugin {
|
|
65
|
+
return typeof plugin === 'object' && plugin !== null && 'hooks' in plugin
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Creates a plugin factory using the new hook-style (`hooks:`) API.
|
|
70
|
+
*
|
|
71
|
+
* The returned factory is called with optional options and produces a `HookStylePlugin`
|
|
72
|
+
* that coexists with plugins created via the legacy `createPlugin` API in the same
|
|
73
|
+
* `kubb.config.ts`.
|
|
74
|
+
*
|
|
75
|
+
* Lifecycle handlers are registered on the `PluginDriver`'s `AsyncEventEmitter`, enabling
|
|
76
|
+
* both the plugin's own handlers and external tooling (CLI, devtools) to observe every event.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* // With PluginFactoryOptions (recommended for real plugins)
|
|
81
|
+
* export const pluginTs = definePlugin<PluginTs>((options) => ({
|
|
82
|
+
* name: 'plugin-ts',
|
|
83
|
+
* hooks: {
|
|
84
|
+
* 'kubb:plugin:setup'(ctx) {
|
|
85
|
+
* ctx.setResolver(resolverTs) // typed as Partial<ResolverTs>
|
|
86
|
+
* },
|
|
87
|
+
* },
|
|
88
|
+
* }))
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export function definePlugin<TFactory extends PluginFactoryOptions = PluginFactoryOptions>(
|
|
92
|
+
factory: (options: TFactory['options']) => HookStylePlugin<TFactory>,
|
|
93
|
+
): (options?: TFactory['options']) => HookStylePlugin<TFactory> {
|
|
94
|
+
return (options) => factory(options ?? ({} as TFactory['options']))
|
|
95
|
+
}
|
package/src/defineResolver.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { camelCase, pascalCase } from '@internals/utils'
|
|
3
|
+
import type { FileNode, InputNode, Node, OperationNode, SchemaNode } from '@kubb/ast'
|
|
3
4
|
import { createFile, isOperationNode, isSchemaNode } from '@kubb/ast'
|
|
4
|
-
import type { FileNode, InputNode, Node, OperationNode, SchemaNode } from '@kubb/ast/types'
|
|
5
5
|
import { getMode } from './PluginDriver.ts'
|
|
6
6
|
import type {
|
|
7
7
|
Config,
|
package/src/devtools.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export { AsyncEventEmitter, URLPath } from '@internals/utils'
|
|
2
|
+
export * as ast from '@kubb/ast'
|
|
2
3
|
export { composeTransformers, definePrinter } from '@kubb/ast'
|
|
3
|
-
export { build, build as default, safeBuild, setup } from './build.ts'
|
|
4
4
|
export { formatters, linters, logLevel } from './constants.ts'
|
|
5
5
|
export { createAdapter } from './createAdapter.ts'
|
|
6
|
+
export { createKubb } from './createKubb.ts'
|
|
6
7
|
export { createPlugin } from './createPlugin.ts'
|
|
8
|
+
export { createRenderer } from './createRenderer.ts'
|
|
7
9
|
export { createStorage } from './createStorage.ts'
|
|
8
|
-
export {
|
|
9
|
-
export { defineGenerator, mergeGenerators } from './defineGenerator.ts'
|
|
10
|
+
export { defineGenerator } from './defineGenerator.ts'
|
|
10
11
|
export { defineLogger } from './defineLogger.ts'
|
|
11
12
|
export { defineParser } from './defineParser.ts'
|
|
12
|
-
export {
|
|
13
|
+
export { definePlugin } from './definePlugin.ts'
|
|
13
14
|
export {
|
|
14
15
|
buildDefaultBanner,
|
|
15
16
|
defaultResolveBanner,
|
|
@@ -26,10 +27,8 @@ export * from './types.ts'
|
|
|
26
27
|
export type { FunctionParamsAST } from './utils/FunctionParams.ts'
|
|
27
28
|
export { detectFormatter } from './utils/formatters.ts'
|
|
28
29
|
export { getBarrelFiles } from './utils/getBarrelFiles.ts'
|
|
29
|
-
export { getConfigs } from './utils/getConfigs.ts'
|
|
30
30
|
export type { Param, Params } from './utils/getFunctionParams.ts'
|
|
31
31
|
export { createFunctionParams, FunctionParams, getFunctionParams } from './utils/getFunctionParams.ts'
|
|
32
|
-
export { getPreset } from './utils/getPreset.ts'
|
|
33
32
|
export { isInputPath } from './utils/isInputPath.ts'
|
|
34
33
|
export { detectLinter } from './utils/linters.ts'
|
|
35
34
|
export { satisfiesDependency } from './utils/packageJSON.ts'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { FileNode } from '@kubb/ast'
|
|
2
|
+
import type { RendererFactory } from './createRenderer.ts'
|
|
3
|
+
import type { PluginDriver } from './PluginDriver.ts'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Handles the return value of a plugin AST hook or generator method.
|
|
7
|
+
*
|
|
8
|
+
* - Renderer output → rendered via the provided `rendererFactory` (e.g. JSX), files stored in `driver.fileManager`
|
|
9
|
+
* - `Array<FileNode>` → added directly into `driver.fileManager`
|
|
10
|
+
* - `void` / `null` / `undefined` → no-op (plugin handled it via `this.upsertFile`)
|
|
11
|
+
*
|
|
12
|
+
* Pass a `rendererFactory` (e.g. `jsxRenderer` from `@kubb/renderer-jsx`) when the result
|
|
13
|
+
* may be a renderer element. Generators that only return `Array<FileNode>` do not need one.
|
|
14
|
+
*/
|
|
15
|
+
export async function applyHookResult<TElement = unknown>(
|
|
16
|
+
result: TElement | Array<FileNode> | void,
|
|
17
|
+
driver: PluginDriver,
|
|
18
|
+
rendererFactory?: RendererFactory<TElement>,
|
|
19
|
+
): Promise<void> {
|
|
20
|
+
if (!result) return
|
|
21
|
+
|
|
22
|
+
if (Array.isArray(result)) {
|
|
23
|
+
driver.fileManager.upsert(...(result as Array<FileNode>))
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!rendererFactory) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const renderer = rendererFactory()
|
|
32
|
+
await renderer.render(result)
|
|
33
|
+
driver.fileManager.upsert(...renderer.files)
|
|
34
|
+
renderer.unmount()
|
|
35
|
+
}
|