@pikku/cli 0.12.20 → 0.12.22
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/cli.schema.json +1 -1
- package/console-app/assets/index-C52h1B_L.css +1 -0
- package/console-app/assets/index-CAk106ji.js +232 -0
- package/console-app/index.html +3 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +3 -3
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.d.ts +6 -6
- package/dist/.pikku/cli/pikku-cli-channel.js +280 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +792 -8
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +44 -70
- package/dist/.pikku/function/pikku-function-types.gen.js +33 -40
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +1439 -316
- package/dist/.pikku/function/pikku-functions.gen.js +21 -9
- 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/pikku-bootstrap.gen.d.ts +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +3 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +2 -1
- package/dist/.pikku/pikku-services.gen.js +1 -0
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -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.d.ts +1 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +6 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +250 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +4 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +5 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +66 -10
- 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/schemas/register.gen.js +157 -11
- package/dist/.pikku/schemas/schemas/BinaryInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbMigrateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbResetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/DbSeedInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDbSchemaOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployApplyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployPlanOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDeployUnitsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsAddOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricDomainsRemoveOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricErrorsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricInitOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLLMKeyOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLinkOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLoginOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricLogsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricMetricsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricRollbackOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsListOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricSecretsSetOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricStatusOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricTraceOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/FabricValidateOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/PikkuCommandChannelsOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandHTTPOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuCommandQueueOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuEventsScaffoldOutput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaClientsInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaContextInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaFunctionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaMiddlewareListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaPermissionsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaSchemasListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresChannelInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresHttpInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresQueueInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresSchedulerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTriggerInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWiresTypeInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsGetInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuMetaWorkflowsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsInstallInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuSkillsListInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsCoverageInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsInitInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/WorkflowRunStatus.schema.json +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +237 -629
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +23 -0
- package/dist/bin/pikku.js +28 -1
- package/dist/src/cli.wiring.js +286 -10
- package/dist/src/deploy/analyzer/analyzer.d.ts +16 -1
- package/dist/src/deploy/analyzer/analyzer.js +83 -43
- package/dist/src/deploy/analyzer/manifest.d.ts +10 -0
- package/dist/src/deploy/build-pipeline.d.ts +2 -0
- package/dist/src/deploy/build-pipeline.js +123 -19
- package/dist/src/deploy/bundler/bundler.d.ts +3 -1
- package/dist/src/deploy/bundler/bundler.js +40 -9
- package/dist/src/deploy/bundler/dep-extractor.d.ts +5 -2
- package/dist/src/deploy/bundler/dep-extractor.js +103 -23
- package/dist/src/deploy/bundler/types.d.ts +5 -1
- package/dist/src/deploy/codegen/per-unit-codegen.d.ts +11 -1
- package/dist/src/deploy/codegen/per-unit-codegen.js +49 -6
- package/dist/src/deploy/plan/planner.js +25 -3
- package/dist/src/deploy/plan/provider.d.ts +2 -0
- package/dist/src/deploy/provider-adapter.d.ts +34 -0
- package/dist/src/deploy/server-entry.d.ts +16 -0
- package/dist/src/deploy/server-entry.js +81 -0
- package/dist/src/fabric/fabric-commands.d.ts +522 -0
- package/dist/src/fabric/fabric-commands.js +299 -0
- package/dist/src/fabric/functions/db-schema.function.d.ts +35 -0
- package/dist/src/fabric/functions/db-schema.function.js +37 -0
- package/dist/src/fabric/functions/deploy-list.function.d.ts +41 -0
- package/dist/src/fabric/functions/deploy-list.function.js +43 -0
- package/dist/src/fabric/functions/deploy-units.function.d.ts +35 -0
- package/dist/src/fabric/functions/deploy-units.function.js +41 -0
- package/dist/src/fabric/functions/deploy.function.d.ts +105 -0
- package/dist/src/fabric/functions/deploy.function.js +122 -0
- package/dist/src/fabric/functions/domains-add.function.d.ts +35 -0
- package/dist/src/fabric/functions/domains-add.function.js +46 -0
- package/dist/src/fabric/functions/domains-list.function.d.ts +20 -0
- package/dist/src/fabric/functions/domains-list.function.js +50 -0
- package/dist/src/fabric/functions/domains-remove.function.d.ts +24 -0
- package/dist/src/fabric/functions/domains-remove.function.js +44 -0
- package/dist/src/fabric/functions/errors.function.d.ts +44 -0
- package/dist/src/fabric/functions/errors.function.js +50 -0
- package/dist/src/fabric/functions/init.function.d.ts +51 -0
- package/dist/src/fabric/functions/init.function.js +54 -0
- package/dist/src/fabric/functions/link.function.d.ts +28 -0
- package/dist/src/fabric/functions/link.function.js +77 -0
- package/dist/src/fabric/functions/llm-key.function.d.ts +46 -0
- package/dist/src/fabric/functions/llm-key.function.js +76 -0
- package/dist/src/fabric/functions/login.function.d.ts +42 -0
- package/dist/src/fabric/functions/login.function.js +68 -0
- package/dist/src/fabric/functions/logs.function.d.ts +40 -0
- package/dist/src/fabric/functions/logs.function.js +84 -0
- package/dist/src/fabric/functions/metrics.function.d.ts +32 -0
- package/dist/src/fabric/functions/metrics.function.js +49 -0
- package/dist/src/fabric/functions/rollback.function.d.ts +76 -0
- package/dist/src/fabric/functions/rollback.function.js +69 -0
- package/dist/src/fabric/functions/secrets-list.function.d.ts +24 -0
- package/dist/src/fabric/functions/secrets-list.function.js +37 -0
- package/dist/src/fabric/functions/secrets-set.function.d.ts +32 -0
- package/dist/src/fabric/functions/secrets-set.function.js +36 -0
- package/dist/src/fabric/functions/status.function.d.ts +34 -0
- package/dist/src/fabric/functions/status.function.js +43 -0
- package/dist/src/fabric/functions/trace.function.d.ts +28 -0
- package/dist/src/fabric/functions/trace.function.js +45 -0
- package/dist/src/fabric/functions/validate.function.d.ts +50 -0
- package/dist/src/fabric/functions/validate.function.js +363 -0
- package/dist/src/fabric/lib/config.d.ts +64 -0
- package/dist/src/fabric/lib/config.js +62 -0
- package/dist/src/fabric/lib/console-url.d.ts +5 -0
- package/dist/src/fabric/lib/console-url.js +13 -0
- package/dist/src/fabric/lib/git.d.ts +53 -0
- package/dist/src/fabric/lib/git.js +151 -0
- package/dist/src/fabric/lib/http.d.ts +4 -0
- package/dist/src/fabric/lib/http.js +12 -0
- package/dist/src/fabric/lib/not-implemented.d.ts +5 -0
- package/dist/src/fabric/lib/not-implemented.js +8 -0
- package/dist/src/fabric/lib/output.d.ts +23 -0
- package/dist/src/fabric/lib/output.js +39 -0
- package/dist/src/fabric/lib/prompt.d.ts +12 -0
- package/dist/src/fabric/lib/prompt.js +32 -0
- package/dist/src/fabric/lib/stage.d.ts +7 -0
- package/dist/src/fabric/lib/stage.js +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.d.ts +14 -0
- package/dist/src/fabric/sdk/pikku-fetch.gen.js +30 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.d.ts +105 -0
- package/dist/src/fabric/sdk/pikku-rpc.gen.js +126 -0
- package/dist/src/functions/commands/all.d.ts +1 -1
- package/dist/src/functions/commands/binary.d.ts +7 -0
- package/dist/src/functions/commands/binary.js +40 -0
- package/dist/src/functions/commands/bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/bootstrap.js +7 -4
- package/dist/src/functions/commands/console.d.ts +3 -3
- package/dist/src/functions/commands/db-migrate.d.ts +1 -0
- package/dist/src/functions/commands/db-migrate.js +35 -0
- package/dist/src/functions/commands/db-reset.d.ts +1 -0
- package/dist/src/functions/commands/db-reset.js +36 -0
- package/dist/src/functions/commands/db-seed.d.ts +1 -0
- package/dist/src/functions/commands/db-seed.js +27 -0
- package/dist/src/functions/commands/db-shared.d.ts +32 -0
- package/dist/src/functions/commands/db-shared.js +26 -0
- package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
- package/dist/src/functions/commands/deploy-apply.js +6 -4
- package/dist/src/functions/commands/deploy-info.d.ts +1 -1
- package/dist/src/functions/commands/deploy-plan.d.ts +3 -3
- package/dist/src/functions/commands/deploy-plan.js +7 -1
- package/dist/src/functions/commands/dev.d.ts +3 -3
- package/dist/src/functions/commands/dev.js +142 -86
- package/dist/src/functions/commands/enable.d.ts +5 -4
- package/dist/src/functions/commands/enable.js +4 -0
- package/dist/src/functions/commands/info.d.ts +4 -4
- package/dist/src/functions/commands/load-user-project.d.ts +11 -0
- package/dist/src/functions/commands/load-user-project.js +40 -0
- package/dist/src/functions/commands/meta.d.ts +82 -0
- package/dist/src/functions/commands/meta.js +454 -0
- package/dist/src/functions/commands/new-addon.d.ts +3 -3
- package/dist/src/functions/commands/new-function.d.ts +3 -3
- package/dist/src/functions/commands/new-middleware.d.ts +3 -3
- package/dist/src/functions/commands/new-permission.d.ts +3 -3
- package/dist/src/functions/commands/new-wiring.d.ts +3 -3
- package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-bootstrap.js +15 -1
- package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
- package/dist/src/functions/commands/pikku-command-summary.js +7 -1
- package/dist/src/functions/commands/skills.d.ts +26 -0
- package/dist/src/functions/commands/skills.js +184 -0
- package/dist/src/functions/commands/tests-coverage.d.ts +7 -0
- package/dist/src/functions/commands/tests-coverage.js +231 -0
- package/dist/src/functions/commands/tests-init.d.ts +7 -0
- package/dist/src/functions/commands/tests-init.js +225 -0
- package/dist/src/functions/commands/versions-check.d.ts +1 -1
- package/dist/src/functions/commands/versions-init.d.ts +3 -3
- package/dist/src/functions/commands/versions-update.d.ts +1 -1
- package/dist/src/functions/commands/versions-update.js +4 -2
- package/dist/src/functions/commands/watch.d.ts +3 -3
- package/dist/src/functions/commands/watch.js +1 -1
- package/dist/src/functions/db/local-db.d.ts +48 -0
- package/dist/src/functions/db/local-db.js +106 -0
- package/dist/src/functions/db/seed.d.ts +11 -0
- package/dist/src/functions/db/seed.js +22 -0
- package/dist/src/functions/db/sql-migrator.d.ts +26 -0
- package/dist/src/functions/db/sql-migrator.js +104 -0
- package/dist/src/functions/db/sqlite-codegen.d.ts +45 -0
- package/dist/src/functions/db/sqlite-codegen.js +294 -0
- package/dist/src/functions/db/zod-codegen.d.ts +10 -0
- package/dist/src/functions/db/zod-codegen.js +109 -0
- package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.js +21 -2
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.d.ts +1 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.js +163 -0
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.d.ts +1 -1
- package/dist/src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.js +5 -2
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -0
- package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.js +32 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.d.ts +11 -0
- package/dist/src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.js +36 -0
- package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +1 -10
- package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +76 -1
- package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
- package/dist/src/functions/wirings/channels/pikku-command-channels.js +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-entry.js +5 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +5 -1
- package/dist/src/functions/wirings/cli/pikku-command-cli-types.js +8 -2
- package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli-client.js +27 -9
- package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +5 -1
- package/dist/src/functions/wirings/cli/serialize-channel-cli.js +13 -3
- package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-console-functions.js +5 -1
- package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +1 -1
- package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +5 -0
- package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +5 -1
- package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +7 -2
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
- package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
- package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
- package/dist/src/functions/wirings/functions/serialize-function-types.js +105 -80
- package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-routes.js +1 -1
- package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
- package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
- package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
- package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
- package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +2 -2
- package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
- package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-map.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
- package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.js +26 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -0
- package/dist/src/functions/wirings/realtime/pikku-command-realtime.js +35 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.d.ts +23 -0
- package/dist/src/functions/wirings/realtime/serialize-events-scaffold.js +98 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.d.ts +22 -0
- package/dist/src/functions/wirings/realtime/serialize-realtime-client.js +337 -0
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.js +5 -1
- package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.js +5 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.js +3 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +2 -2
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +2 -1
- package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +13 -7
- package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +1 -0
- package/dist/src/functions/wirings/rpc/serialize-react-query-hooks.js +1 -1
- package/dist/src/functions/wirings/rpc/serialize-remote-rpc.js +7 -1
- package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +16 -2
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
- package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
- package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.js +1 -1
- package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
- package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.js +1 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +5 -1
- package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +18 -4
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.d.ts +3 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-bootstrap-map.js +40 -0
- package/dist/src/functions/wirings/workflow/serialize-workflow-routes.js +56 -2
- package/dist/src/functions/workflows/all.workflow.js +45 -12
- package/dist/src/scaffold/rpc-remote.gen.d.ts +3 -3
- package/dist/src/scaffold/rpc-remote.gen.js +7 -2
- package/dist/src/scaffold/workflow-routes.gen.d.ts +18 -18
- package/dist/src/scaffold/workflow-routes.gen.js +33 -1
- package/dist/src/services/cli-logger.service.d.ts +22 -3
- package/dist/src/services/cli-logger.service.js +107 -41
- package/dist/src/services.js +32 -67
- package/dist/src/utils/generate-bootstrap-file.js +3 -0
- package/dist/src/utils/parse-cli-filters.d.ts +18 -0
- package/dist/src/utils/parse-cli-filters.js +99 -0
- package/dist/src/utils/pikku-cli-config.js +29 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -4
- package/skills/pikku-addon/SKILL.md +330 -0
- package/skills/pikku-ai-agent/SKILL.md +227 -0
- package/skills/pikku-ai-vercel/SKILL.md +78 -0
- package/skills/pikku-ai-voice/SKILL.md +85 -0
- package/skills/pikku-auth-js/SKILL.md +106 -0
- package/skills/pikku-aws/SKILL.md +107 -0
- package/skills/pikku-backblaze/SKILL.md +70 -0
- package/skills/pikku-cli/SKILL.md +281 -0
- package/skills/pikku-concepts/SKILL.md +281 -0
- package/skills/pikku-concepts/references/concept-mapping.md +528 -0
- package/skills/pikku-config/SKILL.md +208 -0
- package/skills/pikku-cron/SKILL.md +211 -0
- package/skills/pikku-deploy-azure/SKILL.md +69 -0
- package/skills/pikku-deploy-cloudflare/SKILL.md +80 -0
- package/skills/pikku-deploy-express/SKILL.md +83 -0
- package/skills/pikku-deploy-fastify/SKILL.md +70 -0
- package/skills/pikku-deploy-lambda/SKILL.md +107 -0
- package/skills/pikku-deploy-nextjs/SKILL.md +76 -0
- package/skills/pikku-deploy-uws/SKILL.md +85 -0
- package/skills/pikku-fabric/SKILL.md +245 -0
- package/skills/pikku-feature/SKILL.md +258 -0
- package/skills/pikku-gateway-slack/SKILL.md +112 -0
- package/skills/pikku-http/SKILL.md +317 -0
- package/skills/pikku-i18n/SKILL.md +208 -0
- package/skills/pikku-info/SKILL.md +95 -0
- package/skills/pikku-jose/SKILL.md +102 -0
- package/skills/pikku-kysely/SKILL.md +145 -0
- package/skills/pikku-mcp/SKILL.md +237 -0
- package/skills/pikku-mongodb/SKILL.md +102 -0
- package/skills/pikku-n8n-addon-map/SKILL.md +178 -0
- package/skills/pikku-n8n-code-translate/SKILL.md +166 -0
- package/skills/pikku-pino/SKILL.md +77 -0
- package/skills/pikku-queue/SKILL.md +237 -0
- package/skills/pikku-react/SKILL.md +183 -0
- package/skills/pikku-react-query/SKILL.md +205 -0
- package/skills/pikku-realtime/SKILL.md +285 -0
- package/skills/pikku-redis/SKILL.md +87 -0
- package/skills/pikku-rpc/SKILL.md +168 -0
- package/skills/pikku-rtl/SKILL.md +205 -0
- package/skills/pikku-schedule/SKILL.md +54 -0
- package/skills/pikku-schema-ajv/SKILL.md +60 -0
- package/skills/pikku-schema-cfworker/SKILL.md +60 -0
- package/skills/pikku-security/SKILL.md +243 -0
- package/skills/pikku-services/SKILL.md +247 -0
- package/skills/pikku-template-clone/SKILL.md +39 -0
- package/skills/pikku-testing/SKILL.md +428 -0
- package/skills/pikku-trigger/SKILL.md +177 -0
- package/skills/pikku-versioning/SKILL.md +169 -0
- package/skills/pikku-websocket/SKILL.md +239 -0
- package/skills/pikku-workflow/SKILL.md +283 -0
- package/skills/pikku-workflows-client/SKILL.md +150 -0
- package/skills/pikku-ws/SKILL.md +45 -0
- package/console-app/assets/index-BpY2pSuA.css +0 -10
- package/console-app/assets/index-DXLy-_D4.js +0 -717
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +0 -10
- package/dist/.pikku/cli/pikku-cli-client.gen.js +0 -44
- /package/dist/.pikku/schemas/schemas/{PikkuChannelsOutput.schema.json → PikkuCLIEntryOutput.schema.json} +0 -0
|
@@ -6,27 +6,10 @@
|
|
|
6
6
|
* Gateways (MCP, agents, channels) dispatch to function units via RPC.
|
|
7
7
|
* Workflow orchestrators dispatch to step units via queue or RPC (inline).
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
* Determine deploy target for a function based on its explicit flag
|
|
11
|
-
* and service compatibility.
|
|
12
|
-
*/
|
|
13
|
-
function resolveDeployTarget(funcMeta, serverlessIncompatible) {
|
|
14
|
-
// Explicit flag takes priority
|
|
15
|
-
if (funcMeta.deploy === 'serverless')
|
|
16
|
-
return 'serverless';
|
|
17
|
-
if (funcMeta.deploy === 'server')
|
|
18
|
-
return 'server';
|
|
19
|
-
// Auto: check if any service is serverless-incompatible
|
|
20
|
-
if (funcMeta.services?.services) {
|
|
21
|
-
for (const svc of funcMeta.services.services) {
|
|
22
|
-
if (serverlessIncompatible.has(svc))
|
|
23
|
-
return 'server';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return 'serverless';
|
|
27
|
-
}
|
|
9
|
+
import { resolveDeployTarget, } from '@pikku/inspector';
|
|
28
10
|
export function analyzeDeployment(state, options) {
|
|
29
11
|
const serverlessIncompatible = new Set(options.serverlessIncompatible ?? []);
|
|
12
|
+
const workflowQueues = options.workflowQueues ?? true;
|
|
30
13
|
const units = [];
|
|
31
14
|
const queues = [];
|
|
32
15
|
const scheduledTasks = [];
|
|
@@ -56,7 +39,11 @@ export function analyzeDeployment(state, options) {
|
|
|
56
39
|
funcId === 'agentCaller' ||
|
|
57
40
|
funcId === 'agentStreamCaller' ||
|
|
58
41
|
funcId === 'agentApproveCaller' ||
|
|
59
|
-
funcId === 'agentResumeCaller'
|
|
42
|
+
funcId === 'agentResumeCaller' ||
|
|
43
|
+
funcId === 'getAgentThreads' ||
|
|
44
|
+
funcId === 'getAgentThreadMessages' ||
|
|
45
|
+
funcId === 'getAgentThreadRuns' ||
|
|
46
|
+
funcId === 'deleteAgentThread') {
|
|
60
47
|
continue;
|
|
61
48
|
}
|
|
62
49
|
const handlers = [];
|
|
@@ -131,7 +118,7 @@ export function analyzeDeployment(state, options) {
|
|
|
131
118
|
units.push({
|
|
132
119
|
name: toSafeKebab(funcId),
|
|
133
120
|
role: 'function',
|
|
134
|
-
target: resolveDeployTarget(funcMeta, serverlessIncompatible),
|
|
121
|
+
target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId),
|
|
135
122
|
functionIds: [funcId],
|
|
136
123
|
services: collectServicesForFunction(funcMeta),
|
|
137
124
|
dependsOn: [],
|
|
@@ -186,7 +173,14 @@ export function analyzeDeployment(state, options) {
|
|
|
186
173
|
tags: agentMeta.tags ?? [],
|
|
187
174
|
});
|
|
188
175
|
agents.push({
|
|
189
|
-
name
|
|
176
|
+
// The registry KEY (export name, e.g. `kanbanAgent`), NOT the
|
|
177
|
+
// human-facing `agentMeta.name` (e.g. `kanban-agent`). Routes,
|
|
178
|
+
// `addAIAgent(...)`, and the inspector-state name filter all key off
|
|
179
|
+
// this identifier — per-unit codegen passes it to `--names`, and the
|
|
180
|
+
// filter matches it against the `agentsMeta` key. Using the human name
|
|
181
|
+
// here makes the filter prune the agent, so its registration never gets
|
|
182
|
+
// bundled into the deployed unit ("AI agent not found: <key>").
|
|
183
|
+
name: agentName,
|
|
190
184
|
unitName,
|
|
191
185
|
toolFunctionIds: toolIds,
|
|
192
186
|
subAgentNames,
|
|
@@ -252,7 +246,7 @@ export function analyzeDeployment(state, options) {
|
|
|
252
246
|
});
|
|
253
247
|
}
|
|
254
248
|
// ── Step 5: Workflows ──────────────────────────────────────────────
|
|
255
|
-
buildWorkflows(state.workflows.graphMeta, functionsMeta, httpMeta, units, workflows, queues);
|
|
249
|
+
buildWorkflows(state.workflows.graphMeta, functionsMeta, httpMeta, units, workflows, queues, workflowQueues);
|
|
256
250
|
// ── Step 6: Ensure function units exist for gateway dependencies ───
|
|
257
251
|
// Gateways depend on function units. If a function is only used via
|
|
258
252
|
// a gateway (not directly wired to HTTP/queue/cron), it still needs
|
|
@@ -269,7 +263,7 @@ export function analyzeDeployment(state, options) {
|
|
|
269
263
|
units.push({
|
|
270
264
|
name: dep,
|
|
271
265
|
role: 'function',
|
|
272
|
-
target: resolveDeployTarget(funcMeta, serverlessIncompatible),
|
|
266
|
+
target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId),
|
|
273
267
|
functionIds: [funcId],
|
|
274
268
|
services: collectServicesForFunction(funcMeta),
|
|
275
269
|
dependsOn: [],
|
|
@@ -309,6 +303,36 @@ export function analyzeDeployment(state, options) {
|
|
|
309
303
|
}
|
|
310
304
|
}
|
|
311
305
|
}
|
|
306
|
+
// ── Step 8: Scaffold workflow function units need workflow-state ──
|
|
307
|
+
// Scaffold endpoints like workflowStarter destructure { workflowService }
|
|
308
|
+
// and call rpc.startWorkflow / workflowService.runToCompletion. The
|
|
309
|
+
// function-meta inspector doesn't always surface those destructured
|
|
310
|
+
// services into funcMeta.services.services, so collectServicesForFunction
|
|
311
|
+
// returns [] and per-unit codegen omits workflow queue meta — the unit
|
|
312
|
+
// then falls back to the shared 'pikku-workflow-step-worker' queue name
|
|
313
|
+
// at runtime. Force the capability for the known scaffold ids so the
|
|
314
|
+
// queue meta is bundled and the runtime can resolve per-step queues.
|
|
315
|
+
const SCAFFOLD_WORKFLOW_FUNCS = new Set([
|
|
316
|
+
'workflowStarter',
|
|
317
|
+
'workflowRunner',
|
|
318
|
+
'workflowStatusChecker',
|
|
319
|
+
'workflowStatusStream',
|
|
320
|
+
'workflowStatusStreamFull',
|
|
321
|
+
'graphStarter',
|
|
322
|
+
]);
|
|
323
|
+
for (const unit of units) {
|
|
324
|
+
if (unit.role !== 'function')
|
|
325
|
+
continue;
|
|
326
|
+
const hasScaffold = unit.functionIds.some((id) => SCAFFOLD_WORKFLOW_FUNCS.has(id));
|
|
327
|
+
if (!hasScaffold)
|
|
328
|
+
continue;
|
|
329
|
+
if (!unit.services.some((s) => s.capability === 'workflow-state')) {
|
|
330
|
+
unit.services.push({
|
|
331
|
+
capability: 'workflow-state',
|
|
332
|
+
sourceServiceName: 'workflowService',
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
}
|
|
312
336
|
// ── Secrets & Variables ────────────────────────────────────────────
|
|
313
337
|
const secrets = state.secrets.definitions.map((s) => ({
|
|
314
338
|
secretId: s.secretId,
|
|
@@ -337,7 +361,7 @@ export function analyzeDeployment(state, options) {
|
|
|
337
361
|
// ---------------------------------------------------------------------------
|
|
338
362
|
// Workflow builder
|
|
339
363
|
// ---------------------------------------------------------------------------
|
|
340
|
-
function buildWorkflows(graphMeta, _functionsMeta, _httpMeta, units, workflows, queues) {
|
|
364
|
+
function buildWorkflows(graphMeta, _functionsMeta, _httpMeta, units, workflows, queues, workflowQueues) {
|
|
341
365
|
for (const [_wfName, graph] of entries(graphMeta)) {
|
|
342
366
|
const steps = [];
|
|
343
367
|
const stepUnitNames = [];
|
|
@@ -355,13 +379,24 @@ function buildWorkflows(graphMeta, _functionsMeta, _httpMeta, units, workflows,
|
|
|
355
379
|
functionId: node.rpcName,
|
|
356
380
|
unitName: stepUnitName,
|
|
357
381
|
});
|
|
382
|
+
// Every step gets its own unit (for log/metric isolation). The
|
|
383
|
+
// dispatch mechanism differs at runtime: async steps consume a
|
|
384
|
+
// dedicated queue; inline steps are invoked via CF dispatch
|
|
385
|
+
// namespace remote-call from the orchestrator.
|
|
358
386
|
stepUnitNames.push(stepUnitName);
|
|
359
387
|
}
|
|
360
388
|
// Build orchestrator unit — no function code, just orchestration
|
|
361
389
|
const orchUnitName = `wf-${toSafeKebab(graph.name)}`;
|
|
362
390
|
const orchServices = [
|
|
363
391
|
{ capability: 'workflow-state', sourceServiceName: 'workflowService' },
|
|
364
|
-
|
|
392
|
+
...(workflowQueues
|
|
393
|
+
? [
|
|
394
|
+
{
|
|
395
|
+
capability: 'queue',
|
|
396
|
+
sourceServiceName: 'queueService',
|
|
397
|
+
},
|
|
398
|
+
]
|
|
399
|
+
: []),
|
|
365
400
|
];
|
|
366
401
|
// Concrete routes for this workflow via catch-all
|
|
367
402
|
const wfRoutes = [
|
|
@@ -386,11 +421,14 @@ function buildWorkflows(graphMeta, _functionsMeta, _httpMeta, units, workflows,
|
|
|
386
421
|
pikkuFuncId: `graphStart:${graph.name}`,
|
|
387
422
|
},
|
|
388
423
|
];
|
|
389
|
-
// Orchestrator queue — the orchestrator consumes from this
|
|
424
|
+
// Orchestrator queue — the orchestrator consumes from this. Only emitted
|
|
425
|
+
// when the provider's workflow runtime needs queue dispatch.
|
|
390
426
|
const orchQueueName = `wf-orchestrator-${toSafeKebab(graph.name)}`;
|
|
391
427
|
const orchHandlers = [
|
|
392
428
|
{ type: 'fetch', routes: wfRoutes },
|
|
393
|
-
|
|
429
|
+
...(workflowQueues
|
|
430
|
+
? [{ type: 'queue', queueName: orchQueueName }]
|
|
431
|
+
: []),
|
|
394
432
|
];
|
|
395
433
|
units.push({
|
|
396
434
|
name: orchUnitName,
|
|
@@ -402,23 +440,25 @@ function buildWorkflows(graphMeta, _functionsMeta, _httpMeta, units, workflows,
|
|
|
402
440
|
handlers: orchHandlers,
|
|
403
441
|
tags: [],
|
|
404
442
|
});
|
|
405
|
-
|
|
406
|
-
name: orchQueueName,
|
|
407
|
-
consumerUnit: orchUnitName,
|
|
408
|
-
consumerFunctionId: `pikkuWorkflowOrchestrator:${graph.name}`,
|
|
409
|
-
});
|
|
410
|
-
// Per-step queues — each step function worker consumes its own queue.
|
|
411
|
-
// The step units may not exist yet (created in step 6), so we just
|
|
412
|
-
// create queue definitions here. Step 7 wires them to units.
|
|
413
|
-
for (const step of steps) {
|
|
414
|
-
if (step.inline || !step.functionId)
|
|
415
|
-
continue;
|
|
416
|
-
const stepQueueName = `wf-step-${toSafeKebab(step.functionId)}`;
|
|
443
|
+
if (workflowQueues) {
|
|
417
444
|
queues.push({
|
|
418
|
-
name:
|
|
419
|
-
consumerUnit:
|
|
420
|
-
consumerFunctionId: `
|
|
445
|
+
name: orchQueueName,
|
|
446
|
+
consumerUnit: orchUnitName,
|
|
447
|
+
consumerFunctionId: `pikkuWorkflowOrchestrator:${graph.name}`,
|
|
421
448
|
});
|
|
449
|
+
// Per-step queues — each step function worker consumes its own queue.
|
|
450
|
+
// The step units may not exist yet (created in step 6), so we just
|
|
451
|
+
// create queue definitions here. Step 7 wires them to units.
|
|
452
|
+
for (const step of steps) {
|
|
453
|
+
if (step.inline || !step.functionId)
|
|
454
|
+
continue;
|
|
455
|
+
const stepQueueName = `wf-step-${toSafeKebab(step.functionId)}`;
|
|
456
|
+
queues.push({
|
|
457
|
+
name: stepQueueName,
|
|
458
|
+
consumerUnit: toSafeKebab(step.functionId),
|
|
459
|
+
consumerFunctionId: `pikkuWorkflowWorker:${step.functionId}`,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
422
462
|
}
|
|
423
463
|
workflows.push({
|
|
424
464
|
name: graph.name,
|
|
@@ -44,6 +44,16 @@ export interface DeploymentUnit {
|
|
|
44
44
|
/** What runtime handlers this unit needs to export */
|
|
45
45
|
handlers: DeploymentHandler[];
|
|
46
46
|
tags: string[];
|
|
47
|
+
/** SHA-256 of final bundled artifact (set by build pipeline) */
|
|
48
|
+
bundleHash?: string;
|
|
49
|
+
/** Final bundle size in bytes (set by build pipeline) */
|
|
50
|
+
bundleSizeBytes?: number;
|
|
51
|
+
/** SHA-256 of sorted exact dependency map (set by build pipeline) */
|
|
52
|
+
exactDependenciesHash?: string;
|
|
53
|
+
/** Top-level exact runtime dependency versions for this unit (set by build pipeline) */
|
|
54
|
+
exactDependencies?: Record<string, string>;
|
|
55
|
+
/** Top-level exact optional runtime dependency versions for this unit (set by build pipeline) */
|
|
56
|
+
exactOptionalDependencies?: Record<string, string>;
|
|
47
57
|
}
|
|
48
58
|
export interface QueueDefinition {
|
|
49
59
|
name: string;
|
|
@@ -16,6 +16,8 @@ export interface BuildLogger {
|
|
|
16
16
|
export interface BuildPipelineResult {
|
|
17
17
|
manifest: DeploymentManifest;
|
|
18
18
|
providerDir: string;
|
|
19
|
+
deploymentManifestPath: string;
|
|
20
|
+
infraPath: string | null;
|
|
19
21
|
projectId: string;
|
|
20
22
|
bundled: BundleResult[];
|
|
21
23
|
bundleErrors: Array<{
|
|
@@ -10,6 +10,25 @@ import { mkdir, writeFile, copyFile } from 'node:fs/promises';
|
|
|
10
10
|
import { analyzeDeployment } from './analyzer/index.js';
|
|
11
11
|
import { generatePerUnitCodegen } from './codegen/per-unit-codegen.js';
|
|
12
12
|
import { bundleUnits } from './bundler/index.js';
|
|
13
|
+
import { generateServerEntrySource, SERVER_DOCKERFILE, SERVER_DOCKERIGNORE, } from './server-entry.js';
|
|
14
|
+
const MERGED_SERVER_UNIT_NAME = 'pikku-server-container';
|
|
15
|
+
const UNITS_DIR_NAME = 'units';
|
|
16
|
+
const CONTAINER_DIR_NAME = 'container';
|
|
17
|
+
function attachBundleMetadata(manifest, bundled) {
|
|
18
|
+
if (bundled.length === 0)
|
|
19
|
+
return;
|
|
20
|
+
const byUnitName = new Map(bundled.map((b) => [b.unitName, b]));
|
|
21
|
+
for (const unit of manifest.units) {
|
|
22
|
+
const bundle = byUnitName.get(unit.name);
|
|
23
|
+
if (!bundle)
|
|
24
|
+
continue;
|
|
25
|
+
unit.bundleHash = bundle.bundleHash;
|
|
26
|
+
unit.bundleSizeBytes = bundle.bundleSizeBytes;
|
|
27
|
+
unit.exactDependenciesHash = bundle.exactDependenciesHash;
|
|
28
|
+
unit.exactDependencies = bundle.exactDependencies;
|
|
29
|
+
unit.exactOptionalDependencies = bundle.exactOptionalDependencies;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
13
32
|
function findLockfile(projectDir) {
|
|
14
33
|
for (const name of ['yarn.lock', 'package-lock.json', 'pnpm-lock.yaml']) {
|
|
15
34
|
const p = join(projectDir, name);
|
|
@@ -23,13 +42,19 @@ export async function runBuildPipeline(options) {
|
|
|
23
42
|
const deployDir = options.deployDir ?? join(projectDir, '.deploy');
|
|
24
43
|
const providerDir = join(deployDir, provider.deployDirName);
|
|
25
44
|
// Step 1: Analyze
|
|
45
|
+
const workflowQueues = provider.workflowQueues ?? true;
|
|
26
46
|
const manifest = analyzeDeployment(inspectorState, {
|
|
27
47
|
projectId,
|
|
28
48
|
serverlessIncompatible: options.serverlessIncompatible,
|
|
49
|
+
workflowQueues,
|
|
29
50
|
});
|
|
30
51
|
let bundled = [];
|
|
31
52
|
let bundleErrors = [];
|
|
32
53
|
let codegenErrors = [];
|
|
54
|
+
let infraPath = null;
|
|
55
|
+
const deploymentManifestPath = join(providerDir, 'deployment-manifest.json');
|
|
56
|
+
const unitsDir = join(providerDir, UNITS_DIR_NAME);
|
|
57
|
+
const containerDir = join(providerDir, CONTAINER_DIR_NAME);
|
|
33
58
|
if (provider.singleUnit) {
|
|
34
59
|
// Single-unit mode: bundle everything into one unit, use project's .pikku/ directly
|
|
35
60
|
logger.info('Building standalone bundle...');
|
|
@@ -60,9 +85,11 @@ export async function runBuildPipeline(options) {
|
|
|
60
85
|
define: provider.getDefine?.(),
|
|
61
86
|
platform: provider.getPlatform?.(),
|
|
62
87
|
format: provider.getFormat?.(),
|
|
88
|
+
noRequireShim: provider.getNoRequireShim?.(),
|
|
63
89
|
});
|
|
64
90
|
bundled = bundleResult.results;
|
|
65
91
|
bundleErrors = bundleResult.errors;
|
|
92
|
+
attachBundleMetadata(manifest, bundled);
|
|
66
93
|
logger.info(`Bundled standalone${bundleErrors.length > 0 ? ` (${bundleErrors.length} errors)` : ''}`);
|
|
67
94
|
}
|
|
68
95
|
else {
|
|
@@ -74,6 +101,8 @@ export async function runBuildPipeline(options) {
|
|
|
74
101
|
return {
|
|
75
102
|
manifest,
|
|
76
103
|
providerDir,
|
|
104
|
+
deploymentManifestPath,
|
|
105
|
+
infraPath,
|
|
77
106
|
projectId,
|
|
78
107
|
bundled: [],
|
|
79
108
|
bundleErrors: [],
|
|
@@ -88,7 +117,8 @@ export async function runBuildPipeline(options) {
|
|
|
88
117
|
projectDir,
|
|
89
118
|
manifest: serverlessManifest,
|
|
90
119
|
inspectorState,
|
|
91
|
-
deployDir:
|
|
120
|
+
deployDir: unitsDir,
|
|
121
|
+
workflowQueues,
|
|
92
122
|
onProgress: (unitName, status, error) => {
|
|
93
123
|
if (status === 'start') {
|
|
94
124
|
logger.info(` Codegen: ${unitName}...`);
|
|
@@ -104,7 +134,7 @@ export async function runBuildPipeline(options) {
|
|
|
104
134
|
codegenErrors = serverlessCodegenErrors;
|
|
105
135
|
// Step 2b: Server units — single codegen pass with all server function IDs
|
|
106
136
|
if (serverUnits.length > 0) {
|
|
107
|
-
const serverUnitName =
|
|
137
|
+
const serverUnitName = MERGED_SERVER_UNIT_NAME;
|
|
108
138
|
// Create a merged server unit with all server function IDs
|
|
109
139
|
const mergedServerUnit = {
|
|
110
140
|
name: serverUnitName,
|
|
@@ -122,7 +152,9 @@ export async function runBuildPipeline(options) {
|
|
|
122
152
|
projectDir,
|
|
123
153
|
manifest: serverManifest,
|
|
124
154
|
inspectorState,
|
|
125
|
-
deployDir:
|
|
155
|
+
deployDir: containerDir,
|
|
156
|
+
resolveUnitDir: () => containerDir,
|
|
157
|
+
workflowQueues,
|
|
126
158
|
onProgress: (unitName, status, error) => {
|
|
127
159
|
if (status === 'start')
|
|
128
160
|
logger.info(` Codegen: ${unitName}...`);
|
|
@@ -142,28 +174,77 @@ export async function runBuildPipeline(options) {
|
|
|
142
174
|
logger.info(`Codegen complete: ${unitPikkuDirs.size} units`);
|
|
143
175
|
// Step 3: Generate entry points + Bundle
|
|
144
176
|
logger.info('Bundling...');
|
|
145
|
-
const
|
|
177
|
+
const serverlessEntryFiles = new Map();
|
|
178
|
+
const serverEntryFiles = new Map();
|
|
146
179
|
for (const unit of manifest.units) {
|
|
147
180
|
const pikkuDir = unitPikkuDirs.get(unit.name);
|
|
148
181
|
if (!pikkuDir)
|
|
149
182
|
continue;
|
|
150
|
-
const unitDir = join(
|
|
183
|
+
const unitDir = unit.target === 'server' ? containerDir : join(unitsDir, unit.name);
|
|
151
184
|
const entryPath = join(unitDir, 'entry.ts');
|
|
152
185
|
await mkdir(unitDir, { recursive: true });
|
|
153
186
|
const ctx = getEntryContext(unitDir, pikkuDir, unit, inspectorState);
|
|
154
|
-
const source =
|
|
187
|
+
const source = unit.target === 'server'
|
|
188
|
+
? generateServerEntrySource(ctx)
|
|
189
|
+
: provider.generateEntrySource(ctx);
|
|
155
190
|
await writeFile(entryPath, source, 'utf-8');
|
|
156
|
-
|
|
191
|
+
if (unit.target === 'server') {
|
|
192
|
+
serverEntryFiles.set(unit.name, entryPath);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
serverlessEntryFiles.set(unit.name, entryPath);
|
|
196
|
+
}
|
|
157
197
|
}
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
198
|
+
const aggregated = [];
|
|
199
|
+
const aggregatedErrors = [];
|
|
200
|
+
if (serverlessEntryFiles.size > 0) {
|
|
201
|
+
const serverlessManifestForBundle = {
|
|
202
|
+
...manifest,
|
|
203
|
+
units: manifest.units.filter((u) => u.target !== 'server'),
|
|
204
|
+
};
|
|
205
|
+
const result = await bundleUnits(projectDir, serverlessManifestForBundle, serverlessEntryFiles, providerDir, {
|
|
206
|
+
externals: provider.getExternals?.(),
|
|
207
|
+
aliases: provider.getAliases?.(),
|
|
208
|
+
define: provider.getDefine?.(),
|
|
209
|
+
platform: provider.getPlatform?.(),
|
|
210
|
+
format: provider.getFormat?.(),
|
|
211
|
+
noRequireShim: provider.getNoRequireShim?.(),
|
|
212
|
+
resolveOutputDir: (unit) => join(unitsDir, unit.name),
|
|
213
|
+
});
|
|
214
|
+
aggregated.push(...result.results);
|
|
215
|
+
aggregatedErrors.push(...result.errors);
|
|
216
|
+
}
|
|
217
|
+
if (serverEntryFiles.size > 0) {
|
|
218
|
+
// Server bundles use `@pikku/node-http-server` (pure JS), so esbuild
|
|
219
|
+
// can inline everything except node builtins. The bundler still
|
|
220
|
+
// emits a package.json from the metafile; if a user pulls in a
|
|
221
|
+
// native module the dep extractor surfaces it and `npm install`
|
|
222
|
+
// inside the container picks it up.
|
|
223
|
+
const serverManifestForBundle = {
|
|
224
|
+
...manifest,
|
|
225
|
+
units: manifest.units.filter((u) => u.target === 'server'),
|
|
226
|
+
};
|
|
227
|
+
const result = await bundleUnits(projectDir, serverManifestForBundle, serverEntryFiles, providerDir, {
|
|
228
|
+
externals: ['node:*'],
|
|
229
|
+
aliases: undefined,
|
|
230
|
+
define: undefined,
|
|
231
|
+
platform: 'node',
|
|
232
|
+
format: 'esm',
|
|
233
|
+
noRequireShim: false,
|
|
234
|
+
resolveOutputDir: () => containerDir,
|
|
235
|
+
});
|
|
236
|
+
aggregated.push(...result.results);
|
|
237
|
+
aggregatedErrors.push(...result.errors);
|
|
238
|
+
// Emit Dockerfile + .dockerignore alongside bundle.js for any
|
|
239
|
+
// orchestrator that wants to `docker build` the container directly.
|
|
240
|
+
if (result.results.length > 0) {
|
|
241
|
+
await writeFile(join(containerDir, 'Dockerfile'), SERVER_DOCKERFILE, 'utf-8');
|
|
242
|
+
await writeFile(join(containerDir, '.dockerignore'), SERVER_DOCKERIGNORE, 'utf-8');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
bundled = aggregated;
|
|
246
|
+
bundleErrors = aggregatedErrors;
|
|
247
|
+
attachBundleMetadata(manifest, bundled);
|
|
167
248
|
logger.info(`Bundled ${bundled.length} units${bundleErrors.length > 0 ? ` (${bundleErrors.length} failed)` : ''}`);
|
|
168
249
|
}
|
|
169
250
|
if (bundleErrors.length > 0) {
|
|
@@ -172,11 +253,22 @@ export async function runBuildPipeline(options) {
|
|
|
172
253
|
}
|
|
173
254
|
}
|
|
174
255
|
// Step 4: Generate configs + infra manifest
|
|
256
|
+
await mkdir(providerDir, { recursive: true });
|
|
257
|
+
await writeFile(deploymentManifestPath, JSON.stringify(manifest, null, 2), 'utf-8');
|
|
258
|
+
logger.info('Generated deployment manifest');
|
|
175
259
|
const infraContent = provider.generateInfraManifest(manifest);
|
|
176
260
|
if (infraContent) {
|
|
177
|
-
|
|
261
|
+
infraPath = join(providerDir, 'infra.json');
|
|
262
|
+
await writeFile(infraPath, infraContent, 'utf-8');
|
|
178
263
|
logger.info('Generated infrastructure manifest');
|
|
179
264
|
}
|
|
265
|
+
if (provider.emitSideArtifacts) {
|
|
266
|
+
await provider.emitSideArtifacts({
|
|
267
|
+
buildDir: providerDir,
|
|
268
|
+
manifest,
|
|
269
|
+
logger,
|
|
270
|
+
});
|
|
271
|
+
}
|
|
180
272
|
if (provider.generateProviderConfigs) {
|
|
181
273
|
const providerConfigs = provider.generateProviderConfigs(manifest);
|
|
182
274
|
for (const [filename, content] of providerConfigs) {
|
|
@@ -186,8 +278,17 @@ export async function runBuildPipeline(options) {
|
|
|
186
278
|
}
|
|
187
279
|
}
|
|
188
280
|
const lockfileSrc = findLockfile(projectDir);
|
|
281
|
+
let configCount = 0;
|
|
189
282
|
for (const unit of manifest.units) {
|
|
190
|
-
|
|
283
|
+
// Server units don't take per-unit provider configs (no wrangler.toml,
|
|
284
|
+
// etc.) — their runtime is the emitted Dockerfile + bundle.js. Skip
|
|
285
|
+
// both the provider config emit and the lockfile copy; the bundle is
|
|
286
|
+
// self-contained and the Docker build uses npm install on its own.
|
|
287
|
+
if (unit.target === 'server')
|
|
288
|
+
continue;
|
|
289
|
+
const unitDir = provider.singleUnit
|
|
290
|
+
? join(providerDir, unit.name)
|
|
291
|
+
: join(unitsDir, unit.name);
|
|
191
292
|
await mkdir(unitDir, { recursive: true });
|
|
192
293
|
const configs = provider.generateUnitConfigs(unit, manifest, projectId);
|
|
193
294
|
for (const [filename, content] of configs) {
|
|
@@ -196,11 +297,14 @@ export async function runBuildPipeline(options) {
|
|
|
196
297
|
if (lockfileSrc) {
|
|
197
298
|
await copyFile(lockfileSrc, join(unitDir, 'yarn.lock'));
|
|
198
299
|
}
|
|
300
|
+
configCount++;
|
|
199
301
|
}
|
|
200
|
-
logger.info(`Generated ${
|
|
302
|
+
logger.info(`Generated ${configCount} provider config files`);
|
|
201
303
|
return {
|
|
202
304
|
manifest,
|
|
203
305
|
providerDir,
|
|
306
|
+
deploymentManifestPath,
|
|
307
|
+
infraPath,
|
|
204
308
|
projectId,
|
|
205
309
|
bundled,
|
|
206
310
|
bundleErrors,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 5. Generates a minimal package.json with exact versions
|
|
10
10
|
* 6. Writes all artifacts to `<outputDir>/<unit-name>/`
|
|
11
11
|
*/
|
|
12
|
-
import type { DeploymentManifest, BundleOutput } from './types.js';
|
|
12
|
+
import type { DeploymentManifest, DeploymentUnit, BundleOutput } from './types.js';
|
|
13
13
|
/**
|
|
14
14
|
* Bundles all deployment units defined in a DeploymentManifest.
|
|
15
15
|
*
|
|
@@ -27,4 +27,6 @@ export declare function bundleUnits(projectDir: string, manifest: DeploymentMani
|
|
|
27
27
|
define?: Record<string, string>;
|
|
28
28
|
platform?: 'node' | 'neutral' | 'browser';
|
|
29
29
|
format?: 'esm' | 'cjs';
|
|
30
|
+
noRequireShim?: boolean;
|
|
31
|
+
resolveOutputDir?: (unit: DeploymentUnit, baseOutputDir: string) => string;
|
|
30
32
|
}): Promise<BundleOutput>;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { build } from 'esbuild';
|
|
13
13
|
import { writeFile, mkdir, stat, readFile } from 'node:fs/promises';
|
|
14
14
|
import { join } from 'node:path';
|
|
15
|
+
import { createHash } from 'node:crypto';
|
|
15
16
|
import { extractDependencies, generateMinimalPackageJson, } from './dep-extractor.js';
|
|
16
17
|
/**
|
|
17
18
|
* Mapping of service name -> gen file pattern that should be stubbed
|
|
@@ -70,6 +71,7 @@ function createDeadModuleStubPlugin(patterns) {
|
|
|
70
71
|
const BUNDLE_FILENAME = 'bundle.js';
|
|
71
72
|
const METAFILE_FILENAME = 'metafile.json';
|
|
72
73
|
const PACKAGE_JSON_FILENAME = 'package.json';
|
|
74
|
+
const EXACT_DEPENDENCIES_FILENAME = 'exact-dependencies.json';
|
|
73
75
|
/**
|
|
74
76
|
* Bundles a single deployment unit using esbuild.
|
|
75
77
|
*
|
|
@@ -84,6 +86,7 @@ async function bundleUnit(options) {
|
|
|
84
86
|
const bundlePath = join(unitOutputDir, BUNDLE_FILENAME);
|
|
85
87
|
const metafilePath = join(unitOutputDir, METAFILE_FILENAME);
|
|
86
88
|
const packageJsonPath = join(unitOutputDir, PACKAGE_JSON_FILENAME);
|
|
89
|
+
const exactDependenciesPath = join(unitOutputDir, EXACT_DEPENDENCIES_FILENAME);
|
|
87
90
|
// Determine which gen files to stub based on per-unit service requirements
|
|
88
91
|
const deadPatterns = await getDeadGenFilePatterns(unitOutputDir);
|
|
89
92
|
// Run esbuild — inline everything into a self-contained bundle.
|
|
@@ -101,12 +104,22 @@ async function bundleUnit(options) {
|
|
|
101
104
|
break;
|
|
102
105
|
dir = parent;
|
|
103
106
|
}
|
|
104
|
-
// For ESM + node platform, CJS deps may use require()
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
+
// For ESM + node platform, CJS deps may use require() / __filename / __dirname
|
|
108
|
+
// for builtins or to locate native addons (the `bindings` package, used
|
|
109
|
+
// transitively by `pg` and many others, calls `__filename` directly). esbuild
|
|
110
|
+
// wraps require() as __require() which fails at runtime in ESM, and leaves
|
|
111
|
+
// `__filename` / `__dirname` as undefined references. The banner shims all
|
|
112
|
+
// three via createRequire / fileURLToPath so CJS builtins resolve and native-
|
|
113
|
+
// addon loaders find their .node files.
|
|
114
|
+
// Skipped when the provider opts out via `noRequireShim` (e.g. CF Workers
|
|
115
|
+
// — `import.meta.url` is undefined there, so the shim crashes at boot).
|
|
107
116
|
const resolvedFormat = format ?? 'esm';
|
|
108
|
-
const banner = resolvedFormat === 'esm' &&
|
|
109
|
-
|
|
117
|
+
const banner = resolvedFormat === 'esm' &&
|
|
118
|
+
(platform ?? 'node') === 'node' &&
|
|
119
|
+
!options.noRequireShim
|
|
120
|
+
? {
|
|
121
|
+
js: `import { createRequire as __pikkuCreateRequire } from 'node:module'; import { fileURLToPath as __pikkuFileURLToPath } from 'node:url'; import { dirname as __pikkuDirname } from 'node:path'; const require = __pikkuCreateRequire(import.meta.url); const __filename = __pikkuFileURLToPath(import.meta.url); const __dirname = __pikkuDirname(__filename);`,
|
|
122
|
+
}
|
|
110
123
|
: undefined;
|
|
111
124
|
const result = await build({
|
|
112
125
|
entryPoints: [entryPath],
|
|
@@ -132,18 +145,34 @@ async function bundleUnit(options) {
|
|
|
132
145
|
const metafileJson = JSON.stringify(result.metafile, null, 2);
|
|
133
146
|
await writeFile(metafilePath, metafileJson, 'utf-8');
|
|
134
147
|
// Extract dependencies and generate minimal package.json
|
|
135
|
-
const
|
|
136
|
-
const packageJson = generateMinimalPackageJson(unit.name,
|
|
148
|
+
const { exactDependencies, exactOptionalDependencies } = await extractDependencies(result.metafile, projectDir);
|
|
149
|
+
const packageJson = generateMinimalPackageJson(unit.name, exactDependencies, exactOptionalDependencies);
|
|
137
150
|
await writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf-8');
|
|
151
|
+
await writeFile(exactDependenciesPath, JSON.stringify({
|
|
152
|
+
dependencies: Object.fromEntries(Object.entries(exactDependencies).sort(([a], [b]) => a.localeCompare(b))),
|
|
153
|
+
optionalDependencies: Object.fromEntries(Object.entries(exactOptionalDependencies).sort(([a], [b]) => a.localeCompare(b))),
|
|
154
|
+
}, null, 2), 'utf-8');
|
|
138
155
|
// Get bundle size
|
|
139
156
|
const bundleStat = await stat(bundlePath);
|
|
157
|
+
const bundleContents = await readFile(bundlePath);
|
|
158
|
+
const bundleHash = createHash('sha256').update(bundleContents).digest('hex');
|
|
159
|
+
const exactDependenciesHash = createHash('sha256')
|
|
160
|
+
.update(JSON.stringify({
|
|
161
|
+
dependencies: Object.entries(exactDependencies).sort(([a], [b]) => a.localeCompare(b)),
|
|
162
|
+
optionalDependencies: Object.entries(exactOptionalDependencies).sort(([a], [b]) => a.localeCompare(b)),
|
|
163
|
+
}))
|
|
164
|
+
.digest('hex');
|
|
140
165
|
return {
|
|
141
166
|
unitName: unit.name,
|
|
142
167
|
bundlePath,
|
|
143
168
|
packageJsonPath,
|
|
169
|
+
exactDependenciesPath,
|
|
144
170
|
metafilePath,
|
|
145
171
|
bundleSizeBytes: bundleStat.size,
|
|
146
|
-
|
|
172
|
+
bundleHash,
|
|
173
|
+
exactDependenciesHash,
|
|
174
|
+
exactDependencies,
|
|
175
|
+
exactOptionalDependencies,
|
|
147
176
|
};
|
|
148
177
|
}
|
|
149
178
|
/**
|
|
@@ -173,7 +202,9 @@ export async function bundleUnits(projectDir, manifest, entryFiles, outputDir, o
|
|
|
173
202
|
});
|
|
174
203
|
continue;
|
|
175
204
|
}
|
|
176
|
-
const unitOutputDir =
|
|
205
|
+
const unitOutputDir = options?.resolveOutputDir
|
|
206
|
+
? options.resolveOutputDir(unit, buildDir)
|
|
207
|
+
: join(buildDir, unit.name);
|
|
177
208
|
try {
|
|
178
209
|
const result = await bundleUnit({
|
|
179
210
|
unit,
|
|
@@ -28,8 +28,11 @@ export declare function parsePackageName(specifier: string): string | null;
|
|
|
28
28
|
* Returns a record of package name to exact version, suitable for
|
|
29
29
|
* writing into a minimal package.json.
|
|
30
30
|
*/
|
|
31
|
-
export declare function extractDependencies(metafile: Metafile, projectDir: string): Promise<
|
|
31
|
+
export declare function extractDependencies(metafile: Metafile, projectDir: string): Promise<{
|
|
32
|
+
exactDependencies: Record<string, string>;
|
|
33
|
+
exactOptionalDependencies: Record<string, string>;
|
|
34
|
+
}>;
|
|
32
35
|
/**
|
|
33
36
|
* Generates a minimal package.json content object for a unit bundle.
|
|
34
37
|
*/
|
|
35
|
-
export declare function generateMinimalPackageJson(unitName: string, dependencies: Record<string, string>): Record<string, unknown>;
|
|
38
|
+
export declare function generateMinimalPackageJson(unitName: string, dependencies: Record<string, string>, optionalDependencies: Record<string, string>): Record<string, unknown>;
|