Skip to content

Commit d44b748

Browse files
authored
Merge branch 'dev' into ai-in-stack-companion
2 parents 2126fc1 + bb277d3 commit d44b748

634 files changed

Lines changed: 26181 additions & 23619 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.

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ dist
6161
.docusaurus
6262
.cache-loader
6363
**.tsbuildinfo
64+
docker/local-emulator/qemu/images
65+
docker/local-emulator/qemu/run
6466

6567
.xata*
6668

@@ -149,4 +151,3 @@ packages/stack/*
149151
!packages/react/package.json
150152
!packages/next/package.json
151153
!packages/stack/package.json
152-

.github/workflows/db-migration-backwards-compatibility.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ jobs:
145145
run: pnpm run wait-until-postgres-is-ready:pg_isready
146146

147147
- name: Wait on Inbucket
148-
run: pnpx wait-on tcp:localhost:8129
148+
run: pnpm exec wait-on tcp:localhost:8129
149149

150150
- name: Wait on Svix
151-
run: pnpx wait-on tcp:localhost:8113
151+
run: pnpm exec wait-on tcp:localhost:8113
152152

153153
- name: Wait on ClickHouse
154-
run: pnpx wait-on http://localhost:8136/ping
154+
run: pnpm exec wait-on http://localhost:8136/ping
155155

156156
- name: Initialize database
157157
run: pnpm run db:init
@@ -200,7 +200,7 @@ jobs:
200200
uses: JarvusInnovations/background-action@v1.0.7
201201
if: ${{ hashFiles('apps/backend/scripts/run-cron-jobs.ts') != '' }}
202202
with:
203-
run: pnpm -C apps/backend run with-env:dev tsx scripts/run-cron-jobs.ts --log-order=stream &
203+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
204204
wait-on: |
205205
http://localhost:8102
206206
tail: true
@@ -339,13 +339,13 @@ jobs:
339339
run: pnpm run wait-until-postgres-is-ready:pg_isready
340340

341341
- name: Wait on Inbucket
342-
run: pnpx wait-on tcp:localhost:8129
342+
run: pnpm exec wait-on tcp:localhost:8129
343343

344344
- name: Wait on Svix
345-
run: pnpx wait-on tcp:localhost:8113
345+
run: pnpm exec wait-on tcp:localhost:8113
346346

347347
- name: Wait on ClickHouse
348-
run: pnpx wait-on http://localhost:8136/ping
348+
run: pnpm exec wait-on http://localhost:8136/ping
349349

350350
- name: Initialize database
351351
run: pnpm run db:init
@@ -394,7 +394,7 @@ jobs:
394394
uses: JarvusInnovations/background-action@v1.0.7
395395
if: ${{ hashFiles('apps/backend/scripts/run-cron-jobs.ts') != '' }}
396396
with:
397-
run: pnpm -C apps/backend run with-env:dev tsx scripts/run-cron-jobs.ts --log-order=stream &
397+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
398398
wait-on: |
399399
http://localhost:8102
400400
tail: true

.github/workflows/e2e-api-tests-local-emulator.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ jobs:
9393
run: pnpm run wait-until-postgres-is-ready:pg_isready
9494

9595
- name: Wait on Inbucket
96-
run: pnpx wait-on tcp:localhost:8129
96+
run: pnpm exec wait-on tcp:localhost:8129
9797

9898
- name: Wait on Svix
99-
run: pnpx wait-on tcp:localhost:8113
99+
run: pnpm exec wait-on tcp:localhost:8113
100100

101101
- name: Wait on QStash
102-
run: pnpx wait-on tcp:localhost:8125
102+
run: pnpm exec wait-on tcp:localhost:8125
103103

104104
- name: Wait on ClickHouse
105-
run: pnpx wait-on http://localhost:8136/ping
105+
run: pnpm exec wait-on http://localhost:8136/ping
106106

107107
- name: Initialize database
108108
run: pnpm run db:init

.github/workflows/e2e-api-tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ jobs:
9999
run: pnpm run wait-until-postgres-is-ready:pg_isready
100100

101101
- name: Wait on Inbucket
102-
run: pnpx wait-on tcp:localhost:8129
102+
run: pnpm exec wait-on tcp:localhost:8129
103103

104104
- name: Wait on Svix
105-
run: pnpx wait-on tcp:localhost:8113
105+
run: pnpm exec wait-on tcp:localhost:8113
106106

107107
- name: Wait on QStash
108-
run: pnpx wait-on tcp:localhost:8125
108+
run: pnpm exec wait-on tcp:localhost:8125
109109

110110
- name: Wait on ClickHouse
111-
run: pnpx wait-on http://localhost:8136/ping
111+
run: pnpm exec wait-on http://localhost:8136/ping
112112

113113
- name: Initialize database
114114
run: pnpm run db:init

.github/workflows/e2e-custom-base-port-api-tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ jobs:
9292
run: pnpm run wait-until-postgres-is-ready:pg_isready
9393

9494
- name: Wait on Inbucket
95-
run: pnpx wait-on tcp:localhost:6729
95+
run: pnpm exec wait-on tcp:localhost:6729
9696

9797
- name: Wait on Svix
98-
run: pnpx wait-on tcp:localhost:6713
98+
run: pnpm exec wait-on tcp:localhost:6713
9999

100100
- name: Wait on QStash
101-
run: pnpx wait-on tcp:localhost:6725
101+
run: pnpm exec wait-on tcp:localhost:6725
102102

103103
- name: Wait on ClickHouse
104-
run: pnpx wait-on http://localhost:6736/ping
104+
run: pnpm exec wait-on http://localhost:6736/ping
105105

106106
- name: Initialize database
107107
run: pnpm run db:init
@@ -145,7 +145,7 @@ jobs:
145145
- name: Start run-cron-jobs in background
146146
uses: JarvusInnovations/background-action@v1.0.7
147147
with:
148-
run: pnpm -C apps/backend run run-cron-jobs --log-order=stream &
148+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
149149
wait-on: |
150150
http://localhost:6702
151151
tail: true
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# TODO: keep in sync with e2e-tests.yaml — this is a near-copy with the backend
2+
# started on the fallback port (8110) only, so the SDK exercises fallback logic.
3+
name: Runs E2E Fallback Tests
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
- dev
10+
pull_request:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
15+
16+
jobs:
17+
build:
18+
name: E2E Fallback Tests (Node ${{ matrix.node-version }})
19+
runs-on: ubicloud-standard-8
20+
env:
21+
NODE_ENV: test
22+
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
23+
STACK_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe"
24+
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
25+
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"
26+
# SDK reads this as the primary URL, discovers hardcoded fallback to port 8110
27+
NEXT_PUBLIC_STACK_API_URL: "http://localhost:8102"
28+
# Tells js-helpers to omit explicit baseUrl so the SDK exercises fallback logic
29+
STACK_TEST_SDK_FALLBACK: "true"
30+
31+
strategy:
32+
matrix:
33+
node-version: [22.x]
34+
35+
steps:
36+
- uses: actions/checkout@v6
37+
38+
- name: Setup Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v6
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
43+
- name: Setup pnpm
44+
uses: pnpm/action-setup@v4
45+
46+
- name: Start Docker Compose in background
47+
uses: JarvusInnovations/background-action@v1.0.7
48+
with:
49+
run: docker compose -f docker/dependencies/docker.compose.yaml up --pull always -d &
50+
wait-on: /dev/null
51+
tail: true
52+
wait-for: 3s
53+
log-output-if: true
54+
55+
- name: Install dependencies
56+
run: pnpm install --frozen-lockfile
57+
58+
- name: Create .env.test.local files
59+
run: |
60+
cp apps/backend/.env.development apps/backend/.env.test.local
61+
cp apps/dashboard/.env.development apps/dashboard/.env.test.local
62+
cp apps/e2e/.env.development apps/e2e/.env.test.local
63+
cp docs/.env.development docs/.env.test.local
64+
cp examples/cjs-test/.env.development examples/cjs-test/.env.test.local
65+
cp examples/demo/.env.development examples/demo/.env.test.local
66+
cp examples/docs-examples/.env.development examples/docs-examples/.env.test.local
67+
cp examples/e-commerce/.env.development examples/e-commerce/.env.test.local
68+
cp examples/middleware/.env.development examples/middleware/.env.test.local
69+
cp examples/supabase/.env.development examples/supabase/.env.test.local
70+
cp examples/convex/.env.development examples/convex/.env.test.local
71+
72+
- name: Build
73+
run: pnpm build
74+
75+
- name: Wait on Postgres
76+
run: pnpm run wait-until-postgres-is-ready:pg_isready
77+
78+
- name: Wait on Inbucket
79+
run: pnpx wait-on tcp:localhost:8129
80+
81+
- name: Wait on Svix
82+
run: pnpx wait-on tcp:localhost:8113
83+
84+
- name: Wait on QStash
85+
run: pnpx wait-on tcp:localhost:8125
86+
87+
- name: Wait on ClickHouse
88+
run: pnpx wait-on http://localhost:8136/ping
89+
90+
- name: Initialize database
91+
run: pnpm run db:init
92+
93+
# Start backend ONLY on fallback port 8110 — primary port 8102 is intentionally left down
94+
# so the SDK exercises its fallback logic for every request.
95+
- name: Start stack-backend on fallback port (8110)
96+
uses: JarvusInnovations/background-action@v1.0.7
97+
with:
98+
run: pnpm -C apps/backend run with-env:test next start --port 8110 &
99+
wait-on: |
100+
http://localhost:8110
101+
tail: true
102+
wait-for: 30s
103+
log-output-if: true
104+
105+
- name: Start stack-dashboard in background
106+
uses: JarvusInnovations/background-action@v1.0.7
107+
with:
108+
run: pnpm run start:dashboard --log-order=stream &
109+
wait-on: |
110+
http://localhost:8101
111+
tail: true
112+
wait-for: 30s
113+
log-output-if: true
114+
115+
- name: Start mock-oauth-server in background
116+
uses: JarvusInnovations/background-action@v1.0.7
117+
with:
118+
run: pnpm run start:mock-oauth-server --log-order=stream &
119+
wait-on: |
120+
http://localhost:8110
121+
tail: true
122+
wait-for: 30s
123+
log-output-if: true
124+
125+
- name: Start run-email-queue in background
126+
uses: JarvusInnovations/background-action@v1.0.7
127+
with:
128+
run: pnpm -C apps/backend run run-email-queue --log-order=stream &
129+
wait-on: |
130+
http://localhost:8110
131+
tail: true
132+
wait-for: 30s
133+
log-output-if: true
134+
135+
- name: Start run-cron-jobs in background
136+
uses: JarvusInnovations/background-action@v1.0.7
137+
with:
138+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
139+
wait-on: |
140+
http://localhost:8110
141+
tail: true
142+
wait-for: 30s
143+
log-output-if: true
144+
145+
- name: Wait 10 seconds
146+
run: sleep 10
147+
148+
- name: Verify primary port 8102 is NOT running
149+
run: |
150+
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8102/health 2>/dev/null | grep -q "200"; then
151+
echo "ERROR: Primary backend on port 8102 should NOT be running for fallback tests"
152+
exit 1
153+
fi
154+
echo "Confirmed: primary port 8102 is down, fallback tests will exercise SDK fallback logic"
155+
156+
# Only run JS SDK tests — these exercise the SDK's fallback logic.
157+
# Backend API tests use direct HTTP calls that don't go through fallback.
158+
# Exclude cross-domain-auth which hardcodes the primary URL.
159+
- name: Run SDK fallback tests
160+
run: pnpm -w run pre && cd apps/e2e && npx vitest run tests/js/ --exclude '**/{cross-domain-auth,oauth,email-template-existing-project}*'
161+
162+
- name: Print Docker Compose logs
163+
if: always()
164+
run: docker compose -f docker/dependencies/docker.compose.yaml logs

.github/workflows/lint-and-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
node-version: [latest]
20+
node-version: [24]
2121

2222
steps:
2323
- uses: actions/checkout@v6

0 commit comments

Comments
 (0)