@pikku/cli 0.10.1 → 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.
Files changed (150) hide show
  1. package/.pikku/channel/pikku-channel-types.gen.ts +4 -3
  2. package/.pikku/channel/pikku-channels-map.gen.d.ts +2 -2
  3. package/.pikku/channel/pikku-channels-meta.gen.ts +1 -1
  4. package/.pikku/channel/pikku-channels.gen.ts +1 -1
  5. package/.pikku/cli/pikku-cli-types.gen.ts +23 -1
  6. package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +4 -115
  7. package/.pikku/cli/pikku-cli-wirings.gen.ts +2 -3
  8. package/.pikku/function/pikku-function-types.gen.ts +1 -1
  9. package/.pikku/function/pikku-functions-meta.gen.ts +156 -138
  10. package/.pikku/function/pikku-functions-meta.min.gen.ts +37 -32
  11. package/.pikku/function/pikku-functions.gen.ts +1 -1
  12. package/.pikku/http/pikku-http-types.gen.ts +1 -1
  13. package/.pikku/http/pikku-http-wirings-map.gen.d.ts +2 -2
  14. package/.pikku/http/pikku-http-wirings-meta.gen.ts +1 -1
  15. package/.pikku/http/pikku-http-wirings.gen.ts +1 -1
  16. package/.pikku/mcp/pikku-mcp-types.gen.ts +1 -1
  17. package/.pikku/mcp/pikku-mcp-wirings-meta.gen.ts +1 -1
  18. package/.pikku/mcp/pikku-mcp-wirings.gen.ts +1 -1
  19. package/.pikku/pikku-bootstrap.gen.ts +1 -1
  20. package/.pikku/pikku-services.gen.ts +16 -12
  21. package/.pikku/pikku-types.gen.ts +1 -1
  22. package/.pikku/pikku-websocket.gen.ts +15 -1
  23. package/.pikku/queue/pikku-queue-types.gen.ts +1 -1
  24. package/.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts +2 -2
  25. package/.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts +1 -1
  26. package/.pikku/queue/pikku-queue-workers-wirings.gen.ts +1 -1
  27. package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +2 -2
  28. package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +10 -9
  29. package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +9 -8
  30. package/.pikku/scheduler/pikku-scheduler-types.gen.ts +1 -1
  31. package/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts +1 -1
  32. package/.pikku/scheduler/pikku-schedulers-wirings.gen.ts +1 -1
  33. package/.pikku/schemas/register.gen.ts +5 -5
  34. package/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  35. package/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  36. package/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  37. package/CHANGELOG.md +49 -0
  38. package/bin/pikku.ts +30 -21
  39. package/cli.schema.json +1 -1
  40. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +4 -3
  41. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  42. package/dist/.pikku/channel/pikku-channels-meta.gen.js +1 -1
  43. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  44. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  45. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +18 -1
  46. package/dist/.pikku/cli/pikku-cli-types.gen.js +20 -1
  47. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +4 -115
  48. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -2
  49. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -2
  50. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  51. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  52. package/dist/.pikku/function/pikku-functions-meta.gen.js +156 -138
  53. package/dist/.pikku/function/pikku-functions-meta.min.gen.js +37 -32
  54. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  55. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  56. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  57. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  58. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  59. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  60. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  61. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  62. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +1 -1
  63. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  64. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  65. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  66. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  67. package/dist/.pikku/pikku-services.gen.d.ts +9 -6
  68. package/dist/.pikku/pikku-services.gen.js +8 -2
  69. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  70. package/dist/.pikku/pikku-types.gen.js +1 -1
  71. package/dist/.pikku/pikku-websocket.gen.d.ts +15 -1
  72. package/dist/.pikku/pikku-websocket.gen.js +15 -1
  73. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  74. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  75. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  76. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  77. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  78. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +9 -8
  79. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  80. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  81. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +1 -1
  82. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  83. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  84. package/dist/.pikku/schemas/register.gen.js +3 -3
  85. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  86. package/dist/.pikku/schemas/schemas/PikkuChannelsOutput.schema.json +1 -1
  87. package/dist/.pikku/schemas/schemas/PikkuSchemasOutput.schema.json +1 -1
  88. package/dist/bin/pikku.js +24 -19
  89. package/dist/src/cli.wiring.js +107 -99
  90. package/dist/src/functions/commands/all.js +31 -2
  91. package/dist/src/functions/commands/bootstrap.d.ts +1 -0
  92. package/dist/src/functions/commands/bootstrap.js +23 -0
  93. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +46 -2
  94. package/dist/src/functions/wirings/channels/serialize-channel-types.js +3 -2
  95. package/dist/src/functions/wirings/channels/serialize-websocket-wrapper.js +14 -0
  96. package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +4 -4
  97. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +24 -4
  98. package/dist/src/functions/wirings/cli/serialize-channel-cli.js +32 -7
  99. package/dist/src/functions/wirings/cli/serialize-cli-types.js +22 -0
  100. package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
  101. package/dist/src/functions/wirings/functions/pikku-command-services.js +54 -26
  102. package/dist/src/functions/wirings/functions/schemas.js +2 -2
  103. package/dist/src/functions/wirings/http/pikku-command-openapi.js +1 -1
  104. package/dist/src/functions/wirings/middleware/pikku-command-middleware.js +3 -10
  105. package/dist/src/middleware/log-command-info-and-time.d.ts +1 -1
  106. package/dist/src/middleware/log-command-info-and-time.js +8 -5
  107. package/dist/src/services/cli-logger.service.d.ts +7 -2
  108. package/dist/src/services/cli-logger.service.js +16 -4
  109. package/dist/src/services.js +77 -12
  110. package/dist/src/utils/command-summary.d.ts +43 -0
  111. package/dist/src/utils/command-summary.js +73 -0
  112. package/dist/src/utils/file-writer.js +2 -2
  113. package/dist/src/utils/pikku-cli-config.js +28 -0
  114. package/dist/src/utils/schema-generator.d.ts +2 -2
  115. package/dist/src/utils/schema-generator.js +3 -3
  116. package/dist/tsconfig.tsbuildinfo +1 -1
  117. package/package.json +3 -4
  118. package/pikku.config.json +5 -2
  119. package/src/cli.wiring.ts +106 -101
  120. package/src/functions/commands/all.ts +38 -2
  121. package/src/functions/commands/bootstrap.ts +27 -0
  122. package/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts +46 -2
  123. package/src/functions/wirings/channels/serialize-channel-types.ts +3 -2
  124. package/src/functions/wirings/channels/serialize-websocket-wrapper.ts +14 -0
  125. package/src/functions/wirings/cli/pikku-command-cli-entry.ts +4 -4
  126. package/src/functions/wirings/cli/serialize-channel-cli-client.ts +24 -4
  127. package/src/functions/wirings/cli/serialize-channel-cli.ts +40 -8
  128. package/src/functions/wirings/cli/serialize-cli-types.ts +22 -0
  129. package/src/functions/wirings/functions/pikku-command-services.ts +57 -28
  130. package/src/functions/wirings/functions/schemas.ts +4 -3
  131. package/src/functions/wirings/http/pikku-command-openapi.ts +2 -1
  132. package/src/functions/wirings/middleware/pikku-command-middleware.ts +11 -22
  133. package/src/middleware/log-command-info-and-time.ts +8 -5
  134. package/src/services/cli-logger.service.ts +20 -5
  135. package/src/services.ts +86 -11
  136. package/src/utils/command-summary.ts +101 -0
  137. package/src/utils/file-writer.ts +2 -2
  138. package/src/utils/pikku-cli-config.ts +28 -0
  139. package/src/utils/schema-generator.ts +5 -4
  140. package/types/application-types.d.ts +5 -1
  141. package/types/config.d.ts +16 -6
  142. package/.pikku/cli/pikku-cli-channel.gen.ts +0 -34
  143. package/.pikku/cli/pikku-cli-client.gen.ts +0 -43
  144. package/.pikku/cli/pikku-cli.gen.ts +0 -41
  145. package/dist/.pikku/cli/pikku-cli-channel.gen.d.ts +0 -1
  146. package/dist/.pikku/cli/pikku-cli-channel.gen.js +0 -33
  147. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
  148. package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -34
  149. package/dist/.pikku/cli/pikku-cli.gen.d.ts +0 -10
  150. 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.1
