Skip to content

Commit cfef74e

Browse files
committed
Merge branch 'v2'
2 parents da08833 + 8becc4f commit cfef74e

237 files changed

Lines changed: 23975 additions & 11278 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.envrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# shellcheck shell=bash
2+
source_env_if_exists .envrc.local
3+
4+
alias pipelines='bun apps/service/src/bin/sync-service.ts pipelines'
5+
alias tsx='node --conditions bun --import tsx --no-warnings --use-env-proxy'

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
code: ${{ steps.filter.outputs.code }}
2525
steps:
2626
- uses: actions/checkout@v5
27-
- uses: dorny/paths-filter@v3
27+
- uses: dorny/paths-filter@v4
2828
id: filter
2929
with:
3030
filters: |
@@ -447,7 +447,20 @@ jobs:
447447
ghcr.io/${{ github.repository }}-service:${{ github.sha }}-arm64
448448
449449
- name: Docker smoke test
450-
run: docker run --rm ghcr.io/${{ github.repository }}:${{ github.sha }} --version
450+
run: |
451+
docker run -d --name smoke -p 3000:3000 ghcr.io/${{ github.repository }}:${{ github.sha }}
452+
trap 'docker rm -f smoke 2>/dev/null || true' EXIT
453+
for i in $(seq 1 30); do
454+
body=$(curl -sf http://localhost:3000/health 2>/dev/null || true)
455+
if echo "$body" | grep -q '"ok":true'; then
456+
echo "health check passed: $body"
457+
exit 0
458+
fi
459+
sleep 1
460+
done
461+
echo "health check timed out"
462+
docker logs smoke
463+
exit 1
451464
452465
# ---------------------------------------------------------------------------
453466
# E2E Docker — Docker image smoke + engine tests (runs on every push/PR)

.github/workflows/prod-e2e-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
with:
2626
node-version: '24'
2727

28+
- name: Setup Bun
29+
uses: oven-sh/setup-bun@v2
30+
2831
- name: Install Stripe CLI
2932
run: |
3033
curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor -o /usr/share/keyrings/stripe.gpg
@@ -132,7 +135,7 @@ jobs:
132135
DATABASE_URL: ${{ steps.create-db.outputs.db_string }}
133136
run: |
134137
set +e
135-
node scripts/reconcile-sigma-vs-postgres.js
138+
bun scripts/reconcile-sigma-vs-postgres.ts
136139
STATUS=$?
137140
if [ "$STATUS" -ne 0 ]; then
138141
echo "::warning title=Sigma reconciliation::Postgres is missing rows that exist in Sigma. See the job log for the per-table diff and the list of missing IDs with their created timestamps."

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ node_modules/
99
*.tgz
1010
.mcp*
1111
private/
12-
.envrc
12+
.envrc.local
1313

1414
.mcp.*
1515
.vercel
@@ -27,6 +27,10 @@ private/
2727

2828
# Local cred storage
2929
.credentials/
30+
.stripe-sync/
31+
32+
# Local test scripts
33+
scripts/test-all-accounts.sh
3034

3135
# Git worktrees
3236
.worktrees/
@@ -50,3 +54,9 @@ test-results/
5054
apps/visualizer/out/
5155

5256
.sync-state*.json
57+
*.log
58+
59+
# Reconcile / verification output
60+
tmp/
61+
prev-run.txt
62+
verify-*.json

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,14 @@ See [docs/architecture/principles.md](docs/architecture/principles.md) for the c
7979
- Generated OpenAPI specs live in each package's `src/__generated__/openapi.json`. Run `./scripts/generate-openapi.sh` and commit the output before pushing when schemas change. Never edit generated files by hand.
8080
- Non-trivial PRs should be accompanied by a plan artifact in `docs/plans/YYYY-MM-DD-<slug>.md`. Save it before or alongside the first implementation commit.
8181

82+
## Debugging
83+
84+
- **[Debugging the sync CLI](docs/guides/debugging-sync-cli.md)** — subprocess log location, pnpm store staleness, dist vs bun condition.
85+
8286
## Key Gotchas
8387

88+
- **No build step for local dev** — the sync CLI uses `--conditions bun --import tsx` so it reads `.ts` source directly. Edits to workspace packages propagate immediately. `pnpm build` is only needed for vitest (which resolves `dist/`) and Docker.
89+
- **Do NOT add `injectWorkspacePackages: true`** to `pnpm-workspace.yaml` — it copies files into the pnpm store as hardlinks, which break silently when editors save (write-temp-then-rename). Without it, pnpm uses symlinks and edits always propagate. Docker builds use `pnpm deploy --legacy` instead.
8490
- `tsx` fails on `apps/supabase``?raw` imports pull in Deno-only code. Other packages work fine with `npx tsx`.
8591
- `packages/sync-engine/src/supabase` is Deno, not Node. Don't run those files with Node/tsx.
8692
- E2E tests need Stripe keys with **write** permissions (they create real objects).

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ RUN pnpm install --frozen-lockfile
3333

3434
# ---- Build layer ----
3535
COPY . ./
36-
RUN pnpm --filter @stripe/sync-engine deploy --prod /deploy
36+
RUN pnpm --filter @stripe/sync-engine deploy --legacy --prod /deploy
3737

3838
FROM node:24-alpine AS engine
3939
WORKDIR /app
@@ -71,7 +71,7 @@ RUN pnpm install --frozen-lockfile
7171

7272
# ---- Build layer ----
7373
COPY . ./
74-
RUN pnpm --filter @stripe/sync-service deploy --prod /deploy
74+
RUN pnpm --filter @stripe/sync-service deploy --legacy --prod /deploy
7575

7676
FROM node:24 AS service
7777
WORKDIR /app

apps/dashboard/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"clsx": "^2",
2121
"lucide-react": "^0.511",
2222
"openapi-fetch": "^0.13",
23-
"react": "^19",
24-
"react-dom": "^19",
23+
"react": "19.2.5",
24+
"react-dom": "19.2.5",
2525
"tailwind-merge": "^3"
2626
},
2727
"devDependencies": {
@@ -33,8 +33,8 @@
3333
"@stripe/sync-service": "workspace:*",
3434
"@stripe/sync-source-stripe": "workspace:*",
3535
"@tailwindcss/vite": "^4",
36-
"@types/react": "^19",
37-
"@types/react-dom": "^19",
36+
"@types/react": "19.2.14",
37+
"@types/react-dom": "19.2.3",
3838
"@vitejs/plugin-react": "^4",
3939
"tailwindcss": "^4",
4040
"typescript": "^5",

apps/engine/package.json

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,51 @@
2828
"bun": "./src/api/openapi-utils.ts",
2929
"types": "./dist/api/openapi-utils.d.ts",
3030
"import": "./dist/api/openapi-utils.js"
31+
},
32+
"./progress": {
33+
"bun": "./src/lib/progress/index.ts",
34+
"types": "./dist/lib/progress/index.d.ts",
35+
"import": "./dist/lib/progress/index.js"
3136
}
3237
},
3338
"scripts": {
34-
"build": "tsc",
39+
"build": "tsc && cp -r src/__generated__ dist/__generated__",
3540
"x:watch": "sh -c 'if command -v bun > /dev/null 2>&1; then bun --watch \"$@\"; else tsx --watch --conditions bun \"$@\"; fi' --",
36-
"dev": "LOG_LEVEL=${LOG_LEVEL:-trace} LOG_PRETTY=${LOG_PRETTY:-true} DANGEROUSLY_VERBOSE_LOGGING=true pnpm x:watch src/bin/serve.ts",
41+
"dev": "LOG_LEVEL=${LOG_LEVEL:-trace} pnpm x:watch src/bin/serve.ts",
3742
"test": "vitest run",
3843
"generate:types": "openapi-typescript src/__generated__/openapi.json -o src/__generated__/openapi.d.ts"
3944
},
4045
"files": [
41-
"dist",
42-
"src"
46+
"src",
47+
"dist"
4348
],
4449
"dependencies": {
4550
"@hono/node-server": "^1",
4651
"@scalar/hono-api-reference": "^0.6",
4752
"@stripe/sync-destination-google-sheets": "workspace:*",
4853
"@stripe/sync-destination-postgres": "workspace:*",
4954
"@stripe/sync-hono-zod-openapi": "workspace:*",
50-
"@stripe/sync-integration-supabase": "workspace:*",
55+
"@stripe/sync-logger": "workspace:*",
5156
"@stripe/sync-protocol": "workspace:*",
5257
"@stripe/sync-source-stripe": "workspace:*",
53-
"@stripe/sync-state-postgres": "workspace:*",
5458
"@stripe/sync-ts-cli": "workspace:*",
5559
"@stripe/sync-util-postgres": "workspace:*",
5660
"citty": "^0.1.6",
5761
"dotenv": "^16.4.7",
5862
"googleapis": "^148.0.0",
5963
"hono": "^4",
64+
"ink": "^7.0.1",
6065
"openapi-fetch": "^0.17.0",
6166
"pg": "^8.16.3",
62-
"pino": "^10",
63-
"pino-pretty": "^13",
67+
"react": "19.2.5",
6468
"ws": "^8.18.0",
6569
"zod": "^4.3.6"
6670
},
6771
"devDependencies": {
6872
"@hyperjump/json-schema": "^1.17.5",
6973
"@types/node": "^24.10.1",
7074
"@types/pg": "^8.15.4",
75+
"@types/react": "19.2.14",
7176
"openapi-typescript": "^7.13.0",
7277
"vitest": "^3.2.4"
7378
},

0 commit comments

Comments
 (0)