Skip to content

Commit b57ae3a

Browse files
Lykhoydaclaude
andcommitted
fix: inject TESTUDO_API_KEY and TESTUDO_API_URL into extension build
The extension bundle did not replace process.env.TESTUDO_API_KEY because rolldown's define block was missing it. Also, E2E CI was defaulting to the production API URL because TESTUDO_API_URL was not set at build time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7d1b2ed commit b57ae3a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565

6666
- name: Build extension
6767
env:
68+
TESTUDO_API_URL: http://localhost:3001
6869
TESTUDO_API_KEY: e2e-test-key
6970
run: yarn workspace @testudo/extension run build
7071

@@ -143,6 +144,7 @@ jobs:
143144

144145
- name: Build extension
145146
env:
147+
TESTUDO_API_URL: http://localhost:3001
146148
TESTUDO_API_KEY: e2e-test-key
147149
run: yarn workspace @testudo/extension run build
148150

packages/extension/rolldown.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ for (const file of readdirSync(fontsSrc)) {
2626
console.log('Copied manifest.json, popup.html, options.html, blocked.html, and fonts/ to dist/');
2727

2828
const apiUrl = process.env.TESTUDO_API_URL || 'https://testudo-api-production.up.railway.app';
29+
const apiKey = process.env.TESTUDO_API_KEY || '';
2930
console.log(`[Testudo Build] API URL: ${apiUrl}`);
31+
console.log(`[Testudo Build] API Key: ${apiKey ? '[SET]' : '[NOT SET]'}`);
3032

3133
const shared = {
3234
output: {
@@ -37,6 +39,7 @@ const shared = {
3739
},
3840
define: {
3941
'process.env.TESTUDO_API_URL': JSON.stringify(apiUrl),
42+
'process.env.TESTUDO_API_KEY': JSON.stringify(apiKey),
4043
},
4144
transform: {
4245
jsx: { mode: 'automatic' as const, importSource: 'preact' },

0 commit comments

Comments
 (0)