diff --git a/.github/wiki/CODE_OF_CONDUCT.md b/.github/wiki/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..c880c1a --- /dev/null +++ b/.github/wiki/CODE_OF_CONDUCT.md @@ -0,0 +1,34 @@ +# Code of Conduct + +## Summary + +Be direct, be respectful, and focus on the work. + +## Standards + +Constructive behavior: + +- Technical criticism aimed at code and ideas, not people +- Clear and specific feedback with examples where possible +- Acknowledging when you are wrong or do not know something +- Staying on topic in issues and pull requests + +Unacceptable behavior: + +- Personal attacks, insults, or harassment +- Sustained off-topic disruption +- Publishing private information without consent + +## Scope + +This applies to all project spaces: GitHub issues, pull requests, discussions, and any other venue where project work happens. + +## Enforcement + +The project maintainer handles violations. Contact: aric.camarata@gmail.com. + +Reports are reviewed promptly. Responses range from a private note to a permanent ban, depending on severity and history. + +## Attribution + +This code of conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1. diff --git a/.github/wiki/Contributing.md b/.github/wiki/Contributing.md new file mode 100644 index 0000000..10e6a63 --- /dev/null +++ b/.github/wiki/Contributing.md @@ -0,0 +1,61 @@ +# Contributing + +## Prerequisites + +- Node.js 20 or later +- pnpm (enabled via corepack: `corepack enable`) + +## Setup + +```sh +git clone https://github.com/acamarata/pray-calc.git +cd pray-calc +pnpm install +``` + +## Development + +```sh +pnpm build # compile TypeScript +pnpm test # build + run full test suite (ESM + CJS, 106 tests) +pnpm run typecheck # type-check without emitting +pnpm run lint # ESLint +pnpm run format # Prettier format +``` + +## Project Structure + +``` +src/ + index.ts main exports + types.ts all TypeScript types + getSolarEphemeris.ts Jean Meeus Ch. 25 (decl, r, eclLon) + getMSC.ts MSC piecewise seasonal model + getAngles.ts dynamic angle algorithm (3 layers) + getAsr.ts pure-math Asr + getQiyam.ts last-third-of-night + getTimes.ts raw fractional-hour output + calcTimes.ts formatted HH:MM:SS output + getTimesAll.ts all-methods batch SPA call + calcTimesAll.ts all-methods formatted output +test.mjs ESM test suite (94 tests) +test-cjs.cjs CJS subset (12 tests) +``` + +## Making Changes + +1. Algorithm changes: read [Dynamic Algorithm](Dynamic-Algorithm) and [Twilight Physics](Twilight-Physics) first. +2. Any new export must have TypeScript types and JSDoc. +3. Tests use `node:test`. Add tests in `test.mjs` for new behavior. +4. All 106 tests must pass before submitting. + +## Timezone Note + +The test suite uses explicit UTC offset values, not `new Date()` local timezone parsing. Keep this pattern when adding tests — CI runs in UTC and tests must pass there. + +## Pull Requests + +- One logical change per PR +- Include tests covering the new behavior +- Update `CHANGELOG.md` under `[Unreleased]` +- Do not bump the version number diff --git a/.github/wiki/SECURITY.md b/.github/wiki/SECURITY.md new file mode 100644 index 0000000..087fdc6 --- /dev/null +++ b/.github/wiki/SECURITY.md @@ -0,0 +1,29 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| --- | --- | +| 2.x | Yes | +| 1.x | No | + +Only the latest major version receives security fixes. + +## Reporting a Vulnerability + +Do not open a public GitHub issue for security vulnerabilities. + +Email: aric.camarata@gmail.com + +Include: + +- A description of the vulnerability +- Steps to reproduce +- Potential impact +- Any suggested fix, if you have one + +You will receive an acknowledgment within 48 hours and a resolution timeline within 7 days. Once a fix is ready and deployed, the vulnerability will be disclosed publicly with credit to the reporter (unless you prefer to remain anonymous). + +## Scope + +This package is a computation library. It performs no network requests, reads no files, and holds no credentials. It depends on `nrel-spa` for solar position calculations. If you find a vulnerability in `nrel-spa`, report it to that package separately. diff --git a/.github/wiki/_Footer.md b/.github/wiki/_Footer.md new file mode 100644 index 0000000..abb5cd6 --- /dev/null +++ b/.github/wiki/_Footer.md @@ -0,0 +1 @@ +[npm](https://www.npmjs.com/package/pray-calc) · [GitHub](https://github.com/acamarata/pray-calc) · [Changelog](https://github.com/acamarata/pray-calc/blob/main/CHANGELOG.md) · MIT License diff --git a/.github/wiki/_Sidebar.md b/.github/wiki/_Sidebar.md new file mode 100644 index 0000000..298e2a1 --- /dev/null +++ b/.github/wiki/_Sidebar.md @@ -0,0 +1,35 @@ +## pray-calc + +**[Home](Home)** + +**Reference** +- [API Reference](API-Reference) +- [Architecture](Architecture) + +**Algorithm** +- [Dynamic Algorithm](Dynamic-Algorithm) +- [Twilight Physics](Twilight-Physics) +- [Asr Calculation](Asr-Calculation) +- [High Latitude](High-Latitude) +- [Traditional Methods](Traditional-Methods) + +**Research** +- [Research Overview](Research) +- [Methodology](Research-Methodology) +- [Observational Evidence](Research-Observational-Evidence) +- [Global Study](Research-Global-Study) +- [Home Territory](Research-Home-Territory) +- [Verified Observations](Research-Verified-Observations) + +**Migration** +- [Moon Migration](Moon-Migration) + +**Contributing** +- [Contributing](Contributing) +- [Code of Conduct](CODE_OF_CONDUCT) +- [Security](SECURITY) + +**Links** +- [npm](https://www.npmjs.com/package/pray-calc) +- [GitHub](https://github.com/acamarata/pray-calc) +- [Changelog](https://github.com/acamarata/pray-calc/blob/main/CHANGELOG.md)