@pikku/cli 0.10.1 → 0.11.0
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 +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-types.gen.ts +23 -1
- package/.pikku/cli/pikku-cli-wirings-meta.gen.ts +8 -116
- 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 +265 -138
- package/.pikku/function/pikku-functions-meta.min.gen.ts +62 -32
- 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 +21 -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 +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 +26 -10
- package/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts +15 -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 +57 -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 +8 -116
- 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 +265 -138
- package/dist/.pikku/function/pikku-functions-meta.min.gen.js +62 -32
- 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 +15 -6
- package/dist/.pikku/pikku-services.gen.js +14 -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 +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 +15 -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.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 +24 -19
- package/dist/src/cli.wiring.js +107 -99
- package/dist/src/functions/commands/all.js +51 -2
- package/dist/src/functions/commands/bootstrap.d.ts +1 -0
- package/dist/src/functions/commands/bootstrap.js +24 -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 +20 -7
- 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/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/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-forwarder.service.js +1 -1
- package/dist/src/services/cli-logger.service.d.ts +7 -2
- package/dist/src/services/cli-logger.service.js +17 -5
- package/dist/src/services.js +77 -12
- package/dist/src/utils/command-summary.d.ts +44 -0
- package/dist/src/utils/command-summary.js +74 -0
- package/dist/src/utils/file-writer.js +2 -2
- package/dist/src/utils/pikku-cli-config.js +48 -0
- package/dist/src/utils/schema-generator.d.ts +2 -2
- package/dist/src/utils/schema-generator.js +31 -10
- 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 +66 -2
- package/src/functions/commands/bootstrap.ts +28 -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 +20 -7
- 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/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/middleware/log-command-info-and-time.ts +8 -5
- package/src/services/cli-logger-forwarder.service.ts +1 -1
- package/src/services/cli-logger.service.ts +21 -6
- package/src/services.ts +86 -11
- package/src/utils/command-summary.ts +103 -0
- package/src/utils/file-writer.ts +2 -2
- package/src/utils/pikku-cli-config.ts +68 -0
- package/src/utils/schema-generator.ts +30 -11
- package/types/application-types.d.ts +5 -1
- package/types/config.d.ts +61 -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.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
- /package/dist/.pikku/{cli/pikku-cli-channel.gen.d.ts → workflow/pikku-workflow-wirings-meta.gen.d.ts} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
3
|
*/
|
|
4
4
|
import { addSchema } from '@pikku/core/schema';
|
|
5
|
-
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
|
|
6
|
-
addSchema('PikkuSchemasOutput', PikkuSchemasOutput);
|
|
7
5
|
import * as PikkuChannelsOutput from './schemas/PikkuChannelsOutput.schema.json' with { type: 'json' };
|
|
8
6
|
addSchema('PikkuChannelsOutput', PikkuChannelsOutput);
|
|
9
7
|
import * as PikkuCLIOutput from './schemas/PikkuCLIOutput.schema.json' with { type: 'json' };
|
|
10
8
|
addSchema('PikkuCLIOutput', PikkuCLIOutput);
|
|
11
9
|
import * as PikkuFunctionsOutput from './schemas/PikkuFunctionsOutput.schema.json' with { type: 'json' };
|
|
12
10
|
addSchema('PikkuFunctionsOutput', PikkuFunctionsOutput);
|
|
11
|
+
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
|
|
12
|
+
addSchema('PikkuSchemasOutput', PikkuSchemasOutput);
|
|
13
13
|
import * as PikkuHTTPOutput from './schemas/PikkuHTTPOutput.schema.json' with { type: 'json' };
|
|
14
14
|
addSchema('PikkuHTTPOutput', PikkuHTTPOutput);
|
|
15
15
|
import * as PikkuMCPOutput from './schemas/PikkuMCPOutput.schema.json' with { type: 'json' };
|
|
@@ -20,9 +20,15 @@ import * as PikkuPermissionsOutput from './schemas/PikkuPermissionsOutput.schema
|
|
|
20
20
|
addSchema('PikkuPermissionsOutput', PikkuPermissionsOutput);
|
|
21
21
|
import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with { type: 'json' };
|
|
22
22
|
addSchema('PikkuQueueOutput', PikkuQueueOutput);
|
|
23
|
+
import * as PikkuPublicRPCOutput from './schemas/PikkuPublicRPCOutput.schema.json' with { type: 'json' };
|
|
24
|
+
addSchema('PikkuPublicRPCOutput', PikkuPublicRPCOutput);
|
|
25
|
+
import * as PikkuRemoteRPCOutput from './schemas/PikkuRemoteRPCOutput.schema.json' with { type: 'json' };
|
|
26
|
+
addSchema('PikkuRemoteRPCOutput', PikkuRemoteRPCOutput);
|
|
23
27
|
import * as PikkuRPCOutput from './schemas/PikkuRPCOutput.schema.json' with { type: 'json' };
|
|
24
28
|
addSchema('PikkuRPCOutput', PikkuRPCOutput);
|
|
25
29
|
import * as PikkuSchedulerOutput from './schemas/PikkuSchedulerOutput.schema.json' with { type: 'json' };
|
|
26
30
|
addSchema('PikkuSchedulerOutput', PikkuSchedulerOutput);
|
|
31
|
+
import * as PikkuWorkflowOutput from './schemas/PikkuWorkflowOutput.schema.json' with { type: 'json' };
|
|
32
|
+
addSchema('PikkuWorkflowOutput', PikkuWorkflowOutput);
|
|
27
33
|
import * as PikkuCLIConfig from './schemas/PikkuCLIConfig.schema.json' with { type: 'json' };
|
|
28
34
|
addSchema('PikkuCLIConfig', PikkuCLIConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaMinFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaMinFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "workflowsWiringFile": { "type": "string" }, "workflowsWiringMetaFile": { "type": "string" }, "workflowsWorkersFile": { "type": "string" }, "workflowMapDeclarationFile": { "type": "string" }, "workflowTypesFile": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "ignoreFiles": { "type": "array", "items": { "type": "string" } }, "packageMappings": { "type": "object", "additionalProperties": { "type": "string" } }, "configFile": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "userSessionType": { "type": "string" }, "singletonServicesFactoryType": { "type": "string" }, "sessionServicesFactoryType": { "type": "string" }, "configDir": { "type": "string" }, "tsconfig": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "schema": { "type": "object", "properties": { "additionalProperties": { "type": "boolean" }, "supportsImportAttributes": { "type": "boolean" } }, "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "workflows": { "anyOf": [{ "type": "object", "properties": { "singleQueue": { "type": "boolean", "const": true }, "path": { "type": "string" }, "orchestratorQueue": { "type": "string" }, "workerQueue": { "type": "string" } }, "required": ["singleQueue", "path"], "additionalProperties": false }, { "type": "object", "properties": { "singleQueue": { "type": "boolean", "const": false }, "dir": { "type": "string" }, "orchestratorQueuePrefix": { "type": "string" }, "workerQueuePrefix": { "type": "string" } }, "required": ["singleQueue", "dir"], "additionalProperties": false }] }, "rpc": { "type": "object", "properties": { "remoteRpcWorkersPath": { "type": "string" }, "publicRpcPath": { "type": "string" } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["bootstrapFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "cliBootstrapFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringsFile", "configDir", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaMinFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringsFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "middlewareFile", "middlewareGroupsMetaFile", "outDir", "packageMappings", "permissionsFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schemaDirectory", "servicesFile", "srcDirectories", "tsconfig", "typesDeclarationFile", "workflowMapDeclarationFile", "workflowTypesFile", "workflowsWiringFile", "workflowsWiringMetaFile", "workflowsWorkersFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "types": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "description": "This provides the structure needed for typescript to be aware of RPCs and their return types", "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "rpcName": { "type": "string" }, "data": {} }, "required": ["rpcName"], "additionalProperties": false, "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "boolean", "enum": [false, true], "definitions": {} }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Workflow-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { CoreWorkflow, PikkuWorkflowInteraction, WorkflowStepOptions } from '@pikku/core/workflow';
|
|
8
|
+
import { CorePikkuFunctionConfig, CorePikkuFunctionSessionless } from '@pikku/core';
|
|
9
|
+
import type { PikkuPermission, PikkuMiddleware } from '../function/pikku-function-types.gen.js';
|
|
10
|
+
import type { UserSession, SingletonServices } from '../../types/application-types.d.js';
|
|
11
|
+
import type { TypedPikkuRPC, RPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js';
|
|
12
|
+
/**
|
|
13
|
+
* Type definition for workflows that orchestrate multi-step processes.
|
|
14
|
+
* Workflows support both inline and remote execution modes with step caching.
|
|
15
|
+
*/
|
|
16
|
+
type WorkflowWiring = CoreWorkflow<CorePikkuFunctionConfig<PikkuFunctionWorkflow<any, any>, PikkuPermission<any>, PikkuMiddleware>>;
|
|
17
|
+
/**
|
|
18
|
+
* Typed workflow interaction with RPC awareness
|
|
19
|
+
* Provides type-safe workflow.do() for RPC steps
|
|
20
|
+
*/
|
|
21
|
+
export interface TypedWorkflow extends PikkuWorkflowInteraction {
|
|
22
|
+
/**
|
|
23
|
+
* Execute a workflow step with RPC invocation (typed based on available RPCs)
|
|
24
|
+
* @template K - RPC name from the RPC map
|
|
25
|
+
*/
|
|
26
|
+
do<K extends keyof RPCMap>(stepName: string, rpcName: K, data: RPCMap[K]['input'], options?: WorkflowStepOptions): Promise<RPCMap[K]['output']>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute a workflow step with inline function
|
|
29
|
+
* @template T - Return type of the inline function
|
|
30
|
+
*/
|
|
31
|
+
do<T>(stepName: string, fn: () => T | Promise<T>, options?: WorkflowStepOptions): Promise<T>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Workflow function type with typed workflow service
|
|
35
|
+
* Includes the workflow interaction object with typed RPC methods
|
|
36
|
+
*/
|
|
37
|
+
export type PikkuFunctionWorkflow<In = unknown, Out = never> = CorePikkuFunctionSessionless<In, Out, null, SingletonServices & {
|
|
38
|
+
rpc: TypedPikkuRPC;
|
|
39
|
+
workflow: TypedWorkflow;
|
|
40
|
+
}, UserSession>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a workflow function with typed input and output.
|
|
43
|
+
* Workflow functions have access to the workflow interaction object for step execution.
|
|
44
|
+
*
|
|
45
|
+
* @template In - Input type for the workflow
|
|
46
|
+
* @template Out - Output type for the workflow
|
|
47
|
+
* @param func - Function definition, either direct function or configuration object
|
|
48
|
+
* @returns The normalized configuration object
|
|
49
|
+
*/
|
|
50
|
+
export declare const pikkuWorkflowFunc: <In, Out = unknown>(func: PikkuFunctionWorkflow<In, Out> | CorePikkuFunctionConfig<PikkuFunctionWorkflow<In, Out>, PikkuPermission<In>, PikkuMiddleware>) => CorePikkuFunctionConfig<PikkuFunctionWorkflow<In, Out>, PikkuPermission<In>, PikkuMiddleware>;
|
|
51
|
+
/**
|
|
52
|
+
* Registers a workflow with the Pikku framework.
|
|
53
|
+
* Workflows can run in 'inline' (synchronous) or 'remote' (queue-based) execution modes.
|
|
54
|
+
*
|
|
55
|
+
* @param workflow - Workflow definition with name, execution mode, and handler function
|
|
56
|
+
*/
|
|
57
|
+
export declare const wireWorkflow: (workflow: WorkflowWiring) => void;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was generated by @pikku/cli@0.11.0
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Workflow-specific type definitions for tree-shaking optimization
|
|
6
|
+
*/
|
|
7
|
+
import { wireWorkflow as wireWorkflowCore } from '@pikku/core/workflow';
|
|
8
|
+
/**
|
|
9
|
+
* Creates a workflow function with typed input and output.
|
|
10
|
+
* Workflow functions have access to the workflow interaction object for step execution.
|
|
11
|
+
*
|
|
12
|
+
* @template In - Input type for the workflow
|
|
13
|
+
* @template Out - Output type for the workflow
|
|
14
|
+
* @param func - Function definition, either direct function or configuration object
|
|
15
|
+
* @returns The normalized configuration object
|
|
16
|
+
*/
|
|
17
|
+
export const pikkuWorkflowFunc = (func) => {
|
|
18
|
+
return typeof func === 'function' ? { func } : func;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Registers a workflow with the Pikku framework.
|
|
22
|
+
* Workflows can run in 'inline' (synchronous) or 'remote' (queue-based) execution modes.
|
|
23
|
+
*
|
|
24
|
+
* @param workflow - Workflow definition with name, execution mode, and handler function
|
|
25
|
+
*/
|
|
26
|
+
export const wireWorkflow = (workflow) => {
|
|
27
|
+
wireWorkflowCore(workflow);
|
|
28
|
+
};
|
package/dist/bin/pikku.js
CHANGED
|
@@ -3,25 +3,27 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { createConfig, createSingletonServices } from '../src/services.js';
|
|
4
4
|
import { PikkuRPCService } from '@pikku/core/rpc';
|
|
5
5
|
import { LocalVariablesService } from '@pikku/core/services';
|
|
6
|
-
import { existsSync } from 'fs'
|
|
7
|
-
import { fileURLToPath } from 'url'
|
|
8
|
-
import { dirname, join } from 'path'
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
10
|
-
const __dirname = dirname(__filename)
|
|
6
|
+
// import { existsSync } from 'fs'
|
|
7
|
+
// import { fileURLToPath } from 'url'
|
|
8
|
+
// import { dirname, join } from 'path'
|
|
9
|
+
// const __filename = fileURLToPath(import.meta.url)
|
|
10
|
+
// const __dirname = dirname(__filename)
|
|
11
11
|
// Check if Pikku CLI is available
|
|
12
|
-
const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
|
|
13
|
-
if (existsSync(pikkuCliPath)) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
// const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js')
|
|
13
|
+
// if (existsSync(pikkuCliPath)) {
|
|
14
|
+
// try {
|
|
15
|
+
// // Use the generated Pikku CLI
|
|
16
|
+
// const { PikkuCLI } = await import('../.pikku/cli/pikku-cli.gen.js')
|
|
17
|
+
// await PikkuCLI(process.argv.slice(2))
|
|
18
|
+
// process.exit(0)
|
|
19
|
+
// } catch (error) {
|
|
20
|
+
// // If import fails, fall back to Commander.js
|
|
21
|
+
// console.warn(
|
|
22
|
+
// 'Failed to load Pikku CLI, using fallback mode:',
|
|
23
|
+
// error.message
|
|
24
|
+
// )
|
|
25
|
+
// }
|
|
26
|
+
// }
|
|
25
27
|
// Fallback to Commander.js for initial setup
|
|
26
28
|
// Import bootstrap if it exists
|
|
27
29
|
try {
|
|
@@ -56,7 +58,10 @@ const all = (program, name, description) => {
|
|
|
56
58
|
.option('-n, --names <names...>', 'Filter functions by name patterns (supports wildcards)')
|
|
57
59
|
.option('--httpMethods <methods...>', 'Filter HTTP routes by methods (comma-separated)')
|
|
58
60
|
.option('--httpRoutes <routes...>', 'Filter HTTP routes by route patterns (comma-separated)')
|
|
59
|
-
.option('-s, --silent', 'Silent mode - only show errors')
|
|
61
|
+
.option('-s, --silent', 'Silent mode - only show critical errors')
|
|
62
|
+
.option('--info', 'Show info messages and above (info, warn, error, critical)')
|
|
63
|
+
.option('--verbose', 'Show all debug messages (most detailed)')
|
|
64
|
+
.option('--loglevel <level>', 'Set explicit log level (trace, debug, info, warn, error, critical)')
|
|
60
65
|
.option('--state-output <path>', 'Save inspector state to JSON file for reuse')
|
|
61
66
|
.option('--state-input <path>', 'Load inspector state from JSON file (skips inspection)')
|
|
62
67
|
.action((c) => action(name, c));
|
package/dist/src/cli.wiring.js
CHANGED
|
@@ -1,99 +1,107 @@
|
|
|
1
|
-
import { pikkuSchemas } from './functions/wirings/functions/schemas.js'
|
|
2
|
-
import { pikkuFetch } from './functions/wirings/fetch/index.js'
|
|
3
|
-
import { pikkuWebSocketTyped } from './functions/wirings/channels/pikku-command-websocket-typed.js'
|
|
4
|
-
import { pikkuRPCClient } from './functions/wirings/rpc/pikku-command-rpc-client.js'
|
|
5
|
-
import { pikkuQueueService } from './functions/wirings/queue/pikku-command-queue-service.js'
|
|
6
|
-
import { pikkuOpenAPI } from './functions/wirings/http/pikku-command-openapi.js'
|
|
7
|
-
import { pikkuNext } from './functions/runtimes/nextjs/pikku-command-nextjs.js'
|
|
8
|
-
import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js'
|
|
9
|
-
import { all } from './functions/commands/all.js'
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
// import { pikkuSchemas } from './functions/wirings/functions/schemas.js'
|
|
2
|
+
// import { pikkuFetch } from './functions/wirings/fetch/index.js'
|
|
3
|
+
// import { pikkuWebSocketTyped } from './functions/wirings/channels/pikku-command-websocket-typed.js'
|
|
4
|
+
// import { pikkuRPCClient } from './functions/wirings/rpc/pikku-command-rpc-client.js'
|
|
5
|
+
// import { pikkuQueueService } from './functions/wirings/queue/pikku-command-queue-service.js'
|
|
6
|
+
// import { pikkuOpenAPI } from './functions/wirings/http/pikku-command-openapi.js'
|
|
7
|
+
// import { pikkuNext } from './functions/runtimes/nextjs/pikku-command-nextjs.js'
|
|
8
|
+
// import { pikkuCLICommand, wireCLI } from '../.pikku/cli/pikku-cli-types.gen.js'
|
|
9
|
+
// import { all } from './functions/commands/all.js'
|
|
10
|
+
// import { bootstrap } from './functions/commands/bootstrap.js'
|
|
11
|
+
// import { clientCLIRenderer } from './services.js'
|
|
12
|
+
export {};
|
|
13
|
+
// wireCLI({
|
|
14
|
+
// program: 'pikku',
|
|
15
|
+
// description:
|
|
16
|
+
// 'Pikku CLI - Code generation tool for type-safe backend development',
|
|
17
|
+
// render: clientCLIRenderer,
|
|
18
|
+
// options: {
|
|
19
|
+
// config: {
|
|
20
|
+
// description: 'Path to pikku.config.json file',
|
|
21
|
+
// short: 'c',
|
|
22
|
+
// },
|
|
23
|
+
// logLevel: {
|
|
24
|
+
// description: 'Set log level',
|
|
25
|
+
// default: 'info' as const,
|
|
26
|
+
// short: 'l',
|
|
27
|
+
// },
|
|
28
|
+
// userSessionType: {
|
|
29
|
+
// description:
|
|
30
|
+
// 'Specify which UserSession type to use (when multiple exist)',
|
|
31
|
+
// },
|
|
32
|
+
// singletonServicesFactoryType: {
|
|
33
|
+
// description: 'Specify which singleton services factory to use',
|
|
34
|
+
// },
|
|
35
|
+
// sessionServicesFactoryType: {
|
|
36
|
+
// description: 'Specify which session services factory to use',
|
|
37
|
+
// },
|
|
38
|
+
// stateOutput: {
|
|
39
|
+
// description: 'Save inspector state to JSON file for reuse',
|
|
40
|
+
// },
|
|
41
|
+
// stateInput: {
|
|
42
|
+
// description: 'Load inspector state from JSON file (skips inspection)',
|
|
43
|
+
// },
|
|
44
|
+
// },
|
|
45
|
+
// commands: {
|
|
46
|
+
// all: pikkuCLICommand({
|
|
47
|
+
// func: all,
|
|
48
|
+
// description: 'Generate all Pikku files (types, schemas, wirings, etc.)',
|
|
49
|
+
// isDefault: true,
|
|
50
|
+
// options: {
|
|
51
|
+
// tags: {
|
|
52
|
+
// description: 'Filter functions by tags (comma-separated)',
|
|
53
|
+
// short: 't',
|
|
54
|
+
// },
|
|
55
|
+
// types: {
|
|
56
|
+
// description: 'Filter functions by types (comma-separated)',
|
|
57
|
+
// },
|
|
58
|
+
// directories: {
|
|
59
|
+
// description: 'Filter functions by directories (comma-separated)',
|
|
60
|
+
// short: 'd',
|
|
61
|
+
// },
|
|
62
|
+
// httpMethods: {
|
|
63
|
+
// description: 'Filter HTTP routes by methods (comma-separated)',
|
|
64
|
+
// },
|
|
65
|
+
// httpRoutes: {
|
|
66
|
+
// description: 'Filter HTTP routes by route patterns (comma-separated)',
|
|
67
|
+
// },
|
|
68
|
+
// names: {
|
|
69
|
+
// description: 'Filter functions by name patterns (supports wildcards)',
|
|
70
|
+
// short: 'n',
|
|
71
|
+
// },
|
|
72
|
+
// },
|
|
73
|
+
// }),
|
|
74
|
+
// bootstrap: pikkuCLICommand({
|
|
75
|
+
// func: bootstrap,
|
|
76
|
+
// description: 'Generate only type files (setup phase only)',
|
|
77
|
+
// }),
|
|
78
|
+
// schemas: pikkuCLICommand({
|
|
79
|
+
// func: pikkuSchemas,
|
|
80
|
+
// description: 'Generate JSON schemas for function input/output types',
|
|
81
|
+
// }),
|
|
82
|
+
// fetch: pikkuCLICommand({
|
|
83
|
+
// func: pikkuFetch,
|
|
84
|
+
// description: 'Generate type-safe HTTP fetch client',
|
|
85
|
+
// }),
|
|
86
|
+
// websocket: pikkuCLICommand({
|
|
87
|
+
// func: pikkuWebSocketTyped,
|
|
88
|
+
// description: 'Generate type-safe WebSocket client',
|
|
89
|
+
// }),
|
|
90
|
+
// rpc: pikkuCLICommand({
|
|
91
|
+
// func: pikkuRPCClient,
|
|
92
|
+
// description: 'Generate RPC client wrappers',
|
|
93
|
+
// }),
|
|
94
|
+
// 'queue-service': pikkuCLICommand({
|
|
95
|
+
// func: pikkuQueueService,
|
|
96
|
+
// description: 'Generate queue service wrapper',
|
|
97
|
+
// }),
|
|
98
|
+
// openapi: pikkuCLICommand({
|
|
99
|
+
// func: pikkuOpenAPI,
|
|
100
|
+
// description: 'Generate OpenAPI specification from HTTP routes',
|
|
101
|
+
// }),
|
|
102
|
+
// nextjs: pikkuCLICommand({
|
|
103
|
+
// func: pikkuNext,
|
|
104
|
+
// description: 'Generate Next.js backend and HTTP wrappers',
|
|
105
|
+
// }),
|
|
106
|
+
// },
|
|
107
|
+
// })
|
|
@@ -2,8 +2,10 @@ import { existsSync } from 'fs';
|
|
|
2
2
|
import { pikkuVoidFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
3
3
|
import { getFileImportRelativePath } from '../../utils/file-import-path.js';
|
|
4
4
|
import { writeFileInDir } from '../../utils/file-writer.js';
|
|
5
|
+
import { CommandSummary } from '../../utils/command-summary.js';
|
|
5
6
|
export const all = pikkuVoidFunc({
|
|
6
7
|
func: async ({ logger, config, rpc, getInspectorState }) => {
|
|
8
|
+
const summary = new CommandSummary('all');
|
|
7
9
|
const allImports = [];
|
|
8
10
|
let typesDeclarationFileExists = true;
|
|
9
11
|
if (!existsSync(config.typesDeclarationFile)) {
|
|
@@ -12,7 +14,7 @@ export const all = pikkuVoidFunc({
|
|
|
12
14
|
await rpc.invoke('pikkuFunctionTypes', null);
|
|
13
15
|
// This is needed since the wireHTTP function will add the routes to the visitState
|
|
14
16
|
if (!typesDeclarationFileExists) {
|
|
15
|
-
logger.
|
|
17
|
+
logger.debug(`• Type file first created, inspecting again...`);
|
|
16
18
|
await getInspectorState(true);
|
|
17
19
|
}
|
|
18
20
|
// Generate wiring-specific type files for tree-shaking
|
|
@@ -21,6 +23,7 @@ export const all = pikkuVoidFunc({
|
|
|
21
23
|
await rpc.invoke('pikkuChannelTypes', null);
|
|
22
24
|
await rpc.invoke('pikkuSchedulerTypes', null);
|
|
23
25
|
await rpc.invoke('pikkuQueueTypes', null);
|
|
26
|
+
await rpc.invoke('pikkuWorkflowTypes', null);
|
|
24
27
|
await rpc.invoke('pikkuMCPTypes', null);
|
|
25
28
|
await rpc.invoke('pikkuCLITypes', null);
|
|
26
29
|
const hasFunctionRegistrations = await rpc.invoke('pikkuFunctions', null);
|
|
@@ -67,6 +70,22 @@ export const all = pikkuVoidFunc({
|
|
|
67
70
|
if (scheduler) {
|
|
68
71
|
allImports.push(config.schedulersWiringMetaFile, config.schedulersWiringFile);
|
|
69
72
|
}
|
|
73
|
+
// Generate Workflows
|
|
74
|
+
const workflows = await rpc.invoke('pikkuWorkflow', null);
|
|
75
|
+
// Generate Remote RPC Workers (must be before queue discovery so wireQueueWorker calls are picked up)
|
|
76
|
+
const remoteRPC = await rpc.invoke('pikkuRemoteRPC', null);
|
|
77
|
+
// Reinspect to pick up generated workflow workers and remote RPC workers BEFORE generating maps
|
|
78
|
+
if (workflows || remoteRPC) {
|
|
79
|
+
await getInspectorState(true);
|
|
80
|
+
}
|
|
81
|
+
if (workflows) {
|
|
82
|
+
await rpc.invoke('pikkuWorkflowMap', null);
|
|
83
|
+
allImports.push(config.workflowsWiringMetaFile, config.workflowsWiringFile);
|
|
84
|
+
}
|
|
85
|
+
if (remoteRPC && config.rpc?.remoteRpcWorkersPath) {
|
|
86
|
+
// Only add to imports if we actually generated the file
|
|
87
|
+
allImports.push(config.rpc.remoteRpcWorkersPath);
|
|
88
|
+
}
|
|
70
89
|
// Generate Queues
|
|
71
90
|
const queues = await rpc.invoke('pikkuQueue', null);
|
|
72
91
|
if (queues) {
|
|
@@ -97,7 +116,7 @@ export const all = pikkuVoidFunc({
|
|
|
97
116
|
await rpc.invoke('pikkuNext', null);
|
|
98
117
|
}
|
|
99
118
|
if (config.openAPI) {
|
|
100
|
-
logger.
|
|
119
|
+
logger.debug(`• OpenAPI requires a reinspection to pickup new generated types..`);
|
|
101
120
|
await getInspectorState(true);
|
|
102
121
|
await rpc.invoke('pikkuOpenAPI', null);
|
|
103
122
|
}
|
|
@@ -106,6 +125,36 @@ export const all = pikkuVoidFunc({
|
|
|
106
125
|
.map((to) => `import '${getFileImportRelativePath(config.bootstrapFile, to, config.packageMappings)}'`)
|
|
107
126
|
.sort((to) => (to.includes('meta') ? -1 : 1)) // Ensure meta files are at the top
|
|
108
127
|
.join('\n'));
|
|
128
|
+
// Get final inspector state and collect stats for summary
|
|
129
|
+
const state = await getInspectorState();
|
|
130
|
+
if (state.http?.meta)
|
|
131
|
+
summary.set('httpRoutes', Object.keys(state.http.meta).length);
|
|
132
|
+
if (state.channels?.meta)
|
|
133
|
+
summary.set('channels', Object.keys(state.channels.meta).length);
|
|
134
|
+
if (state.scheduledTasks?.meta)
|
|
135
|
+
summary.set('scheduledTasks', Object.keys(state.scheduledTasks.meta).length);
|
|
136
|
+
if (state.queueWorkers?.meta)
|
|
137
|
+
summary.set('queueWorkers', Object.keys(state.queueWorkers.meta).length);
|
|
138
|
+
if (state.mcpEndpoints) {
|
|
139
|
+
const mcpTotal = Object.keys(state.mcpEndpoints.toolsMeta || {}).length +
|
|
140
|
+
Object.keys(state.mcpEndpoints.resourcesMeta || {}).length +
|
|
141
|
+
Object.keys(state.mcpEndpoints.promptsMeta || {}).length;
|
|
142
|
+
if (mcpTotal > 0)
|
|
143
|
+
summary.set('mcpEndpoints', mcpTotal);
|
|
144
|
+
}
|
|
145
|
+
if (state.cli?.meta) {
|
|
146
|
+
// Count total CLI commands across all programs
|
|
147
|
+
const totalCommands = Object.values(state.cli.meta).reduce((sum, program) => sum + (program.commands?.length || 0), 0);
|
|
148
|
+
if (totalCommands > 0)
|
|
149
|
+
summary.set('cliCommands', totalCommands);
|
|
150
|
+
}
|
|
151
|
+
if (state.workflows?.meta) {
|
|
152
|
+
summary.set('workflows', Object.keys(state.workflows.meta).length);
|
|
153
|
+
}
|
|
154
|
+
// Display summary (unless in silent mode)
|
|
155
|
+
if (!logger.isSilent()) {
|
|
156
|
+
console.log(summary.format());
|
|
157
|
+
}
|
|
109
158
|
// Check for critical errors and exit if any were logged
|
|
110
159
|
if (logger.hasCriticalErrors()) {
|
|
111
160
|
process.exit(1);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const bootstrap: any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { pikkuVoidFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
2
|
+
export const bootstrap = pikkuVoidFunc({
|
|
3
|
+
func: async ({ logger, config, rpc, getInspectorState }) => {
|
|
4
|
+
// Initialize inspector state in bootstrap mode with core types only
|
|
5
|
+
// This allows bootstrap to run immediately without inspecting the codebase
|
|
6
|
+
// All subsequent RPC commands will use this cached state
|
|
7
|
+
await getInspectorState(false, false, true);
|
|
8
|
+
await rpc.invoke('pikkuFunctionTypes', null);
|
|
9
|
+
// Generate wiring-specific type files for tree-shaking
|
|
10
|
+
// These use the bootstrap mode state with core types
|
|
11
|
+
await rpc.invoke('pikkuFunctionTypesSplit', null);
|
|
12
|
+
await rpc.invoke('pikkuHTTPTypes', null);
|
|
13
|
+
await rpc.invoke('pikkuChannelTypes', null);
|
|
14
|
+
await rpc.invoke('pikkuSchedulerTypes', null);
|
|
15
|
+
await rpc.invoke('pikkuQueueTypes', null);
|
|
16
|
+
await rpc.invoke('pikkuWorkflowTypes', null);
|
|
17
|
+
await rpc.invoke('pikkuMCPTypes', null);
|
|
18
|
+
await rpc.invoke('pikkuCLITypes', null);
|
|
19
|
+
// Check for critical errors and exit if any were logged
|
|
20
|
+
if (logger.hasCriticalErrors()) {
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
});
|