Skip to content

chore(sdks/runner-protocol): add .cjs and .d.cts to npm publish to fix resolution for cjs#4180

Draft
abcxff wants to merge 1 commit intomainfrom
02-11-chore_sdks_runner-protocol_add_.cjs_and_.d.cts_to_npm_publish_to_fix_resolution_for_cjs
Draft

chore(sdks/runner-protocol): add .cjs and .d.cts to npm publish to fix resolution for cjs#4180
abcxff wants to merge 1 commit intomainfrom
02-11-chore_sdks_runner-protocol_add_.cjs_and_.d.cts_to_npm_publish_to_fix_resolution_for_cjs

Conversation

@abcxff
Copy link
Contributor

@abcxff abcxff commented Feb 11, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link

railway-app bot commented Feb 11, 2026

🚅 Deployed to the rivet-pr-4180 environment in rivet-frontend

Service Status Web Updated (UTC)
website 😴 Sleeping (View Logs) Web Feb 12, 2026 at 12:55 am
frontend-inspector ❌ Build Failed (View Logs) Web Feb 11, 2026 at 8:04 pm
frontend-cloud ❌ Build Failed (View Logs) Web Feb 11, 2026 at 8:04 pm
ladle ❌ Build Failed (View Logs) Web Feb 11, 2026 at 8:03 pm
mcp-hub ✅ Success (View Logs) Web Feb 11, 2026 at 7:33 pm

Copy link
Contributor Author

abcxff commented Feb 11, 2026


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@abcxff abcxff requested a review from NathanFlurry February 11, 2026 19:34
@abcxff abcxff marked this pull request as ready for review February 11, 2026 19:34
@claude
Copy link

claude bot commented Feb 11, 2026

PR Review - Fix CJS Resolution for @rivetkit/engine-runner-protocol

Summary

This PR addresses a CommonJS (CJS) module resolution issue by ensuring .cjs and .d.cts files are published to npm. The changes are minimal and focused.


Code Quality & Changes ✅

Good:

  • The simplification of the files field from specific glob patterns to just "dist" is cleaner and more maintainable
  • This follows the pattern already used in @rivetkit/engine-runner (line 6 of engine/sdks/typescript/runner/package.json)
  • The change correctly ensures all build outputs (including .cjs, .d.cts, and other generated files from tsup) are included

Note: Based on tsup.base.ts:8, the build generates both cjs and esm formats with dts files, so publishing the entire dist folder is appropriate.


CI Workflow Changes ✅

The @rivetkit/db exclusion appears correct:

  • Looking at rivetkit-typescript/packages/db/package.json, this package has peer dependencies on drizzle-kit and drizzle-orm
  • These are marked as optional peer dependencies, which could cause build issues in CI if not installed
  • The corresponding removal from package.json resolutions is consistent

Potential Issues & Concerns

1. Missing Test Coverage ⚠️

  • The PR checklist shows "I have added tests that prove my fix is effective" is unchecked
  • Recommendation: Add a test that verifies CJS import/require works correctly:
    // test/cjs-resolution.test.cjs
    const protocol = require('@rivetkit/engine-runner-protocol');
    // Assert that the module loads correctly

2. Verification of Published Files 📋

Before merging, verify the package contents using:

cd engine/sdks/typescript/runner-protocol
pnpm build
pnpm pack --dry-run

This will show exactly what files will be published and confirm .cjs and .d.cts are included.

3. PR Description Lacks Context 📝

The PR description is templated and doesn't explain:

  • What was the actual bug/issue being fixed?
  • How was this discovered (user report, internal testing)?
  • What error message or behavior occurred before the fix?

Recommendation: Update the PR description with specific details about the resolution issue.


Security & Performance ✅

  • No security concerns
  • No performance implications
  • Changes are purely configuration-related

Style & Conventions ✅

  • Follows the repository's package.json patterns
  • CI workflow change is consistent with other exclusions
  • Conventional commit message format is correct: chore(sdks/runner-protocol): ...

Final Recommendation

Approve with minor suggestions:

  1. ✅ The fix itself is correct and solves the CJS resolution issue
  2. ⚠️ Add a CJS import test to prevent regression
  3. 📝 Update PR description with more context about the issue
  4. ✅ Verify published file list before merging (use pnpm pack --dry-run)

The core changes are sound and follow established patterns in the codebase.

@abcxff abcxff force-pushed the 02-11-chore_sdks_runner-protocol_add_.cjs_and_.d.cts_to_npm_publish_to_fix_resolution_for_cjs branch from d9adcbb to 3456073 Compare February 11, 2026 19:36
@abcxff abcxff force-pushed the 02-11-chore_sdks_runner-protocol_add_.cjs_and_.d.cts_to_npm_publish_to_fix_resolution_for_cjs branch from 3456073 to 0905972 Compare February 11, 2026 19:38
@abcxff abcxff force-pushed the 02-11-chore_sdks_runner-protocol_add_.cjs_and_.d.cts_to_npm_publish_to_fix_resolution_for_cjs branch from 0905972 to e20d235 Compare February 11, 2026 19:46
@abcxff abcxff force-pushed the 02-11-chore_sdks_runner-protocol_add_.cjs_and_.d.cts_to_npm_publish_to_fix_resolution_for_cjs branch from e20d235 to cd074aa Compare February 11, 2026 19:59
@abcxff abcxff force-pushed the 02-11-chore_sdks_runner-protocol_add_.cjs_and_.d.cts_to_npm_publish_to_fix_resolution_for_cjs branch from cd074aa to ba25358 Compare February 11, 2026 20:01
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 11, 2026

More templates

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4180

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4180

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@4180

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4180

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4180

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4180

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4180

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4180

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4180

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4180

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4180

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4180

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4180

commit: ba25358

@abcxff abcxff removed the request for review from NathanFlurry February 11, 2026 20:35
@abcxff abcxff marked this pull request as draft February 11, 2026 20:35
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

Comments