This guide explains how to test the GyroGovernance extension in different environments.
Load the extension in Chrome for full functionality:
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
dist/folder - The extension will appear in your extensions toolbar
Use webpack-dev-server for instant hot reload during development:
# Start dev server with hot reload
npm run dev-serverThe server will automatically open http://localhost:3000/sidepanel.html with hot module replacement enabled.
For static file serving (without hot reload):
# Build and serve static files
npm run serve-static
# Or just serve (if already built)
npm run serveYou can open dist/sidepanel.html directly in your browser, but:
- Import functionality may not work due to CORS restrictions
- Some features may be limited
- Use the local web server instead for better testing
The "Import Official Results" feature works in:
- ✅ Chrome Extension mode
- ✅ Local web server (http://localhost:3000)
- ❌ Direct file:// loading (CORS restrictions)
We use a single, consistent assets layout in both dev and prod:
-
Source of truth:
assets/assets/icons/*assets/media/*assets/fonts/*assets/files/results.zip
-
Dev server: serves assets at
/assets/... -
Production build: copies subfolders into
dist/assets/...
Manifest and code now reference assets/... paths, so both dev and prod resolve identically.
- Use the local web server:
npm run dev-server - Or load as a Chrome extension
- This was a bug that has been fixed
- The insights are now properly saved to storage
- Try importing again
- Ensure
assets/files/results.zipexists in the repository - Rebuild the project:
npm run build
For the fastest development experience with automatic hot reload:
npm run dev-serverThis will:
- ✅ Start webpack-dev-server with Hot Module Replacement (HMR)
- ✅ Automatically rebuild and refresh when you save files
- ✅ Open your browser to http://localhost:3000/sidepanel.html
- ✅ Preserve React component state during updates when possible
No manual rebuilds needed! Just save your files and see changes instantly.
If you prefer manual control or need to test the production build:
- Make changes to source code
- Run
npm run buildto compile - Test with either:
- Chrome extension (reload the extension)
- Local server (
npm run serve-static)
- Repeat as needed
We use Jest for unit tests (e.g., core calculations for QI, SI, AR).
Commands:
# Run all tests once
npm run test
# Watch mode (reruns on file changes)
npm run test:watch
# Coverage report
npm run test:coverageNotes:
- Test suite location:
src/lib/calculations.test.ts - Tested areas include Superintelligence Index (SI), Quality Index (QI), Alignment Rate (AR), and aggregation helpers
- If tests fail to run, ensure dependencies are installed:
npm install
public/is not a standalone build; it's a source for the HTML template andmanifest.jsononly.- We removed
public/fontsandpublic/icons. Do not store assets inpublic/. - Dev server serves
/assetsdirectly from the rootassets/directory.