Fix: Add npm Scripts for Hardhat Development Workflow #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.