Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
fbe2174
feat::fixes
broisnees Jul 1, 2026
ec6ede6
feat::licensing
broisnees Jul 2, 2026
e7432b5
feat::working
broisnees Jul 2, 2026
3ff7940
chore(db): migrate from Postgres to Cloudflare D1 (SQLite)
broisnees Jul 3, 2026
a624a9c
Merge remote-tracking branch 'origin/feat/license' into feat/license-d1
broisnees Jul 3, 2026
42b79f2
feat(db): D1 migration for device-locked licensing
broisnees Jul 3, 2026
0e18b0b
feat(design): migrate to SQL Studio-inspired dark design system
broisnees Jul 3, 2026
6357ca5
feat(landing): mirror sql.studio layout 1:1
broisnees Jul 3, 2026
e7e4bce
fix(landing): match sql.studio look more precisely
broisnees Jul 3, 2026
2693d0c
feat(theme): add proper light + dark themes with system default
broisnees Jul 3, 2026
77b072e
feat(icons): revamp all icons to Hugeicons; fix theme-toggle dep churn
broisnees Jul 3, 2026
24b3174
feat(blog): add battery-science blog + flagship lithium-ion article
broisnees Jul 3, 2026
cabc7ed
feat(blog): rebuild lithium-ion article with interactive canvas visuals
broisnees Jul 3, 2026
f390384
feat: add terms, privacy, and changelog pages
broisnees Jul 14, 2026
2e5678d
feat: integrate PostHog product analytics
broisnees Jul 14, 2026
d773a3c
chore: add .env.example documenting all env vars
broisnees Jul 14, 2026
ac159ff
Merge remote-tracking branch 'origin/worktree-legal-pages' into feat/…
broisnees Jul 15, 2026
e8b3a36
feat(seo): add environment-driven seo() helper with twitter:url
broisnees Jul 15, 2026
1a6d365
feat(seo): add JSON-LD schema builders and <JsonLd> component
broisnees Jul 15, 2026
201e37b
feat(seo): add 1200x630 Open Graph share image
broisnees Jul 15, 2026
ba0e8a9
feat(brand): add Battlify favicon set (svg, png, apple-touch-icon)
broisnees Jul 15, 2026
6b396aa
chore(seo): drop static robots.txt in favor of a dynamic route
broisnees Jul 15, 2026
1f6bcc6
feat(seo): serve robots.txt from an environment-aware route
broisnees Jul 15, 2026
0463673
feat(seo): generate sitemap.xml from the route table
broisnees Jul 15, 2026
598cac4
feat(routes): add /download route to the latest release
broisnees Jul 15, 2026
201e22f
feat(seo): wire site-wide meta defaults and Battlify icons into root …
broisnees Jul 15, 2026
eb901d9
feat(seo): add home page metadata and JSON-LD graph
broisnees Jul 15, 2026
c0d61bd
feat(seo): add blog index metadata and breadcrumb schema
broisnees Jul 15, 2026
90a06fb
feat(seo): add blog post metadata and article/breadcrumb schema
broisnees Jul 15, 2026
3c7f51b
feat(changelog): add metadata and restructure the release timeline
broisnees Jul 15, 2026
1233f82
feat(seo): add metadata to legal pages
broisnees Jul 15, 2026
db0a996
feat(seo): add metadata to privacy/terms redirect pages
broisnees Jul 15, 2026
11e2ab0
chore(router): regenerate route tree for new routes
broisnees Jul 15, 2026
870fa05
chore(copy): remove em dashes from dashboard copy
broisnees Jul 15, 2026
2d528f8
chore(copy): remove em dashes from blog posts
broisnees Jul 15, 2026
5ee8643
chore(copy): de-dash aging explorer caption and buy button toast
broisnees Jul 15, 2026
1c3d33e
docs: add SEO audit snapshot
broisnees Jul 15, 2026
999e11e
feat(landing): add theme-aware elevation tokens and scroll-reveal mot…
broisnees Jul 15, 2026
45606ea
feat(landing): rewrite feature moments and testimonials copy
broisnees Jul 15, 2026
1015867
feat(landing): restructure landing into a storytelling narrative arc
broisnees Jul 15, 2026
448f62c
feat: rebrand the site to eWiz on ewiz.app with a new design
broisnees Oct 6, 2026
abb88ce
feat: eWiz 0.18.2 and the AI Agents section on the site
broisnees Oct 6, 2026
b5aeb83
feat: read the changelog, latest version and DMG from GitHub releases
broisnees Oct 7, 2026
92a60aa
feat: cleaner changelog layout
broisnees Oct 7, 2026
54fb2f8
Adopt the eWiz License (MMF-style)
broisnees Oct 7, 2026
1043c07
Merge pull request #9 from stroke-app/adopt-ewiz-license
broisnees Oct 7, 2026
ecc02a4
feat: a /pricing page and the eWiz License on /legal/license
broisnees Oct 7, 2026
9180572
Merge pull request #10 from stroke-app/pricing-and-license-pages
broisnees Oct 7, 2026
ea114d6
feat: a calmer feature tour on the home page
broisnees Oct 7, 2026
b19d064
Merge pull request #11 from stroke-app/features-redesign
broisnees Oct 7, 2026
7f49d23
feat: rewrite the home page copy in the developer's own voice
broisnees Oct 7, 2026
31e6533
Merge pull request #12 from stroke-app/landing-copy
broisnees Oct 7, 2026
2da0297
chore: keep local Claude Code tool state out of git
broisnees Oct 7, 2026
2cd6a51
Merge pull request #13 from stroke-app/license-sync
broisnees Oct 7, 2026
96cdc8a
feat: a plainer hero headline
broisnees Oct 7, 2026
162db6d
chore: drop the "one developer" lines
broisnees Oct 7, 2026
c5e3113
feat: link the Donate page from the home page and footer
broisnees Oct 7, 2026
d5f83cf
Merge pull request #14 from stroke-app/hero-donate
broisnees Oct 7, 2026
92dc3d9
feat: six hero headlines that take turns
broisnees Oct 7, 2026
aaea7a2
feat: lead with a random headline on each visit
broisnees Oct 7, 2026
904b17e
Merge pull request #15 from stroke-app/rotating-headlines
broisnees Oct 7, 2026
66c7e90
Move the macOS app into apps/macos
broisnees Nov 21, 2026
1f9d2f8
Merge the website from stroke-app/ewiz-releases into apps/web (histor…
broisnees Nov 21, 2026
dfe76f0
apps/web: apply oxfmt to the three files that failed format:check
broisnees Nov 21, 2026
ba83613
Set up the monorepo: Bun workspaces + Turborepo
broisnees Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 4 additions & 6 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- name: Create Version PR
id: changesets
uses: changesets/action@v1
with:
version: npm run version
version: bun run version
commit: "chore: version packages"
title: "chore: version packages"
env:
Expand Down Expand Up @@ -56,7 +54,7 @@ jobs:
exit 0
fi

version=$(node -p "require('./package.json').version")
version=$(node -p "require('./apps/macos/package.json').version")
if git ls-remote --exit-code --tags origin "refs/tags/v$version" >/dev/null 2>&1; then
echo "v$version is already tagged — nothing to do."
exit 0
Expand Down
42 changes: 41 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,33 @@ concurrency:
cancel-in-progress: true

jobs:
build-and-test:
changes:
runs-on: ubuntu-latest
outputs:
macos: ${{ steps.filter.outputs.macos }}
web: ${{ steps.filter.outputs.web }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
macos:
- 'apps/macos/**'
- '.github/workflows/ci.yml'
web:
- 'apps/web/**'
- 'package.json'
- 'bun.lock'
- '.github/workflows/ci.yml'

macos:
needs: changes
if: needs.changes.outputs.macos == 'true'
runs-on: macos-15
defaults:
run:
working-directory: apps/macos
steps:
- uses: actions/checkout@v4

Expand All @@ -24,3 +49,18 @@ jobs:
- name: Test (unit + benchmarks)
# GitHub's runners ship full Xcode, so scripts/test.sh runs plain `swift test`.
run: ./scripts/test.sh

web:
needs: changes
if: needs.changes.outputs.web == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- name: Format check
run: bun run --filter @ewiz/web format:check
- name: Lint
run: bun run --filter @ewiz/web lint
- name: Build
run: bun run --filter @ewiz/web build
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
# (SDK 15) build silently fails to launch (exit 1) on macOS 26 — the Swift
# concurrency runtime mismatch — so the release must be built on 26.
runs-on: macos-26
defaults:
run:
working-directory: apps/macos
# secrets can't be used in step `if:` directly, so surface them as env flags.
env:
HAS_SIGNING: ${{ secrets.DEVELOPER_ID_CERT_P12_BASE64 != '' }}
Expand Down Expand Up @@ -135,7 +138,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: eWiz-${{ steps.ver.outputs.version }}
path: dist/eWiz-${{ steps.ver.outputs.version }}.dmg
path: apps/macos/dist/eWiz-${{ steps.ver.outputs.version }}.dmg

# The release notes are this version's CHANGELOG.md section, which the
# Version PR wrote. ewiz.app's changelog and download pages read them from
Expand Down Expand Up @@ -168,11 +171,11 @@ jobs:
with:
name: "eWiz ${{ steps.ver.outputs.version }}"
tag_name: ${{ github.ref_name }}
body_path: dist/release-notes.md
body_path: apps/macos/dist/release-notes.md
files: |
dist/eWiz-${{ steps.ver.outputs.version }}.dmg
dist/appcast.xml
dist/appcast.json
apps/macos/dist/eWiz-${{ steps.ver.outputs.version }}.dmg
apps/macos/dist/appcast.xml
apps/macos/dist/appcast.json
draft: false
make_latest: true

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ package-lock.json
*.p12
*.p8
AuthKey_*.p8
.turbo/
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bunx lint-staged
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,34 @@ your neck.
with **Apple Pay** in a couple of taps, in-app or
[on ewiz.app](https://ewiz.app/buy).

## Repository layout

This is a monorepo ([Bun](https://bun.sh) workspaces + [Turborepo](https://turbo.build)):

| Path | What |
| --- | --- |
| [`apps/macos`](apps/macos) | The menu-bar app, helper daemon, MCP server and release scripts (Swift) |
| [`apps/web`](apps/web) | [ewiz.app](https://ewiz.app): website, checkout and licensing (TanStack Start on Cloudflare) |
| `packages/` | Shared code (empty for now) |

The in-app update feed (`appcast.xml` / `appcast.json`) and the Homebrew cask still
live in [`stroke-app/ewiz-releases`](https://github.com/stroke-app/ewiz-releases):
installed copies read the feed from that URL, and the release workflow publishes to it.

```bash
bun install
bun run dev:web # the website
bun run build # build everything (turbo)
bun run test # Swift tests
```

## Build from source

Requires the Swift toolchain (Xcode or the Command Line Tools), macOS 14+, and an
Apple Silicon Mac.
Apple Silicon Mac. From `apps/macos`:

```bash
cd apps/macos
swift build
swift run eWiz # run the menu-bar app
sudo ./scripts/install-helper.sh # install the root helper daemon
Expand All @@ -258,20 +280,20 @@ sudo ./scripts/install-helper.sh # install the root helper daemon
it adds the swift-testing framework search paths automatically. CI runs it on every
push and pull request.

See [`DISTRIBUTION.md`](DISTRIBUTION.md) for signing, notarization, the GitHub
See [`DISTRIBUTION.md`](apps/macos/DISTRIBUTION.md) for signing, notarization, the GitHub
Actions release pipeline, licensing on ewiz.app, and the auto-update feed.

## Contributing & releases

This repo uses [Changesets](https://github.com/changesets/changesets):

```bash
npm install
npm run changeset # describe your change (patch / minor / major)
bun install
bun run changeset # describe your change (patch / minor / major)
```

Commit the generated `.changeset/*.md`. Merging the auto-opened "Version Packages"
PR bumps the version and `CHANGELOG.md`; pushing that version tag triggers the
PR bumps the version in `apps/macos/package.json` and [`CHANGELOG.md`](apps/macos/CHANGELOG.md); pushing that version tag triggers the
release build.

The app and helper speak a small versioned protocol over their socket. When you
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
11 changes: 11 additions & 0 deletions apps/macos/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "ewiz",
"version": "0.19.10",
"private": true,
"description": "Menu bar battery saver and charge limiter for Apple Silicon Macs",
"scripts": {
"build": "swift build",
"test": "./scripts/test.sh",
"package": "./scripts/package-app.sh"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/macos/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["//"],
"tasks": {
"build": { "cache": false },
"test": { "cache": false }
}
}
26 changes: 26 additions & 0 deletions apps/web/.agents/auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Auth Conventions

## Auth Architecture

- Better Auth config lives in `src/lib/auth/auth.ts`.
- Auth utilities are centralized in `src/lib/auth/*`.
- In components, prefer shared auth hooks (`useAuth`, `useAuthSuspense`) from `src/lib/auth/hooks.ts`. These reuse the same auth data as the route loader.
- For route loaders under `_auth`, prefer loader context user over duplicate auth fetches.

## Route Guards

- Protected route layout is `src/routes/_auth/route.tsx`.
- It enforces auth in `beforeLoad` using `ensureQueryData(authQueryOptions())`.
- It returns `{ user }`, which is available to all child route loaders via router context.
- Guest-only route layout is `src/routes/_guest/route.tsx`.
- It redirects authenticated users away from login/signup routes.

## Server Functions and Mutations

- Server functions can be called from both server and client code.
- Server call: executed directly on the server.
- Client call: treated as RPC and executed through an HTTP API request.
- Treat protected server functions like protected API routes from a security perspective.
- If a server function requires auth, always apply `authMiddleware` from `src/lib/auth/middleware.ts`. This applies even when called from an auth-protected route (`routes/_auth/**`).
- Route-level `beforeLoad` guards protect route navigation/rendering, but they do not replace server-function authorization.
- When auth is required, middleware-provided user context is the source of truth.
86 changes: 86 additions & 0 deletions apps/web/.agents/tanstack-patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!-- based on https://github.com/TanStack/tanstack.com/blob/main/.claude/tanstack-patterns.md -->

# TanStack Patterns

## Route Group Conventions

- Protected routes live under `src/routes/_auth/**`, enforced by `beforeLoad` in the `_auth` layout (`src/routes/_auth/route.tsx`).
- Guest-only routes live under `src/routes/_guest/**`, enforced by `beforeLoad` in the `_guest` layout (`src/routes/_guest/route.tsx`).
- Auth-specific route guard behavior and middleware rules are documented in `.agents/auth.md`.

## Data Fetching

Route loaders are isomorphic; they run on both server and client. They cannot directly access server-only APIs.

```typescript
// Bad: direct server API access
loader: async () => {
const todos = await fs.readFile("todos.json");
return { todos };
};
```

```typescript
// Good (minimal/valid): call a server function from the loader
loader: async () => {
const todos = await $getTodos({ data: {} });
return { todos };
};
```

Instead of directly calling server functions in loaders, prefer wrapping in TanStack Query for better caching and reusability.

```typescript
loader: async ({ context }) => {
// Best/Preferred: For read/data-fetching server functions, wrap in TanStack Query
const todos = await context.queryClient.ensureQueryData(todosQueryOptions());
return { todos };
};

// lib/todos/queries.ts
export const todosQueryOptions = () =>
queryOptions({
queryKey: ["todos"],
queryFn: ({ signal }) => $getTodos({ signal }), // TanStack Query calls the server function
});
```

## Environment Shaking

TanStack Start strips any code not referenced by a `createServerFn` handler from the client build.

- Server-only code (database, fs) is automatically excluded from client bundles
- Only code inside `createServerFn` handlers goes to server bundles
- Code outside handlers is included in both bundles

## Importing Server Functions

Server functions wrapped in `createServerFn` can be imported statically. Never use dynamic imports for server-only code in components. Prefix server function names with `$` (e.g. `$getUser`) for easier identification.

```typescript
// Bad: dynamic import causes bundler issues
const rolesQuery = useQuery({
queryFn: async () => {
const { $listRoles } = await import("#/utils/roles.server");
return $listRoles({ data: {} });
},
});

// Good: static import
import { $listRoles } from "#/utils/roles.server";

const rolesQuery = useQuery({
queryFn: async () => $listRoles({ data: {} }),
});
```

## Server-Only Import Rules

1. `createServerFn` wrappers can be imported statically anywhere
2. Direct server-only code (database clients, fs) must only be imported:
- Inside `createServerFn` handlers
- In `*.server.ts` files

## Auth-specific Patterns

- See `.agents/auth.md` for auth middleware usage, route guards, and session/cookie patterns.
47 changes: 47 additions & 0 deletions apps/web/.agents/typescript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- based on https://github.com/TanStack/tanstack.com/blob/main/.claude/typescript.md -->

# TypeScript Conventions

## Avoid Type Casting

Never cast types unless absolutely necessary. This includes:

- Manual generic type parameters (e.g., `<Type>`)
- Type assertions using `as`
- Type assertions using `satisfies`

## Prefer Type Inference

Infer types by going up the logical chain:

1. **Schema validation** as source of truth (e.g. Zod)
2. **Type inference** from function return types, API responses
3. **Fix at source** (schema, API definition, function signature) rather than casting at point of use

```typescript
// Bad
const result = api.getData() as MyType;
const value = getValue<MyType>();

// Good
const result = api.getData(); // Type inferred from return type
const value = getValue(); // Type inferred from implementation
```

## Generic Type Parameter Naming

All generic type parameters must be prefixed with `T`.

```typescript
// Bad
function withCapability<Args extends unknown[], R>(
handler: (user: AuthUser, ...args: Args) => R,
) { ... }

// Good
function withCapability<TArgs extends unknown[], TReturn>(
handler: (user: AuthUser, ...args: TArgs) => TReturn,
) { ... }
```

Common names: `T`, `TArgs`, `TReturn`, `TData`, `TError`, `TKey`, `TValue`
18 changes: 18 additions & 0 deletions apps/web/.agents/workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Workflow

## Build Commands

- `pnpm build`: Only for build/bundler issues or verifying production output
- `pnpm lint`: Type-checking & type-aware linting
- `pnpm dev` runs indefinitely in watch mode
- `pnpm db` for Drizzle Kit commands (e.g. `pnpm db generate` to generate a migration)

Don't build after every change. If lint & type checks pass; assume changes work.

## Testing

No testing framework is currently set up. Prefer lint checks for now.

## Formatting

Oxfmt is configured for consistent code formatting via `pnpm format`. It runs automatically on commit via Husky pre-commit hooks, so manual formatting is not necessary.
10 changes: 10 additions & 0 deletions apps/web/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
max_line_length = 100
Loading
Loading