Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: more permissive registration destructuring - #187

Merged
RohinBhargava merged 3 commits into
mainfrom
rohin/fix-worker-semantics
May 12, 2026
Merged

fix: more permissive registration destructuring#187
RohinBhargava merged 3 commits into
mainfrom
rohin/fix-worker-semantics

Conversation

@RohinBhargava

@RohinBhargava RohinBhargava commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Bumped many runtime/dev dependencies and refreshed dev tooling across framework, blueprints, and implementations; updated CI pnpm version and workspace build allowlist; updated .gitignore and package manager pin.
  • New / Integrations
    • Stripe integration upgraded to a newer Stripe API version.
  • New Features
    • Generated worker templates now include event encryption/decryption support.
  • Tests
    • Added unit tests improving function parameter extraction parsing.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89a2af6c-335f-4743-99b1-280c6ae5a136

📥 Commits

Reviewing files that changed from the base of the PR and between 4b95fdc and dec4a55.

📒 Files selected for processing (5)
  • .github/workflows/build_blueprint.yml
  • .github/workflows/build_framework.yml
  • blueprint/pnpm-workspace.yaml
  • framework/pnpm-workspace.yaml
  • package.json
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/build_blueprint.yml
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • framework/pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

Workspace-wide dependency and package version bumps; extractArgumentNames refactor with tests; CLI codegen now emits encryption-aware worker factories and injects them into registrations templates; Stripe apiVersion and pnpm/CI/workspace configurations updated.

Changes

Workspace Version Update and Code Refactor

