@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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface CommandSummaryStats {
|
|
2
|
+
httpRoutes?: number;
|
|
3
|
+
channels?: number;
|
|
4
|
+
functions?: number;
|
|
5
|
+
scheduledTasks?: number;
|
|
6
|
+
queueWorkers?: number;
|
|
7
|
+
mcpEndpoints?: number;
|
|
8
|
+
cliCommands?: number;
|
|
9
|
+
workflows?: number;
|
|
10
|
+
[key: string]: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Utility class to collect and display command execution summaries
|
|
14
|
+
*/
|
|
15
|
+
export declare class CommandSummary {
|
|
16
|
+
private stats;
|
|
17
|
+
private startTime;
|
|
18
|
+
private commandName;
|
|
19
|
+
constructor(commandName: string);
|
|
20
|
+
/**
|
|
21
|
+
* Increment a stat counter
|
|
22
|
+
*/
|
|
23
|
+
increment(key: keyof CommandSummaryStats, count?: number): void;
|
|
24
|
+
/**
|
|
25
|
+
* Set a stat value directly
|
|
26
|
+
*/
|
|
27
|
+
set(key: keyof CommandSummaryStats, value: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get current stats
|
|
30
|
+
*/
|
|
31
|
+
getStats(): CommandSummaryStats;
|
|
32
|
+
/**
|
|
33
|
+
* Get elapsed time in milliseconds
|
|
34
|
+
*/
|
|
35
|
+
getElapsedTime(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Format the summary for display
|
|
38
|
+
*/
|
|
39
|
+
format(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Check if there are any stats to display
|
|
42
|
+
*/
|
|
43
|
+
hasStats(): boolean;
|
|
44
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
/**
|
|
3
|
+
* Utility class to collect and display command execution summaries
|
|
4
|
+
*/
|
|
5
|
+
export class CommandSummary {
|
|
6
|
+
stats = {};
|
|
7
|
+
startTime;
|
|
8
|
+
commandName;
|
|
9
|
+
constructor(commandName) {
|
|
10
|
+
this.commandName = commandName;
|
|
11
|
+
this.startTime = Date.now();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Increment a stat counter
|
|
15
|
+
*/
|
|
16
|
+
increment(key, count = 1) {
|
|
17
|
+
this.stats[key] = (this.stats[key] || 0) + count;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Set a stat value directly
|
|
21
|
+
*/
|
|
22
|
+
set(key, value) {
|
|
23
|
+
this.stats[key] = value;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get current stats
|
|
27
|
+
*/
|
|
28
|
+
getStats() {
|
|
29
|
+
return { ...this.stats };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get elapsed time in milliseconds
|
|
33
|
+
*/
|
|
34
|
+
getElapsedTime() {
|
|
35
|
+
return Date.now() - this.startTime;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Format the summary for display
|
|
39
|
+
*/
|
|
40
|
+
format() {
|
|
41
|
+
const elapsed = this.getElapsedTime();
|
|
42
|
+
const lines = [];
|
|
43
|
+
// Header with timing
|
|
44
|
+
lines.push(chalk.green(`\npikku ${this.commandName} (completed in ${elapsed}ms)`));
|
|
45
|
+
// Stats
|
|
46
|
+
const statLabels = {
|
|
47
|
+
httpRoutes: 'HTTP route',
|
|
48
|
+
channels: 'WebSocket channel',
|
|
49
|
+
functions: 'Function',
|
|
50
|
+
scheduledTasks: 'Scheduled task',
|
|
51
|
+
queueWorkers: 'Queue worker',
|
|
52
|
+
mcpEndpoints: 'MCP endpoint',
|
|
53
|
+
cliCommands: 'CLI command',
|
|
54
|
+
workflows: 'Workflow',
|
|
55
|
+
};
|
|
56
|
+
for (const [key, label] of Object.entries(statLabels)) {
|
|
57
|
+
const value = this.stats[key];
|
|
58
|
+
if (value !== undefined && value > 0) {
|
|
59
|
+
lines.push(chalk.gray(` • ${value} ${label}${value > 1 ? 's' : ''}`));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// If no stats, show a simple completion message
|
|
63
|
+
if (Object.values(this.stats).every((v) => !v || v === 0)) {
|
|
64
|
+
return chalk.green(`\npikku ${this.commandName} (completed in ${elapsed}ms)\n`);
|
|
65
|
+
}
|
|
66
|
+
return lines.join('\n') + '\n';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Check if there are any stats to display
|
|
70
|
+
*/
|
|
71
|
+
hasStats() {
|
|
72
|
+
return Object.values(this.stats).some((v) => v && v > 0);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -35,7 +35,7 @@ export const writeFileInDir = async (logger, path, content, { ignoreModifyCommen
|
|
|
35
35
|
await mkdir(dirname(path), { recursive: true });
|
|
36
36
|
await writeFile(path, content, 'utf-8');
|
|
37
37
|
if (logWrite) {
|
|
38
|
-
logger.
|
|
38
|
+
logger.debug({ message: `✓ File written to ${path}`, type: 'success' });
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
};
|
|
@@ -44,7 +44,7 @@ export const removeFileInDir = async (logger, path, { logRemove = true } = {}) =
|
|
|
44
44
|
if (existsSync(path)) {
|
|
45
45
|
await rm(path, { force: true });
|
|
46
46
|
if (logRemove) {
|
|
47
|
-
logger.
|
|
47
|
+
logger.debug({ message: `✓ File removed at ${path}`, type: 'success' });
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
};
|
|
@@ -38,6 +38,19 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
38
38
|
...extendedConfig.packageMappings,
|
|
39
39
|
...config.packageMappings,
|
|
40
40
|
},
|
|
41
|
+
ignoreFiles: config.ignoreFiles ??
|
|
42
|
+
extendedConfig.ignoreFiles ?? [
|
|
43
|
+
'**/*.test.ts',
|
|
44
|
+
'**/*.spec.ts',
|
|
45
|
+
'**/node_modules/**',
|
|
46
|
+
'**/dist/**',
|
|
47
|
+
],
|
|
48
|
+
schema: {
|
|
49
|
+
additionalProperties: false,
|
|
50
|
+
supportsImportAttributes: false,
|
|
51
|
+
...extendedConfig.schema,
|
|
52
|
+
...config.schema,
|
|
53
|
+
},
|
|
41
54
|
};
|
|
42
55
|
}
|
|
43
56
|
else {
|
|
@@ -48,6 +61,17 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
48
61
|
rootDir: config.rootDir
|
|
49
62
|
? resolve(configDir, config.rootDir)
|
|
50
63
|
: configDir,
|
|
64
|
+
ignoreFiles: config.ignoreFiles ?? [
|
|
65
|
+
'**/*.test.ts',
|
|
66
|
+
'**/*.spec.ts',
|
|
67
|
+
'**/node_modules/**',
|
|
68
|
+
'**/dist/**',
|
|
69
|
+
],
|
|
70
|
+
schema: {
|
|
71
|
+
additionalProperties: false,
|
|
72
|
+
supportsImportAttributes: false,
|
|
73
|
+
...config.schema,
|
|
74
|
+
},
|
|
51
75
|
};
|
|
52
76
|
}
|
|
53
77
|
// Create transport/event directories
|
|
@@ -57,6 +81,7 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
57
81
|
const rpcDir = join(result.outDir, 'rpc');
|
|
58
82
|
const schedulerDir = join(result.outDir, 'scheduler');
|
|
59
83
|
const queueDir = join(result.outDir, 'queue');
|
|
84
|
+
const workflowDir = join(result.outDir, 'workflow');
|
|
60
85
|
const mcpDir = join(result.outDir, 'mcp');
|
|
61
86
|
const cliDir = join(result.outDir, 'cli');
|
|
62
87
|
const middlewareDir = join(result.outDir, 'middleware');
|
|
@@ -116,6 +141,13 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
116
141
|
if (!result.rpcMapDeclarationFile) {
|
|
117
142
|
result.rpcMapDeclarationFile = join(rpcDir, 'pikku-rpc-wirings-map.gen.d.ts');
|
|
118
143
|
}
|
|
144
|
+
// RPC config defaults
|
|
145
|
+
if (!result.rpc) {
|
|
146
|
+
result.rpc = {};
|
|
147
|
+
}
|
|
148
|
+
if (!result.rpc.remoteRpcWorkersPath) {
|
|
149
|
+
result.rpc.remoteRpcWorkersPath = join(rpcDir, 'pikku-remote-rpc-workers.gen.ts');
|
|
150
|
+
}
|
|
119
151
|
// Scheduler
|
|
120
152
|
if (!result.schedulersWiringFile) {
|
|
121
153
|
result.schedulersWiringFile = join(schedulerDir, 'pikku-schedulers-wirings.gen.ts');
|
|
@@ -139,6 +171,22 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
139
171
|
if (!result.queueTypesFile) {
|
|
140
172
|
result.queueTypesFile = join(queueDir, 'pikku-queue-types.gen.ts');
|
|
141
173
|
}
|
|
174
|
+
// Workflows
|
|
175
|
+
if (!result.workflowsWiringFile) {
|
|
176
|
+
result.workflowsWiringFile = join(workflowDir, 'pikku-workflow-wirings.gen.ts');
|
|
177
|
+
}
|
|
178
|
+
if (!result.workflowsWiringMetaFile) {
|
|
179
|
+
result.workflowsWiringMetaFile = join(workflowDir, 'pikku-workflow-wirings-meta.gen.ts');
|
|
180
|
+
}
|
|
181
|
+
if (!result.workflowsWorkersFile) {
|
|
182
|
+
result.workflowsWorkersFile = join(workflowDir, 'pikku-workflow-workers.gen.ts');
|
|
183
|
+
}
|
|
184
|
+
if (!result.workflowMapDeclarationFile) {
|
|
185
|
+
result.workflowMapDeclarationFile = join(workflowDir, 'pikku-workflow-map.gen.d.ts');
|
|
186
|
+
}
|
|
187
|
+
if (!result.workflowTypesFile) {
|
|
188
|
+
result.workflowTypesFile = join(workflowDir, 'pikku-workflow-types.gen.ts');
|
|
189
|
+
}
|
|
142
190
|
// Services
|
|
143
191
|
if (!result.servicesFile) {
|
|
144
192
|
result.servicesFile = join(result.outDir, 'pikku-services.gen.ts');
|
|
@@ -2,5 +2,5 @@ import { FunctionsMeta, JSONValue } from '@pikku/core';
|
|
|
2
2
|
import { HTTPWiringsMeta } from '@pikku/core/http';
|
|
3
3
|
import { TypesMap } from '@pikku/inspector';
|
|
4
4
|
import { CLILogger } from '../services/cli-logger.service.js';
|
|
5
|
-
export declare function generateSchemas(logger: CLILogger, tsconfig: string, typesMap: TypesMap, functionMeta: FunctionsMeta, httpWiringsMeta: HTTPWiringsMeta, additionalTypes?: string[]): Promise<Record<string, JSONValue>>;
|
|
6
|
-
export declare function saveSchemas(logger: CLILogger, schemaParentDir: string, schemas: Record<string, JSONValue>, typesMap: TypesMap, functionsMeta: FunctionsMeta,
|
|
5
|
+
export declare function generateSchemas(logger: CLILogger, tsconfig: string, typesMap: TypesMap, functionMeta: FunctionsMeta, httpWiringsMeta: HTTPWiringsMeta, additionalTypes?: string[], additionalProperties?: boolean): Promise<Record<string, JSONValue>>;
|
|
6
|
+
export declare function saveSchemas(logger: CLILogger, schemaParentDir: string, schemas: Record<string, JSONValue>, typesMap: TypesMap, functionsMeta: FunctionsMeta, additionalTypes?: string[], supportsImportAttributes?: boolean): Promise<void>;
|
|
@@ -2,14 +2,19 @@ import { createGenerator, RootlessError } from 'ts-json-schema-generator';
|
|
|
2
2
|
import { writeFileInDir } from './file-writer.js';
|
|
3
3
|
import { mkdir, writeFile } from 'fs/promises';
|
|
4
4
|
import { ErrorCode } from '@pikku/inspector';
|
|
5
|
-
export async function generateSchemas(logger, tsconfig, typesMap, functionMeta, httpWiringsMeta, additionalTypes) {
|
|
5
|
+
export async function generateSchemas(logger, tsconfig, typesMap, functionMeta, httpWiringsMeta, additionalTypes, additionalProperties = false) {
|
|
6
6
|
const schemasSet = new Set(typesMap.customTypes.keys());
|
|
7
7
|
for (const { inputs, outputs } of Object.values(functionMeta)) {
|
|
8
8
|
const types = [...(inputs || []), ...(outputs || [])];
|
|
9
9
|
for (const type of types) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
try {
|
|
11
|
+
const uniqueName = typesMap.getUniqueName(type);
|
|
12
|
+
if (uniqueName) {
|
|
13
|
+
schemasSet.add(uniqueName);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Skip types not in typesMap (e.g., inline types in generated workflow workers)
|
|
13
18
|
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
@@ -42,7 +47,7 @@ export async function generateSchemas(logger, tsconfig, typesMap, functionMeta,
|
|
|
42
47
|
sortProps: true,
|
|
43
48
|
strictTuples: false,
|
|
44
49
|
encodeRefs: false,
|
|
45
|
-
additionalProperties
|
|
50
|
+
additionalProperties,
|
|
46
51
|
});
|
|
47
52
|
const schemas = {};
|
|
48
53
|
schemasSet.forEach((schema) => {
|
|
@@ -60,14 +65,30 @@ export async function generateSchemas(logger, tsconfig, typesMap, functionMeta,
|
|
|
60
65
|
});
|
|
61
66
|
return schemas;
|
|
62
67
|
}
|
|
63
|
-
export async function saveSchemas(logger, schemaParentDir, schemas, typesMap, functionsMeta,
|
|
68
|
+
export async function saveSchemas(logger, schemaParentDir, schemas, typesMap, functionsMeta, additionalTypes, supportsImportAttributes = false) {
|
|
64
69
|
await writeFileInDir(logger, `${schemaParentDir}/register.gen.ts`, 'export const empty = null;');
|
|
65
70
|
const desiredSchemas = new Set([
|
|
66
71
|
...Object.values(functionsMeta)
|
|
67
|
-
.map(({ inputs, outputs }) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
.map(({ inputs, outputs }) => {
|
|
73
|
+
const types = [];
|
|
74
|
+
if (inputs?.[0]) {
|
|
75
|
+
try {
|
|
76
|
+
types.push(typesMap.getUniqueName(inputs[0]));
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Skip types not in typesMap (e.g., inline types in generated workflow workers)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (outputs?.[0]) {
|
|
83
|
+
try {
|
|
84
|
+
types.push(typesMap.getUniqueName(outputs[0]));
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Skip types not in typesMap (e.g., inline types in generated workflow workers)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return types;
|
|
91
|
+
})
|
|
71
92
|
.flat()
|
|
72
93
|
.filter((s) => !!s &&
|
|
73
94
|
!['boolean', 'string', 'number', 'null', 'undefined'].includes(s)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/functions/commands/all.ts","../src/functions/commands/watch.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/pikku-command-websocket-typed.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/channels/serialize-websocket-wrapper.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/fetch/index.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/pikku-function-types.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/http/openapi-spec-generator.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-json.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-groups-meta.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/middleware/log-command-info-and-time.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/custom-types-generator.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/schema-generator.ts","../src/utils/serialize-import-map.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/pikku-websocket.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/channel/pikku-channels-map.gen.d.ts","../.pikku/channel/pikku-channels-meta.gen.ts","../.pikku/channel/pikku-channels.gen.ts","../.pikku/cli/pikku-cli-
|
|
1
|
+
{"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/functions/commands/all.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/watch.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/pikku-command-websocket-typed.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/channels/serialize-websocket-wrapper.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/fetch/index.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/pikku-function-types.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/http/openapi-spec-generator.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-json.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-groups-meta.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-map.ts","../src/functions/wirings/workflow/pikku-command-workflow-types.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/wirings/workflow/serialize-workflow-workers.ts","../src/middleware/log-command-info-and-time.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/command-summary.ts","../src/utils/custom-types-generator.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/schema-generator.ts","../src/utils/serialize-import-map.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/pikku-websocket.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/channel/pikku-channels-map.gen.d.ts","../.pikku/channel/pikku-channels-meta.gen.ts","../.pikku/channel/pikku-channels.gen.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions-meta.min.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/mcp/pikku-mcp-wirings-meta.gen.ts","../.pikku/mcp/pikku-mcp-wirings.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-remote-rpc-workers.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/scheduler/pikku-schedulers-wirings-meta.gen.ts","../.pikku/scheduler/pikku-schedulers-wirings.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/config.d.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -22,11 +22,10 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@openapi-contrib/json-schema-to-openapi-schema": "^4.2.0",
|
|
25
|
-
"@pikku/core": "^0.
|
|
26
|
-
"@pikku/inspector": "^0.
|
|
25
|
+
"@pikku/core": "^0.11.0",
|
|
26
|
+
"@pikku/inspector": "^0.11.0",
|
|
27
27
|
"@types/cookie": "^1.0.0",
|
|
28
28
|
"@types/json-schema": "^7.0.15",
|
|
29
|
-
"@types/uuid": "^11.0.0",
|
|
30
29
|
"chalk": "^5.6.2",
|
|
31
30
|
"chokidar": "^4.0.3",
|
|
32
31
|
"commander": "^14",
|
package/pikku.config.json
CHANGED
|
@@ -6,16 +6,19 @@
|
|
|
6
6
|
"packageMappings": {
|
|
7
7
|
"../inspector/src": "@pikku/inspector"
|
|
8
8
|
},
|
|
9
|
-
"supportsImportAttributes": true,
|
|
10
9
|
"schemasFromTypes": ["PikkuCLIConfig"],
|
|
11
10
|
"websocketFile": ".pikku/pikku-websocket.gen.ts",
|
|
11
|
+
"supportsImportAttributes": true,
|
|
12
|
+
"schema": {
|
|
13
|
+
"supportsImportAttributes": true
|
|
14
|
+
},
|
|
12
15
|
"cli": {
|
|
13
16
|
"entrypoints": {
|
|
14
17
|
"pikku": [
|
|
15
18
|
".pikku/cli/pikku-cli.gen.ts",
|
|
16
19
|
{
|
|
17
20
|
"type": "channel",
|
|
18
|
-
"wirePath": ".pikku/cli/pikku-cli-channel.
|
|
21
|
+
"wirePath": ".pikku/cli/pikku-cli-channel.ts",
|
|
19
22
|
"path": ".pikku/cli/pikku-cli-client.gen.ts",
|
|
20
23
|
"name": "pikku-cli",
|
|
21
24
|
"route": "/cli/pikku"
|
package/src/cli.wiring.ts
CHANGED
|
@@ -1,102 +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 {
|
|
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'
|
|
11
12
|
|
|
12
|
-
wireCLI({
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
+
// })
|