Contributing to Tempo โ
Thank you for your interest in contributing to Tempo! This project is a professional-grade date-time utility built on top of the native Temporal API. To maintain the high performance and architectural integrity of the library, please follow these guidelines.
๐๏ธ Project Architecture โ
Tempo uses several advanced JavaScript patterns that contributors should be familiar with:
- Proxy-Delegators: For
lazy evaluation of instance properties. - Soft Freeze: For secure but extensible global registries.
- Logify: For decoupled, symbol-based diagnostic logging.
๐ ๏ธ Local Development โ
Prerequisites โ
- Node.js 20+ (Tempo requires native
Temporalsupport or a robust environment). - npm v9+ (For monorepo workspace support).
Setup โ
git clone https://github.com/magmacomputing/magma.git
cd magma
npm installBuilding โ
Tempo is a TypeScript project that compiles to ES2022.
npm run build -w @magmacomputing/tempo๐งช Testing โ
We use Vitest for our test suite. All new features or bug fixes must include corresponding tests.
- Run all tests:
npm run test - Watch mode:
npm run dev - Coverage:
npm run coverage
IMPORTANT
Zero State Contamination: Tests must be idempotent. If your test modifies a global registry (e.g., Tempo.extend), ensure you use the using keyword or manually call Tempo[Symbol.dispose]() to reset the engine for the next test.
๐ Coding Standards โ
- Private Fields: Use native
#privatefields for internal state that should not be accessible via Proxies. - Internal Symbols: Use the symbols exported from
tempo.symbol.tsfor cross-module internal communication. - Immutability: Tempo instances are strictly immutable. Any method that changes state must return a new instance.
- Documentation: If you change a public API, please update the corresponding
.mdfile in thedoc/directory.
๐ Pull Request Process โ
- Create a new branch for your feature or fix.
- Ensure the test suite passes at 100%.
- Update the
CHANGELOG.mdwith a brief description of your changes. - Open a Pull Request and describe the problem you are solving and your technical approach.
Tempo is maintained by Magma Computing. For commercial support or architectural consulting, please reach out via the Contact Page.