All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.
git clone https://github.com/TwilioDevEd/message-segment-calculator.git
cd message-segment-calculator
npm install
npm run check # Lint + test (mirrors CI)npm test # Type-check + jest (659 tests)
npm run lint # ESLint on src/**/*.ts
npm run check # Lint + test (run before pushing)
npm run release # Build library (dist/) + browser bundle (docs/scripts/)
npm run dev # Watch mode for tscnpm run release
python3 -m http.server 8080 --directory docs
# Open http://localhost:8080src/libs/— Core library: SMS/RCS encoding and segmentation logicsrc/browser/— Browser UI: analysis, rendering, DOM wiringdocs/— GitHub Pages site (HTML, CSS, built JS bundles)tests/— Jest test suitesdist/— Built NPM package output (tsc)
See CLAUDE.md for detailed architecture documentation.
- Create a feature branch:
git checkout -b feat/DEVED-XXXXX-description - Make your changes in
src/ - Run
npm run checkto verify lint + tests pass - Run
npm run releaseto rebuilddist/anddocs/scripts/ - Commit all changes including built artifacts
- Push and create a PR against
main
Husky + lint-staged automatically runs eslint --fix on staged TypeScript files at commit time. If lint fails, the commit is blocked — fix the issues and try again.
GitHub Actions runs on every PR to main:
npm run lintnpm test
Across Node.js 14.x, 16.x, 18.x, 19.x. Run npm run check locally to catch failures before pushing.
- TypeScript with
eslint-config-twilio-ts(includes prettier) - CSS uses design tokens from
docs/styles/tokens.css— never hard-code hex colors - Interactive UI elements need accessibility attributes (
tabindex,role,aria-label)
PRs follow a 3-agent + 1-human review pattern:
| Reviewer | Focus |
|---|---|
| Claude Code | Architecture, quality, test coverage |
| Codex | Correctness, security, edge cases |
| GitHub Copilot | Inline suggestions, style |
| Human | Business logic, acceptance criteria |
See docs/pr-reviews/README.md for the full process and templates.