@pikku/cli 0.10.2 → 0.11.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/.pikku/channel/pikku-channel-types.gen.ts +1 -1
- package/.pikku/channel/pikku-channels-map.gen.d.ts +5 -2
- package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
- package/.pikku/channel/pikku-channels.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-channel.ts +92 -0
- package/.pikku/cli/pikku-cli-client.gen.ts +56 -0
- package/.pikku/cli/pikku-cli-types.gen.ts +1 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +131 -5
- package/.pikku/cli/pikku-cli-wirings.gen.ts +3 -2
- package/.pikku/cli/pikku-cli.gen.ts +41 -0
- package/.pikku/function/pikku-function-types.gen.ts +1 -1
- package/.pikku/function/pikku-functions-meta.gen.ts +240 -131
- package/.pikku/function/pikku-functions-meta.min.gen.ts +59 -34
- package/.pikku/function/pikku-functions.gen.ts +9 -1
- package/.pikku/http/pikku-http-types.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +5 -2
- package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-types.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +1 -1
- package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
- package/.pikku/pikku-bootstrap.gen.ts +4 -1
- package/.pikku/pikku-services.gen.ts +8 -3
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/pikku-websocket.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +5 -2
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +7 -2
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-remote-rpc-workers.gen.ts +27 -0
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +13 -3
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +25 -10
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +14 -9
- package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +1 -1
- package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
- package/.pikku/schemas/register.gen.ts +17 -5
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -0
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -0
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +62 -0
- package/.pikku/workflow/pikku-workflow-types.gen.ts +92 -0
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +5 -0
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +4 -0
- package/CHANGELOG.md +13 -0
- package/bin/pikku.ts +20 -20
- package/build.sh +1 -1
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +1 -0
- package/dist/.pikku/cli/pikku-cli-channel.js +91 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +10 -0
- package/dist/.pikku/cli/pikku-cli-client.gen.js +46 -0
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +131 -5
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +2 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +2 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +10 -0
- package/dist/.pikku/cli/pikku-cli.gen.js +38 -0
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +240 -131
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +59 -34
- package/dist/.pikku/function/pikku-functions.gen.js +9 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +4 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +4 -1
- package/dist/.pikku/pikku-services.gen.d.ts +10 -4
- package/dist/.pikku/pikku-services.gen.js +8 -2
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
- package/dist/.pikku/pikku-websocket.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +7 -2
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.d.ts +17 -0
- package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +22 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +14 -9
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +9 -3
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuPublicRPCOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRemoteInternalRPCInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuRemoteRPCOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuWorkflowOutput.schema.json +1 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +58 -0
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +28 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.d.ts +1 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +5 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +4 -0
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +5 -0
- package/dist/bin/pikku.js +18 -20
- package/dist/src/cli.wiring.js +109 -107
- package/dist/src/functions/commands/all.js +20 -0
- package/dist/src/functions/commands/bootstrap.js +1 -0
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +15 -22
- package/dist/src/functions/wirings/queue/pikku-queue.js +9 -1
- package/dist/src/functions/wirings/queue/serialize-queue-map.d.ts +2 -2
- package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +23 -0
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -0
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.js +23 -0
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.d.ts +4 -0
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +30 -0
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.d.ts +4 -0
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +30 -0
- package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +2 -2
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +27 -3
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-map.js +12 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-types.js +11 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -0
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +55 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-map.js +79 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.d.ts +2 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +10 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-types.js +95 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.d.ts +4 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-workers.js +60 -0
- package/dist/src/services/cli-logger-forwarder.service.d.ts +3 -0
- package/dist/src/services/cli-logger-forwarder.service.js +9 -2
- package/dist/src/services/cli-logger.service.js +1 -1
- package/dist/src/utils/command-summary.d.ts +1 -0
- package/dist/src/utils/command-summary.js +9 -8
- package/dist/src/utils/pikku-cli-config.js +24 -4
- package/dist/src/utils/schema-generator.js +28 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/cli.wiring.ts +111 -106
- package/src/functions/commands/all.ts +28 -0
- package/src/functions/commands/bootstrap.ts +1 -0
- package/src/functions/wirings/cli/serialize-channel-cli-client.ts +15 -22
- package/src/functions/wirings/queue/pikku-queue.ts +10 -1
- package/src/functions/wirings/queue/serialize-queue-map.ts +3 -3
- package/src/functions/wirings/queue/serialize-queue-meta.ts +2 -2
- package/src/functions/wirings/rpc/pikku-command-public-rpc.ts +32 -0
- package/src/functions/wirings/rpc/pikku-command-remote-rpc.ts +35 -0
- package/src/functions/wirings/rpc/serialize-public-rpc.ts +30 -0
- package/src/functions/wirings/rpc/serialize-remote-rpc.ts +30 -0
- package/src/functions/wirings/rpc/serialize-rpc-wrapper.ts +2 -2
- package/src/functions/wirings/rpc/serialize-typed-rpc-map.ts +26 -3
- package/src/functions/wirings/workflow/pikku-command-workflow-map.ts +24 -0
- package/src/functions/wirings/workflow/pikku-command-workflow-types.ts +22 -0
- package/src/functions/wirings/workflow/pikku-command-workflow.ts +123 -0
- package/src/functions/wirings/workflow/serialize-workflow-map.ts +123 -0
- package/src/functions/wirings/workflow/serialize-workflow-meta.ts +16 -0
- package/src/functions/wirings/workflow/serialize-workflow-types.ts +95 -0
- package/src/functions/wirings/workflow/serialize-workflow-workers.ts +60 -0
- package/src/services/cli-logger-forwarder.service.ts +11 -2
- package/src/services/cli-logger.service.ts +1 -1
- package/src/utils/command-summary.ts +10 -8
- package/src/utils/pikku-cli-config.ts +44 -4
- package/src/utils/schema-generator.ts +25 -7
- package/types/config.d.ts +45 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* This provides the structure needed for TypeScript to be aware of channels
|
|
@@ -9,17 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
// Custom types are those that are defined directly within generics
|
|
11
11
|
// or are broken into simpler types
|
|
12
|
+
export type PikkuSchemasOutput = false | true
|
|
12
13
|
export type PikkuChannelsOutput = false | true
|
|
13
14
|
export type PikkuCLIOutput = false | true
|
|
14
15
|
export type PikkuFunctionsOutput = false | true
|
|
15
|
-
export type PikkuSchemasOutput = false | true
|
|
16
16
|
export type PikkuHTTPOutput = false | true
|
|
17
17
|
export type PikkuMCPOutput = false | true
|
|
18
18
|
export type PikkuMiddlewareOutput = false | true
|
|
19
19
|
export type PikkuPermissionsOutput = false | true
|
|
20
20
|
export type PikkuQueueOutput = false | true
|
|
21
|
+
export type PikkuPublicRPCOutput = false | true
|
|
22
|
+
export type PikkuRemoteRPCOutput = false | true
|
|
21
23
|
export type PikkuRPCOutput = false | true
|
|
22
24
|
export type PikkuSchedulerOutput = false | true
|
|
25
|
+
export type PikkuWorkflowOutput = false | true
|
|
23
26
|
|
|
24
27
|
interface ChannelHandler<I, O> {
|
|
25
28
|
input: I;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket channel backend for 'pikku' CLI commands
|
|
6
|
+
*/
|
|
7
|
+
import { wireChannel } from '../channel/pikku-channel-types.gen.js'
|
|
8
|
+
import { pikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
9
|
+
import { all } from '../../src/functions/commands/all.js'
|
|
10
|
+
import { bootstrap } from '../../src/functions/commands/bootstrap.js'
|
|
11
|
+
import { watch } from '../../src/functions/commands/watch.js'
|
|
12
|
+
import { pikkuSchemas } from '../../src/functions/wirings/functions/schemas.js'
|
|
13
|
+
import { pikkuFetch } from '../../src/functions/wirings/fetch/index.js'
|
|
14
|
+
import { pikkuWebSocketTyped } from '../../src/functions/wirings/channels/pikku-command-websocket-typed.js'
|
|
15
|
+
import { pikkuRPCClient } from '../../src/functions/wirings/rpc/pikku-command-rpc-client.js'
|
|
16
|
+
import { pikkuQueueService } from '../../src/functions/wirings/queue/pikku-command-queue-service.js'
|
|
17
|
+
import { pikkuOpenAPI } from '../../src/functions/wirings/http/pikku-command-openapi.js'
|
|
18
|
+
import { pikkuNext } from '../../src/functions/runtimes/nextjs/pikku-command-nextjs.js'
|
|
19
|
+
|
|
20
|
+
// Middleware to close the channel after CLI command completes
|
|
21
|
+
const cliCloseOnComplete = pikkuMiddleware(async (services, { channel }, next) => {
|
|
22
|
+
const closeChannel = () => {
|
|
23
|
+
setTimeout(async () => {
|
|
24
|
+
try {
|
|
25
|
+
// This gives time for the response to be sent before closing
|
|
26
|
+
await channel?.close()
|
|
27
|
+
} catch (err) {
|
|
28
|
+
// Ignore errors on close
|
|
29
|
+
}
|
|
30
|
+
}, 200)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
const result = await next()
|
|
35
|
+
closeChannel()
|
|
36
|
+
return result
|
|
37
|
+
} catch (error) {
|
|
38
|
+
closeChannel()
|
|
39
|
+
throw error
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
wireChannel({
|
|
44
|
+
name: 'pikku-cli',
|
|
45
|
+
route: '/cli/pikku',
|
|
46
|
+
auth: false,
|
|
47
|
+
onMessageWiring: {
|
|
48
|
+
command: {
|
|
49
|
+
'all': {
|
|
50
|
+
func: all,
|
|
51
|
+
middleware: [cliCloseOnComplete],
|
|
52
|
+
},
|
|
53
|
+
'bootstrap': {
|
|
54
|
+
func: bootstrap,
|
|
55
|
+
middleware: [cliCloseOnComplete],
|
|
56
|
+
},
|
|
57
|
+
'watch': {
|
|
58
|
+
func: watch,
|
|
59
|
+
middleware: [cliCloseOnComplete],
|
|
60
|
+
},
|
|
61
|
+
'schemas': {
|
|
62
|
+
func: pikkuSchemas,
|
|
63
|
+
middleware: [cliCloseOnComplete],
|
|
64
|
+
},
|
|
65
|
+
'fetch': {
|
|
66
|
+
func: pikkuFetch,
|
|
67
|
+
middleware: [cliCloseOnComplete],
|
|
68
|
+
},
|
|
69
|
+
'websocket': {
|
|
70
|
+
func: pikkuWebSocketTyped,
|
|
71
|
+
middleware: [cliCloseOnComplete],
|
|
72
|
+
},
|
|
73
|
+
'rpc': {
|
|
74
|
+
func: pikkuRPCClient,
|
|
75
|
+
middleware: [cliCloseOnComplete],
|
|
76
|
+
},
|
|
77
|
+
'queue-service': {
|
|
78
|
+
func: pikkuQueueService,
|
|
79
|
+
middleware: [cliCloseOnComplete],
|
|
80
|
+
},
|
|
81
|
+
'openapi': {
|
|
82
|
+
func: pikkuOpenAPI,
|
|
83
|
+
middleware: [cliCloseOnComplete],
|
|
84
|
+
},
|
|
85
|
+
'nextjs': {
|
|
86
|
+
func: pikkuNext,
|
|
87
|
+
middleware: [cliCloseOnComplete],
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
tags: ['cli', 'pikku']
|
|
92
|
+
})
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { executeCLIViaChannel } from '@pikku/core/cli/channel'
|
|
6
|
+
import { CorePikkuWebsocket } from '@pikku/websocket'
|
|
7
|
+
import '../pikku-bootstrap.gen.js'
|
|
8
|
+
import { clientCLIRenderer } from '../../src/services.js'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Pikku CLI Client (via WebSocket Channel)
|
|
12
|
+
* Executes CLI commands over a WebSocket connection
|
|
13
|
+
*/
|
|
14
|
+
export async function PikkuCLIClient(
|
|
15
|
+
ws: WebSocket,
|
|
16
|
+
args?: string[]
|
|
17
|
+
): Promise<void> {
|
|
18
|
+
// Create Pikku WebSocket wrapper
|
|
19
|
+
const pikkuWS = new CorePikkuWebsocket(ws)
|
|
20
|
+
|
|
21
|
+
// Register renderers for CLI commands
|
|
22
|
+
const renderers = {}
|
|
23
|
+
|
|
24
|
+
await executeCLIViaChannel({
|
|
25
|
+
programName: 'pikku',
|
|
26
|
+
pikkuWS,
|
|
27
|
+
args,
|
|
28
|
+
renderers,
|
|
29
|
+
defaultRenderer: clientCLIRenderer,
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Export as default for easy importing
|
|
34
|
+
export default PikkuCLIClient
|
|
35
|
+
|
|
36
|
+
// For direct execution (if this file is run directly)
|
|
37
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
38
|
+
const url = process.env.PIKKU_WS_URL || 'ws://localhost:4002/cli/pikku'
|
|
39
|
+
|
|
40
|
+
// Create WebSocket instance
|
|
41
|
+
let WebSocketImpl: any
|
|
42
|
+
if (typeof WebSocket !== 'undefined') {
|
|
43
|
+
WebSocketImpl = WebSocket
|
|
44
|
+
} else {
|
|
45
|
+
// Node.js environment - dynamically import 'ws'
|
|
46
|
+
const wsModule = await import('ws')
|
|
47
|
+
WebSocketImpl = wsModule.default
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const ws = new WebSocketImpl(url) as WebSocket
|
|
51
|
+
PikkuCLIClient(ws, process.argv.slice(2)).catch(error => {
|
|
52
|
+
console.error('Fatal channel CLI error:', error)
|
|
53
|
+
// TODO: We get an error code even when it exists cleanly, investigate
|
|
54
|
+
// process.exit(1)
|
|
55
|
+
})
|
|
56
|
+
}
|
|
@@ -1,9 +1,132 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core'
|
|
5
5
|
pikkuState('cli', 'meta', {
|
|
6
|
-
"programs": {
|
|
6
|
+
"programs": {
|
|
7
|
+
"pikku": {
|
|
8
|
+
"program": "pikku",
|
|
9
|
+
"commands": {
|
|
10
|
+
"all": {
|
|
11
|
+
"pikkuFuncName": "all",
|
|
12
|
+
"positionals": [],
|
|
13
|
+
"options": {
|
|
14
|
+
"tags": {
|
|
15
|
+
"description": "Filter functions by tags (comma-separated)",
|
|
16
|
+
"short": "t"
|
|
17
|
+
},
|
|
18
|
+
"types": {
|
|
19
|
+
"description": "Filter functions by types (comma-separated)"
|
|
20
|
+
},
|
|
21
|
+
"directories": {
|
|
22
|
+
"description": "Filter functions by directories (comma-separated)",
|
|
23
|
+
"short": "d"
|
|
24
|
+
},
|
|
25
|
+
"httpMethods": {
|
|
26
|
+
"description": "Filter HTTP routes by methods (comma-separated)"
|
|
27
|
+
},
|
|
28
|
+
"httpRoutes": {
|
|
29
|
+
"description": "Filter HTTP routes by route patterns (comma-separated)"
|
|
30
|
+
},
|
|
31
|
+
"names": {
|
|
32
|
+
"description": "Filter functions by name patterns (supports wildcards)",
|
|
33
|
+
"short": "n"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"description": "Generate all Pikku files (types, schemas, wirings, etc.)",
|
|
37
|
+
"isDefault": true
|
|
38
|
+
},
|
|
39
|
+
"bootstrap": {
|
|
40
|
+
"pikkuFuncName": "bootstrap",
|
|
41
|
+
"positionals": [],
|
|
42
|
+
"options": {},
|
|
43
|
+
"description": "Generate only type files (setup phase only)"
|
|
44
|
+
},
|
|
45
|
+
"watch": {
|
|
46
|
+
"pikkuFuncName": "watch",
|
|
47
|
+
"positionals": [],
|
|
48
|
+
"options": {},
|
|
49
|
+
"description": "Watch for file changes and regenerate automatically"
|
|
50
|
+
},
|
|
51
|
+
"schemas": {
|
|
52
|
+
"pikkuFuncName": "pikkuSchemas",
|
|
53
|
+
"positionals": [],
|
|
54
|
+
"options": {},
|
|
55
|
+
"description": "Generate JSON schemas for function input/output types"
|
|
56
|
+
},
|
|
57
|
+
"fetch": {
|
|
58
|
+
"pikkuFuncName": "pikkuFetch",
|
|
59
|
+
"positionals": [],
|
|
60
|
+
"options": {},
|
|
61
|
+
"description": "Generate type-safe HTTP fetch client"
|
|
62
|
+
},
|
|
63
|
+
"websocket": {
|
|
64
|
+
"pikkuFuncName": "pikkuWebSocketTyped",
|
|
65
|
+
"positionals": [],
|
|
66
|
+
"options": {},
|
|
67
|
+
"description": "Generate type-safe WebSocket client"
|
|
68
|
+
},
|
|
69
|
+
"rpc": {
|
|
70
|
+
"pikkuFuncName": "pikkuRPCClient",
|
|
71
|
+
"positionals": [],
|
|
72
|
+
"options": {},
|
|
73
|
+
"description": "Generate RPC client wrappers"
|
|
74
|
+
},
|
|
75
|
+
"queue-service": {
|
|
76
|
+
"pikkuFuncName": "pikkuQueueService",
|
|
77
|
+
"positionals": [],
|
|
78
|
+
"options": {},
|
|
79
|
+
"description": "Generate queue service wrapper"
|
|
80
|
+
},
|
|
81
|
+
"openapi": {
|
|
82
|
+
"pikkuFuncName": "pikkuOpenAPI",
|
|
83
|
+
"positionals": [],
|
|
84
|
+
"options": {},
|
|
85
|
+
"description": "Generate OpenAPI specification from HTTP routes"
|
|
86
|
+
},
|
|
87
|
+
"nextjs": {
|
|
88
|
+
"pikkuFuncName": "pikkuNext",
|
|
89
|
+
"positionals": [],
|
|
90
|
+
"options": {},
|
|
91
|
+
"description": "Generate Next.js backend and HTTP wrappers"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"options": {
|
|
95
|
+
"config": {
|
|
96
|
+
"description": "Path to pikku.config.json file",
|
|
97
|
+
"short": "c"
|
|
98
|
+
},
|
|
99
|
+
"logLevel": {
|
|
100
|
+
"description": "Set log level",
|
|
101
|
+
"short": "l",
|
|
102
|
+
"choices": [
|
|
103
|
+
"trace",
|
|
104
|
+
"debug",
|
|
105
|
+
"info",
|
|
106
|
+
"warn",
|
|
107
|
+
"error",
|
|
108
|
+
"critical"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"userSessionType": {
|
|
112
|
+
"description": "Specify which UserSession type to use (when multiple exist)"
|
|
113
|
+
},
|
|
114
|
+
"singletonServicesFactoryType": {
|
|
115
|
+
"description": "Specify which singleton services factory to use"
|
|
116
|
+
},
|
|
117
|
+
"sessionServicesFactoryType": {
|
|
118
|
+
"description": "Specify which session services factory to use"
|
|
119
|
+
},
|
|
120
|
+
"stateOutput": {
|
|
121
|
+
"description": "Save inspector state to JSON file for reuse"
|
|
122
|
+
},
|
|
123
|
+
"stateInput": {
|
|
124
|
+
"description": "Load inspector state from JSON file (skips inspection)"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"defaultRenderName": "clientCLIRenderer"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
7
130
|
"renderers": {
|
|
8
131
|
"defaultCLIRenderer": {
|
|
9
132
|
"name": "defaultCLIRenderer",
|
|
@@ -16,10 +139,13 @@ pikkuState('cli', 'meta', {
|
|
|
16
139
|
"schema",
|
|
17
140
|
"jwt",
|
|
18
141
|
"config",
|
|
19
|
-
"variables"
|
|
142
|
+
"variables",
|
|
143
|
+
"workflowService",
|
|
144
|
+
"queueService",
|
|
145
|
+
"schedulerService"
|
|
20
146
|
]
|
|
21
147
|
},
|
|
22
|
-
"filePath": "src/services.ts"
|
|
148
|
+
"filePath": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
|
|
23
149
|
},
|
|
24
150
|
"clientCLIRenderer": {
|
|
25
151
|
"name": "clientCLIRenderer",
|
|
@@ -28,7 +154,7 @@ pikkuState('cli', 'meta', {
|
|
|
28
154
|
"optimized": true,
|
|
29
155
|
"services": []
|
|
30
156
|
},
|
|
31
|
-
"filePath": "src/services.ts"
|
|
157
|
+
"filePath": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
|
|
32
158
|
}
|
|
33
159
|
}
|
|
34
160
|
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.1
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { executeCLI, CLIError } from '@pikku/core/cli'
|
|
6
|
+
import { createConfig as createConfig } from '../../src/services.js'
|
|
7
|
+
import { createSingletonServices as createSingletonServices } from '../../src/services.js'
|
|
8
|
+
import { createSessionServices as createSessionServices } from '../../src/services.js'
|
|
9
|
+
import '../pikku-bootstrap.gen.js'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Pikku CLI function
|
|
13
|
+
* Handles command line arguments and executes the appropriate function
|
|
14
|
+
*/
|
|
15
|
+
export async function PikkuCLI(args: string[]): Promise<void> {
|
|
16
|
+
try {
|
|
17
|
+
await executeCLI({
|
|
18
|
+
programName: 'pikku',
|
|
19
|
+
args: args || process.argv.slice(2),
|
|
20
|
+
createConfig,
|
|
21
|
+
createSingletonServices,
|
|
22
|
+
createSessionServices,
|
|
23
|
+
})
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (error instanceof CLIError) {
|
|
26
|
+
process.exit(error.exitCode)
|
|
27
|
+
}
|
|
28
|
+
throw error
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Export as default for easy importing
|
|
33
|
+
export default PikkuCLI
|
|
34
|
+
|
|
35
|
+
// For direct execution (if this file is run directly)
|
|
36
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
37
|
+
PikkuCLI(process.argv.slice(2)).catch(error => {
|
|
38
|
+
console.error('Fatal error:', error.message)
|
|
39
|
+
process.exit(1)
|
|
40
|
+
})
|
|
41
|
+
}
|