Skip to content

fix(ci): use napi create-npm-dir for @napi-rs/cli v2 in SDK release#60

Merged
amondnet merged 1 commit into
mainfrom
fix/napi-create-npm-dir
Jun 27, 2026
Merged

fix(ci): use napi create-npm-dir for @napi-rs/cli v2 in SDK release#60
amondnet merged 1 commit into
mainfrom
fix/napi-create-npm-dir

Conversation

@amondnet

@amondnet amondnet commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the SDK release workflow (release-sdk.yml) which was calling bunx napi create-npm-dirs (plural) — a subcommand that only exists in @napi-rs/cli v3. The repo pins @napi-rs/cli@^2.18.4 (see crates/csp-node/package.json), and v2 does not recognize create-npm-dirs, causing the workflow to fail with "Command not found".

Changes

  • Replace bunx napi create-npm-dirsbunx napi create-npm-dir (singular, the correct v2 subcommand)
  • Update the inline comment to match the corrected subcommand name

Root Cause

create-npm-dirs (plural) is the v3 CLI name; create-npm-dir (singular) is the v2 name. Since the project pins v2, the singular form is required.

Test Plan

  • Trigger the SDK release workflow after merging to confirm the Assemble platform packages step passes

Summary by cubic

Fix SDK release workflow by using the correct napi subcommand for @napi-rs/cli v2. This removes the "Command not found" error and unblocks the "Assemble platform packages" step.

  • Bug Fixes
    • Replace bunx napi create-npm-dirs with bunx napi create-npm-dir and update the inline comment.

Written for commit c1224e8. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Updated the SDK release packaging workflow to use the latest build directory generation step.

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0febd80e-565c-44f5-932d-b7e3b4da2e92

📥 Commits

Reviewing files that changed from the base of the PR and between ee44a24 and c1224e8.

📒 Files selected for processing (1)
  • .github/workflows/release-sdk.yml

📝 Walkthrough

Walkthrough

The SDK release workflow now uses bunx napi create-npm-dir in the platform package assembly step. The rest of the publish job still downloads native artifacts, stages them under crates/csp-node/artifacts, and publishes the platform packages and wrapper package.

Changes

SDK release workflow

Layer / File(s) Summary
Assemble platform packages
.github/workflows/release-sdk.yml
The publish job runs bunx napi create-npm-dir instead of bunx napi create-npm-dirs in the platform package assembly step.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hopped through release night glow,
One tiny command made the packages go.
create-npm-dir was the clue today,
Thump-thump—ship it on its merry way. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the workflow fix and the npm subcommand change for the SDK release.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/napi-create-npm-dir

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

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Jun 27, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a broken step in the SDK release workflow by correcting the @napi-rs/cli v2 subcommand name from create-npm-dirs (plural, which only exists in v3) to create-npm-dir (singular, the correct v2 form). The napi-rs v2→v3 migration guide explicitly documents this rename, confirming the fix is accurate for the pinned @napi-rs/cli@^2.18.4.

  • Subcommand corrected: bunx napi create-npm-dirsbunx napi create-npm-dir in the Assemble platform packages step of the publish job.
  • Comment updated: The inline comment above the step is updated to match the corrected command name.

Confidence Score: 5/5

Safe to merge — the change is a single-word fix to a broken CI command with no impact on build logic, artifact handling, or publish behavior.

The napi-rs v2→v3 migration guide explicitly documents that create-npm-dir (singular) was renamed to create-npm-dirs (plural) in v3. With @napi-rs/cli@^2.18.4 pinned in package.json, the singular form is correct and the publish job's Assemble platform packages step will now succeed where it previously failed with "Command not found".

No files require special attention. The only changed file is the workflow YAML, and the edit is minimal and well-scoped.

Important Files Changed

Filename Overview
.github/workflows/release-sdk.yml Changes bunx napi create-npm-dirsbunx napi create-npm-dir (and updates the inline comment to match) — correct fix for the @napi-rs/cli@^2.18.4 (v2) pin, where the plural form did not yet exist and caused a "Command not found" failure.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant RP as release-please.yml
    participant SDK as release-sdk.yml
    participant Build as build (matrix)
    participant Publish as publish

    RP->>SDK: "workflow_call (publish=true)"
    SDK->>Build: build native addon (6 targets)
    Build-->>Build: bunx napi build --platform --release
    Build-->>SDK: upload artifact csp-sdk-target

    SDK->>Publish: needs: build
    Publish->>Publish: bun install
    Publish->>Publish: "download-artifact (csp-sdk-*)"
    Note over Publish: bunx napi create-npm-dir (v2)
    Publish->>Publish: bunx napi artifacts --dir artifacts
    Publish->>npm: npm publish (per-platform pkgs)
    Publish->>npm: "npm publish (wrapper @pleaseai/csp-sdk)"
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant RP as release-please.yml
    participant SDK as release-sdk.yml
    participant Build as build (matrix)
    participant Publish as publish

    RP->>SDK: "workflow_call (publish=true)"
    SDK->>Build: build native addon (6 targets)
    Build-->>Build: bunx napi build --platform --release
    Build-->>SDK: upload artifact csp-sdk-target

    SDK->>Publish: needs: build
    Publish->>Publish: bun install
    Publish->>Publish: "download-artifact (csp-sdk-*)"
    Note over Publish: bunx napi create-npm-dir (v2)
    Publish->>Publish: bunx napi artifacts --dir artifacts
    Publish->>npm: npm publish (per-platform pkgs)
    Publish->>npm: "npm publish (wrapper @pleaseai/csp-sdk)"
Loading

Reviews (1): Last reviewed commit: "fix(ci): use napi create-npm-dir for @na..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@sonarqubecloud

Copy link
Copy Markdown

@amondnet amondnet self-assigned this Jun 27, 2026
@amondnet amondnet merged commit a7445f0 into main Jun 27, 2026
10 checks passed
@amondnet amondnet deleted the fix/napi-create-npm-dir branch June 27, 2026 13:20
@pleaseai-bot pleaseai-bot Bot mentioned this pull request Jun 27, 2026
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