Skip to content

Commit d629afc

Browse files
sylvansysclaude
andauthored
feat: Disable local dev startup hook & enhance preview URL display (#332)
- Disable Docker/Supabase/dev server startup hook (install-start-supabase-next.ts) and cleanup hook (cleanup-supabase-session.ts) by moving to _disabled_hooks section - Add formatGroupedPreviews() function to ci-status.ts for consistent preview URL formatting across hooks - Update await-pr-status.ts to show ALL preview URLs (Vercel, Cloudflare, Supabase) grouped by provider instead of just first Vercel URL Closes #331 Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c9be2bb commit d629afc

4 files changed

Lines changed: 82 additions & 30 deletions

File tree

.claude/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
"enabledPlugins": {
9292
"plugin-dev@claude-code-plugins": true,
9393
"feature-dev@claude-code-plugins": true,
94-
"nextjs-supabase-ai-sdk-dev@constellos": true,
95-
"github-orchestration@constellos": true
94+
"github-orchestration@constellos": true,
95+
"nextjs-supabase-ai-sdk-dev@constellos": true
9696
},
9797
"extraKnownMarketplaces": {
9898
"claude-code-plugins": {

plugins/github-orchestration/hooks/await-pr-status.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ import {
2929
import {
3030
awaitCIWithFailFast,
3131
getLatestCIRun,
32-
extractPreviewUrls,
32+
extractAllPreviews,
3333
extractLinkedIssuesFromPR,
34+
formatGroupedPreviews,
3435
} from '../shared/hooks/utils/ci-status.js';
3536
import { addPRToState } from '../shared/hooks/utils/github-state.js';
3637

@@ -106,9 +107,9 @@ async function handler(
106107
const ciResult = await awaitCIWithFailFast({ prNumber }, input.cwd);
107108

108109
// Get latest CI run details, preview URLs, and linked issues in parallel
109-
const [ciRun, previewUrls, linkedIssues] = await Promise.all([
110+
const [ciRun, groupedPreviews, linkedIssues] = await Promise.all([
110111
getLatestCIRun(prNumber, input.cwd),
111-
extractPreviewUrls(prNumber, input.cwd),
112+
extractAllPreviews(prNumber, input.cwd),
112113
extractLinkedIssuesFromPR(prNumber, input.cwd),
113114
]);
114115

@@ -169,18 +170,18 @@ async function handler(
169170
statusMessage += `\n🔗 [CI Run](${ciRun.url})`;
170171
}
171172

172-
// Add Vercel preview URLs (concise)
173-
if (previewUrls.allUrls.length > 0) {
174-
statusMessage += `\n🔗 Preview: ${previewUrls.allUrls[0]}`;
175-
if (previewUrls.allUrls.length > 1) {
176-
statusMessage += ` (+${previewUrls.allUrls.length - 1} more)`;
177-
}
173+
// Add all preview URLs grouped by provider
174+
const previewSection = formatGroupedPreviews(groupedPreviews);
175+
if (previewSection) {
176+
statusMessage += previewSection;
178177
}
179178

180179
await logger.logOutput({
181180
success: ciResult.success,
182181
ci_status: ciRun?.status,
183-
vercel_urls: previewUrls.allUrls,
182+
vercel_urls: groupedPreviews.vercel,
183+
cloudflare_urls: groupedPreviews.cloudflare,
184+
supabase_urls: groupedPreviews.supabase,
184185
});
185186

186187
return {

plugins/github-orchestration/shared/hooks/utils/ci-status.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,56 @@ export async function extractAllPreviews(
738738
};
739739
}
740740

741+
/**
742+
* Format grouped preview URLs for display
743+
*
744+
* Formats preview URLs from all providers (Vercel, Cloudflare, Supabase)
745+
* into a markdown-formatted string with provider sections.
746+
*
747+
* @param previews - Grouped preview URLs by provider
748+
* @returns Formatted markdown string, empty if no previews
749+
*
750+
* @example
751+
* ```typescript
752+
* const previews = await extractAllPreviews(42, '/path/to/repo');
753+
* const formatted = formatGroupedPreviews(previews);
754+
* // Returns:
755+
* // "
756+
* // **Vercel Previews:**
757+
* // - https://my-app-abc123.vercel.app
758+
* //
759+
* // **Cloudflare Previews:**
760+
* // - https://my-worker.workers.dev
761+
* // "
762+
* ```
763+
*/
764+
export function formatGroupedPreviews(previews: GroupedPreviewUrls): string {
765+
let message = '';
766+
767+
if (previews.vercel.length > 0) {
768+
message += '\n\n**Vercel Previews:**';
769+
for (const url of previews.vercel) {
770+
message += `\n - ${url}`;
771+
}
772+
}
773+
774+
if (previews.cloudflare.length > 0) {
775+
message += '\n\n**Cloudflare Previews:**';
776+
for (const url of previews.cloudflare) {
777+
message += `\n - ${url}`;
778+
}
779+
}
780+
781+
if (previews.supabase.length > 0) {
782+
message += '\n\n**Supabase Previews:**';
783+
for (const url of previews.supabase) {
784+
message += `\n - ${url}`;
785+
}
786+
}
787+
788+
return message;
789+
}
790+
741791
/**
742792
* Parse CI checks output into structured format
743793
*

plugins/nextjs-supabase-ai-sdk-dev/hooks/hooks.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@
66
"Tracks task/agent calls for context",
77
"Check hooks moved to rule-based system in project-context plugin"
88
],
9+
"_disabled_hooks": {
10+
"_note": "Disabled hooks preserved for future re-enabling",
11+
"SessionStart": [
12+
{
13+
"type": "command",
14+
"command": "npx tsx ${CLAUDE_PLUGIN_ROOT}/hooks/install-start-supabase-next.ts",
15+
"description": "Sets up Supabase local dev: installs CLI, starts Docker, starts Supabase, exports env vars, starts dev server",
16+
"timeout": 600
17+
}
18+
],
19+
"SessionEnd": [
20+
{
21+
"type": "command",
22+
"command": "npx tsx ${CLAUDE_PLUGIN_ROOT}/hooks/cleanup-supabase-session.ts",
23+
"description": "Stops Supabase containers and marks session as stopped when session ends",
24+
"timeout": 60
25+
}
26+
]
27+
},
928
"description": "Local development environment setup for Next.js, Supabase, and AI SDK projects",
1029
"hooks": {
1130
"SessionStart": [
@@ -27,12 +46,6 @@
2746
"command": "npx tsx ${CLAUDE_PLUGIN_ROOT}/hooks/link-vercel-apps.ts",
2847
"description": "Auto-links monorepo apps to Vercel projects and pulls env vars"
2948
},
30-
{
31-
"type": "command",
32-
"command": "npx tsx ${CLAUDE_PLUGIN_ROOT}/hooks/install-start-supabase-next.ts",
33-
"description": "Sets up Supabase local dev: installs CLI, starts Docker, starts Supabase, exports env vars, starts dev server",
34-
"timeout": 600
35-
},
3649
{
3750
"type": "command",
3851
"command": "npx tsx ${CLAUDE_PLUGIN_ROOT}/hooks/cache-supabase-schema.ts",
@@ -111,18 +124,6 @@
111124
}
112125
]
113126
}
114-
],
115-
"SessionEnd": [
116-
{
117-
"hooks": [
118-
{
119-
"type": "command",
120-
"command": "npx tsx ${CLAUDE_PLUGIN_ROOT}/hooks/cleanup-supabase-session.ts",
121-
"description": "Stops Supabase containers and marks session as stopped when session ends",
122-
"timeout": 60
123-
}
124-
]
125-
}
126127
]
127128
}
128129
}

0 commit comments

Comments
 (0)