@pikku/cli 0.7.7 → 0.8.1
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/CHANGELOG.md +43 -0
- package/bin/pikku-all.ts +188 -91
- package/bin/pikku-fetch.ts +10 -38
- package/bin/pikku-nextjs.ts +12 -113
- package/bin/pikku-openapi.ts +9 -54
- package/bin/pikku-queue-service.ts +28 -0
- package/bin/pikku-schemas.ts +6 -32
- package/bin/pikku-websocket.ts +11 -41
- package/bin/pikku.ts +2 -0
- package/cli.schema.json +113 -10
- package/dist/bin/pikku-all.d.ts +1 -1
- package/dist/bin/pikku-all.js +105 -84
- package/dist/bin/pikku-fetch.d.ts +1 -3
- package/dist/bin/pikku-fetch.js +9 -15
- package/dist/bin/pikku-nextjs.d.ts +1 -4
- package/dist/bin/pikku-nextjs.js +10 -40
- package/dist/bin/pikku-openapi.d.ts +0 -3
- package/dist/bin/pikku-openapi.js +8 -24
- package/dist/bin/pikku-queue-service.d.ts +4 -0
- package/dist/bin/pikku-queue-service.js +19 -0
- package/dist/bin/pikku-schemas.d.ts +0 -3
- package/dist/bin/pikku-schemas.js +5 -11
- package/dist/bin/pikku-websocket.d.ts +1 -3
- package/dist/bin/pikku-websocket.js +9 -18
- package/dist/bin/pikku.js +2 -0
- package/dist/src/events/channels/pikku-channels.d.ts +2 -0
- package/dist/src/events/channels/pikku-channels.js +9 -0
- package/dist/src/events/channels/pikku-command-channels-map.d.ts +2 -0
- package/dist/src/events/channels/pikku-command-channels-map.js +8 -0
- package/dist/src/events/channels/pikku-command-channels.d.ts +2 -0
- package/dist/src/events/channels/pikku-command-channels.js +9 -0
- package/dist/src/events/channels/pikku-command-websocket-typed.d.ts +2 -0
- package/dist/src/events/channels/pikku-command-websocket-typed.js +15 -0
- package/dist/src/{serialize-typed-channel-map.js → events/channels/serialize-typed-channel-map.js} +2 -2
- package/dist/src/events/fetch/index.d.ts +2 -0
- package/dist/src/events/fetch/index.js +12 -0
- package/dist/src/events/functions/pikku-command-function-types.d.ts +2 -0
- package/dist/src/events/functions/pikku-command-function-types.js +13 -0
- package/dist/src/events/functions/pikku-command-functions.d.ts +6 -0
- package/dist/src/events/functions/pikku-command-functions.js +35 -0
- package/dist/src/events/functions/pikku-command-services.d.ts +3 -0
- package/dist/src/events/functions/pikku-command-services.js +73 -0
- package/dist/src/events/functions/pikku-function-types.d.ts +2 -0
- package/dist/{bin → src/events/functions}/pikku-function-types.js +6 -6
- package/dist/src/events/functions/pikku-functions.d.ts +6 -0
- package/dist/{bin → src/events/functions}/pikku-functions.js +5 -5
- package/dist/src/events/http/pikku-command-http-map.d.ts +2 -0
- package/dist/src/events/http/pikku-command-http-map.js +8 -0
- package/dist/src/events/http/pikku-command-http-routes.d.ts +2 -0
- package/dist/src/events/http/pikku-command-http-routes.js +9 -0
- package/dist/src/events/http/pikku-command-openapi.d.ts +2 -0
- package/dist/src/events/http/pikku-command-openapi.js +20 -0
- package/dist/src/events/http/pikku-http-routes.d.ts +2 -0
- package/dist/src/events/http/pikku-http-routes.js +9 -0
- package/dist/src/{serialize-typed-http-map.d.ts → events/http/serialize-typed-http-map.d.ts} +0 -1
- package/dist/src/{serialize-typed-http-map.js → events/http/serialize-typed-http-map.js} +2 -15
- package/dist/src/events/mcp/pikku-command-mcp-json.d.ts +2 -0
- package/dist/src/events/mcp/pikku-command-mcp-json.js +13 -0
- package/dist/src/events/mcp/pikku-command-mcp.d.ts +2 -0
- package/dist/src/events/mcp/pikku-command-mcp.js +54 -0
- package/dist/src/events/mcp/serialize-mcp-json.d.ts +5 -0
- package/dist/src/events/mcp/serialize-mcp-json.js +101 -0
- package/dist/src/events/queue/pikku-command-queue-map.d.ts +2 -0
- package/dist/src/events/queue/pikku-command-queue-map.js +8 -0
- package/dist/src/events/queue/pikku-command-queue-service.d.ts +2 -0
- package/dist/src/events/queue/pikku-command-queue-service.js +12 -0
- package/dist/src/events/queue/pikku-command-queue.d.ts +2 -0
- package/dist/src/events/queue/pikku-command-queue.js +10 -0
- package/dist/src/events/queue/pikku-queue-map.d.ts +2 -0
- package/dist/src/events/queue/pikku-queue-map.js +8 -0
- package/dist/src/events/queue/pikku-queue.d.ts +2 -0
- package/dist/src/events/queue/pikku-queue.js +10 -0
- package/dist/src/events/queue/serialize-queue-map.d.ts +4 -0
- package/dist/src/events/queue/serialize-queue-map.js +77 -0
- package/dist/src/events/queue/serialize-queue-meta.d.ts +2 -0
- package/dist/src/events/queue/serialize-queue-meta.js +6 -0
- package/dist/src/events/queue/serialize-queue-wrapper.d.ts +1 -0
- package/dist/src/events/queue/serialize-queue-wrapper.js +35 -0
- package/dist/src/events/rpc/pikku-command-rpc-client.d.ts +2 -0
- package/dist/src/events/rpc/pikku-command-rpc-client.js +12 -0
- package/dist/src/events/rpc/pikku-command-rpc-map.d.ts +2 -0
- package/dist/src/events/rpc/pikku-command-rpc-map.js +8 -0
- package/dist/src/events/rpc/pikku-command-rpc.d.ts +2 -0
- package/dist/src/events/rpc/pikku-command-rpc.js +6 -0
- package/dist/src/events/rpc/pikku-rpc.d.ts +2 -0
- package/dist/src/events/rpc/pikku-rpc.js +6 -0
- package/dist/src/events/rpc/serialize-rpc-wrapper.d.ts +1 -0
- package/dist/src/events/rpc/serialize-rpc-wrapper.js +29 -0
- package/dist/src/{serialize-typed-rpc-map.d.ts → events/rpc/serialize-typed-rpc-map.d.ts} +1 -1
- package/dist/src/{serialize-typed-rpc-map.js → events/rpc/serialize-typed-rpc-map.js} +3 -3
- package/dist/src/events/scheduler/pikku-command-scheduler.d.ts +2 -0
- package/dist/src/events/scheduler/pikku-command-scheduler.js +10 -0
- package/dist/src/inspector-glob.d.ts +1 -1
- package/dist/src/inspector-glob.js +4 -4
- package/dist/src/pikku-cli-config.d.ts +12 -2
- package/dist/src/pikku-cli-config.js +79 -30
- package/dist/src/pikku-command-schemas.d.ts +2 -0
- package/dist/src/pikku-command-schemas.js +8 -0
- package/dist/src/runtimes/nextjs/pikku-command-nextjs.d.ts +2 -0
- package/dist/src/runtimes/nextjs/pikku-command-nextjs.js +36 -0
- package/dist/src/schema-generator.d.ts +3 -2
- package/dist/src/schema-generator.js +9 -9
- package/dist/src/schemas.d.ts +2 -0
- package/dist/src/schemas.js +8 -0
- package/dist/src/{utils/serialize-import-map.js → serialize-import-map.js} +3 -0
- package/dist/src/serialize-pikku-types.js +378 -1
- package/dist/src/types.d.ts +5 -0
- package/dist/src/types.js +1 -0
- package/dist/src/{utils/utils.d.ts → utils.d.ts} +20 -7
- package/dist/src/{utils/utils.js → utils.js} +56 -32
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/{bin → src/events/channels}/pikku-channels.ts +8 -3
- package/src/events/channels/pikku-command-channels-map.ts +26 -0
- package/src/events/channels/pikku-command-channels.ts +38 -0
- package/src/events/channels/pikku-command-websocket-typed.ts +36 -0
- package/src/{serialize-typed-channel-map.ts → events/channels/serialize-typed-channel-map.ts} +2 -2
- package/src/events/fetch/index.ts +33 -0
- package/src/events/functions/pikku-command-function-types.ts +48 -0
- package/src/events/functions/pikku-command-functions.ts +84 -0
- package/src/events/functions/pikku-command-services.ts +125 -0
- package/{bin → src/events/functions}/pikku-function-types.ts +12 -15
- package/{bin → src/events/functions}/pikku-functions.ts +9 -6
- package/src/events/http/pikku-command-http-map.ts +27 -0
- package/src/events/http/pikku-command-http-routes.ts +40 -0
- package/src/events/http/pikku-command-openapi.ts +54 -0
- package/{bin → src/events/http}/pikku-http-routes.ts +8 -3
- package/src/{serialize-typed-http-map.ts → events/http/serialize-typed-http-map.ts} +2 -19
- package/src/events/mcp/pikku-command-mcp-json.ts +33 -0
- package/src/events/mcp/pikku-command-mcp.ts +110 -0
- package/src/events/mcp/serialize-mcp-json.ts +159 -0
- package/src/events/queue/pikku-command-queue-map.ts +26 -0
- package/src/events/queue/pikku-command-queue-service.ts +33 -0
- package/src/events/queue/pikku-command-queue.ts +42 -0
- package/src/events/queue/pikku-queue-map.ts +26 -0
- package/src/events/queue/pikku-queue.ts +40 -0
- package/src/events/queue/serialize-queue-map.ts +119 -0
- package/src/events/queue/serialize-queue-meta.ts +10 -0
- package/src/events/queue/serialize-queue-wrapper.ts +35 -0
- package/src/events/rpc/pikku-command-rpc-client.ts +33 -0
- package/src/events/rpc/pikku-command-rpc-map.ts +26 -0
- package/src/events/rpc/pikku-command-rpc.ts +22 -0
- package/{bin → src/events/rpc}/pikku-rpc.ts +8 -6
- package/src/events/rpc/serialize-rpc-wrapper.ts +29 -0
- package/src/{serialize-typed-rpc-map.ts → events/rpc/serialize-typed-rpc-map.ts} +5 -4
- package/{bin/pikku-scheduler.ts → src/events/scheduler/pikku-command-scheduler.ts} +11 -8
- package/src/inspector-glob.ts +4 -2
- package/src/pikku-cli-config.ts +119 -42
- package/src/pikku-command-schemas.ts +33 -0
- package/src/runtimes/nextjs/pikku-command-nextjs.ts +110 -0
- package/src/schema-generator.ts +10 -5
- package/src/schemas.ts +33 -0
- package/src/{utils/serialize-import-map.ts → serialize-import-map.ts} +5 -0
- package/src/serialize-pikku-types.ts +378 -1
- package/src/types.ts +16 -0
- package/src/{utils/utils.ts → utils.ts} +68 -34
- package/tsconfig.json +1 -1
- package/bin/pikku-channels-map.ts +0 -25
- package/bin/pikku-http-map.ts +0 -26
- package/bin/pikku-nextjs.test.ts +0 -279
- package/bin/pikku-rpc-map.ts +0 -25
- package/dist/bin/pikku-channels-map.d.ts +0 -3
- package/dist/bin/pikku-channels-map.js +0 -8
- package/dist/bin/pikku-channels.d.ts +0 -3
- package/dist/bin/pikku-channels.js +0 -9
- package/dist/bin/pikku-function-types.d.ts +0 -4
- package/dist/bin/pikku-functions.d.ts +0 -7
- package/dist/bin/pikku-http-map.d.ts +0 -3
- package/dist/bin/pikku-http-map.js +0 -8
- package/dist/bin/pikku-http-routes.d.ts +0 -3
- package/dist/bin/pikku-http-routes.js +0 -9
- package/dist/bin/pikku-rpc-map.d.ts +0 -3
- package/dist/bin/pikku-rpc-map.js +0 -8
- package/dist/bin/pikku-rpc.d.ts +0 -3
- package/dist/bin/pikku-rpc.js +0 -6
- package/dist/bin/pikku-scheduler.d.ts +0 -3
- package/dist/bin/pikku-scheduler.js +0 -10
- /package/dist/src/{serialize-typed-channel-map.d.ts → events/channels/serialize-typed-channel-map.d.ts} +0 -0
- /package/dist/src/{serialize-websocket-wrapper.d.ts → events/channels/serialize-websocket-wrapper.d.ts} +0 -0
- /package/dist/src/{serialize-websocket-wrapper.js → events/channels/serialize-websocket-wrapper.js} +0 -0
- /package/dist/src/{openapi-spec-generator.d.ts → events/http/openapi-spec-generator.d.ts} +0 -0
- /package/dist/src/{openapi-spec-generator.js → events/http/openapi-spec-generator.js} +0 -0
- /package/dist/src/{serialize-fetch-wrapper.d.ts → events/http/serialize-fetch-wrapper.d.ts} +0 -0
- /package/dist/src/{serialize-fetch-wrapper.js → events/http/serialize-fetch-wrapper.js} +0 -0
- /package/dist/src/{serialize-scheduler-meta.d.ts → events/scheduler/serialize-scheduler-meta.d.ts} +0 -0
- /package/dist/src/{serialize-scheduler-meta.js → events/scheduler/serialize-scheduler-meta.js} +0 -0
- /package/dist/src/{serialize-nextjs-backend-wrapper.d.ts → runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts} +0 -0
- /package/dist/src/{serialize-nextjs-backend-wrapper.js → runtimes/nextjs/serialize-nextjs-backend-wrapper.js} +0 -0
- /package/dist/src/{serialize-nextjs-http-wrapper.d.ts → runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts} +0 -0
- /package/dist/src/{serialize-nextjs-http-wrapper.js → runtimes/nextjs/serialize-nextjs-http-wrapper.js} +0 -0
- /package/dist/src/{utils/serialize-import-map.d.ts → serialize-import-map.d.ts} +0 -0
- /package/src/{serialize-websocket-wrapper.ts → events/channels/serialize-websocket-wrapper.ts} +0 -0
- /package/src/{openapi-spec-generator.ts → events/http/openapi-spec-generator.ts} +0 -0
- /package/src/{serialize-fetch-wrapper.ts → events/http/serialize-fetch-wrapper.ts} +0 -0
- /package/src/{serialize-scheduler-meta.ts → events/scheduler/serialize-scheduler-meta.ts} +0 -0
- /package/src/{serialize-nextjs-backend-wrapper.ts → runtimes/nextjs/serialize-nextjs-backend-wrapper.ts} +0 -0
- /package/src/{serialize-nextjs-http-wrapper.ts → runtimes/nextjs/serialize-nextjs-http-wrapper.ts} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { queueWorkersMeta } from '@pikku/core/queue'
|
|
2
|
+
import { serializeImportMap } from '../../serialize-import-map.js'
|
|
3
|
+
import { TypesMap } from '@pikku/inspector'
|
|
4
|
+
import { FunctionsMeta } from '@pikku/core'
|
|
5
|
+
import { generateCustomTypes } from '../../utils.js'
|
|
6
|
+
|
|
7
|
+
export const serializeQueueMap = (
|
|
8
|
+
relativeToPath: string,
|
|
9
|
+
packageMappings: Record<string, string>,
|
|
10
|
+
typesMap: TypesMap,
|
|
11
|
+
functionsMeta: FunctionsMeta,
|
|
12
|
+
queueWorkersMeta: queueWorkersMeta
|
|
13
|
+
) => {
|
|
14
|
+
const requiredTypes = new Set<string>()
|
|
15
|
+
const serializedCustomTypes = generateCustomTypes(typesMap, requiredTypes)
|
|
16
|
+
const serializedQueues = generateQueues(
|
|
17
|
+
queueWorkersMeta,
|
|
18
|
+
functionsMeta,
|
|
19
|
+
typesMap,
|
|
20
|
+
requiredTypes
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
const serializedImportMap = serializeImportMap(
|
|
24
|
+
relativeToPath,
|
|
25
|
+
packageMappings,
|
|
26
|
+
typesMap,
|
|
27
|
+
requiredTypes
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
return `/**
|
|
31
|
+
* This provides the structure needed for typescript to be aware of Queue workers and their input/output types
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
${serializedImportMap}
|
|
35
|
+
${serializedCustomTypes}
|
|
36
|
+
|
|
37
|
+
import type { QueueJob } from '@pikku/core/queue'
|
|
38
|
+
|
|
39
|
+
interface QueueHandler<I, O> {
|
|
40
|
+
input: I;
|
|
41
|
+
output: O;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
${serializedQueues}
|
|
45
|
+
|
|
46
|
+
type QueueAdd = <Name extends keyof QueueMap>(
|
|
47
|
+
name: Name,
|
|
48
|
+
data: QueueMap[Name]['input'],
|
|
49
|
+
options?: {
|
|
50
|
+
priority?: number
|
|
51
|
+
delay?: number
|
|
52
|
+
attempts?: number
|
|
53
|
+
removeOnComplete?: number
|
|
54
|
+
removeOnFail?: number
|
|
55
|
+
jobId?: string
|
|
56
|
+
}
|
|
57
|
+
) => Promise<string>
|
|
58
|
+
|
|
59
|
+
type QueueGetJob = <Name extends keyof QueueMap>(
|
|
60
|
+
name: Name,
|
|
61
|
+
jobId: string
|
|
62
|
+
) => Promise<QueueJob<QueueMap[Name]['input'], QueueMap[Name]['output']> | null>
|
|
63
|
+
|
|
64
|
+
export type TypedPikkuQueue = {
|
|
65
|
+
add: QueueAdd;
|
|
66
|
+
getJob: QueueGetJob;
|
|
67
|
+
}
|
|
68
|
+
`
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function generateQueues(
|
|
72
|
+
queueWorkersMeta: queueWorkersMeta,
|
|
73
|
+
functionsMeta: FunctionsMeta,
|
|
74
|
+
typesMap: TypesMap,
|
|
75
|
+
requiredTypes: Set<string>
|
|
76
|
+
) {
|
|
77
|
+
// Initialize an object to collect queues
|
|
78
|
+
const queuesObj: Record<string, { inputType: string; outputType: string }> =
|
|
79
|
+
{}
|
|
80
|
+
|
|
81
|
+
// Iterate through Queue metadata
|
|
82
|
+
for (const [queueName, { pikkuFuncName }] of Object.entries(
|
|
83
|
+
queueWorkersMeta
|
|
84
|
+
)) {
|
|
85
|
+
const functionMeta = functionsMeta[pikkuFuncName]
|
|
86
|
+
if (!functionMeta) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
`Function ${queueName} not found in functionsMeta. Please check your configuration.`
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const input = functionMeta.inputs ? functionMeta.inputs[0] : undefined
|
|
93
|
+
const output = functionMeta.outputs ? functionMeta.outputs[0] : undefined
|
|
94
|
+
|
|
95
|
+
// Store the input and output types for QueueHandler
|
|
96
|
+
const inputType = input ? typesMap.getTypeMeta(input).uniqueName : 'null'
|
|
97
|
+
const outputType = output ? typesMap.getTypeMeta(output).uniqueName : 'null'
|
|
98
|
+
|
|
99
|
+
requiredTypes.add(inputType)
|
|
100
|
+
requiredTypes.add(outputType)
|
|
101
|
+
|
|
102
|
+
// Add Queue entry
|
|
103
|
+
queuesObj[queueName] = {
|
|
104
|
+
inputType,
|
|
105
|
+
outputType,
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Build the Queues object as a string
|
|
110
|
+
let queuesStr = 'export type QueueMap = {\n'
|
|
111
|
+
|
|
112
|
+
for (const [queueName, handler] of Object.entries(queuesObj)) {
|
|
113
|
+
queuesStr += ` readonly '${queueName}': QueueHandler<${handler.inputType}, ${handler.outputType}>,\n`
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
queuesStr += '};\n'
|
|
117
|
+
|
|
118
|
+
return queuesStr
|
|
119
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { queueWorkersMeta } from '@pikku/core'
|
|
2
|
+
|
|
3
|
+
export const serializeQueueMeta = (queueWorkersMeta: queueWorkersMeta) => {
|
|
4
|
+
const serializedOutput: string[] = []
|
|
5
|
+
serializedOutput.push("import { pikkuState } from '@pikku/core'")
|
|
6
|
+
serializedOutput.push(
|
|
7
|
+
`pikkuState('queue', 'meta', ${JSON.stringify(queueWorkersMeta, null, 2)})`
|
|
8
|
+
)
|
|
9
|
+
return serializedOutput.join('\n')
|
|
10
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const serializeQueueWrapper = (queueMapPath: string) => {
|
|
2
|
+
return `
|
|
3
|
+
import type { QueueService, QueueJob } from '@pikku/core/queue'
|
|
4
|
+
import type { QueueMap, TypedPikkuQueue } from '${queueMapPath}'
|
|
5
|
+
|
|
6
|
+
export class PikkuQueue implements TypedPikkuQueue {
|
|
7
|
+
constructor(private queueService: QueueService) {}
|
|
8
|
+
|
|
9
|
+
public async add<Name extends keyof QueueMap>(
|
|
10
|
+
queueName: Name,
|
|
11
|
+
data: QueueMap[Name]['input'],
|
|
12
|
+
options?: {
|
|
13
|
+
priority?: number
|
|
14
|
+
delay?: number
|
|
15
|
+
attempts?: number
|
|
16
|
+
removeOnComplete?: number
|
|
17
|
+
removeOnFail?: number
|
|
18
|
+
jobId?: string
|
|
19
|
+
}
|
|
20
|
+
): Promise<string> {
|
|
21
|
+
return this.queueService.add(queueName as string, data, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public async getJob<Name extends keyof QueueMap>(
|
|
25
|
+
queueName: Name,
|
|
26
|
+
jobId: string
|
|
27
|
+
): Promise<QueueJob<QueueMap[Name]['input'], QueueMap[Name]['output']> | null> {
|
|
28
|
+
return this.queueService.getJob<QueueMap[Name]['input'], QueueMap[Name]['output']>(
|
|
29
|
+
queueName as string,
|
|
30
|
+
jobId
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`
|
|
35
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { serializeRPCWrapper } from './serialize-rpc-wrapper.js'
|
|
2
|
+
import {
|
|
3
|
+
getFileImportRelativePath,
|
|
4
|
+
logCommandInfoAndTime,
|
|
5
|
+
writeFileInDir,
|
|
6
|
+
} from '../../utils.js'
|
|
7
|
+
import { PikkuCommandWithoutState } from '../../types.js'
|
|
8
|
+
|
|
9
|
+
export const pikkuRPCClient: PikkuCommandWithoutState = async (
|
|
10
|
+
logger,
|
|
11
|
+
{ rpcFile, rpcMapDeclarationFile, packageMappings }
|
|
12
|
+
) => {
|
|
13
|
+
return await logCommandInfoAndTime(
|
|
14
|
+
logger,
|
|
15
|
+
'Generating RPC wrapper',
|
|
16
|
+
'Generated RPC wrapper',
|
|
17
|
+
[rpcFile === undefined, "rpcFile isn't set in the pikku config"],
|
|
18
|
+
async () => {
|
|
19
|
+
if (!rpcFile) {
|
|
20
|
+
throw new Error("rpcFile isn't set in the pikku config")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const rpcMapDeclarationPath = getFileImportRelativePath(
|
|
24
|
+
rpcFile,
|
|
25
|
+
rpcMapDeclarationFile,
|
|
26
|
+
packageMappings
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const content = [serializeRPCWrapper(rpcMapDeclarationPath)]
|
|
30
|
+
await writeFileInDir(logger, rpcFile, content.join('\n'))
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { logCommandInfoAndTime, writeFileInDir } from '../../utils.js'
|
|
2
|
+
import { serializeTypedRPCMap } from './serialize-typed-rpc-map.js'
|
|
3
|
+
import { PikkuCommand } from '../../types.js'
|
|
4
|
+
|
|
5
|
+
export const pikkuRPCMap: PikkuCommand = async (
|
|
6
|
+
logger,
|
|
7
|
+
{ rpcMapDeclarationFile, packageMappings },
|
|
8
|
+
{ functions, rpc }
|
|
9
|
+
) => {
|
|
10
|
+
return await logCommandInfoAndTime(
|
|
11
|
+
logger,
|
|
12
|
+
'Creating RPC map',
|
|
13
|
+
'Created RPC map',
|
|
14
|
+
[false],
|
|
15
|
+
async () => {
|
|
16
|
+
const content = serializeTypedRPCMap(
|
|
17
|
+
rpcMapDeclarationFile,
|
|
18
|
+
packageMappings,
|
|
19
|
+
functions.typesMap,
|
|
20
|
+
functions.meta,
|
|
21
|
+
rpc.meta
|
|
22
|
+
)
|
|
23
|
+
await writeFileInDir(logger, rpcMapDeclarationFile, content)
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { logCommandInfoAndTime, writeFileInDir } from '../../utils.js'
|
|
2
|
+
import { PikkuCommand } from '../../types.js'
|
|
3
|
+
|
|
4
|
+
export const pikkuRPC: PikkuCommand = async (
|
|
5
|
+
logger,
|
|
6
|
+
{ rpcMetaFile },
|
|
7
|
+
{ rpc }
|
|
8
|
+
) => {
|
|
9
|
+
return await logCommandInfoAndTime(
|
|
10
|
+
logger,
|
|
11
|
+
'Finding RPCs tasks',
|
|
12
|
+
'Found RPCs',
|
|
13
|
+
[false],
|
|
14
|
+
async () => {
|
|
15
|
+
await writeFileInDir(
|
|
16
|
+
logger,
|
|
17
|
+
rpcMetaFile,
|
|
18
|
+
`import { pikkuState } from '@pikku/core'\npikkuState('rpc', 'meta', ${JSON.stringify(rpc.meta, null, 2)})`
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { logCommandInfoAndTime, writeFileInDir } from '../src/utils/utils.js'
|
|
1
|
+
import { logCommandInfoAndTime, writeFileInDir } from '../../utils.js'
|
|
2
|
+
import { PikkuCommand } from '../../types.js'
|
|
4
3
|
|
|
5
|
-
export const pikkuRPC = async (
|
|
6
|
-
|
|
7
|
-
{
|
|
4
|
+
export const pikkuRPC: PikkuCommand = async (
|
|
5
|
+
logger,
|
|
6
|
+
{ rpcMetaFile },
|
|
7
|
+
{ rpc }
|
|
8
8
|
) => {
|
|
9
9
|
return await logCommandInfoAndTime(
|
|
10
|
+
logger,
|
|
10
11
|
'Finding RPCs tasks',
|
|
11
12
|
'Found RPCs',
|
|
12
13
|
[false],
|
|
13
14
|
async () => {
|
|
14
15
|
await writeFileInDir(
|
|
16
|
+
logger,
|
|
15
17
|
rpcMetaFile,
|
|
16
18
|
`import { pikkuState } from '@pikku/core'\npikkuState('rpc', 'meta', ${JSON.stringify(rpc.meta, null, 2)})`
|
|
17
19
|
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const serializeRPCWrapper = (rpcMapPath: string) => {
|
|
2
|
+
return `
|
|
3
|
+
import { PikkuFetch } from "./pikku-fetch.gen.js"
|
|
4
|
+
import type { RPCInvoke } from '${rpcMapPath}'
|
|
5
|
+
|
|
6
|
+
export class PikkuRPC {
|
|
7
|
+
pikkuFetch = new PikkuFetch()
|
|
8
|
+
|
|
9
|
+
setPikkuFetch(pikkuFetch: PikkuFetch): void {
|
|
10
|
+
this.pikkuFetch = pikkuFetch
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
setServerUrl(serverUrl: string): void {
|
|
14
|
+
this.pikkuFetch.setServerUrl(serverUrl)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
setAuthorizationJWT(jwt: string | null): void {
|
|
18
|
+
this.pikkuFetch.setAuthorizationJWT(jwt)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Generic RPC invoke method
|
|
22
|
+
invoke: RPCInvoke = async (name, data) => {
|
|
23
|
+
return await this.pikkuFetch.post('/rpc', { name, data })
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const pikkuRPC = new PikkuRPC();
|
|
28
|
+
`
|
|
29
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RPCMeta } from '@pikku/core/rpc'
|
|
2
|
+
|
|
3
|
+
import { serializeImportMap } from '../../serialize-import-map.js'
|
|
2
4
|
import { TypesMap } from '@pikku/inspector'
|
|
3
5
|
import { FunctionsMeta } from '@pikku/core'
|
|
4
|
-
import { generateCustomTypes } from '
|
|
5
|
-
import { RPCMeta } from '../../core/src/rpc/rpc-types.js'
|
|
6
|
+
import { generateCustomTypes } from '../../utils.js'
|
|
6
7
|
|
|
7
8
|
export const serializeTypedRPCMap = (
|
|
8
9
|
relativeToPath: string,
|
|
@@ -41,7 +42,7 @@ interface RPCHandler<I, O> {
|
|
|
41
42
|
|
|
42
43
|
${serializedRPCs}
|
|
43
44
|
|
|
44
|
-
type RPCInvoke = <Name extends keyof RPCMap>(
|
|
45
|
+
export type RPCInvoke = <Name extends keyof RPCMap>(
|
|
45
46
|
name: Name,
|
|
46
47
|
data: RPCMap[Name]['input'],
|
|
47
48
|
options?: {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { PikkuCLIConfig } from '../src/pikku-cli-config.js'
|
|
2
|
-
import { InspectorState } from '@pikku/inspector'
|
|
3
1
|
import {
|
|
4
2
|
logCommandInfoAndTime,
|
|
5
3
|
serializeFileImports,
|
|
6
4
|
writeFileInDir,
|
|
7
|
-
} from '
|
|
8
|
-
import { serializeSchedulerMeta } from '
|
|
5
|
+
} from '../../utils.js'
|
|
6
|
+
import { serializeSchedulerMeta } from './serialize-scheduler-meta.js'
|
|
7
|
+
import { PikkuCommand } from '../../types.js'
|
|
9
8
|
|
|
10
|
-
export const pikkuScheduler = async (
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export const pikkuScheduler: PikkuCommand = async (
|
|
10
|
+
logger,
|
|
11
|
+
cliConfig,
|
|
12
|
+
visitState
|
|
13
13
|
) => {
|
|
14
14
|
return await logCommandInfoAndTime(
|
|
15
|
+
logger,
|
|
15
16
|
'Finding scheduled tasks',
|
|
16
17
|
'Found scheduled tasks',
|
|
17
18
|
[visitState.scheduledTasks.files.size === 0],
|
|
@@ -19,13 +20,15 @@ export const pikkuScheduler = async (
|
|
|
19
20
|
const { schedulersFile, schedulersMetaFile, packageMappings } = cliConfig
|
|
20
21
|
const { scheduledTasks } = visitState
|
|
21
22
|
await writeFileInDir(
|
|
23
|
+
logger,
|
|
22
24
|
schedulersMetaFile,
|
|
23
25
|
serializeSchedulerMeta(scheduledTasks.meta)
|
|
24
26
|
)
|
|
25
27
|
await writeFileInDir(
|
|
28
|
+
logger,
|
|
26
29
|
schedulersFile,
|
|
27
30
|
serializeFileImports(
|
|
28
|
-
'
|
|
31
|
+
'addScheduledTasks',
|
|
29
32
|
schedulersFile,
|
|
30
33
|
scheduledTasks.files,
|
|
31
34
|
packageMappings
|
package/src/inspector-glob.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as path from 'path'
|
|
2
2
|
import { glob } from 'tinyglobby'
|
|
3
3
|
import { InspectorFilters, InspectorState, inspect } from '@pikku/inspector'
|
|
4
|
-
import { logCommandInfoAndTime } from './utils
|
|
4
|
+
import { logCommandInfoAndTime } from './utils.js'
|
|
5
5
|
|
|
6
6
|
export const inspectorGlob = async (
|
|
7
|
+
logger,
|
|
7
8
|
rootDir: string,
|
|
8
9
|
srcDirectories: string[],
|
|
9
10
|
filters: InspectorFilters
|
|
10
11
|
) => {
|
|
11
12
|
let result: InspectorState
|
|
12
13
|
await logCommandInfoAndTime(
|
|
14
|
+
logger,
|
|
13
15
|
'Inspecting codebase',
|
|
14
16
|
'Inspected codebase',
|
|
15
17
|
[false],
|
|
@@ -21,7 +23,7 @@ export const inspectorGlob = async (
|
|
|
21
23
|
)
|
|
22
24
|
)
|
|
23
25
|
).flat()
|
|
24
|
-
result = await inspect(routeFiles, filters)
|
|
26
|
+
result = await inspect(logger, routeFiles, filters)
|
|
25
27
|
}
|
|
26
28
|
)
|
|
27
29
|
return result!
|
package/src/pikku-cli-config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join, dirname, resolve, isAbsolute } from 'path'
|
|
2
2
|
import { readdir, readFile } from 'fs/promises'
|
|
3
|
-
import { OpenAPISpecInfo } from './openapi-spec-generator.js'
|
|
3
|
+
import { OpenAPISpecInfo } from './events/http/openapi-spec-generator.js'
|
|
4
4
|
import { InspectorFilters } from '@pikku/inspector'
|
|
5
5
|
import { PikkuEventTypes } from '@pikku/core'
|
|
6
6
|
|
|
@@ -34,6 +34,18 @@ export interface PikkuCLICoreOutputFiles {
|
|
|
34
34
|
schedulersFile: string
|
|
35
35
|
schedulersMetaFile: string
|
|
36
36
|
|
|
37
|
+
// Queue processors
|
|
38
|
+
queueWorkersFile: string
|
|
39
|
+
queueWorkersMetaFile: string
|
|
40
|
+
queueMapDeclarationFile: string
|
|
41
|
+
|
|
42
|
+
// MCP
|
|
43
|
+
mcpEndpointsFile: string
|
|
44
|
+
mcpEndpointsMetaFile: string
|
|
45
|
+
|
|
46
|
+
// Services
|
|
47
|
+
servicesFile: string
|
|
48
|
+
|
|
37
49
|
// Application bootstrap
|
|
38
50
|
bootstrapFile: string
|
|
39
51
|
bootstrapFiles: Record<PikkuEventTypes, string>
|
|
@@ -56,12 +68,17 @@ export type PikkuCLIConfig = {
|
|
|
56
68
|
nextHTTPFile?: string
|
|
57
69
|
fetchFile?: string
|
|
58
70
|
websocketFile?: string
|
|
71
|
+
rpcFile?: string
|
|
72
|
+
queueFile?: string
|
|
73
|
+
mcpJsonFile?: string
|
|
59
74
|
|
|
60
75
|
openAPI?: {
|
|
61
76
|
outputFile: string
|
|
62
77
|
additionalInfo: OpenAPISpecInfo
|
|
63
78
|
}
|
|
64
79
|
|
|
80
|
+
middlewareServices?: string[]
|
|
81
|
+
|
|
65
82
|
filters: InspectorFilters
|
|
66
83
|
} & PikkuCLICoreOutputFiles
|
|
67
84
|
|
|
@@ -70,18 +87,21 @@ const CONFIG_DIR_FILES = [
|
|
|
70
87
|
'nextHTTPFile',
|
|
71
88
|
'fetchFile',
|
|
72
89
|
'websocketFile',
|
|
90
|
+
'rpcFile',
|
|
91
|
+
'queueFile',
|
|
92
|
+
'mcpJsonFile',
|
|
73
93
|
]
|
|
74
94
|
|
|
75
95
|
export const getPikkuCLIConfig = async (
|
|
76
96
|
configFile: string | undefined = undefined,
|
|
77
97
|
requiredFields: Array<keyof PikkuCLIConfig>,
|
|
78
|
-
|
|
98
|
+
filters: InspectorFilters = {},
|
|
79
99
|
exitProcess: boolean = false
|
|
80
100
|
): Promise<PikkuCLIConfig> => {
|
|
81
101
|
const config = await _getPikkuCLIConfig(
|
|
82
102
|
configFile,
|
|
83
103
|
requiredFields,
|
|
84
|
-
|
|
104
|
+
filters,
|
|
85
105
|
exitProcess
|
|
86
106
|
)
|
|
87
107
|
return config
|
|
@@ -90,7 +110,7 @@ export const getPikkuCLIConfig = async (
|
|
|
90
110
|
const _getPikkuCLIConfig = async (
|
|
91
111
|
configFile: string | undefined = undefined,
|
|
92
112
|
requiredFields: Array<keyof PikkuCLIConfig>,
|
|
93
|
-
|
|
113
|
+
filters: InspectorFilters = {},
|
|
94
114
|
exitProcess: boolean = false
|
|
95
115
|
): Promise<PikkuCLIConfig> => {
|
|
96
116
|
if (!configFile) {
|
|
@@ -118,7 +138,7 @@ const _getPikkuCLIConfig = async (
|
|
|
118
138
|
const extendedConfig = await getPikkuCLIConfig(
|
|
119
139
|
resolve(configDir, config.extends),
|
|
120
140
|
[],
|
|
121
|
-
|
|
141
|
+
filters,
|
|
122
142
|
exitProcess
|
|
123
143
|
)
|
|
124
144
|
result = {
|
|
@@ -142,77 +162,128 @@ const _getPikkuCLIConfig = async (
|
|
|
142
162
|
}
|
|
143
163
|
|
|
144
164
|
if (result.outDir) {
|
|
165
|
+
// Create transport/event directories
|
|
166
|
+
const functionDir = join(result.outDir, 'function')
|
|
167
|
+
const httpDir = join(result.outDir, 'http')
|
|
168
|
+
const channelDir = join(result.outDir, 'channel')
|
|
169
|
+
const rpcDir = join(result.outDir, 'rpc')
|
|
170
|
+
const schedulerDir = join(result.outDir, 'scheduler')
|
|
171
|
+
const queueDir = join(result.outDir, 'queue')
|
|
172
|
+
const mcpDir = join(result.outDir, 'mcp')
|
|
173
|
+
|
|
174
|
+
// Create directories if they don't exist (will be done lazily when files are written)
|
|
175
|
+
|
|
145
176
|
if (!result.schemaDirectory) {
|
|
146
|
-
result.schemaDirectory = join(result.outDir, '
|
|
177
|
+
result.schemaDirectory = join(result.outDir, 'schemas')
|
|
147
178
|
}
|
|
179
|
+
|
|
180
|
+
// Functions
|
|
148
181
|
if (!result.functionsFile) {
|
|
149
|
-
result.functionsFile = join(
|
|
182
|
+
result.functionsFile = join(functionDir, 'pikku-functions.gen.ts')
|
|
150
183
|
}
|
|
151
184
|
if (!result.functionsMetaFile) {
|
|
152
185
|
result.functionsMetaFile = join(
|
|
153
|
-
|
|
186
|
+
functionDir,
|
|
154
187
|
'pikku-functions-meta.gen.ts'
|
|
155
188
|
)
|
|
156
189
|
}
|
|
157
|
-
if (!result.
|
|
158
|
-
result.
|
|
159
|
-
}
|
|
160
|
-
if (!result.rpcMapDeclarationFile) {
|
|
161
|
-
result.rpcMapDeclarationFile = join(
|
|
162
|
-
result.outDir,
|
|
163
|
-
'pikku-rpc-map.gen.ts'
|
|
164
|
-
)
|
|
190
|
+
if (!result.typesDeclarationFile) {
|
|
191
|
+
result.typesDeclarationFile = join(result.outDir, 'pikku-types.gen.ts')
|
|
165
192
|
}
|
|
193
|
+
|
|
194
|
+
// HTTP
|
|
166
195
|
if (!result.httpRoutesFile) {
|
|
167
|
-
result.httpRoutesFile = join(
|
|
196
|
+
result.httpRoutesFile = join(httpDir, 'pikku-http-routes.gen.ts')
|
|
168
197
|
}
|
|
169
198
|
if (!result.httpRoutesMetaFile) {
|
|
170
199
|
result.httpRoutesMetaFile = join(
|
|
171
|
-
|
|
200
|
+
httpDir,
|
|
172
201
|
'pikku-http-routes-meta.gen.ts'
|
|
173
202
|
)
|
|
174
203
|
}
|
|
175
|
-
if (!result.
|
|
176
|
-
result.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
result.schedulersMetaFile = join(
|
|
180
|
-
result.outDir,
|
|
181
|
-
'pikku-schedules-meta.gen.ts'
|
|
204
|
+
if (!result.httpRoutesMapDeclarationFile) {
|
|
205
|
+
result.httpRoutesMapDeclarationFile = join(
|
|
206
|
+
httpDir,
|
|
207
|
+
'pikku-http-routes-map.gen.d.ts'
|
|
182
208
|
)
|
|
183
209
|
}
|
|
210
|
+
|
|
211
|
+
// Channels/WebSocket
|
|
184
212
|
if (!result.channelsFile) {
|
|
185
|
-
result.channelsFile = join(
|
|
213
|
+
result.channelsFile = join(channelDir, 'pikku-channels.gen.ts')
|
|
186
214
|
}
|
|
187
215
|
if (!result.channelsMetaFile) {
|
|
188
|
-
result.channelsMetaFile = join(
|
|
189
|
-
|
|
190
|
-
|
|
216
|
+
result.channelsMetaFile = join(channelDir, 'pikku-channels-meta.gen.ts')
|
|
217
|
+
}
|
|
218
|
+
if (!result.channelsMapDeclarationFile) {
|
|
219
|
+
result.channelsMapDeclarationFile = join(
|
|
220
|
+
channelDir,
|
|
221
|
+
'pikku-channels-map.gen.d.ts'
|
|
191
222
|
)
|
|
192
223
|
}
|
|
193
|
-
|
|
194
|
-
|
|
224
|
+
|
|
225
|
+
// RPC
|
|
226
|
+
if (!result.rpcMetaFile) {
|
|
227
|
+
result.rpcMetaFile = join(rpcDir, 'pikku-rpc-meta.gen.ts')
|
|
195
228
|
}
|
|
196
|
-
if (!result.
|
|
197
|
-
result.
|
|
198
|
-
|
|
199
|
-
|
|
229
|
+
if (!result.rpcMapDeclarationFile) {
|
|
230
|
+
result.rpcMapDeclarationFile = join(rpcDir, 'pikku-rpc-map.gen.ts')
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Scheduler
|
|
234
|
+
if (!result.schedulersFile) {
|
|
235
|
+
result.schedulersFile = join(schedulerDir, 'pikku-scheduler.gen.ts')
|
|
236
|
+
}
|
|
237
|
+
if (!result.schedulersMetaFile) {
|
|
238
|
+
result.schedulersMetaFile = join(
|
|
239
|
+
schedulerDir,
|
|
240
|
+
'pikku-scheduler-meta.gen.ts'
|
|
200
241
|
)
|
|
201
242
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
243
|
+
|
|
244
|
+
// Queue
|
|
245
|
+
if (!result.queueWorkersFile) {
|
|
246
|
+
result.queueWorkersFile = join(queueDir, 'pikku-queue-workers.gen.ts')
|
|
247
|
+
}
|
|
248
|
+
if (!result.queueWorkersMetaFile) {
|
|
249
|
+
result.queueWorkersMetaFile = join(
|
|
250
|
+
queueDir,
|
|
251
|
+
'pikku-queue-workers-meta.gen.ts'
|
|
206
252
|
)
|
|
207
253
|
}
|
|
254
|
+
if (!result.queueMapDeclarationFile) {
|
|
255
|
+
result.queueMapDeclarationFile = join(
|
|
256
|
+
queueDir,
|
|
257
|
+
'pikku-queue-map.gen.ts'
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Services
|
|
262
|
+
if (!result.servicesFile) {
|
|
263
|
+
result.servicesFile = join(result.outDir, 'pikku-services.gen.ts')
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Bootstrap files
|
|
208
267
|
if (!result.bootstrapFile) {
|
|
209
268
|
result.bootstrapFile = join(result.outDir, 'pikku-bootstrap.gen.ts')
|
|
210
269
|
}
|
|
211
270
|
|
|
271
|
+
// MCP
|
|
272
|
+
if (!result.mcpEndpointsMetaFile) {
|
|
273
|
+
result.mcpEndpointsMetaFile = join(mcpDir, 'mcp-endpoints-meta.gen.ts')
|
|
274
|
+
}
|
|
275
|
+
if (!result.mcpEndpointsFile) {
|
|
276
|
+
result.mcpEndpointsFile = join(mcpDir, 'mcp-endpoints.gen.ts')
|
|
277
|
+
}
|
|
278
|
+
if (!result.mcpJsonFile) {
|
|
279
|
+
result.mcpJsonFile = join(mcpDir, 'mcp.gen.json')
|
|
280
|
+
}
|
|
281
|
+
|
|
212
282
|
result.bootstrapFiles = result.bootstrapFiles || {}
|
|
213
283
|
for (const key of Object.keys(PikkuEventTypes)) {
|
|
284
|
+
const eventDir = join(result.outDir, key.toLowerCase())
|
|
214
285
|
result.bootstrapFiles[key] = join(
|
|
215
|
-
|
|
286
|
+
eventDir,
|
|
216
287
|
`pikku-bootstrap-${key}.gen.ts`
|
|
217
288
|
)
|
|
218
289
|
}
|
|
@@ -236,8 +307,14 @@ const _getPikkuCLIConfig = async (
|
|
|
236
307
|
}
|
|
237
308
|
|
|
238
309
|
result.filters = result.filters || {}
|
|
239
|
-
if (tags.length > 0) {
|
|
240
|
-
result.filters.tags = tags
|
|
310
|
+
if (filters.tags && filters.tags.length > 0) {
|
|
311
|
+
result.filters.tags = filters.tags
|
|
312
|
+
}
|
|
313
|
+
if (filters.types && filters.types.length > 0) {
|
|
314
|
+
result.filters.types = filters.types
|
|
315
|
+
}
|
|
316
|
+
if (filters.directories && filters.directories.length > 0) {
|
|
317
|
+
result.filters.directories = filters.directories
|
|
241
318
|
}
|
|
242
319
|
|
|
243
320
|
if (!isAbsolute(result.tsconfig)) {
|