Contribution
May 29, 2022
This page describes contributing to the advanced-logger npm library. To change this documentation site, edit the advanced-logger-guide repository instead.
Prerequisites
- Node.js 24+ (see library
.mise.toml)
mise install # optional: install Node via mise
cd advanced-logger
npm ciBuild
The library is bundled with tsup (npm run build):
npm run buildOutputs under dist/:
index.mjs— ESMindex.cjs— CommonJSindex.d.ts— TypeScript declarationsindex.global.js— browser IIFE (window.advancedLogger)
Local watch mode:
npm run build:watchTests
npm run type-check # TypeScript
npm test # unit tests (import from src/)
npm run test:integration # build + runtime tests (CJS + browser IIFE)
npm run test:all # unit + integration
npm run coverage # unit tests with coverage (CI on master)Jest runs two projects: unit (source specs) and runtime (built dist/index.cjs and window.advancedLogger from the IIFE). Open coverage/lcov-report/index.html after npm run coverage.
Call logger.destroy() in tests when using interval or throttle strategies.
CI
GitHub Actions on every branch: type-check, unit tests, full build, runtime integration. master also runs coverage and SonarCloud.
Releasing
On master, bump version and changelog with standard-version:
npm run release
git push origin master --follow-tagsRelease commits are tagged; npm publish follows your existing release pipeline for tagged commits on master.
Git workflow
Commits
Follow Conventional Commits. Commitlint runs on commit via Husky.
Branches and pull requests
Use feature branches and open PRs to master. Keep history clean (rebase when appropriate). All CI checks should pass; resolve or discuss Sonar findings.
AI / contributor notes
See AGENTS.md in the library repo for architecture, extension points, and testing conventions.