Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .changeset/devnet-config-hint-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@offckb/cli': patch
---

fix(devnet): only show init hint for InitializationError

The `offckb devnet config` command was showing the "run `offckb node` once to initialize devnet config files first" hint for ALL errors, including user input errors like invalid `--set` syntax or validation failures.

Now the hint is only shown for actual initialization errors (missing config path, ckb.toml, or miner.toml), making error messages clearer and less misleading.

- Added `InitializationError` class to distinguish initialization errors from user input errors
- Updated `createDevnetConfigEditor()` to throw `InitializationError` for missing files/paths
- Modified `devnetConfig()` catch block to only show hint for `InitializationError`
- Added type safety guard for error handling

Fixes #406
14 changes: 14 additions & 0 deletions .changeset/lazy-wasi-warning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@offckb/cli': patch
---

fix(ckb-debugger): lazy-load WASI module to suppress ExperimentalWarning

Convert static import of node:wasi to dynamic import with caching.
This prevents the ExperimentalWarning from being emitted when running
non-debugger commands like 'offckb accounts' or 'offckb config list'.

The WASI module is now only loaded when debugger functionality is
actually executed.

Fixes #405
97 changes: 90 additions & 7 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ name: Changeset Check

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review, labeled]
branches: [master, develop]

jobs:
changeset:
name: Require changeset
verify:
name: Verify Changeset
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changeset') && !contains(github.event.pull_request.labels.*.name, 'dependencies') }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read

steps:
- name: Checkout repository
Expand All @@ -23,14 +28,92 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: '20'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check for changeset
id: check
run: |
echo "Checking for changeset files in this PR..."
echo "If this fails, run 'pnpm changeset' to add a changeset describing your changes."
echo "For changes that don't need a changelog entry (docs, CI, refactoring), use 'pnpm changeset --empty'."
pnpm changeset status --since=origin/${{ github.base_ref }}
if pnpm changeset status --since=origin/${{ github.base_ref }}; then
echo "has_changeset=true" >> $GITHUB_OUTPUT
else
echo "has_changeset=false" >> $GITHUB_OUTPUT
exit 1
fi

- name: Comment on PR (success)
if: steps.check.outputs.has_changeset == 'true'
uses: actions/github-script@v7
with:
script: |
const marker = '<!-- changeset-check -->';
const body = marker + '\n✅ Changeset file detected.';

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});

const existing = comments.find(c => c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
}

- name: Comment on PR (failure)
if: failure()
uses: actions/github-script@v7
with:
script: |
const marker = '<!-- changeset-check -->';
const body = [
marker,
'❌ **Missing Changeset**',
'',
'Please add a changeset describing your changes:',
'```bash',
'pnpm changeset',
'```',
'',
'If your changes do not need a version bump (docs, CI, refactoring),',
'add the `skip-changeset` label to this PR.',
'',
'For dependency updates, use the `dependencies` label.'
].join('\n');

const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});

const existing = comments.find(c => c.body.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
}

skipped:
name: Changeset Check (Skipped)
if: ${{ contains(github.event.pull_request.labels.*.name, 'skip-changeset') || contains(github.event.pull_request.labels.*.name, 'dependencies') }}
runs-on: ubuntu-latest
steps:
- run: echo "⏭️ Changeset check skipped via label"
66 changes: 29 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading