Skip to content

Commit 1888b00

Browse files
committed
use doppler
1 parent 7a5b665 commit 1888b00

File tree

17 files changed

+113
-89
lines changed

17 files changed

+113
-89
lines changed

.github/workflows/continuous-release.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
test:
4646
runs-on: ubuntu-latest
4747
needs: [lint, typecheck]
48+
permissions:
49+
id-token: write
50+
contents: read
4851
steps:
4952
- name: Checkout code
5053
uses: actions/checkout@v4
@@ -58,18 +61,23 @@ jobs:
5861
- name: Install dependencies
5962
run: pnpm install --frozen-lockfile
6063

61-
- name: Install 1Password CLI
62-
uses: 1password/install-cli-action@v1
64+
- name: Install Doppler CLI
65+
uses: dopplerhq/cli-action@v3
66+
67+
- name: Get OIDC token
68+
run: |
69+
TOKEN=$(curl -s -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
70+
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=https://github.com/$GITHUB_REPOSITORY_OWNER")
71+
echo "OIDC_TOKEN=$(echo $TOKEN | jq -r '.value')" >> $GITHUB_ENV
72+
73+
- name: Authenticate with Doppler
74+
run: doppler oidc login --scope=. --identity=${{ vars.DOPPLER_SERVICE_IDENTITY_ID }} --token=$OIDC_TOKEN
6375

6476
- name: Run Unit Tests
65-
run: op run --env-file=op.env -- pnpm test
66-
env:
67-
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
77+
run: pnpm test
6878

6979
- name: Run fmodata E2E Tests
70-
run: op run --env-file=op.env -- pnpm --filter @proofkit/fmodata test:e2e:ci
71-
env:
72-
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
80+
run: pnpm --filter @proofkit/fmodata test:e2e
7381

7482
build:
7583
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,23 @@ jobs:
4444
- name: Type Check
4545
run: pnpm typecheck
4646

47-
- name: Install 1Password CLI
48-
uses: 1password/install-cli-action@v1
47+
- name: Install Doppler CLI
48+
uses: dopplerhq/cli-action@v3
49+
50+
- name: Get OIDC token
51+
run: |
52+
TOKEN=$(curl -s -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
53+
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=https://github.com/$GITHUB_REPOSITORY_OWNER")
54+
echo "OIDC_TOKEN=$(echo $TOKEN | jq -r '.value')" >> $GITHUB_ENV
55+
56+
- name: Authenticate with Doppler
57+
run: doppler oidc login --scope=. --identity=${{ vars.DOPPLER_SERVICE_IDENTITY_ID }} --token=$OIDC_TOKEN
4958

5059
- name: Run Tests
51-
run: op run --env-file=op.env -- pnpm test
52-
env:
53-
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
60+
run: pnpm test
5461

5562
- name: Run fmodata E2E Tests
56-
run: op run --env-file=op.env -- pnpm --filter @proofkit/fmodata test:e2e:ci
57-
env:
58-
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
63+
run: pnpm --filter @proofkit/fmodata test:e2e
5964

6065
release:
6166
name: Release

CONTRIBUTING.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Contributing to ProofKit
2+
3+
## Getting Started
4+
5+
### Prerequisites
6+
7+
- Node.js >= 18
8+
- pnpm (managed via corepack)
9+
- [Doppler CLI](https://docs.doppler.com/docs/install-cli) for secrets management
10+
11+
### Setup
12+
13+
1. Clone the repository and install dependencies:
14+
15+
```bash
16+
git clone https://github.com/proofgeist/proofkit.git
17+
cd proofkit
18+
corepack enable
19+
pnpm install
20+
```
21+
22+
2. Install and configure Doppler:
23+
24+
```bash
25+
# Install Doppler CLI
26+
brew install dopplerhq/cli/doppler # macOS
27+
# or: curl -Ls https://cli.doppler.com/install.sh | sh # Linux
28+
29+
# Login to Doppler
30+
doppler login
31+
32+
# Setup project (select proofkit project, dev config)
33+
doppler setup
34+
```
35+
36+
### Running Tests
37+
38+
Test scripts automatically use `doppler run` to inject secrets:
39+
40+
```bash
41+
# Run all tests
42+
pnpm test
43+
44+
# Run specific package tests
45+
pnpm --filter @proofkit/fmodata test
46+
pnpm --filter @proofkit/fmodata test:e2e
47+
```
48+
49+
### Building
50+
51+
```bash
52+
pnpm build
53+
```
54+
55+
### Linting and Formatting
56+
57+
```bash
58+
pnpm lint
59+
pnpm format
60+
```
61+
62+
## Development Workflow
63+
64+
1. Create a new branch for your feature or fix
65+
2. Make your changes
66+
3. Run tests with `pnpm test:local`
67+
4. Run `pnpm lint` to check for issues
68+
5. Submit a pull request
69+
70+
## Code Style
71+
72+
This project uses [Ultracite](https://github.com/proofgeist/ultracite) for linting and formatting. Run `pnpm dlx ultracite fix` to auto-fix issues before committing.

doppler.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
setup:
2+
project: proofkit
3+
config: dev

op.env

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"sherif": "pnpm dlx sherif@latest",
1313
"sherif:fix": "pnpm sherif --fix",
1414
"release": "turbo run build --filter={./packages/*} && changeset publish",
15-
"test": "vitest",
15+
"test": "doppler run -- vitest",
1616
"knip": "knip",
1717
"prepare": "husky"
1818
},

packages/better-auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "dist/esm/index.js",
77
"scripts": {
88
"dev": "pnpm build:watch",
9-
"test": "vitest run",
9+
"test": "doppler run -- vitest run",
1010
"typecheck": "tsc --noEmit",
1111
"build": "vite build && publint --strict",
1212
"build:watch": "vite build --watch",

packages/better-auth/tests/setupEnv.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import { defineConfig } from "vitest/config";
2-
// import dotenv from "dotenv";
3-
// import path from "path";
4-
5-
// // Load .env.local file explicitly
6-
// dotenv.config({ path: path.resolve(__dirname, ".env.local") });
72

83
export default defineConfig({
94
test: {
105
testTimeout: 15_000, // 15 seconds, since we're making a network call to FM
11-
setupFiles: ["./tests/setupEnv.ts"],
126
},
137
});

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"pub:beta": "NODE_ENV=production pnpm build && npm publish --tag beta --access public",
5252
"pub:next": "NODE_ENV=production pnpm build && npm publish --tag next --access public",
5353
"pub:release": "NODE_ENV=production pnpm build && npm publish --access public",
54-
"test": "vitest run"
54+
"test": "doppler run -- vitest run"
5555
},
5656
"dependencies": {
5757
"@better-fetch/fetch": "1.1.17",

0 commit comments

Comments
 (0)