@lunora/codegen 1.0.0-alpha.30 → 1.0.0-alpha.31

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/dist/index.mjs CHANGED
@@ -20,10 +20,10 @@ export { SHAPES_FILENAME, discoverShapes } from './packem_shared/SHAPES_FILENAME
20
20
  export { default as discoverStorageRulesMetadata } from './packem_shared/discoverStorageRulesMetadata-CFHByjIl.mjs';
21
21
  export { WORKFLOWS_FILENAME, discoverWorkflows } from './packem_shared/WORKFLOWS_FILENAME-CCC_42o3.mjs';
22
22
  export { GENERATED_HEADER, emitApi, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers } from './packem_shared/GENERATED_HEADER-f6nMvllu.mjs';
23
- export { emitApp } from './packem_shared/emitApp-DKt3rPtr.mjs';
23
+ export { emitApp } from './packem_shared/emitApp-BUCrHOeI.mjs';
24
24
  export { buildOpenApiDocument, emitOpenApi, emitOpenApiModule } from './packem_shared/buildOpenApiDocument-AgKWmlry.mjs';
25
25
  export { OPENRPC_VERSION, buildOpenRpcDocument, emitOpenRpc, emitOpenRpcModule } from './packem_shared/OPENRPC_VERSION-u5SqDDGk.mjs';
26
- export { SCHEMA_SNAPSHOT_FILENAME, createCodegenProject, refreshCodegenProject, runCodegen } from './packem_shared/SCHEMA_SNAPSHOT_FILENAME-Cpfn80SH.mjs';
26
+ export { SCHEMA_SNAPSHOT_FILENAME, createCodegenProject, refreshCodegenProject, runCodegen } from './packem_shared/SCHEMA_SNAPSHOT_FILENAME-Ca-TlVEc.mjs';
27
27
  export { SCHEMA_SNAPSHOT_VERSION, SchemaSnapshotParseError, buildSchemaSnapshot, diffSchemaSnapshots, evaluateSchemaDrift, parseSchemaSnapshot, serializeSchemaSnapshot } from './packem_shared/SCHEMA_SNAPSHOT_VERSION-D0ARY6rL.mjs';
28
28
  export { schemaFromIr } from './packem_shared/schemaFromIr-DTYsLBaA.mjs';
29
29
  export { LUNORA_ERROR_CODES, validatorIrToJsonSchema } from './packem_shared/LUNORA_ERROR_CODES-CySpQPD3.mjs';
@@ -27,7 +27,7 @@ import discoverStorageRulesMetadata from './discoverStorageRulesMetadata-CFHByjI
27
27
  import { e as enclosingExportName$2 } from './discover-ast-CT6BgBr4.mjs';
28
28
  import { discoverWorkflows } from './WORKFLOWS_FILENAME-CCC_42o3.mjs';
29
29
  import { buildStorageColumns, emitDataModel, emitApi, emitServer, emitFunctions, emitShard, emitCollections, emitContainers, emitWorkflows, emitQueues, emitCrons, emitVectors, emitDrizzleSchema, emitSeed, emitWranglerCronTriggers } from './GENERATED_HEADER-f6nMvllu.mjs';
30
- import { emitApp } from './emitApp-DKt3rPtr.mjs';
30
+ import { emitApp } from './emitApp-BUCrHOeI.mjs';
31
31
  import { buildOpenApiDocument, emitOpenApiModule } from './buildOpenApiDocument-AgKWmlry.mjs';
32
32
  import { buildOpenRpcDocument, emitOpenRpcModule } from './OPENRPC_VERSION-u5SqDDGk.mjs';
33
33
  import { buildSchemaSnapshot, serializeSchemaSnapshot } from './SCHEMA_SNAPSHOT_VERSION-D0ARY6rL.mjs';
@@ -83,7 +83,10 @@ const buildImportLines = (options) => {
83
83
  ...hasGlobal || hasHyperdriveGlobal ? [`import schema from "../schema.js";`] : [],
84
84
  `import { LUNORA_CRONS } from "./crons.js";`,
85
85
  `import { LUNORA_FUNCTIONS } from "./functions.js";`,
86
- ...hasQueue ? [`import { dispatchQueueBatch } from "@lunora/queue";`, `import { LUNORA_QUEUE_REGISTRY } from "./queues.js";`] : [],
86
+ ...hasQueue ? [
87
+ `import { createQueueCaptureSink, dispatchQueueBatch, shouldCaptureQueue } from "@lunora/queue";`,
88
+ `import { LUNORA_QUEUE_REGISTRY } from "./queues.js";`
89
+ ] : [],
87
90
  ...wantsOpenApi ? [`import { openApiSpec } from "./openapi.js";`] : [],
88
91
  ...wantsOpenRpc ? [`import { openRpcSpec } from "./openrpc.js";`] : [],
89
92
  `import { createShardDO } from "./shard.js";`
@@ -416,10 +419,17 @@ const buildBaseWorkerOptions = (options) => [
416
419
  // The push-consumer handler backing the worker's `queue(batch, …)` entry:
417
420
  // routes each delivered batch to its `defineQueue` handler. Built from
418
421
  // `@lunora/queue` here (keeping the runtime decoupled) and wired only when the
419
- // app declares push queues in `lunora/queues.ts`.
422
+ // app declares push queues in `lunora/queues.ts`. In a dev environment (or with
423
+ // `LUNORA_QUEUE_CAPTURE`), every consumed message is recorded into the studio's
424
+ // Queues log via the root shard's `recordQueueMessage` admin RPC.
420
425
  ...options.hasQueue ? [
421
426
  ` queue: (batch: unknown, queueEnv: unknown, _context: ExecutionContextLike): Promise<void> =>`,
422
- ` dispatchQueueBatch(batch as Parameters<typeof dispatchQueueBatch>[0], LUNORA_QUEUE_REGISTRY, { env: queueEnv as Record<string, unknown> }),`
427
+ ` dispatchQueueBatch(batch as Parameters<typeof dispatchQueueBatch>[0], LUNORA_QUEUE_REGISTRY, {`,
428
+ ` capture: shouldCaptureQueue(queueEnv as Record<string, unknown>)`,
429
+ ` ? createQueueCaptureSink(queueEnv as Record<string, unknown>${options.jurisdiction ? `, { jurisdiction: ${JSON.stringify(options.jurisdiction)} }` : ""})`,
430
+ ` : undefined,`,
431
+ ` env: queueEnv as Record<string, unknown>,`,
432
+ ` }),`
423
433
  ] : [],
424
434
  ` routes: this.routeMap,`,
425
435
  ` shardDO: this.shardSelector?.(env) ?? (undefined as unknown as ShardNamespaceLike),`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/codegen",
3
- "version": "1.0.0-alpha.30",
3
+ "version": "1.0.0-alpha.31",
4
4
  "description": "Code generator for Lunora: emits _generated/{api,server,dataModel}.ts from your schema",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -49,7 +49,7 @@
49
49
  "@lunora/advisor": "1.0.0-alpha.17",
50
50
  "@lunora/container": "1.0.0-alpha.6",
51
51
  "@lunora/errors": "1.0.0-alpha.1",
52
- "@lunora/queue": "1.0.0-alpha.3",
52
+ "@lunora/queue": "1.0.0-alpha.4",
53
53
  "@lunora/scheduler": "1.0.0-alpha.5",
54
54
  "@lunora/values": "1.0.0-alpha.4",
55
55
  "@lunora/workflow": "1.0.0-alpha.6",