Skip to content

Validate and repair missing Rolldown native deps during webviewer scaffold#268

Open
eluce2 wants to merge 3 commits into
mainfrom
codex/fix-scaffold-native-deps
Open

Validate and repair missing Rolldown native deps during webviewer scaffold#268
eluce2 wants to merge 3 commits into
mainfrom
codex/fix-scaffold-native-deps

Conversation

@eluce2
Copy link
Copy Markdown
Collaborator

@eluce2 eluce2 commented May 17, 2026

Summary

  • Validate fresh pnpm webviewer scaffolds with pnpm exec vite --version after install
  • Repair missing Rolldown native bindings by forcing a clean reinstall when validation hits the native-binding error signature
  • Surface clear recovery text when validation or repair still fails
  • Add executor coverage for success, repair, and post-repair failure paths

Testing

  • Added unit coverage for the new validation and repair flow
  • packages/cli executor tests pass
  • pnpm run ci passes when PROOFKIT_MANIFEST_REVALIDATE_SECRET is set locally

Summary by CodeRabbit

  • Bug Fixes

    • Fixed webviewer scaffold installs by validating Vite native dependencies and automatically repairing missing native bindings during setup.
  • Tests

    • Added tests covering native-dependency validation, repair and failure paths.
    • Test harness extended to script simulated command results for more precise testing.
  • Chores

    • Added a Changeset entry for a patch release.
  • CI

    • Added a build environment variable for manifest revalidation.

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 17, 2026

🦋 Changeset detected

Latest commit: 375b748

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@proofkit/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
proofkit-docs Skipped Skipped May 17, 2026 4:34pm

Request Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 17, 2026

Open in StackBlitz

@proofkit/better-auth

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/better-auth@268

@proofkit/cli

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/cli@268

create-proofkit

pnpm add https://pkg.pr.new/proofsh/proofkit/create-proofkit@268

@proofkit/fmdapi

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/fmdapi@268

@proofkit/fmodata

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/fmodata@268

@proofkit/typegen

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/typegen@268

@proofkit/webviewer

pnpm add https://pkg.pr.new/proofsh/proofkit/@proofkit/webviewer@268

commit: 375b748

@eluce2 eluce2 marked this pull request as ready for review May 17, 2026 16:24
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 061550f3-a05d-463f-818a-cdb7dedd3695

📥 Commits

Reviewing files that changed from the base of the PR and between 8b54a24 and 375b748.

📒 Files selected for processing (3)
  • packages/cli/src/core/executeInitPlan.ts
  • packages/cli/tests/executor.test.ts
  • packages/cli/tests/test-layer.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/cli/tests/test-layer.ts
  • packages/cli/tests/executor.test.ts

📝 Walkthrough

Walkthrough

Adds webviewer+pnpm Vite validation (runs pnpm exec vite --version) with Rolldown-native-binding detection and an automatic repair that removes node_modules/pnpm-lock.yaml and forces reinstall; test layer gains scripted process runs and tests cover success, repair, and repeated-failure diagnostics; release metadata and workflow env vars updated.

Changes

Vite Native Dependency Validation

Layer / File(s) Summary
Test scaffolding enhancements for process result scripting
packages/cli/tests/test-layer.ts
makeTestLayer accepts an optional processRuns map to script ProcessService.run results per command, and ProcessService.run consumes queued scripted results to drive test scenarios.
Vite validation and native binding repair logic
packages/cli/src/core/executeInitPlan.ts
Adds destructured CLI error imports, a Rolldown-native-binding detection regex, getErrorDetails/isRolldownNativeBindingError helpers, and a webviewer+pnpm-only validation-and-repair step that runs pnpm exec vite --version, conditionally removes node_modules/pnpm-lock.yaml, runs pnpm install --force, re-validates, and throws composed ExternalCommandError diagnostics on failure.
Feature verification tests for validation and repair
packages/cli/tests/executor.test.ts
Updates expected command sequence to include pnpm exec vite --version. Adds tests for successful validation, repair-on-missing-Rolldown-binding (with warnings and forced reinstall), and repeated validation failure returning an ExternalCommandError including manual recovery instructions.
Release metadata and workflow environment setup
.changeset/quiet-bikes-validate.md, .github/workflows/release.yml
Adds a Changeset documenting a patch for @proofkit/cli describing the Vite/native-deps fix and injects PROOFKIT_MANIFEST_REVALIDATE_SECRET: ci-build-placeholder into Build steps in the release workflow.

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • proofsh/proofkit#259: Modifies executeInitPlan.ts pnpm install flow; related at the code-level to pnpm/vite install behavior.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 title accurately summarizes the main change: validating and repairing missing Rolldown native dependencies during webviewer scaffold installation. It is specific, concise, and directly related to the primary objective of the pull request.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-scaffold-native-deps

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@packages/cli/src/core/executeInitPlan.ts`:
- Line 44: The hardcoded POSIX-only repair string PNPM_ROLLDOWN_REPAIR_COMMAND
uses `rm -rf` which breaks on Windows; replace it with a platform-agnostic
recovery message or provide platform-specific commands: emit a human-readable
instruction like "Delete node_modules and pnpm-lock.yaml, then run: pnpm install
--force" or detect process.platform and offer `rm -rf node_modules
pnpm-lock.yaml && pnpm install --force` for POSIX and `rmdir /s /q node_modules
& del pnpm-lock.yaml & pnpm install --force` for Windows; update every
occurrence of the same repair string (including the other instances noted) so
all user-facing recovery instructions use the new cross-platform wording or
detection logic.

In `@packages/cli/tests/test-layer.ts`:
- Around line 352-363: The code currently checks "if (scriptedResult)" which
skips falsy queued entries (e.g. "", 0, false, null) and can wrongly fall back
to default behavior; change the existence check to "scriptedResult !==
undefined" (or "typeof scriptedResult !== 'undefined'") so the value popped from
options.processRuns?.[processCommand]?.shift() is always consumed even when
falsy, then keep the same branching that uses Effect.succeed when it's an object
with stdout/stderr and Effect.fail otherwise (references: variable
scriptedResult, options.processRuns, processCommand, Effect.succeed,
Effect.fail).
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0ccd713c-c878-46aa-832d-50af51adeeaa

📥 Commits

Reviewing files that changed from the base of the PR and between 2b6b208 and 8b54a24.

📒 Files selected for processing (5)
  • .changeset/quiet-bikes-validate.md
  • .github/workflows/release.yml
  • packages/cli/src/core/executeInitPlan.ts
  • packages/cli/tests/executor.test.ts
  • packages/cli/tests/test-layer.ts

Comment thread packages/cli/src/core/executeInitPlan.ts Outdated
Comment thread packages/cli/tests/test-layer.ts
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.

2 participants