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
56 changes: 15 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,30 @@ Open-source **React**, **Vite**, **Tailwind CSS** & **TypeScript** tool that acc
| Dark mode | Light/dark theme toggle with `localStorage` persistence | :heavy_check_mark:
| File import (TXT, DOCX, PDF, EPUB) | Import files via advanced mode toggle — parsed client-side, files never leave the browser | :heavy_check_mark:
| Bionic EPUB export | Export a bionic-formatted `.epub` file with `<b>` fixation points applied to all HTML chapters | :heavy_check_mark:
| [57× Unicode speedup][perf-commit] | Hoist `toUnicodeVariant` constants to module scope — data structures built once at load time instead of once per word | :heavy_check_mark:
| Show characters | Display Characters after textarea | backlog
| Increase fonts | Create functionality to increase/descrease fonts size | backlog

[perf-commit]: https://github.com/crisanlucid/primusread/commit/1bd266d8f973ce9d83bfb016e0e1405f48ccf197


### How to Run

```bash
npm install && npm run dev
```

## Performance

Unicode mode (`toUnicodeVariant`) was originally rebuilding all data structures on every call. [Hoisting constants to module scope][perf-commit] reduced the per-call overhead to zero, yielding a **57× throughput improvement** on a 500-word document (86 ops/s → 4,915 ops/s).

| Mode | 500-word document |
|---|---|
| CSS mode (default) | ~15,700 ops/s |
| Unicode mode (after fix) | ~4,900 ops/s |

Run the benchmark yourself: `npm run bench`

## PDF functionality
![Save text as PDF file](./src/assets/primusread_pdf_export.PNG)

Expand Down Expand Up @@ -67,47 +81,7 @@ Pull requests are welcome :)

---

## Release Flow

Step-by-step guide for releasing a new version.

### 1. Develop on a feature branch

```bash
git checkout -b feature/my-feature
# ... make changes ...
git add <files>
git commit -m "feat: my feature"
git push origin feature/my-feature
```

### 2. Open a Pull Request → merge into `main`

Opening a PR triggers:
- **Node.js CI** — installs deps, builds, runs tests
- **CodeQL** — security scan

Merging into `main` additionally triggers:
- **Build and Deploy** — deploys to GitHub Pages (only when source files change)

### 3. Bump the version

Go to **Actions → Bump version → Run workflow** and choose:
- `patch` → bug fixes / small improvements (0.5.0 → 0.5.1)
- `minor` → new features, backwards compatible (0.5.0 → 0.6.0)
- `major` → breaking changes (0.5.0 → 1.0.0)

This workflow will:
- Bump `package.json` + `package-lock.json` version
- Create a git tag (e.g. `v0.6.0`) and push it
- Open a PR named `chore: bump version to vX.X.X`

### 4. Merge the version bump PR

Merge the `chore: bump version to vX.X.X` PR into `main`. This automatically:
- Runs CI (install, build, test)
- Deploys to GitHub Pages
- **Creates a GitHub Release** with auto-generated notes
For the step-by-step release process see [ReleaseFlow.md](./ReleaseFlow.md).

---

Expand Down
41 changes: 41 additions & 0 deletions ReleaseFlow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Release Flow

Step-by-step guide for releasing a new version.

### 1. Develop on a feature branch

```bash
git checkout -b feature/my-feature
# ... make changes ...
git add <files>
git commit -m "feat: my feature"
git push origin feature/my-feature
```

### 2. Open a Pull Request → merge into `main`

Opening a PR triggers:
- **Node.js CI** — installs deps, builds, runs tests
- **CodeQL** — security scan

Merging into `main` additionally triggers:
- **Build and Deploy** — deploys to GitHub Pages (only when source files change)

### 3. Bump the version

Go to **Actions → Bump version → Run workflow** and choose:
- `patch` → bug fixes / small improvements (0.5.0 → 0.5.1)
- `minor` → new features, backwards compatible (0.5.0 → 0.6.0)
- `major` → breaking changes (0.5.0 → 1.0.0)

This workflow will:
- Bump `package.json` + `package-lock.json` version
- Create a git tag (e.g. `v0.6.0`) and push it
- Open a PR named `chore: bump version to vX.X.X`

### 4. Merge the version bump PR

Merge the `chore: bump version to vX.X.X` PR into `main`. This automatically:
- Runs CI (install, build, test)
- Deploys to GitHub Pages
- **Creates a GitHub Release** with auto-generated notes