@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.
Files changed (197) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/bin/pikku-all.ts +188 -91
  3. package/bin/pikku-fetch.ts +10 -38
  4. package/bin/pikku-nextjs.ts +12 -113
  5. package/bin/pikku-openapi.ts +9 -54
  6. package/bin/pikku-queue-service.ts +28 -0
  7. package/bin/pikku-schemas.ts +6 -32
  8. package/bin/pikku-websocket.ts +11 -41
  9. package/bin/pikku.ts +2 -0
  10. package/cli.schema.json +113 -10
  11. package/dist/bin/pikku-all.d.ts +1 -1
  12. package/dist/bin/pikku-all.js +105 -84
  13. package/dist/bin/pikku-fetch.d.ts +1 -3
  14. package/dist/bin/pikku-fetch.js +9 -15
  15. package/dist/bin/pikku-nextjs.d.ts +1 -4
  16. package/dist/bin/pikku-nextjs.js +10 -40
  17. package/dist/bin/pikku-openapi.d.ts +0 -3
  18. package/dist/bin/pikku-openapi.js +8 -24
  19. package/dist/bin/pikku-queue-service.d.ts +4 -0
  20. package/dist/bin/pikku-queue-service.js +19 -0
  21. package/dist/bin/pikku-schemas.d.ts +0 -3
  22. package/dist/bin/pikku-schemas.js +5 -11
  23. package/dist/bin/pikku-websocket.d.ts +1 -3
  24. package/dist/bin/pikku-websocket.js +9 -18
  25. package/dist/bin/pikku.js +2 -0
  26. package/dist/src/events/channels/pikku-channels.d.ts +2 -0
  27. package/dist/src/events/channels/pikku-channels.js +9 -0
  28. package/dist/src/events/channels/pikku-command-channels-map.d.ts +2 -0
  29. package/dist/src/events/channels/pikku-command-channels-map.js +8 -0
  30. package/dist/src/events/channels/pikku-command-channels.d.ts +2 -0
  31. package/dist/src/events/channels/pikku-command-channels.js +9 -0
  32. package/dist/src/events/channels/pikku-command-websocket-typed.d.ts +2 -0
  33. package/dist/src/events/channels/pikku-command-websocket-typed.js +15 -0
  34. package/dist/src/{serialize-typed-channel-map.js → events/channels/serialize-typed-channel-map.js} +2 -2
  35. package/dist/src/events/fetch/index.d.ts +2 -0
  36. package/dist/src/events/fetch/index.js +12 -0
  37. package/dist/src/events/functions/pikku-command-function-types.d.ts +2 -0
  38. package/dist/src/events/functions/pikku-command-function-types.js +13 -0
  39. package/dist/src/events/functions/pikku-command-functions.d.ts +6 -0
  40. package/dist/src/events/functions/pikku-command-functions.js +35 -0
  41. package/dist/src/events/functions/pikku-command-services.d.ts +3 -0
  42. package/dist/src/events/functions/pikku-command-services.js +73 -0
  43. package/dist/src/events/functions/pikku-function-types.d.ts +2 -0
  44. package/dist/{bin → src/events/functions}/pikku-function-types.js +6 -6
  45. package/dist/src/events/functions/pikku-functions.d.ts +6 -0
  46. package/dist/{bin → src/events/functions}/pikku-functions.js +5 -5
  47. package/dist/src/events/http/pikku-command-http-map.d.ts +2 -0
  48. package/dist/src/events/http/pikku-command-http-map.js +8 -0
  49. package/dist/src/events/http/pikku-command-http-routes.d.ts +2 -0
  50. package/dist/src/events/http/pikku-command-http-routes.js +9 -0
  51. package/dist/src/events/http/pikku-command-openapi.d.ts +2 -0
  52. package/dist/src/events/http/pikku-command-openapi.js +20 -0
  53. package/dist/src/events/http/pikku-http-routes.d.ts +2 -0
  54. package/dist/src/events/http/pikku-http-routes.js +9 -0
  55. package/dist/src/{serialize-typed-http-map.d.ts → events/http/serialize-typed-http-map.d.ts} +0 -1
  56. package/dist/src/{serialize-typed-http-map.js → events/http/serialize-typed-http-map.js} +2 -15
  57. package/dist/src/events/mcp/pikku-command-mcp-json.d.ts +2 -0
  58. package/dist/src/events/mcp/pikku-command-mcp-json.js +13 -0
  59. package/dist/src/events/mcp/pikku-command-mcp.d.ts +2 -0
  60. package/dist/src/events/mcp/pikku-command-mcp.js +54 -0
  61. package/dist/src/events/mcp/serialize-mcp-json.d.ts +5 -0
  62. package/dist/src/events/mcp/serialize-mcp-json.js +101 -0
  63. package/dist/src/events/queue/pikku-command-queue-map.d.ts +2 -0
  64. package/dist/src/events/queue/pikku-command-queue-map.js +8 -0
  65. package/dist/src/events/queue/pikku-command-queue-service.d.ts +2 -0
  66. package/dist/src/events/queue/pikku-command-queue-service.js +12 -0
  67. package/dist/src/events/queue/pikku-command-queue.d.ts +2 -0
  68. package/dist/src/events/queue/pikku-command-queue.js +10 -0
  69. package/dist/src/events/queue/pikku-queue-map.d.ts +2 -0
  70. package/dist/src/events/queue/pikku-queue-map.js +8 -0
  71. package/dist/src/events/queue/pikku-queue.d.ts +2 -0
  72. package/dist/src/events/queue/pikku-queue.js +10 -0
  73. package/dist/src/events/queue/serialize-queue-map.d.ts +4 -0
  74. package/dist/src/events/queue/serialize-queue-map.js +77 -0
  75. package/dist/src/events/queue/serialize-queue-meta.d.ts +2 -0
  76. package/dist/src/events/queue/serialize-queue-meta.js +6 -0
  77. package/dist/src/events/queue/serialize-queue-wrapper.d.ts +1 -0
  78. package/dist/src/events/queue/serialize-queue-wrapper.js +35 -0
  79. package/dist/src/events/rpc/pikku-command-rpc-client.d.ts +2 -0
  80. package/dist/src/events/rpc/pikku-command-rpc-client.js +12 -0
  81. package/dist/src/events/rpc/pikku-command-rpc-map.d.ts +2 -0
  82. package/dist/src/events/rpc/pikku-command-rpc-map.js +8 -0
  83. package/dist/src/events/rpc/pikku-command-rpc.d.ts +2 -0
  84. package/dist/src/events/rpc/pikku-command-rpc.js +6 -0
  85. package/dist/src/events/rpc/pikku-rpc.d.ts +2 -0
  86. package/dist/src/events/rpc/pikku-rpc.js +6 -0
  87. package/dist/src/events/rpc/serialize-rpc-wrapper.d.ts +1 -0
  88. package/dist/src/events/rpc/serialize-rpc-wrapper.js +29 -0
  89. package/dist/src/{serialize-typed-rpc-map.d.ts → events/rpc/serialize-typed-rpc-map.d.ts} +1 -1
  90. package/dist/src/{serialize-typed-rpc-map.js → events/rpc/serialize-typed-rpc-map.js} +3 -3
  91. package/dist/src/events/scheduler/pikku-command-scheduler.d.ts +2 -0
  92. package/dist/src/events/scheduler/pikku-command-scheduler.js +10 -0
  93. package/dist/src/inspector-glob.d.ts +1 -1
  94. package/dist/src/inspector-glob.js +4 -4
  95. package/dist/src/pikku-cli-config.d.ts +12 -2
  96. package/dist/src/pikku-cli-config.js +79 -30
  97. package/dist/src/pikku-command-schemas.d.ts +2 -0
  98. package/dist/src/pikku-command-schemas.js +8 -0
  99. package/dist/src/runtimes/nextjs/pikku-command-nextjs.d.ts +2 -0
  100. package/dist/src/runtimes/nextjs/pikku-command-nextjs.js +36 -0
  101. package/dist/src/schema-generator.d.ts +3 -2
  102. package/dist/src/schema-generator.js +9 -9
  103. package/dist/src/schemas.d.ts +2 -0
  104. package/dist/src/schemas.js +8 -0
  105. package/dist/src/{utils/serialize-import-map.js → serialize-import-map.js} +3 -0
  106. package/dist/src/serialize-pikku-types.js +378 -1
  107. package/dist/src/types.d.ts +5 -0
  108. package/dist/src/types.js +1 -0
  109. package/dist/src/{utils/utils.d.ts → utils.d.ts} +20 -7
  110. package/dist/src/{utils/utils.js → utils.js} +56 -32
  111. package/dist/tsconfig.tsbuildinfo +1 -1
  112. package/package.json +3 -3
  113. package/{bin → src/events/channels}/pikku-channels.ts +8 -3
  114. package/src/events/channels/pikku-command-channels-map.ts +26 -0
  115. package/src/events/channels/pikku-command-channels.ts +38 -0
  116. package/src/events/channels/pikku-command-websocket-typed.ts +36 -0
  117. package/src/{serialize-typed-channel-map.ts → events/channels/serialize-typed-channel-map.ts} +2 -2
  118. package/src/events/fetch/index.ts +33 -0
  119. package/src/events/functions/pikku-command-function-types.ts +48 -0
  120. package/src/events/functions/pikku-command-functions.ts +84 -0
  121. package/src/events/functions/pikku-command-services.ts +125 -0
  122. package/{bin → src/events/functions}/pikku-function-types.ts +12 -15
  123. package/{bin → src/events/functions}/pikku-functions.ts +9 -6
  124. package/src/events/http/pikku-command-http-map.ts +27 -0
  125. package/src/events/http/pikku-command-http-routes.ts +40 -0
  126. package/src/events/http/pikku-command-openapi.ts +54 -0
  127. package/{bin → src/events/http}/pikku-http-routes.ts +8 -3
  128. package/src/{serialize-typed-http-map.ts → events/http/serialize-typed-http-map.ts} +2 -19
  129. package/src/events/mcp/pikku-command-mcp-json.ts +33 -0
  130. package/src/events/mcp/pikku-command-mcp.ts +110 -0
  131. package/src/events/mcp/serialize-mcp-json.ts +159 -0
  132. package/src/events/queue/pikku-command-queue-map.ts +26 -0
  133. package/src/events/queue/pikku-command-queue-service.ts +33 -0
  134. package/src/events/queue/pikku-command-queue.ts +42 -0
  135. package/src/events/queue/pikku-queue-map.ts +26 -0
  136. package/src/events/queue/pikku-queue.ts +40 -0
  137. package/src/events/queue/serialize-queue-map.ts +119 -0
  138. package/src/events/queue/serialize-queue-meta.ts +10 -0
  139. package/src/events/queue/serialize-queue-wrapper.ts +35 -0
  140. package/src/events/rpc/pikku-command-rpc-client.ts +33 -0
  141. package/src/events/rpc/pikku-command-rpc-map.ts +26 -0
  142. package/src/events/rpc/pikku-command-rpc.ts +22 -0
  143. package/{bin → src/events/rpc}/pikku-rpc.ts +8 -6
  144. package/src/events/rpc/serialize-rpc-wrapper.ts +29 -0
  145. package/src/{serialize-typed-rpc-map.ts → events/rpc/serialize-typed-rpc-map.ts} +5 -4
  146. package/{bin/pikku-scheduler.ts → src/events/scheduler/pikku-command-scheduler.ts} +11 -8
  147. package/src/inspector-glob.ts +4 -2
  148. package/src/pikku-cli-config.ts +119 -42
  149. package/src/pikku-command-schemas.ts +33 -0
  150. package/src/runtimes/nextjs/pikku-command-nextjs.ts +110 -0
  151. package/src/schema-generator.ts +10 -5
  152. package/src/schemas.ts +33 -0
  153. package/src/{utils/serialize-import-map.ts → serialize-import-map.ts} +5 -0
  154. package/src/serialize-pikku-types.ts +378 -1
  155. package/src/types.ts +16 -0
  156. package/src/{utils/utils.ts → utils.ts} +68 -34
  157. package/tsconfig.json +1 -1
  158. package/bin/pikku-channels-map.ts +0 -25
  159. package/bin/pikku-http-map.ts +0 -26
  160. package/bin/pikku-nextjs.test.ts +0 -279
  161. package/bin/pikku-rpc-map.ts +0 -25
  162. package/dist/bin/pikku-channels-map.d.ts +0 -3
  163. package/dist/bin/pikku-channels-map.js +0 -8
  164. package/dist/bin/pikku-channels.d.ts +0 -3
  165. package/dist/bin/pikku-channels.js +0 -9
  166. package/dist/bin/pikku-function-types.d.ts +0 -4
  167. package/dist/bin/pikku-functions.d.ts +0 -7
  168. package/dist/bin/pikku-http-map.d.ts +0 -3
  169. package/dist/bin/pikku-http-map.js +0 -8
  170. package/dist/bin/pikku-http-routes.d.ts +0 -3
  171. package/dist/bin/pikku-http-routes.js +0 -9
  172. package/dist/bin/pikku-rpc-map.d.ts +0 -3
  173. package/dist/bin/pikku-rpc-map.js +0 -8
  174. package/dist/bin/pikku-rpc.d.ts +0 -3
  175. package/dist/bin/pikku-rpc.js +0 -6
  176. package/dist/bin/pikku-scheduler.d.ts +0 -3
  177. package/dist/bin/pikku-scheduler.js +0 -10
  178. /package/dist/src/{serialize-typed-channel-map.d.ts → events/channels/serialize-typed-channel-map.d.ts} +0 -0
  179. /package/dist/src/{serialize-websocket-wrapper.d.ts → events/channels/serialize-websocket-wrapper.d.ts} +0 -0
  180. /package/dist/src/{serialize-websocket-wrapper.js → events/channels/serialize-websocket-wrapper.js} +0 -0
  181. /package/dist/src/{openapi-spec-generator.d.ts → events/http/openapi-spec-generator.d.ts} +0 -0
  182. /package/dist/src/{openapi-spec-generator.js → events/http/openapi-spec-generator.js} +0 -0
  183. /package/dist/src/{serialize-fetch-wrapper.d.ts → events/http/serialize-fetch-wrapper.d.ts} +0 -0
  184. /package/dist/src/{serialize-fetch-wrapper.js → events/http/serialize-fetch-wrapper.js} +0 -0
  185. /package/dist/src/{serialize-scheduler-meta.d.ts → events/scheduler/serialize-scheduler-meta.d.ts} +0 -0
  186. /package/dist/src/{serialize-scheduler-meta.js → events/scheduler/serialize-scheduler-meta.js} +0 -0
  187. /package/dist/src/{serialize-nextjs-backend-wrapper.d.ts → runtimes/nextjs/serialize-nextjs-backend-wrapper.d.ts} +0 -0
  188. /package/dist/src/{serialize-nextjs-backend-wrapper.js → runtimes/nextjs/serialize-nextjs-backend-wrapper.js} +0 -0
  189. /package/dist/src/{serialize-nextjs-http-wrapper.d.ts → runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts} +0 -0
  190. /package/dist/src/{serialize-nextjs-http-wrapper.js → runtimes/nextjs/serialize-nextjs-http-wrapper.js} +0 -0
  191. /package/dist/src/{utils/serialize-import-map.d.ts → serialize-import-map.d.ts} +0 -0
  192. /package/src/{serialize-websocket-wrapper.ts → events/channels/serialize-websocket-wrapper.ts} +0 -0
  193. /package/src/{openapi-spec-generator.ts → events/http/openapi-spec-generator.ts} +0 -0
  194. /package/src/{serialize-fetch-wrapper.ts → events/http/serialize-fetch-wrapper.ts} +0 -0
  195. /package/src/{serialize-scheduler-meta.ts → events/scheduler/serialize-scheduler-meta.ts} +0 -0
  196. /package/src/{serialize-nextjs-backend-wrapper.ts → runtimes/nextjs/serialize-nextjs-backend-wrapper.ts} +0 -0
  197. /package/src/{serialize-nextjs-http-wrapper.ts → runtimes/nextjs/serialize-nextjs-http-wrapper.ts} +0 -0