2
+ * This file was generated by @pikku/cli@0.10.2
3
3
  */
4
4
  /**
5
5
 
@@ -18,6 +18,23 @@ type Session = UserSession;
18
18
  * @template RequiredServices - The services required for this renderer
19
19
  */
20
20
  type PikkuCLIRender<Data, RequiredServices extends SingletonServices = SingletonServices> = CorePikkuCLIRender<Data, RequiredServices, Session>;
21
+ /**
22
+ * Creates a type-safe CLI renderer with access to your application's singleton services.
23
+ * The renderer receives the full singleton services and output data to format and display results.
24
+ *
25
+ * @template Data - The output data type from the CLI command
26
+ * @template RequiredServices - The minimum services required for type checking (defaults to SingletonServices)
27
+ * @param render - Function that receives singleton services and data to render output
28
+ * @returns A CLI renderer configuration
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * const myRenderer = pikkuCLIRender<MyData>(({ logger }, data) => {
33
+ * logger.info(data.message)
34
+ * })
35
+ * ```
36
+ */
37
+ export declare const pikkuCLIRender: <Data, RequiredServices extends SingletonServices = SingletonServices>(render: (services: SingletonServices, data: Data) => void | Promise<void>) => PikkuCLIRender<Data, RequiredServices>;
21
38
  /**
22
39
  * CLI command configuration with project-specific types.
23
40
  * Uses CoreCLICommandConfig from @pikku/core with local middleware and render types.
@@ -1,11 +1,30 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.10.1
2
+ * This file was generated by @pikku/cli@0.10.2
3
3
  */
