Skip to content

Commit 74d6bc9

Browse files
tywenkclaude
andcommitted
chore: retool fork and rename to vitest-prisma
Forked from codepunkt/vitest-environment-prisma-postgres at v1.0.1. This change resets the tooling to match kaizen-labs conventions and drops "postgres" from the public API so the environment can grow into a db-adapter-agnostic package. Tooling swaps: - Biome → Oxlint + Oxfmt (.oxlintrc.json, .oxfmtrc.jsonc) - tsup → tsdown (ESM-only, target node20, dts copied from src/dts) - release-it + conventional-changelog → Changesets (.changeset/config.json, release workflow) - Renovate → Dependabot (npm + github-actions, weekly, grouped) - Removed CodeRabbit, mise; added .nvmrc (Node 24) for local dev Rename (breaking): - Package: vitest-environment-prisma-postgres → vitest-prisma (scripts, keywords, description made adapter-agnostic) - Repo: github.com/the-kaizen-labs/vitest-prisma - Env name: 'prisma-postgres' → 'prisma' - Global: prismaPostgresTestContext → prismaTestContext - Type: PrismaPostgresEnvironmentOptions → PrismaEnvironmentOptions - Error prefix: [vitest-environment-prisma-postgres] → [vitest-prisma] - Savepoint prefix: vitest_environment_prisma_postgres_ → vitest_prisma_ - Fixed typo: src/contest.test.ts → src/context.test.ts CI: - Split into quality job (lint/format/typecheck/build, runs once on the .nvmrc Node) and test job (matrix on Node 20/22/24 with Codecov upload on Node 24) - Added concurrency cancellation for PR runs - Switched pinned-SHA action refs to floating tags; Dependabot owns updates now - Added cache: pnpm on setup-node Docs: - CHANGELOG.md cleared with a fork-attribution note - README banner image removed; examples updated to new API; framing made adapter-agnostic - CONTRIBUTING.md: conventional-commits section replaced with Changesets section; references updated - SECURITY.md advisory URL updated Verified: lint 0/0, format clean, tsc --noEmit clean, 10/10 tests passing (100% coverage), tsdown build emits dist/{index,setup}.mjs and dist/index.d.ts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fc5b11e commit 74d6bc9

29 files changed

Lines changed: 1868 additions & 2368 deletions

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json",
3+
"changelog": [
4+
"@changesets/cli/changelog",
5+
{ "repo": "the-kaizen-labs/vitest-prisma" }
6+
],
7+
"commit": false,
8+
"fixed": [],
9+
"linked": [],
10+
"access": "public",
11+
"baseBranch": "main",
12+
"updateInternalDependencies": "patch",
13+
"ignore": []
14+
}

.coderabbit.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/CONTRIBUTING.md

Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to vitest-environment-prisma-postgres
1+
# Contributing to vitest-prisma
22

3-
Thank you for considering contributing to vitest-environment-prisma-postgres! Whether you're fixing a typo, reporting a bug, or proposing a new feature, your contribution helps make database testing faster and easier for the entire Vitest and Prisma community. This is a small project maintained in limited time, and every contribution is genuinely appreciated.
3+
Thank you for considering contributing to vitest-prisma! Whether you're fixing a typo, reporting a bug, or proposing a new feature, your contribution helps make database testing faster and easier for the entire Vitest and Prisma community. This is a small project maintained in limited time, and every contribution is genuinely appreciated.
44

55
## How You Can Contribute
66

@@ -31,7 +31,7 @@ When reporting a bug, please include:
3131
- Package version
3232
- Vitest version
3333
- Prisma version
34-
- PostgreSQL version
34+
- Database adapter and version (e.g. `@prisma/adapter-pg`)
3535
- **Error messages** or stack traces if applicable
3636

3737
The more details you provide, the easier it is to understand and fix the issue.
@@ -48,9 +48,11 @@ The more details you provide, the easier it is to understand and fix the issue.
4848
1. **Fork the repository** on GitHub
4949

5050
2. **Clone your fork** locally:
51+
5152
```bash
52-
git clone https://github.com/YOUR_USERNAME/vitest-environment-prisma-postgres.git
53-
cd vitest-environment-prisma-postgres
53+
git clone https://github.com/YOUR_USERNAME/vitest-prisma.git
54+
# then add the upstream remote (the-kaizen-labs/vitest-prisma)
55+
cd vitest-prisma
5456
```
5557