@@ -1,70 +1,25 @@
1
1
  import { Command } from 'commander'
2
- import {
3
- logCommandInfoAndTime,
4
- logPikkuLogo,
5
- PikkuCLIOptions,
6
- writeFileInDir,
7
- } from '../src/utils/utils.js'
8
- import { generateSchemas } from '../src/schema-generator.js'
9
- import { generateOpenAPISpec } from '../src/openapi-spec-generator.js'
10
- import { getPikkuCLIConfig, PikkuCLIConfig } from '../src/pikku-cli-config.js'
11
- import { InspectorState } from '@pikku/inspector'
12
- import { stringify } from 'yaml'
2
+ import { CLILogger, PikkuCLIOptions } from '../src/utils.js'
3
+ import { getPikkuCLIConfig } from '../src/pikku-cli-config.js'
13
4
  import { inspectorGlob } from '../src/inspector-glob.js'
14
-
15
- export const pikkuOpenAPI = async (
16
- { tsconfig, openAPI }: PikkuCLIConfig,
17
- { http, functions }: InspectorState
18
- ) => {
19
- await logCommandInfoAndTime(
20
- 'Creating OpenAPI spec',
21
- 'Created OpenAPI spec',
22
- [openAPI?.outputFile === undefined, 'openAPI outfile is not defined'],
23
- async () => {
24
- if (!openAPI?.outputFile) {
25
- throw new Error('openAPI is required')
26
- }
27
- const schemas = await generateSchemas(
28
- tsconfig,
29
- functions.typesMap,
30
- functions.meta,
31
- http.meta
32
- )
33
- const openAPISpec = await generateOpenAPISpec(
34
- functions.meta,
35
- http.meta,
36
- schemas,
37
- openAPI.additionalInfo
38
- )
39
- if (openAPI.outputFile.endsWith('.json')) {
40
- await writeFileInDir(
41
- openAPI.outputFile,
42
- JSON.stringify(openAPISpec, null, 2),
43
- true
44
- )
45
- } else if (
46
- openAPI.outputFile.endsWith('.yaml') ||
47
- openAPI.outputFile.endsWith('.yml')
48
- ) {
49
- await writeFileInDir(openAPI.outputFile, stringify(openAPISpec), true)
50
- }
51
- }
52
- )
53
- }
5
+ import { pikkuOpenAPI } from '../src/events/http/pikku-command-openapi.js'
54
6
 
