Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 44 additions & 42 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,50 +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": {}
},

"forwardPorts": [3000],
"portsAttributes": {
"3000": { "label": "Web App", "onAutoForward": "notify" }
},
"remoteEnv": {
"AUTH_URL": "https://${containerEnv:CODESPACE_NAME}-3000.app.github.dev"
},

"initializeCommand": "git submodule update --init --recursive",
"postCreateCommand": "bash .devcontainer/scripts/post-create.sh",
"postStartCommand": "bash .devcontainer/scripts/post-start.sh",
"forwardPorts": [3000],
"portsAttributes": {
"3000": { "label": "Web App", "onAutoForward": "notify" }
},

"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"
"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",
"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"
}
22 changes: 20 additions & 2 deletions .devcontainer/scripts/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 4
}
13 changes: 12 additions & 1 deletion packages/web/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down