From 5137d1308901669a80d70c09748bc2fd1fc4f256 Mon Sep 17 00:00:00 2001 From: bkellam Date: Sat, 31 Jan 2026 13:11:18 -0800 Subject: [PATCH 1/2] add AUTH_URL --- .devcontainer/devcontainer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 604496ff..078af94a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,6 +9,10 @@ "ghcr.io/devcontainers/features/github-cli:1": {} }, + "remoteEnv": { + "AUTH_URL": "https://${containerEnv:CODESPACE_NAME}-3000.app.github.dev" + }, + "forwardPorts": [3000], "portsAttributes": { "3000": { "label": "Web App", "onAutoForward": "notify" } From ea36fa1257cdc17c05cd46190a5f523d3fd7fa3c Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Sat, 31 Jan 2026 21:26:33 +0000 Subject: [PATCH 2/2] s --- .devcontainer/devcontainer.json | 88 ++++++++++++++-------------- .devcontainer/scripts/post-create.sh | 22 ++++++- .prettierrc | 3 + packages/web/next.config.mjs | 13 +++- 4 files changed, 78 insertions(+), 48 deletions(-) create mode 100644 .prettierrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 078af94a..485a6087 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,54 +1,52 @@ { - "name": "Sourcebot Development", - "dockerComposeFile": "docker-compose.yml", - "service": "devcontainer", - "workspaceFolder": "/workspaces/sourcebot", + "name": "Sourcebot Development", + "dockerComposeFile": "docker-compose.yml", + "service": "devcontainer", + "workspaceFolder": "/workspaces/sourcebot", - "features": { - "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} - }, + "features": { + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, - "remoteEnv": { - "AUTH_URL": "https://${containerEnv:CODESPACE_NAME}-3000.app.github.dev" - }, + "remoteEnv": { + "AUTH_URL": "https://${containerEnv:CODESPACE_NAME}-3000.app.github.dev" + }, - "forwardPorts": [3000], - "portsAttributes": { - "3000": { "label": "Web App", "onAutoForward": "notify" } - }, + "forwardPorts": [3000], + "portsAttributes": { + "3000": { "label": "Web App", "onAutoForward": "notify" } + }, - "initializeCommand": "git submodule update --init --recursive", - "postCreateCommand": "bash .devcontainer/scripts/post-create.sh", - "postStartCommand": "bash .devcontainer/scripts/post-start.sh", + "initializeCommand": "git submodule update --init --recursive", + "postCreateCommand": "bash .devcontainer/scripts/post-create.sh", + "postStartCommand": "bash .devcontainer/scripts/post-start.sh", - "customizations": { - "vscode": { - "extensions": [ - "dbaeumer.vscode-eslint", - "bradlc.vscode-tailwindcss", - "Prisma.prisma", - "esbenp.prettier-vscode", - "golang.go", - "ms-azuretools.vscode-docker", - "mikestead.dotenv", - "eamodio.gitlens" - ], - "settings": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[prisma]": { - "editor.defaultFormatter": "Prisma.prisma" + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "bradlc.vscode-tailwindcss", + "Prisma.prisma", + "esbenp.prettier-vscode", + "golang.go", + "eamodio.gitlens" + ], + "settings": { + "editor.formatOnSave": false, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[prisma]": { + "editor.defaultFormatter": "Prisma.prisma" + } + } } - } - } - }, + }, - "remoteUser": "node" + "remoteUser": "node" } diff --git a/.devcontainer/scripts/post-create.sh b/.devcontainer/scripts/post-create.sh index 26b9a710..7169a093 100755 --- a/.devcontainer/scripts/post-create.sh +++ b/.devcontainer/scripts/post-create.sh @@ -10,14 +10,32 @@ cd /workspaces/sourcebot # 1. Initialize git submodules (in case initializeCommand didn't run) echo "" -echo "[1/2] Initializing git submodules..." +echo "[1/4] Initializing git submodules..." git submodule update --init --recursive # 2. Build Zoekt and install dependencies (uses Makefile) echo "" -echo "[2/2] Building Zoekt and installing dependencies..." +echo "[2/4] Building Zoekt and installing dependencies..." make +echo "" +echo "[3/4] Running database migrations..." +yarn dev:prisma:migrate:dev + +echo "" +echo "[4/4] Creating default config.json..." +cat > config.json << 'EOF' +{ + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", + "connections": { + "github": { + "type": "github", + "repos": ["sourcebot-dev/sourcebot"] + } + } +} +EOF + echo "" echo "==========================================" echo "Post-create setup complete!" diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..5fcd8a70 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "tabWidth": 4 +} diff --git a/packages/web/next.config.mjs b/packages/web/next.config.mjs index d344d121..e6f00539 100644 --- a/packages/web/next.config.mjs +++ b/packages/web/next.config.mjs @@ -38,7 +38,18 @@ const nextConfig = { ] }, - turbopack: {} + turbopack: {}, + + // @see: https://github.com/vercel/next.js/issues/58019#issuecomment-1910531929 + ...(process.env.NODE_ENV === 'development' ? { + experimental: { + serverActions: { + allowedOrigins: [ + 'localhost:3000' + ] + } + } + } : {}), }; export default withSentryConfig(nextConfig, {