4
4
  /**
5
5
 
6
6
  * CLI-specific type definitions for tree-shaking optimization
7
7
  */
8
8
  import { wireCLI as wireCLICore } from '@pikku/core/cli';
9
+ /**
10
+ * Creates a type-safe CLI renderer with access to your application's singleton services.
11
+ * The renderer receives the full singleton services and output data to format and display results.
12
+ *
13
+ * @template Data - The output data type from the CLI command
14
+ * @template RequiredServices - The minimum services required for type checking (defaults to SingletonServices)
15
+ * @param render - Function that receives singleton services and data to render output
16
+ * @returns A CLI renderer configuration
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const myRenderer = pikkuCLIRender<MyData>(({ logger }, data) => {
21
+ * logger.info(data.message)
22
+ * })
23
+ * ```
24
+ */
25
+ export const pikkuCLIRender = (render) => {
26
+ return render;
27
+ };
9
28
  /**
10
29
  * Registers a CLI application with the Pikku framework.
11
30
  * Creates command-line interfaces with type-safe commands and options.
@@ -1,120 +1,9 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.10.1
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": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
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": "/home/runner/work/pikku/pikku/packages/cli/src/services.ts"
31
+ "filePath": "src/services.ts"
143
32
  }
144
33
  }
145
34
  });
@@ -1,5 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.10.1
2
+ * This file was generated by @pikku/cli@0.10.2
3
3
  */
4
4
  import '../../src/services.js';
5
- import '../../src/cli.wiring.js';
@@ -1,6 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.10.1
2
+ * This file was generated by @pikku/cli@0.10.2
3
3
  */
4
4
  /* The files with an wireCLI function call */
5
5
  import '../../src/services.js';
6
- import '../../src/cli.wiring.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.10.1
2
+ * This file was generated by @pikku/cli@0.10.2
3
3
  */
4
4
  /**
5
5
  * Core function, middleware, and permission types for all wirings
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.10.1
2
+ * This file was generated by @pikku/cli@0.10.2
3
3
  */
4
4
  /**
5
5
  * Core function, middleware, and permission types for all wirings