@pikku/cli 0.10.0 → 0.10.2
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 +4 -3
- package/.pikku/channel/pikku-channels-map.gen.d.ts +2 -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-types.gen.ts +23 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -115
- package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -3
- package/.pikku/function/pikku-function-types.gen.ts +1 -1
- package/.pikku/function/pikku-functions-meta.gen.ts +156 -138
- package/.pikku/function/pikku-functions-meta.min.gen.ts +37 -32
- package/.pikku/function/pikku-functions.gen.ts +1 -1
- package/.pikku/http/pikku-http-types.gen.ts +1 -1
- package/.pikku/http/pikku-http-wirings-map.gen.d.ts +2 -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 +1 -1
- package/.pikku/pikku-services.gen.ts +16 -12
- package/.pikku/pikku-types.gen.ts +1 -1
- package/.pikku/pikku-websocket.gen.ts +15 -1
- package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +2 -2
- package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +1 -1
- package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -2
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +10 -9
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +9 -8
- 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 +5 -5
- package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
- package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
- package/CHANGELOG.md +58 -0
- package/bin/pikku.ts +30 -21
- package/cli.schema.json +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +4 -3
- 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-types.gen.d.ts +18 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +20 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +4 -115
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -2
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -2
- 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 +156 -138
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +37 -32
- package/dist/.pikku/function/pikku-functions.gen.js +1 -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 +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +9 -6
- 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 +15 -1
- package/dist/.pikku/pikku-websocket.gen.js +15 -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 +1 -1
- 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-rpc-wirings-meta.internal.gen.js +9 -8
- 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 +3 -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/PikkuSchemasOutput.schema.json +1 -1
- package/dist/bin/pikku.js +24 -19
- package/dist/src/cli.wiring.js +107 -99
- package/dist/src/functions/commands/all.js +31 -2
- package/dist/src/functions/commands/bootstrap.d.ts +1 -0
- package/dist/src/functions/commands/bootstrap.js +23 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +46 -2
- package/dist/src/functions/wirings/channels/serialize-channel-types.js +3 -2
- package/dist/src/functions/wirings/channels/serialize-websocket-wrapper.js +14 -0
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +24 -4
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +32 -7
- package/dist/src/functions/wirings/cli/serialize-cli-types.js +22 -0
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.js +54 -26
- package/dist/src/functions/wirings/functions/schemas.js +2 -2
- package/dist/src/functions/wirings/http/pikku-command-openapi.js +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +3 -10
- package/dist/src/middleware/log-command-info-and-time.d.ts +1 -1
- package/dist/src/middleware/log-command-info-and-time.js +8 -5
- package/dist/src/services/cli-logger.service.d.ts +7 -2
- package/dist/src/services/cli-logger.service.js +16 -4
- package/dist/src/services.js +77 -12
- package/dist/src/utils/check-required-types.js +11 -1
- package/dist/src/utils/command-summary.d.ts +43 -0
- package/dist/src/utils/command-summary.js +73 -0
- package/dist/src/utils/file-writer.js +2 -2
- package/dist/src/utils/pikku-cli-config.js +28 -0
- package/dist/src/utils/schema-generator.d.ts +2 -2
- package/dist/src/utils/schema-generator.js +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/pikku.config.json +5 -2
- package/src/cli.wiring.ts +106 -101
- package/src/functions/commands/all.ts +38 -2
- package/src/functions/commands/bootstrap.ts +27 -0
- package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +46 -2
- package/src/functions/wirings/channels/serialize-channel-types.ts +3 -2
- package/src/functions/wirings/channels/serialize-websocket-wrapper.ts +14 -0
- package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
- package/src/functions/wirings/cli/serialize-channel-cli-client.ts +24 -4
- package/src/functions/wirings/cli/serialize-channel-cli.ts +40 -8
- package/src/functions/wirings/cli/serialize-cli-types.ts +22 -0
- package/src/functions/wirings/functions/pikku-command-services.ts +57 -28
- package/src/functions/wirings/functions/schemas.ts +4 -3
- package/src/functions/wirings/http/pikku-command-openapi.ts +2 -1
- package/src/functions/wirings/middleware/pikku-command-middleware.ts +11 -22
- package/src/middleware/log-command-info-and-time.ts +8 -5
- package/src/services/cli-logger.service.ts +20 -5
- package/src/services.ts +86 -11
- package/src/utils/check-required-types.ts +16 -1
- package/src/utils/command-summary.ts +101 -0
- package/src/utils/file-writer.ts +2 -2
- package/src/utils/pikku-cli-config.ts +28 -0
- package/src/utils/schema-generator.ts +5 -4
- package/types/application-types.d.ts +5 -1
- package/types/config.d.ts +16 -6
- package/.pikku/cli/pikku-cli-channel.gen.ts +0 -34
- package/.pikku/cli/pikku-cli-client.gen.ts +0 -43
- package/.pikku/cli/pikku-cli.gen.ts +0 -41
- package/dist/.pikku/cli/pikku-cli-channel.gen.d.ts +0 -1
- package/dist/.pikku/cli/pikku-cli-channel.gen.js +0 -33
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -34
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli.gen.js +0 -38
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.10.
|
|
2
|
+
* This file was generated by @pikku/cli@0.10.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
import { CoreChannel, wireChannel as wireChannelCore } from '@pikku/core/channel'
|
|
10
10
|
import { CorePikkuFunctionConfig } from '@pikku/core'
|
|
11
11
|
import { AssertHTTPWiringParams } from '@pikku/core/http'
|
|
12
|
-
import type { PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
12
|
+
import type { PikkuFunction, PikkuFunctionSessionless, PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Type definition for WebSocket channels with typed data exchange.
|
|
16
16
|
* Supports connection, disconnection, and message handling.
|
|
17
|
+
* Accepts both session-based (PikkuFunction) and sessionless (PikkuFunctionSessionless) functions.
|
|
17
18
|
*
|
|
18
19
|
* @template ChannelData - Type of data exchanged through the channel
|
|
19
20
|
* @template Channel - String literal type for the channel name
|
|
@@ -23,7 +24,7 @@ type ChannelWiring<ChannelData, Channel extends string> = CoreChannel<
|
|
|
23
24
|
Channel,
|
|
24
25
|
CorePikkuFunctionConfig<PikkuFunctionSessionless<void, any, ChannelData>, PikkuPermission<void>, PikkuMiddleware>,
|
|
25
26
|
CorePikkuFunctionConfig<PikkuFunctionSessionless<void, void, ChannelData>, PikkuPermission<void>, PikkuMiddleware>,
|
|
26
|
-
CorePikkuFunctionConfig<PikkuFunctionSessionless<any, any, ChannelData>, PikkuPermission<any>, PikkuMiddleware>,
|
|
27
|
+
CorePikkuFunctionConfig<PikkuFunctionSessionless<any, any, ChannelData> | PikkuFunction<any, any, ChannelData>, PikkuPermission<any>, PikkuMiddleware>,
|
|
27
28
|
PikkuPermission,
|
|
28
29
|
PikkuMiddleware
|
|
29
30
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.10.
|
|
2
|
+
* This file was generated by @pikku/cli@0.10.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* This provides the structure needed for TypeScript to be aware of channels
|
|
@@ -9,10 +9,10 @@
|
|
|
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
|
|
13
12
|
export type PikkuChannelsOutput = false | true
|
|
14
13
|
export type PikkuCLIOutput = false | true
|
|
15
14
|
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.10.
|
|
2
|
+
* This file was generated by @pikku/cli@0.10.2
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
|
|
@@ -23,6 +23,28 @@ type Session = UserSession
|
|
|
23
23
|
*/
|
|
24
24
|
type PikkuCLIRender<Data, RequiredServices extends SingletonServices = SingletonServices> = CorePikkuCLIRender<Data, RequiredServices, Session>
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Creates a type-safe CLI renderer with access to your application's singleton services.
|
|
28
|
+
* The renderer receives the full singleton services and output data to format and display results.
|
|
29
|
+
*
|
|
30
|
+
* @template Data - The output data type from the CLI command
|
|
31
|
+
* @template RequiredServices - The minimum services required for type checking (defaults to SingletonServices)
|
|
32
|
+
* @param render - Function that receives singleton services and data to render output
|
|
33
|
+
* @returns A CLI renderer configuration
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const myRenderer = pikkuCLIRender<MyData>(({ logger }, data) => {
|
|
38
|
+
* logger.info(data.message)
|
|
39
|
+
* })
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export const pikkuCLIRender = <Data, RequiredServices extends SingletonServices = SingletonServices>(
|
|
43
|
+
render: (services: SingletonServices, data: Data) => void | Promise<void>
|
|
44
|
+
): PikkuCLIRender<Data, RequiredServices> => {
|
|
45
|
+
return render as any
|
|
46
|
+
}
|
|
47
|
+
|
|
26
48
|
/**
|
|
27
49
|
* CLI command configuration with project-specific types.
|
|
28
50
|
* Uses CoreCLICommandConfig from @pikku/core with local middleware and render types.
|
|
@@ -1,120 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.10.
|
|
2
|
+
* This file was generated by @pikku/cli@0.10.2
|
|
3
3
|
*/
|
|
4
4
|
import { pikkuState } from '@pikku/core'
|
|
5
5
|
pikkuState('cli', 'meta', {
|
|
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
|
-
"schemas": {
|
|
40
|
-
"pikkuFuncName": "pikkuSchemas",
|
|
41
|
-
"positionals": [],
|
|
42
|
-
"options": {},
|
|
43
|
-
"description": "Generate JSON schemas for function input/output types"
|
|
44
|
-
},
|
|
45
|
-
"fetch": {
|
|
46
|
-
"pikkuFuncName": "pikkuFetch",
|
|
47
|
-
"positionals": [],
|
|
48
|
-
"options": {},
|
|
49
|
-
"description": "Generate type-safe HTTP fetch client"
|
|
50
|
-
},
|
|
51
|
-
"websocket": {
|
|
52
|
-
"pikkuFuncName": "pikkuWebSocketTyped",
|
|
53
|
-
"positionals": [],
|
|
54
|
-
"options": {},
|
|
55
|
-
"description": "Generate type-safe WebSocket client"
|
|
56
|
-
},
|
|
57
|
-
"rpc": {
|
|
58
|
-
"pikkuFuncName": "pikkuRPCClient",
|
|
59
|
-
"positionals": [],
|
|
60
|
-
"options": {},
|
|
61
|
-
"description": "Generate RPC client wrappers"
|
|
62
|
-
},
|
|
63
|
-
"queue-service": {
|
|
64
|
-
"pikkuFuncName": "pikkuQueueService",
|
|
65
|
-
"positionals": [],
|
|
66
|
-
"options": {},
|
|
67
|
-
"description": "Generate queue service wrapper"
|
|
68
|
-
},
|
|
69
|
-
"openapi": {
|
|
70
|
-
"pikkuFuncName": "pikkuOpenAPI",
|
|
71
|
-
"positionals": [],
|
|
72
|
-
"options": {},
|
|
73
|
-
"description": "Generate OpenAPI specification from HTTP routes"
|
|
74
|
-
},
|
|
75
|
-
"nextjs": {
|
|
76
|
-
"pikkuFuncName": "pikkuNext",
|
|
77
|
-
"positionals": [],
|
|
78
|
-
"options": {},
|
|
79
|
-
"description": "Generate Next.js backend and HTTP wrappers"
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
"options": {
|
|
83
|
-
"config": {
|
|
84
|
-
"description": "Path to pikku.config.json file",
|
|
85
|
-
"short": "c"
|
|
86
|
-
},
|
|
87
|
-
"logLevel": {
|
|
88
|
-
"description": "Set log level",
|
|
89
|
-
"short": "l",
|
|
90
|
-
"choices": [
|
|
91
|
-
"trace",
|
|
92
|
-
"debug",
|
|
93
|
-
"info",
|
|
94
|
-
"warn",
|
|
95
|
-
"error",
|
|
96
|
-
"critical"
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
"userSessionType": {
|
|
100
|
-
"description": "Specify which UserSession type to use (when multiple exist)"
|
|
101
|
-
},
|
|
102
|
-
"singletonServicesFactoryType": {
|
|
103
|
-
"description": "Specify which singleton services factory to use"
|
|
104
|
-
},
|
|
105
|
-
"sessionServicesFactoryType": {
|
|
106
|
-
"description": "Specify which session services factory to use"
|
|
107
|
-
},
|
|
108
|
-
"stateOutput": {
|
|
109
|
-
"description": "Save inspector state to JSON file for reuse"
|
|
110
|
-
},
|
|
111
|
-
"stateInput": {
|
|
112
|
-
"description": "Load inspector state from JSON file (skips inspection)"
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"defaultRenderName": "clientCLIRenderer"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
6
|
+
"programs": {},
|
|
118
7
|
"renderers": {
|
|
119
8
|
"defaultCLIRenderer": {
|
|
120
9
|
"name": "defaultCLIRenderer",
|
|
@@ -130,7 +19,7 @@ pikkuState('cli', 'meta', {
|
|
|
130
19
|
"variables"
|
|
131
20
|
]
|
|
132
21
|
},
|
|
133
|
-
"filePath": "
|
|
22
|
+
"filePath": "src/services.ts"
|
|
134
23
|
},
|
|
135
24
|
"clientCLIRenderer": {
|
|
136
25
|
"name": "clientCLIRenderer",
|
|
@@ -139,7 +28,7 @@ pikkuState('cli', 'meta', {
|
|
|
139
28
|
"optimized": true,
|
|
140
29
|
"services": []
|
|
141
30
|
},
|
|
142
|
-
"filePath": "
|
|
31
|
+
"filePath": "src/services.ts"
|
|
143
32
|
}
|
|
144
33
|
}
|
|
145
34
|
})
|