Before pushing to GitHub, run the complete local validation for all npm packages:
# 1. microsoft-trydotnet
cd src/microsoft-trydotnet
npm ci
npm run buildProd
# 2. microsoft-trydotnet-editor
cd ../microsoft-trydotnet-editor
npm ci
npm run buildProd
# 3. microsoft-trydotnet-styles
cd ../microsoft-trydotnet-styles
npm ci
npm run buildProd
# 4. microsoft-learn-mock
cd ../microsoft-learn-mock
npm ci
npm run buildProdAll builds must complete without errors. Warnings are acceptable (e.g., polyglot-notebooks circular dependencies), but any ERROR output means the CI will fail.
npm install --package-lock-onlyonly validates lock file syntax; it does NOT catch build/TypeScript errors- CI runs the full build and will fail if any package cannot be built
- Running locally first catches:
- TypeScript compilation errors
- Missing type definitions
- Webpack/bundler issues
- Node version compatibility
- Module resolution failures
- Test failures
- TypeScript errors → Check
tsconfig.jsonhas"types": ["node"]if code uses Node APIs (Buffer, util, etc.) - Module not found → Verify dependencies are listed in
package.json - Engine version conflicts → Check that all transitive dependencies support the pinned Node version
- Build cache issues → Run
npm ci(notnpm install) to use exact lock file versions