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
39 changes: 16 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,30 @@ jobs:
NPM_CONFIG_OPTIONAL: "true"
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Enable Corepack
run: corepack enable

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1.16.1
with:
node-version: "24.x"
node-version: "24"
cache: true
run-install: true

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build package
run: vp pack

- name: Check
run: pnpm exec vp check
run: vp check

- name: Test
run: pnpm exec vp test

- name: Build package
run: pnpm exec vp pack
run: vp test

- name: Inspect packed package manifest
shell: bash
run: |
PACK_DIR="$RUNNER_TEMP/npm-pack"
mkdir -p "$PACK_DIR"
pnpm pack --pack-destination "$PACK_DIR"
vp pm pack --pack-destination "$PACK_DIR"

TARBALL="$(find "$PACK_DIR" -maxdepth 1 -name '*.tgz' -print -quit)"
if [[ -z "$TARBALL" ]]; then
Expand All @@ -66,19 +62,16 @@ jobs:
node -e 'const fs = require("node:fs"); const pkg = JSON.parse(fs.readFileSync(process.argv[1], "utf8")); if (pkg.pnpm?.patchedDependencies || pkg.patchedDependencies) { console.error("::error ::Packed package.json contains publish-time patch metadata."); process.exit(1); }' "$PACK_DIR/package.json"

- name: Lint package metadata
run: pnpm run lint:package
run: vp run lint:package

- name: Lint package types
run: pnpm run lint:types

- name: TanStack example check
run: pnpm --dir examples/tanstack run check:ci
run: vp run lint:types

- name: TanStack example test
run: pnpm --dir examples/tanstack run test
run: vp -C examples/tanstack test run

- name: TanStack example build
run: pnpm --dir examples/tanstack run build
run: vp -C examples/tanstack build

- name: TanStack example Wrangler dry-run
run: pnpm --dir examples/tanstack run wrangler:dry-run
run: vp -C examples/tanstack run wrangler:dry-run
55 changes: 17 additions & 38 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown,
Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend
tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, and it invokes Vite through
`vp dev` and `vp build`. Run `vp help` to print a list of commands and `vp <command> --help` for
information about a specific command.
tooling in a single global CLI called `vp`. Vite+ is distinct from Vite. Built-in app commands use
`vp dev`, `vp build`, and `vp preview`; target the TanStack app explicitly with
`vp -C examples/tanstack <command>`. The library uses `vp pack`. Run `vp help` to print a list of
commands and `vp <command> --help` for information about a specific command.

Docs are local at `node_modules/vite-plus/docs` or online at https://viteplus.dev/guide/.

Expand All @@ -31,7 +32,7 @@ No local vendoring. Use `opensrc path <package>` + `rg`/`sed`.
- Read: `cat $(opensrc path <package>)/path/to/file`
- Other registries: `find $(opensrc path pypi:requests) -name "*.py"`

> **Note:** For deep technical details, refer to [README.md](file:///Users/alexasomba/Documents/GitHub/alexasomba/better-auth-paystack/README.md).
> **Note:** For deep technical details, refer to [README.md](README.md).

## Project Identity

Expand All @@ -41,43 +42,21 @@ A TypeScript library providing **Paystack** integration for **Better Auth**. Sup

For best practices and reference implementations, research:

- `better-auth better-auth main packages-stripe/`: Stripe integration reference.
- `docs/better-auth/concepts`: Core Better Auth concepts and patterns.
- [Better Auth Stripe integration](https://github.com/better-auth/better-auth/tree/main/packages/stripe)
- [Better Auth plugin documentation](https://github.com/better-auth/better-auth/tree/main/docs/content/docs/plugins)

## Tech Stack
## Repository Validation

- **Core**: TypeScript, pnpm, tsdown, vitest, Oxlint
- **Dependencies**: `better-auth`, `@alexasomba/paystack-node`, `better-call`, `zod`
Run the following checks for changes that affect the package or its examples:

## Project Map

- `src/`: Core logic
- `index.ts`: Server plugin entry
- `client.ts`: Client plugin entry
- `routes.ts`: API implementations
- `schema.ts`: DB extensions
- `middleware.ts`, `limits.ts`, `utils.ts`: Core helpers
- `examples/`: Next.js and TanStack Start reference implementations
- `test/`: Unit and integration test suite

## Key Commands (vp)

| Command | Action |
| :------------------- | :---------------------------------------------------- |
| `vp pack` | Build the library |
| `vp test` | Run tests (`RUN_INTEGRATION_TESTS=1` for integration) |
| `vp check` | All-in-one format, lint, and type check |
| `vp lint` / `vp fmt` | Lint and format code |

## Rules of Engagement

1. **Surgical Updates**: Maintain existing architectural patterns and strict type safety.
2. **Planning Mode**: Enter plan mode for any non-trivial task (3+ steps). Write detailed specs.
3. **Subagent Strategy**: Use subagents for research, exploration, and parallel analysis.
4. **Autonomous Bug Fixing**: Fix bugs and failing CI tests without hand-holding.
5. **Verification**: Never mark a task complete without proof (tests, logs, diffs).
6. **Elegance**: Avoid hacky fixes. Seek the elegant solution for non-trivial changes.
7. **Self-Improvement**: Update `tasks/lessons.md` after any user correction.
- `vp check`
- `vp test`
- `vp pack`
- `vp run lint:package`
- `vp run lint:types`
- `vp -C examples/tanstack test run`
- `vp -C examples/tanstack build`
- `vp -C examples/tanstack run wrangler:dry-run`

## 🚨 Session Close Protocol

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -866,19 +866,19 @@ This repository is powered by **Vite+**. You use the `vp` CLI to manage the enti

```bash
# Install dependencies
vp i
vp install

# Check project health (format, lint, types)
vp check --fix

# Build the core library
vp build
vp pack

# Run tests
vp test

# Run the TanStack Start example
vp run examples/tanstack dev
vp -C examples/tanstack dev
```

Contributions are welcome! Please open an issue or pull request.
Expand Down
Loading
Loading