Commit graph

30 commits

Author SHA1 Message Date
Aric Camarata
35128dda86 build: use prepack hook so npm pack/publish reliably emit index.d.mts 2026-06-13 10:30:51 -04:00
Aric Camarata
70da984a3b ci: fix eslint parser devDeps, flat config files pattern, untrack coverage
- Add @typescript-eslint/parser and @typescript-eslint/eslint-plugin as
  direct devDependencies (were only peer deps of @acamarata/eslint-config,
  causing ERR_MODULE_NOT_FOUND in CI)
- Add files: ['**/*.ts'] to eslint.config.mjs so ESLint 10 flat config
  picks up TypeScript files; add parserOptions.project for type-aware rules
- Run prettier --write src/ to fix formatting after config changes
- Add coverage/ to .gitignore and untrack previously committed coverage files
2026-05-31 08:48:01 -04:00
Aric Camarata
1e75709789 chore: P1 standardization — finalize src/wiki/ci 2026-05-30 18:48:57 -04:00
Aric Camarata
6be2c20113 docs: refresh TypeDoc API output (T-E8-03 QA-A verify) 2026-05-30 17:48:45 -04:00
Aric Camarata
b52802f94b docs: add TypeDoc API generation (typedoc@0.28.19 + typedoc-plugin-markdown@4.11.0)
Add typedoc and typedoc-plugin-markdown as devDependencies. Add typedoc.json config
targeting src/index.ts with markdown output to .github/wiki/api. Add docs script to
package.json. Generate initial API reference pages.

Part of T-E8-03 — TypeDoc automation for all 12 JS/TS packages.
2026-05-30 16:41:57 -04:00
Aric Camarata
dea28b9262 chore: adopt shared config packages (tsconfig, eslint, prettier) 2026-05-30 15:03:07 -04:00
Aric Camarata
8a8efd69ad ci: corepack before setup-node, scope prettier to src/, emit d.mts 2026-05-29 20:05:22 -04:00
Aric Camarata
a2a4564731 chore: E6 polish wiki content (P1) 2026-05-29 07:15:55 -04:00
Aric Camarata
37f2823e9d chore: untrack AGENTS.md (AI working memory, not source code) 2026-05-29 06:36:40 -04:00
Aric Camarata
ba68c43a55 fix: revert type:module to restore CJS compatibility (2.0.2 patch) 2026-05-28 14:17:44 -04:00
Aric Camarata
aa850f806c feat(e6): portfolio polish — docs, CI, TypeScript standard, wiki
- Trim README to ≤80 lines with wiki link for full docs
- Add CHANGELOG.md with initial entry
- Fix CI: replace pinned pnpm/action-setup with corepack enable
- Add "type": "module" and flat exports map (ADR-015)
- Add ./package.json exports entry
- Add coverage script
- Rename lib/spa.js → lib/spa.cjs to fix CJS/ESM conflict under "type": "module"
- Update src/index.ts and tsup.config.ts to reference spa.cjs
- Add .github/wiki pages: _Sidebar, _Footer, Contributing, SECURITY, CODE_OF_CONDUCT
2026-05-28 13:59:43 -04:00
Aric Camarata
66dd84047b chore(config): add AGENTS.md for dual-harness parity 2026-05-25 15:51:15 -04:00
Aric Camarata
d428f71cea chore: align repository structure with portfolio documentation standards 2026-05-15 15:27:22 -04:00
Aric Camarata
6ff8269f45 Add GitHub Sponsors funding config 2026-03-28 18:18:54 -04:00
Aric Camarata
7b6b413908 style: fix prettier table formatting in wiki 2026-03-08 17:30:53 -04:00
Aric Camarata
13c1145fcc style: replace em dashes with colons in docs and wiki 2026-03-08 17:28:02 -04:00
Aric Camarata
54f6ddfedd refactor: code quality improvements across the board 2026-03-08 11:34:05 -04:00
Aric Camarata
51dcf89d63 nrel-spa v2.0.1: validation, NaN returns, overloads, wiki comparison
Fixed:
- calcSpa with empty angles array no longer crashes (consistent guard with getSpa)
- getSpa with SPA_ZA/SPA_ZA_INC now returns NaN for sunrise/solarNoon/sunset
  instead of misleading 0; calcSpa returns "N/A" for those fields
