Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm test
- name: Check package contents
if: matrix.node-version == '24.x'
run: npm pack --dry-run
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

permissions:
contents: read
id-token: write # required for npm Trusted Publishing (OIDC) and provenance

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24.x
registry-url: https://registry.npmjs.org

# Trusted Publishing needs npm >= 11.5.1.
- run: npm install -g npm@latest

- name: Check that the tag matches package.json
run: |
PKG_VERSION="$(node -p "require('./package.json').version")"
if [ "v$PKG_VERSION" != "$GITHUB_REF_NAME" ]; then
echo "Tag $GITHUB_REF_NAME does not match package.json version $PKG_VERSION"
exit 1
fi

- run: npm test

# No NPM_TOKEN: npm exchanges the GitHub OIDC token for a short-lived publish credential.
- run: npm publish --provenance --access public
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
*.tgz
.DS_Store
.npmrc
coverage/
*.log
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

All notable changes to this project are documented here.
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and the project uses [Semantic Versioning](https://semver.org/).

## [Unreleased]

## [0.1.0] - 2026-10-12

### Added

- `StudyTracker.create({ appId })`: stores sessions and answers in `localStorage`
under `study-tracker:<appId>`, with an in-memory fallback when storage is unavailable.
- Answers are saved the moment they are recorded; multiple tabs do not overwrite each other.
- Stats: `periodStats`, `mastery`, `progress`, `questionStats`, `getSessions`, `getAnswers`.
- `exportData` / `importData` (merge or replace) with a versioned data format (`schema: 1`).
- `StudyTrackerView.render`: ready-made progress screen with weekly/monthly charts,
per-topic table, session history and export/import buttons. English strings by
default; every string can be replaced through `texts` (e.g. Spanish) and dates follow `locale`.
- ESM entry point (`import StudyTracker from '@fabianimv/study-tracker'`) and
CommonJS/UMD builds usable from a `<script>` tag or a CDN.

[Unreleased]: https://github.com/FabianIMV/study-tracker/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/FabianIMV/study-tracker/releases/tag/v0.1.0
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributing

Thanks for helping out! Issues and pull requests are welcome.

## Development

No build step and no dependencies. You only need Node.js 18 or newer.

```bash
git clone https://github.com/FabianIMV/study-tracker.git
cd study-tracker
npm test
```

## Guidelines

- Keep the library dependency-free and loadable with a plain `<script>` tag (ES5, UMD).
- Add or update tests in `test/` for any behavior change.
- Never break existing saved data. If the stored format changes, bump `SCHEMA` in
`study-tracker.js` and convert old data inside `migrate()`.
- Add a line under `## [Unreleased]` in `CHANGELOG.md`.

## Releasing (maintainers)

1. Update `version` in `package.json` **and** in `study-tracker.js` (a test checks they match).
2. Move the `Unreleased` notes in `CHANGELOG.md` under the new version.
3. Commit, then tag and push: `git tag v0.2.0 && git push origin v0.2.0`.
The `Release` workflow publishes to npm with provenance via Trusted Publishing.
Loading
Loading