55
7
  async function action({ config, tags }: PikkuCLIOptions): Promise<void> {
56
- logPikkuLogo()
8
+ const logger = new CLILogger({ logLogo: true })
57
9
  const cliConfig = await getPikkuCLIConfig(
58
10
  config,
59
11
  ['rootDir', 'httpRoutesFile', 'openAPI', 'schemaDirectory', 'tsconfig'],
60
- tags
12
+ {
13
+ tags: tags || [],
14
+ }
61
15
  )
62
16
  const visitState = await inspectorGlob(
17
+ logger,
63
18
  cliConfig.rootDir,
64
19
  cliConfig.srcDirectories,
65
20
  cliConfig.filters
66
21
  )
67
- await pikkuOpenAPI(cliConfig, visitState)
22
+ await pikkuOpenAPI(logger, cliConfig, visitState)
68
23
  }
69
24
 
70
25
  export const openapi = (program: Command): void => {
@@ -0,0 +1,28 @@
1
+ import { Command } from 'commander'
2
+ import { getPikkuCLIConfig } from '../src/pikku-cli-config.js'
3
+ import { CLILogger, PikkuCLIOptions } from '../src/utils.js'
4
+ import { pikkuQueueService } from '../src/events/queue/pikku-command-queue-service.js'
5
+
6
+ export const action = async (options: PikkuCLIOptions): Promise<void> => {
7
+ const logger = new CLILogger({ logLogo: true })
8
+
9
+ const cliConfig = await getPikkuCLIConfig(
10
+ options.config,
11
+ ['rootDir', 'schemaDirectory', 'configDir', 'queueFile'],
12
+ {
13
+ tags: options.tags,
14
+ types: options.types,
15
+ directories: options.directories,
16
+ },
17
+ true
18
+ )
19
+ await pikkuQueueService(logger, cliConfig)
20
+ }
21
+
22
+ export const queue = (program: Command): void => {
23
+ program
24
+ .command('queue')
25
+ .description('generate queue service wrapper')
26
+ .option('-c | --config <string>', 'The path to pikku cli config file')
27
+ .action(action)
28
+ }
@@ -1,39 +1,12 @@
1
1
  import { Command } from 'commander'
2
- import { saveSchemas, generateSchemas } from '../src/schema-generator.js'
3
2
 
4
- import { getPikkuCLIConfig, PikkuCLIConfig } from '../src/pikku-cli-config.js'
5
- import { InspectorState } from '@pikku/inspector'
6
- import { logCommandInfoAndTime, logPikkuLogo } from '../src/utils/utils.js'
3
+ import { getPikkuCLIConfig } from '../src/pikku-cli-config.js'
7
4
  import { inspectorGlob } from '../src/inspector-glob.js'
8
-
9
- export const pikkuSchemas = async (
10
- { tsconfig, schemaDirectory, supportsImportAttributes }: PikkuCLIConfig,
11
- { functions, http }: InspectorState
12
- ) => {
13
- return await logCommandInfoAndTime(
14
- 'Creating schemas',
15
- 'Created schemas',
16
- [false],
17
- async () => {
18
- const schemas = await generateSchemas(
19
- tsconfig,
20
- functions.typesMap,
21
- functions.meta,
22
- http.meta
23
- )
24
- await saveSchemas(
25
- schemaDirectory,
26
- schemas,
27
- functions.typesMap,
28
- functions.meta,
29
- supportsImportAttributes
30
- )
31
- }
32
- )
33
- }
5
+ import { pikkuSchemas } from '../src/schemas.js'
6
+ import { CLILogger } from '../src/utils.js'
34
7
 
35
8
  async function action({ config }: { config?: string }): Promise<void> {
36
- logPikkuLogo()
9
+ const logger = new CLILogger({ logLogo: true })
37
10
 
38
11
  const cliConfig = await getPikkuCLIConfig(config, [
39
12
  'srcDirectories',
@@ -41,11 +14,12 @@ async function action({ config }: { config?: string }): Promise<void> {
41
14
  'tsconfig',
42
15
  ])
43
16
  const visitState = await inspectorGlob(
17
+ logger,
44
18
  cliConfig.rootDir,
45
19
  cliConfig.srcDirectories,
46
20
  cliConfig.filters
47
21
  )
48
- await pikkuSchemas(cliConfig, visitState)
22
+ await pikkuSchemas(logger, cliConfig, visitState)
49
23
  }
50
24
 
51
25
  export const schemas = (program: Command): void => {
@@ -1,52 +1,22 @@
1
1
  import { Command } from 'commander'
2
- import {
3
- getFileImportRelativePath,
4
- logCommandInfoAndTime,
5
- logPikkuLogo,
6
- PikkuCLIOptions,
7
- writeFileInDir,
8
- } from '../src/utils/utils.js'
9
- import { getPikkuCLIConfig, PikkuCLIConfig } from '../src/pikku-cli-config.js'
10
- import { serializeWebsocketWrapper } from '../src/serialize-websocket-wrapper.js'
11
-
12
- export const pikkuWebSocket = async ({
13
- websocketFile,
14
- channelsMapDeclarationFile,
15
- packageMappings,
16
- }: PikkuCLIConfig) => {
17
- await logCommandInfoAndTime(
18
- 'Generating websocket wrapper',
19
- 'Generated websocket wrapper',
20
- [
21
- websocketFile === undefined,
22
- "websocketFile isn't set in the pikku config",
23
- ],
24
- async () => {
25
- if (!websocketFile) {
26
- throw new Error("fetchFile is isn't set in the pikku config")
27
- }
28
-
29
- const channelsMapDeclarationPath = getFileImportRelativePath(
30
- websocketFile,
31
- channelsMapDeclarationFile,
32
- packageMappings
33
- )
34
-
35
- const content = [serializeWebsocketWrapper(channelsMapDeclarationPath)]
36
- await writeFileInDir(websocketFile, content.join('\n'))
37
- }
38
- )
39
- }
2
+ import { CLILogger, PikkuCLIOptions } from '../src/utils.js'
3
+ import { getPikkuCLIConfig } from '../src/pikku-cli-config.js'
4
+ import { pikkuWebSocketTyped } from '../src/events/channels/pikku-command-websocket-typed.js'
40
5
 
41
6
  export const action = async (options: PikkuCLIOptions): Promise<void> => {
42
- logPikkuLogo()
7
+ const logger = new CLILogger({ logLogo: true })
8
+
43
9
  const cliConfig = await getPikkuCLIConfig(
44
10
  options.config,
45
11
  ['rootDir', 'schemaDirectory', 'configDir', 'fetchFile'],
46
- options.tags,
12
+ {
13
+ tags: options.tags,
14
+ types: options.types,
15
+ directories: options.directories,
16
+ },
47
17
  true
48
18
  )
49
- await pikkuWebSocket(cliConfig)
19
+ await pikkuWebSocketTyped(logger, cliConfig)
50
20
  }
51
21
 
52
22
  export const websocket = (program: Command): void => {
package/bin/pikku.ts CHANGED
@@ -4,6 +4,7 @@ import { schemas } from './pikku-schemas.js'
4
4
  import { nextjs } from './pikku-nextjs.js'
5
5
  import { all } from './pikku-all.js'
6
6
  import { fetch } from './pikku-fetch.js'
7
+ import { queue } from './pikku-queue-service.js'
7
8
 
8
9
  const program = new Command('pikku')
9
10
  program.usage('[command]')
@@ -12,5 +13,6 @@ all(program)
12
13
  schemas(program)
13
14
  nextjs(program)
14
15
  fetch(program)
16
+ queue(program)
15
17
 
16
18
  program.parse(process.argv)
package/cli.schema.json CHANGED
@@ -2,6 +2,18 @@
2
2
  "$ref": "#/definitions/PikkuCLIConfig",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "definitions": {
5
+ "InspectorFilters": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "tags": {
9
+ "items": {
10
+ "type": "string"
11
+ },
12
+ "type": "array"
13
+ }
14
+ },
15
+ "type": "object"
16
+ },
5
17
  "OpenAPISpecInfo": {
6
18
  "additionalProperties": false,
7
19
  "properties": {
@@ -123,12 +135,40 @@
123
135
  "bootstrapFile": {
124
136
  "type": "string"
125
137
  },
138
+ "bootstrapFiles": {
139
+ "additionalProperties": false,
140
+ "properties": {
141
+ "channel": {
142
+ "type": "string"
143
+ },
144
+ "http": {
145
+ "type": "string"
146
+ },
147
+ "mcp": {
148
+ "type": "string"
149
+ },
150
+ "queue": {
151
+ "type": "string"
152
+ },
153
+ "rpc": {
154
+ "type": "string"
155
+ },
156
+ "scheduled": {
157
+ "type": "string"
158
+ }
159
+ },
160
+ "required": ["http", "scheduled", "channel", "rpc", "queue", "mcp"],
161
+ "type": "object"
162
+ },
126
163
  "channelsFile": {
127
164
  "type": "string"
128
165
  },
129
166
  "channelsMapDeclarationFile": {
130
167
  "type": "string"
131
168
  },
169
+ "channelsMetaFile": {
170
+ "type": "string"
171
+ },
132
172
  "configDir": {
133
173
  "type": "string"
134
174
  },
@@ -138,6 +178,33 @@
138
178
  "fetchFile": {
139
179
  "type": "string"
140
180
  },
181
+ "filters": {
182
+ "$ref": "#/definitions/InspectorFilters"
183
+ },
184
+ "functionsFile": {
185
+ "type": "string"
186
+ },
187
+ "functionsMetaFile": {
188
+ "type": "string"
189
+ },
190
+ "httpRoutesFile": {
191
+ "type": "string"
192
+ },
193
+ "httpRoutesMapDeclarationFile": {
194
+ "type": "string"
195
+ },
196
+ "httpRoutesMetaFile": {
197
+ "type": "string"
198
+ },
199
+ "mcpEndpointsFile": {
200
+ "type": "string"
201
+ },
202
+ "mcpEndpointsMetaFile": {
203
+ "type": "string"
204
+ },
205
+ "mcpJsonFile": {
206
+ "type": "string"
207
+ },
141
208
  "nextBackendFile": {
142
209
  "type": "string"
143
210
  },
@@ -166,27 +233,48 @@
166
233
  },
167
234
  "type": "object"
168
235
  },
236
+ "queueFile": {
237
+ "type": "string"
238
+ },
239
+ "queueMapDeclarationFile": {
240
+ "type": "string"
241
+ },
242
+ "queueWorkersFile": {
243
+ "type": "string"
244
+ },
245
+ "queueWorkersMetaFile": {
246
+ "type": "string"
247
+ },
169
248
  "rootDir": {
170
249
  "type": "string"
171
250
  },
172
- "srcDirectories": {
173
- "items": {
174
- "type": "string"
175
- },
176
- "type": "array"
251
+ "rpcFile": {
252
+ "type": "string"
177
253
  },
178
- "routesFile": {
254
+ "rpcMapDeclarationFile": {
179
255
  "type": "string"
180
256
  },
181
- "routesMapDeclarationFile": {
257
+ "rpcMetaFile": {
182
258
  "type": "string"
183
259
  },
184
260
  "schedulersFile": {
185
261
  "type": "string"
186
262
  },
263
+ "schedulersMetaFile": {
264
+ "type": "string"
265
+ },
187
266
  "schemaDirectory": {
188
267
  "type": "string"
189
268
  },
269
+ "servicesFile": {
270
+ "type": "string"
271
+ },
272
+ "srcDirectories": {
273
+ "items": {
274
+ "type": "string"
275
+ },
276
+ "type": "array"
277
+ },
190
278
  "supportsImportAttributes": {
191
279
  "type": "boolean"
192
280
  },
@@ -202,16 +290,31 @@
202
290
  },
203
291
  "required": [
204
292
  "bootstrapFile",
293
+ "bootstrapFiles",
205
294
  "channelsFile",
206
295
  "channelsMapDeclarationFile",
296
+ "channelsMetaFile",
207
297
  "configDir",
298
+ "filters",
299
+ "functionsFile",
300
+ "functionsMetaFile",
301
+ "httpRoutesFile",
302
+ "httpRoutesMapDeclarationFile",
303
+ "httpRoutesMetaFile",
304
+ "mcpEndpointsFile",
305
+ "mcpEndpointsMetaFile",
208
306
  "packageMappings",
307
+ "queueMapDeclarationFile",
308
+ "queueWorkersFile",
309
+ "queueWorkersMetaFile",
209
310
  "rootDir",
210
- "srcDirectories",
211
- "routesFile",
212
- "routesMapDeclarationFile",
311
+ "rpcMapDeclarationFile",
312
+ "rpcMetaFile",
213
313
  "schedulersFile",
314
+ "schedulersMetaFile",
214
315
  "schemaDirectory",
316
+ "servicesFile",
317
+ "srcDirectories",
215
318
  "supportsImportAttributes",
216
319
  "tsconfig",
217
320
  "typesDeclarationFile"
@@ -1,4 +1,4 @@
1
1
  import { Command } from 'commander';
2
- import { PikkuCLIOptions } from '../src/utils/utils.js';
2
+ import { PikkuCLIOptions } from '../src/utils.js';
3
3
  export declare const action: (options: PikkuCLIOptions) => Promise<void>;
4
4
  export declare const all: (program: Command) => void;