5658
3. **Install dependencies**:
@@ -69,7 +71,7 @@ All tests must pass before submitting a pull request.
6971

7072
### Code Quality Checks
7173

72-
This project uses [Biome](https://biomejs.dev/) for linting and formatting:
74+
This project uses [Oxlint](https://oxc.rs/docs/guide/usage/linter) for linting and [Oxfmt](https://oxc.rs/docs/guide/usage/formatter) for formatting:
7375

7476
```bash
7577
pnpm run lint # Check for linting issues
@@ -104,6 +106,7 @@ For **small fixes** (typos, small bug fixes, documentation improvements), feel f
104106
### Creating a Pull Request
105107

106108
1. **Create a feature branch** from `main`:
109+
107110
```bash
108111
git checkout -b feat/your-feature-name
109112
# or
@@ -119,6 +122,7 @@ For **small fixes** (typos, small bug fixes, documentation improvements), feel f
119122
3. **Commit your changes** following our [commit message guidelines](#commit-message-guidelines)
120123

121124
4. **Push to your fork**:
125+
122126
```bash
123127
git push origin feat/your-feature-name
124128
```
@@ -141,52 +145,25 @@ For **small fixes** (typos, small bug fixes, documentation improvements), feel f
141145
- Once approved, your PR will be merged using "Squash and Merge"
142146
- Your contribution will be included in the next release with automated changelog generation
143147

144-
## Commit Message Guidelines
148+
## Changesets
145149

146-
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated changelog generation and semantic versioning.
150+
This project uses [Changesets](https://github.com/changesets/changesets) for changelog generation and versioning. If your PR contains a user-facing change (a feature, fix, or breaking change), add a changeset:
147151

148-
### Format
149-
150-
```
151-
<type>: <description>
152+
```bash
153+
pnpm changeset
152154
```
153155

154-
### Types
156+
Pick the appropriate semver bump (`patch` / `minor` / `major`) and write a short summary that will land in the public changelog. Commit the generated file in `.changeset/` along with your PR.
155157

156-
Based on the project's release configuration, use one of these types:
158+
Internal-only changes (refactors, tests, CI tweaks) don't need a changeset.
157159

158-
- `feat:` - New features (appears in changelog as ✨ **New Features**)
159-
- `fix:` - Bug fixes (appears in changelog as 🐛 **Bug Fixes**)
160-
- `docs:` - Documentation changes (appears in changelog as 📚 **Documentation**)
161-
- `perf:` - Performance improvements (appears in changelog as 🚀 **Performance**)
162-
- `ci:` - CI/CD changes (appears in changelog as ⚙️ **CI**)
163-
- `test:` - Test additions or changes (not in changelog)
164-
- `refactor:` - Code refactoring (not in changelog)
165-
- `chore:` - Maintenance tasks (not in changelog)
166-
- `build:` - Build system changes (not in changelog)
167-
168-
### Examples
169-
170-
```bash
171-
feat: add support for nested transactions
172-
fix: prevent memory leak in transaction rollback
173-
docs: clarify setup instructions for Testcontainers
174-
perf: optimize transaction initialization
175-
test: add tests for edge cases in rollback logic
176-
refactor: simplify client creation logic
177-
```
178-
179-
Include a detailed description in the commit body explaining:
180-
- What changed
181-
- Why it changed
182-
- How to migrate from the old behavior
160+
## Commit Message Guidelines
183161

184-
### Tips
162+
Commit messages are not parsed for releases (Changesets owns that), but please keep them readable:
185163

186-
- **Keep it concise**: The description should be clear and to the point
187-
- **Use imperative mood**: "add feature" not "added feature" or "adds feature"
188-
- **Don't capitalize** the first letter of the description
189-
- **No period** at the end of the description
164+
- Use imperative mood: "add feature" not "added feature"
165+
- Keep the summary line short and descriptive
166+
- Add a body when the change needs context or migration notes
190167

191168
## Testing Guidelines
192169

@@ -224,10 +201,10 @@ describe('MyFeature', () => {
224201
## Getting Help
225202

226203
- **Usage questions?** Check the [README](./README.md) first
227-
- **Found a bug?** [Open an issue](https://github.com/codepunkt/vitest-environment-prisma-postgres/issues/new)
228-
- **Want to discuss a feature?** [Open an issue](https://github.com/codepunkt/vitest-environment-prisma-postgres/issues/new) for discussion
204+
- **Found a bug?** [Open an issue](https://github.com/the-kaizen-labs/vitest-prisma/issues/new)
205+
- **Want to discuss a feature?** [Open an issue](https://github.com/the-kaizen-labs/vitest-prisma/issues/new) for discussion
229206
- **General questions?** Feel free to start a discussion or comment on relevant issues
230207

231208
## License
232209

233-
By contributing to vitest-environment-prisma-postgres, you agree that your contributions will be licensed under the [MIT License](./LICENSE).
210+
By contributing to vitest-prisma, you agree that your contributions will be licensed under the [MIT License](./LICENSE).

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github: codepunkt
1+
github: codepunkt

.github/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
If you find a security issue, please do not open a public issue.
44

5-
Please report vulnerabilities through GitHub’s [private reporting feature](https://github.com/codepunkt/vitest-environment-prisma-postgres/security/advisories/new) instead.
5+
Please report vulnerabilities through GitHub’s [private reporting feature](https://github.com/the-kaizen-labs/vitest-prisma/security/advisories/new) instead.

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
labels:
9+
- dependencies
10+
groups:
11+
all-non-major:
12+
update-types:
13+
- minor
14+
- patch
15+
- package-ecosystem: github-actions
16+
directory: '/'
17+
schedule:
18+
interval: weekly
19+
labels:
20+
- dependencies

.github/workflows/ci.yml

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,54 @@
1-
name: Continuous Integration
1+
name: CI
22

33
on:
44
pull_request:
5-
branches: [ main ]
5+
branches: [main]
66
push:
7-
branches: [ main ]
7+
branches: [main]
88
workflow_dispatch:
99

10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13+
1014
jobs:
11-
main:
12-
name: Continuous Integration
15+
quality:
16+
name: Lint, format, typecheck, build
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.27.0
23+
- uses: actions/setup-node@v6
24+
with:
25+
node-version-file: .nvmrc
26+
cache: pnpm
27+
- run: pnpm install --frozen-lockfile
28+
- run: pnpm run lint
29+
- run: pnpm run format:check
30+
- run: pnpm run typecheck
31+
- run: pnpm run build
32+
33+
test:
34+
name: Test (Node ${{ matrix.node-version }})
1335
runs-on: ubuntu-latest
1436
strategy:
37+
fail-fast: false
1538
matrix:
16-
node-version: [20.x, 22.x, 24.x]
39+
node-version: ['20', '22', '24']
1740
steps:
18-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
21-
with:
22-
node-version: ${{ matrix.node-version }}
23-
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
41+
- uses: actions/checkout@v6
42+
- uses: pnpm/action-setup@v4
2443
with:
2544
version: 10.27.0
26-
- name: Install Dependencies
27-
run: |
28-
pnpm install --frozen-lockfile
29-
- name: Lint, check formatting and types
30-
run: |
31-
pnpm run lint
32-
pnpm run format:check
33-
pnpm run typecheck
34-
- name: Test
35-
run: |
36-
pnpm run test
37-
- name: Upload coverage reports to Codecov
38-
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
45+
- uses: actions/setup-node@v6
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
cache: pnpm
49+
- run: pnpm install --frozen-lockfile
50+
- run: pnpm run test
51+
- if: matrix.node-version == '24'
52+
uses: codecov/codecov-action@v5
3953
with:
4054
token: ${{ secrets.CODECOV_TOKEN }}
41-
if: matrix.node-version == '24.x'
42-
- name: Build
43-
run: |
44-
pnpm run build

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
concurrency: ${{ github.workflow }}-${{ github.ref }}-release
8+
9+
jobs:
10+
release:
11+
if: github.repository == 'the-kaizen-labs/vitest-prisma'
12+
name: Release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
id-token: write
18+
steps:
19+
- uses: actions/checkout@v6
20+
21+
- uses: pnpm/action-setup@v4
22+
with:
23+
version: 10.27.0
24+
25+
- uses: actions/setup-node@v6
26+
with:
27+
node-version-file: .nvmrc
28+
registry-url: https://registry.npmjs.org
29+
30+
- run: pnpm install --frozen-lockfile
31+
32+
- run: pnpm run lint
33+
- run: pnpm run typecheck
34+
- run: pnpm run test
35+
- run: pnpm run build
36+
37+
- uses: changesets/action@v1
38+
with:
39+
title: 'chore(release): version package'
40+
commit: 'chore(release): version package'
41+
version: pnpm run version
42+
publish: pnpm exec changeset publish
43+
createGithubReleases: true
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.mise.toml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

0 commit comments

Comments
 (0)