verify-dist

โดย sentry

สร้าง dist/index.js ใหม่และ commit เมื่อไฟล์ต้นฉบับหรือ dependencies ที่ใช้ตอน runtime เปลี่ยนแปลง

npx skills add https://github.com/getsentry/action-release --skill verify-dist

Verify Dist Skill

action-release ships a bundle in dist/ built by ncc. The verify-dist CI workflow (.github/workflows/verify-dist.yml) fails any PR where the committed bundle does not match the source. This skill keeps them in sync locally.

dist/ is a directory, not a single file. Alongside dist/index.js, ncc emits code-split chunks (dist/319.index.js and friends) for every dynamic import() in a dependency. @opentelemetry/resources loads its per-platform getMachineId that way, so the chunks arrive with @sentry/node. index.js loads them at runtime with a relative require, so they must sit next to it and must all be committed.

When to invoke

  • You changed anything under src/.
  • You bumped a runtime dep in package.json (anything under dependencies, not devDependencies).
  • CI posted "Detected uncommitted changes after build" on a PR.

Modes

--check (default)

Report whether dist/ is in sync with the current source tree. Do not modify anything.

yarn install --frozen-lockfile
yarn build
git diff --ignore-space-at-eol --stat dist/
git ls-files --others --exclude-standard dist/   # new chunks show up here, not in git diff
  • If both commands print nothing → dist/ is in sync. Done.
  • If either prints something → report the changed files and line counts, then ask the user whether to switch to --fix.

--fix

Rebuild and stage dist/.

yarn install
yarn build
git add dist/
git status --short dist/

Do not commit automatically — let the user review the bundle diff first. A reasonable follow-up commit message:

build: regenerate dist/index.js

Or, if tied to a source change:

<type>(<scope>): <summary>

Regenerates dist/index.js.

Before the user commits: pre-commit hook reminder

Whoever runs the follow-up commit needs the repo's pre-commit hooks installed. Verify with ls .git/hooks/pre-commit; if missing, run make (installs yarn deps + pre-commit install) or pre-commit install.

If a hook modifies files, the commit fails. Recover by staging the modified files and committing again (never --amend, because the hook-failed commit never landed):

git add <modified files>
git commit -m "<same message>"

Notes

  • The CI check runs git diff --ignore-space-at-eol dist/ — whitespace-only diffs pass, anything else fails. Match that locally.
  • CI also fails on untracked files in dist/ via git ls-files --others --exclude-standard dist/. git diff alone never reports a brand-new chunk, so a missing chunk would otherwise pass CI and only break at runtime on whichever platform needs it.
  • yarn build shells out to ncc build src/main.ts -e @sentry/cli. @sentry/cli is deliberately excluded from the bundle because it ships its own native binaries at runtime.
  • The bundle diff can be large even for small source changes (minifier + bundler reshuffles). That is expected; just verify the intended symbols are present.
  • Never hand-edit dist/index.js or any chunk. Always regenerate.

Related files

  • .github/workflows/verify-dist.yml — the CI check this skill satisfies.
  • package.json → scripts.build — the canonical build command.
  • src/main.ts — the ncc entry point.

Skills เพิ่มเติมจาก sentry

add-ai-integration
sentry
เพิ่มการรวมผู้ให้บริการ AI ใหม่เข้าไปใน Sentry JavaScript SDK ใช้เมื่อมีส่วนร่วมในการสร้างเครื่องมือวัด AI ใหม่ (OpenAI, Anthropic, Vercel AI, LangChain ฯลฯ)…
add-cdn-bundle
sentry
สร้างชุด CDN ใหม่สำหรับแพ็กเกจเบราว์เซอร์ที่มีฟีเจอร์ที่ระบุ
agent-prompt
sentry
คู่มืออ้างอิงสำหรับการเขียนพรอมต์และสกิลของเอเจนต์อย่างมีประสิทธิภาพ ใช้เมื่อสร้างสกิลใหม่ ตรวจสอบคุณภาพของพรอมต์ หรือทำความเข้าใจพรอมต์ของ Warden…
agents-md
sentry
ทักษะนี้ควรใช้เมื่อผู้ใช้ขอให้ "สร้าง AGENTS.md", "อัปเดต AGENTS.md", "ดูแลเอกสารเอเจนต์", "ตั้งค่า CLAUDE.md" หรือต้องการให้เอเจนต์…
agents-md
sentry
สร้างและดูแลเอกสารเอเจนต์ที่สั้นกระชับ มีเนื้อหาสำคัญ ภายใต้ 60 บรรทัด บังคับใช้แนวปฏิบัติที่ดีที่สุดที่ผ่านการวิจัยสำหรับเอกสารที่เอเจนต์ใช้ คุณภาพของคำสั่งจะลดลงตามความยาว ต้องมีสามส่วนหลัก: Package Manager, File-Scoped Commands (test/lint/typecheck ต่อไฟล์), และ Commit Attribution พร้อมระบุตัวตนเอเจนต์ วิเคราะห์โครงสร้างโปรเจกต์ (ไฟล์ lock, ไฟล์กำหนดค่า linter, คำสั่ง CI, ตัวบ่งชี้ monorepo) เพื่อกำหนดสิ่งที่ควรอยู่ในไฟล์ ใช้เฉพาะหัวข้อและสัญลักษณ์แสดงหัวข้อย่อย อ้างอิง...
agents-md
sentry
ทักษะนี้ควรใช้เมื่อผู้ใช้ขอให้ "สร้าง AGENTS.md", "อัปเดต AGENTS.md", "ดูแลเอกสารเอเจนต์", "ตั้งค่า CLAUDE.md" หรือต้องการให้เอเจนต์…
ai-sdk
sentry
ai-sdk — ทักษะที่สามารถติดตั้งได้สำหรับเอเจนต์ AI เผยแพร่โดย getsentry/webvitals.com
analytics
sentry
เครื่องมือและค้นพบเหตุการณ์วิเคราะห์ใน UI ส่วนหน้าของ Sentry ใช้เมื่อเพิ่มการติดตามไปยังปุ่ม หน้า โมดอล หรือการโต้ตอบที่กำหนดเอง เมื่อกำหนดใหม่…