Layer / File(s) Summary
Blueprint, interface, and implementation updates
blueprint/*, blueprint/interfaces/*, blueprint/implementations/*
Bumped package versions and updated dependency ranges across blueprint packages, interfaces, and implementations; added changelog entries for patch releases.
Framework package versions
framework/*
Bumped framework package versions and updated dependency/devDependency pins and changelogs across many framework packages.
CLI package-json constants
cli/src/core/package_json/package_json_constants.rs
Updated pinned version constants used by the CLI generator for Node types, Jest, TypeScript tooling, workspace package pins, Mikro-ORM, and several third-party libs.
Worker encryption factory generation
cli/src/core/worker_type.rs
Producer/consumer factory templates updated to accept EventEncryptor, wrap consumers with decryption helpers, and return EncryptingWorkerProducer wrappers for producers.
Registration template transformation
cli/src/core/ast/transformations/*, cli/src/templates/project/service/registrations.ts
Replaced inline WorkerProducer/WorkerConsumer factory implementations with placeholder factories and inject helper-generated factory expressions into registrations template; adjusted Rust transform format! placeholders.
extractArgumentNames parser refactor & tests
framework/common/src/extractArgumentNames.ts, framework/common/__test__/extractArgumentNames.test.ts
Replaced regex-based extraction with a multi-stage parser that validates parameter-list boundaries, respects nested braces/brackets/parentheses, strips top-level type annotations, and added tests for destructured/typed parameters.
Stripe apiVersion, pnpm, CI, and root settings
blueprint/billing-stripe/scripts/*, blueprint/pnpm-workspace.yaml, framework/pnpm-workspace.yaml, .github/workflows/*, package.json, .gitignore
Bumped Stripe apiVersion in scripts; added pnpm allowBuilds allowlists; pinned pnpm in CI to v11.1.0; updated root packageManager and added .pnpm-store to .gitignore.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

"🐰
I hopped through updates, version by version bright —
Parsers now parse clean and factories encrypt right.
Stripe got a nudge, the workspace trimmed its build,
A carrot for reviewers — the repo's neatly tilled! 🥕"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: more permissive registration destructuring' directly relates to the main changes in the changeset, specifically modifications to destructuring logic in the CLI transformation files (transform_registrations_ts.rs and transform_service_to_worker.rs) that make parameter destructuring more flexible.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rohin/fix-worker-semantics

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
cli/src/core/worker_type.rs (1)

132-164: 💤 Low value

Remove redundant type cast on tenantId.

The cast (context?.tenantId as string) is unnecessary. Since tenantId is already typed as string | undefined in the context, and the ?? '' operator safely defaults to an empty string, the explicit cast adds no value and can be removed. The code is safe as-is, but removing the cast improves clarity.

(context?.tenantId ?? '')
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/src/core/worker_type.rs` around lines 132 - 164, Remove the unnecessary
type cast on tenantId inside the factory string literals: update
BULLMQ_WORKER_PRODUCER_FACTORY, KAFKA_WORKER_PRODUCER_FACTORY, and
REDIS_WORKER_PRODUCER_FACTORY to replace occurrences of "(context?.tenantId as
string) ?? ''" with "(context?.tenantId ?? '')", i.e., edit the embedded JS
factory strings so they no longer include the redundant "as string" cast while
preserving the nullish coalescing fallback to ''.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@blueprint/iam-better-auth/package.json`:
- Line 58: The package now depends on "uuid": "^14.0.0" which requires Node.js
20+, so update the package manifest to declare the Node.js engine or revert the
uuid upgrade; specifically, in blueprint/iam-better-auth package.json add an
"engines" field (e.g. "node": ">=20") to make the requirement explicit for
consumers or CI, or alternatively pin "uuid" back to a Node 18-compatible
version (e.g. ^13.0.0) if you must keep Node 18 support—update the package.json
near the "uuid": "^14.0.0" entry and ensure any CI/tooling respects the engine
constraint.

In `@framework/core/package.json`:
- Around line 97-108: The package.json mixes OpenTelemetry release lines (e.g.,
"@opentelemetry/sdk-logs", "@opentelemetry/sdk-node",
"@opentelemetry/exporter-trace-otlp-http",
"@opentelemetry/instrumentation-http", "@opentelemetry/resources",
"@opentelemetry/sdk-metrics", "@opentelemetry/sdk-trace-node"); update these
entries so they all use the same release line (choose either the stable 2.7.x
line or the experimental 0.217.x line) and change each version string
accordingly to be consistent across all OpenTelemetry packages in the file.

---

Nitpick comments:
In `@cli/src/core/worker_type.rs`:
- Around line 132-164: Remove the unnecessary type cast on tenantId inside the
factory string literals: update BULLMQ_WORKER_PRODUCER_FACTORY,
KAFKA_WORKER_PRODUCER_FACTORY, and REDIS_WORKER_PRODUCER_FACTORY to replace
occurrences of "(context?.tenantId as string) ?? ''" with "(context?.tenantId ??
'')", i.e., edit the embedded JS factory strings so they no longer include the
redundant "as string" cast while preserving the nullish coalescing fallback to
''.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c24cb2b6-2b1c-41f2-8605-286ae5331cff

📥 Commits

Reviewing files that changed from the base of the PR and between 0c8ab1e and c43ad4d.

⛔ Files ignored due to path filters (2)
  • blueprint/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • framework/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (63)
  • blueprint/billing-base/package.json
  • blueprint/billing-stripe/package.json
  • blueprint/billing-stripe/scripts/seed-plans-from-stripe.ts
  • blueprint/billing-stripe/scripts/sync-stripe-plans.ts
  • blueprint/core/package.json
  • blueprint/iam-base/package.json
  • blueprint/iam-better-auth/package.json
  • blueprint/implementations/billing/base/CHANGELOG.md
  • blueprint/implementations/billing/base/package.json
  • blueprint/implementations/billing/stripe/CHANGELOG.md
  • blueprint/implementations/billing/stripe/package.json
  • blueprint/implementations/iam/base/CHANGELOG.md
  • blueprint/implementations/iam/base/package.json
  • blueprint/implementations/worker/bullmq/CHANGELOG.md
  • blueprint/implementations/worker/bullmq/package.json
  • blueprint/implementations/worker/database/CHANGELOG.md
  • blueprint/implementations/worker/database/package.json
  • blueprint/implementations/worker/kafka/CHANGELOG.md
  • blueprint/implementations/worker/kafka/package.json
  • blueprint/implementations/worker/redis/CHANGELOG.md
  • blueprint/implementations/worker/redis/package.json
  • blueprint/interfaces/billing/CHANGELOG.md
  • blueprint/interfaces/billing/package.json
  • blueprint/interfaces/iam/CHANGELOG.md
  • blueprint/interfaces/iam/package.json
  • blueprint/interfaces/worker/CHANGELOG.md
  • blueprint/interfaces/worker/package.json
  • blueprint/monitoring/package.json
  • blueprint/package.json
  • blueprint/sample-worker/package.json
  • cli/src/core/ast/transformations/transform_registrations_ts.rs
  • cli/src/core/ast/transformations/transform_service_to_worker.rs
  • cli/src/core/package_json/package_json_constants.rs
  • cli/src/core/worker_type.rs
  • cli/src/templates/project/service/registrations.ts
  • framework/bunrun/CHANGELOG.md
  • framework/bunrun/package.json
  • framework/common/CHANGELOG.md
  • framework/common/__test__/extractArgumentNames.test.ts
  • framework/common/package.json
  • framework/common/src/extractArgumentNames.ts
  • framework/core/CHANGELOG.md
  • framework/core/package.json
  • framework/e2e-tests/package.json
  • framework/express/CHANGELOG.md
  • framework/express/package.json
  • framework/hyper-express/CHANGELOG.md
  • framework/hyper-express/package.json
  • framework/infrastructure/S3/CHANGELOG.md
  • framework/infrastructure/S3/package.json
  • framework/infrastructure/redis/CHANGELOG.md
  • framework/infrastructure/redis/package.json
  • framework/internal/CHANGELOG.md
  • framework/internal/package.json
  • framework/package.json
  • framework/testing/CHANGELOG.md
  • framework/testing/package.json
  • framework/universal-sdk/CHANGELOG.md
  • framework/universal-sdk/package.json
  • framework/validator/CHANGELOG.md
  • framework/validator/package.json
  • framework/ws/CHANGELOG.md
  • framework/ws/package.json

Comment thread blueprint/iam-better-auth/package.json
Comment thread framework/core/package.json
@RohinBhargava
RohinBhargava merged commit 6ab28cb into main May 12, 2026
12 checks passed
@RohinBhargava
RohinBhargava deleted the rohin/fix-worker-semantics branch May 12, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant