#3973: fix: enhance npm package integrity checks and include critical files
scripts
Cluster:
OpenClaw Plugin Enhancements
- Added `dist/entry.js` to the npm package to prevent global install failures.
- Introduced a new `verify-package.js` script to verify the presence of critical files before publishing.
- Updated the `prepack` script in `package.json` to include the verification step.
Issue #3914
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the npm package contents and publish flow by:
- Adding `dist/entry.js` to the `files` allowlist so it’s included in the published tarball.
- Adding a new `scripts/verify-package.js` step to the `prepack` script to fail fast if critical publish artifacts are missing.
- Adding a small Vitest test that asserts `package.json` includes the new file and `prepack` runs verification.
The intent aligns with prior packaging fixes in this repo (preventing `ERR_MODULE_NOT_FOUND` on install), but the verification step currently appears to require an artifact (`dist/entry.js`) that isn’t produced by the build in this repository, which could make `prepack`/packing fail until the build pipeline generates it.
<h3>Confidence Score: 3/5</h3>
- This PR is close to safe to merge, but may break the publish/pack flow if `dist/entry.js` is not actually generated.
- The change is small and isolated, but `prepack` is now gated on a new verification script that asserts `dist/entry.js` exists; a repo-wide search did not find any `dist/**` source for that file, suggesting `prepack`/`pnpm pack` would fail unless another step creates it.
- scripts/verify-package.js, package.json
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#8988: fix: resolve security vulnerabilities in dependencies
by fotorpics · 2026-02-04
81.7%
#11048: fix: address repository issues (env, author, CI comments, security ...
by cavula · 2026-02-07
80.7%
#11951: Prepending Windows Node to PATH didn’t help
by tranhoangtu-it · 2026-02-08
80.3%
#11415: Update package.json metadata for npm discoverability
by PythonUser42 · 2026-02-07
79.7%
#9914: fix(hooks): resolve bundled hook dist paths and packaging checks
by zimmra · 2026-02-05
78.7%
#7824: fix(ui): remove --prod install flag that causes vite not found error
by adityarao3 · 2026-02-03
78.6%
#20843: docs: add troubleshooting for A2UI bundling and missing node_modules
by yahiag04 · 2026-02-19
77.7%
#6888: feat: PowerShell completion install/uninstall + templates script + ...
by ThinkIbrokeIt · 2026-02-02
77.5%
#14112: test(security): harden plugin install against script execution
by davidahmann · 2026-02-11
77.5%
#2753: fix: Support nested packages in pnpm-workspace.yaml (#2745)
by HarshalJain-cs · 2026-01-27
77.4%