Pivot to a data-only calendar-feed library#9
Merged
Conversation
Pivot @nbtca/nbtcal from campus course scraper to a data-only calendar feed library that fetches/parses ical.nbtca.space, owns date/recurrence logic, and exposes typed events plus heatmap data for @nbtca/prompt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- heatmap buckets by a fixed IANA time zone (default Asia/Shanghai) with an optional timeZone override, instead of host-local time; output is now deterministic across Node/browser/any host TZ (verified under TZ=America/New_York) - upcoming() uses a clean rolling now+days*24h window (was ~1 day too long) - next() clamps non-positive counts; horizon cap documented - remove unused DateRange export (YAGNI) - drop TZ=UTC test crutch now that bucketing is timezone-explicit Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replaces the stale scraper test.yml.example. Release publishes @nbtca/nbtcal to npm on pushing a v* tag, using the NPM_TOKEN secret. No provenance because the source repo is private. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
m1ngsama
added a commit
that referenced
this pull request
Jun 17, 2026
Pivot to a data-only calendar-feed library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8.
Summary
Rebuilds
@nbtca/nbtcalfrom a campus course-schedule scraper into a data-only, isomorphic calendar-feed library forical.nbtca.space(the maintainers' Google Calendar, exported as ICS). It owns all date/recurrence logic and hands typed events + heatmap data to consumers like@nbtca/prompt; rendering stays out of this package.What changed
src/auth|scraper|converter|mailer|i18n|cli,api/, the CLI bin) and the related doc sprawl.fetchFeed()— isomorphic fetch (globalfetch) with timeout + typed errors.parseCalendar()— ICS → events viaical.js.occurrencesInRange/upcoming/next— recurrence-aware queries (the old prompt code silently droppedRRULEevents).heatmap()— dense day/week buckets, timezone-stable (defaultAsia/Shanghai, overridable) so output is identical on Node, browser, and any host TZ.loadCalendar()— convenience wrapper;FeedFetchError/FeedParseErrortyped errors.TZ=UTCandTZ=America/New_York).0.2.0, data-only exports, nobin; added MITLICENSE.ci.yml(test + build on push/PR) andrelease.yml(npm publish with provenance onv*tags).Test plan
npm test— 26/26 passnpm testunderTZ=America/New_York— 26/26 pass (timezone stability)npm run build— clean,dist/has no test filesnpx tsc --noEmit— cleanNotes
A whole-implementation code review was completed; findings (timezone-stable heatmap, rolling
upcomingwindow,nextclamp, removed deadDateRangeexport) are addressed infix: address code review.The
@nbtca/prompt-side change to consume this library is intentionally out of scope and tracked separately.