Fix: Add npm Scripts for Hardhat Development Workflow#104
Fix: Add npm Scripts for Hardhat Development Workflow#104Pushkar111 wants to merge 1 commit intoStabilityNexus:mainfrom
Conversation
- Added standard Hardhat scripts (node, compile, test, clean) - Added 'dev' script to start local Hardhat node - Added web frontend shortcuts (web:dev, web:build, web:start, web:lint) - Enables consistent npm-style workflow for contributors Fixes StabilityNexus#100
WalkthroughAdded a new Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fix: Add npm Scripts for Hardhat Development Workflow
Problem
Running
npm run devfails with "Missing script: 'dev'" because the rootpackage.jsonhas noscriptssection.Current Behavior:
npm run dev # ❌ Error: Missing script: "dev"Root Cause:
The
scriptssection was completely absent frompackage.json. Hardhat projects traditionally usenpx hardhat <command>, but this is not discoverable for contributors expecting a standard npm workflow as documented in the README.Solution
Added comprehensive
scriptssection to rootpackage.jsonwith standard Hardhat commands and web frontend shortcuts.Changes Made
File:
package.json(root)Added Scripts Section
Available Commands
Hardhat (Blockchain):
npm run dev- Start local Hardhat nodenpm run compile- Compile smart contractsnpm test- Run contract testsnpm run test:coverage- Generate coverage reportnpm run clean- Clean build artifactsWeb (Frontend):
npm run web:dev- Start Next.js dev servernpm run web:build- Build for productionnpm run web:start- Start production servernpm run web:lint- Run ESLintKey Features
npm run devnow works as documented in READMEnpx hardhatstill works)Testing
Verification
Before Fix
npm run dev # ❌ Error: Missing script: "dev"After Fix
npm run dev # ✅ Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/How to Test
Files Changed
Checklist
npm run devcommandnpm runto list scriptsRelated Issues
Fixes #100
Ready for review! 🚀
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.