- lib/spa.js header comment corrected from dist/spa.js to lib/spa.js
- dist/spa.js removed (file moved to lib/spa.js in v2.0.0, stale copy deleted)
- wiki-sync.yml handles first-run when GitHub Wiki repo does not yet exist
- CI pack-check grep uses word-boundary pattern to prevent false prefix matches
- Removed package-import-method=hardlink from .npmrc (pnpm default, caused npm warn)

Added:
- options.function validated before calculation; invalid code throws RangeError
- angles with non-RTS function code throws RangeError (requires suntransit)
- TypeScript function overloads for getSpa and calcSpa; angles typed as
  [number, ...number[]] non-empty tuple, narrows return type automatically
- SpaFormattedAnglesResult interface, consistent with SpaAnglesResult
- CI jobs declare explicit permissions: contents: read
- Wiki: Implementation Comparison page with accuracy table (8 locations vs C
  reference, max delta 0.49 s) and performance benchmarks (nrel-spa vs solar-spa
  vs C, both SPA_ZA_RTS and SPA_ZA modes, 200k iterations on Node v24.6.0)
- Wiki: API Reference updated with named types, all throws, Named Types block
- Wiki: Architecture updated with all exported interfaces
2026-02-25 11:54:03 -05:00
Aric Camarata
423560c0ab Remove pnpm-specific .npmrc setting that causes npm warning
package-import-method=hardlink is pnpm's default since v7 and does not
need to be set explicitly. npm reads .npmrc and warns about unknown
project config keys — removing it silences the warning with no effect
on pnpm behavior.
2026-02-25 11:17:19 -05:00
Aric Camarata
b44d9a958b v2.0.0: TypeScript rewrite with dual CJS/ESM build
Complete modernization of the package. The core SPA algorithm is
unchanged and validated; everything else is rebuilt to match current
JavaScript ecosystem standards.

Changes:
- TypeScript wrapper in src/ with full type definitions
- Dual CJS/ESM build via tsup (dist/index.cjs, dist/index.mjs)
- Core algorithm moved from dist/spa.js to lib/spa.js (same code)
- Input validation with descriptive TypeError/RangeError messages
- formatTime() and SPA function code constants as named exports
- getSpa() / calcSpa() accept null for optional args (tz, options)
- Test suite: 61 ESM assertions and 17 CJS assertions
- GitHub Actions CI: Node 20/22/24 matrix, typecheck, pack-check
- GitHub Wiki: Home, API Reference, Architecture, Twilight, NREL SPA
- NREL attribution in LICENSE and README per their license terms
- package.json: exports map, files, engines >=20, sideEffects: false
- Author corrected to Aric Camarata; repository.url uses git+https://
- LICENSE year corrected to 2023-2026
- Removed: index.js, test.js, dist/spa.js (superseded by above)
2026-02-25 11:01:38 -05:00
b1c7f638ae Major fix to core time calculations 2025-05-04 07:50:00 -04:00
uny-dev
322342d978 Updated package.json repository field for NPM 2025-03-18 06:13:30 -04:00
88edcab489
Update LICENSE 2025-03-07 09:49:05 -05:00
3a2f6fcbab updated version 2023-11-13 07:46:28 +07:00
61ef96ad08 updated require in readme 2023-11-13 07:45:53 +07:00
e2c6dbe6ba updated format and docs 2023-11-13 07:43:18 +07:00
4a5c28261e major fix for handling timezones 2023-11-13 07:05:10 +07:00
8c4c4991f2 updated version 2023-11-11 18:18:01 +07:00
18b3c8d5b7 unignored dist folder 2023-11-11 18:17:51 +07:00
82fd5feb92 initial commit 2023-11-11 17:23:30 +07:00