From 8c12734e3a9e5ef95a3945583e582abb5beb85dc Mon Sep 17 00:00:00 2001 From: Satya Patel Date: Wed, 14 Jan 2026 19:02:26 -0800 Subject: [PATCH 1/3] refactor: consolidate setup/teardown docs to docs site - Move setup/teardown scripts documentation from marketing to docs site - Update SCRIPTS_URL to point to docs.superset.sh/setup-teardown-scripts - Add NEXT_PUBLIC_DOCS_URL to desktop build CI and electron config - Remove duplicate content from marketing site - Single source of truth: docs.superset.sh/setup-teardown-scripts --- .github/workflows/build-desktop.yml | 1 + apps/desktop/electron.vite.config.ts | 8 + apps/marketing/src/app/scripts/page.tsx | 193 ------------------------ packages/shared/src/constants.ts | 2 +- 4 files changed, 10 insertions(+), 194 deletions(-) delete mode 100644 apps/marketing/src/app/scripts/page.tsx diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index c8b8ae9b645..785fe11e32c 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -90,6 +90,7 @@ jobs: GH_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }} NEXT_PUBLIC_WEB_URL: ${{ secrets.NEXT_PUBLIC_WEB_URL }} NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} + NEXT_PUBLIC_DOCS_URL: ${{ secrets.NEXT_PUBLIC_DOCS_URL }} SENTRY_DSN_DESKTOP: ${{ secrets.SENTRY_DSN_DESKTOP }} run: bun run compile:app diff --git a/apps/desktop/electron.vite.config.ts b/apps/desktop/electron.vite.config.ts index 0040ff74d2f..bbe81337c38 100644 --- a/apps/desktop/electron.vite.config.ts +++ b/apps/desktop/electron.vite.config.ts @@ -42,6 +42,10 @@ export default defineConfig({ process.env.NEXT_PUBLIC_WEB_URL, "https://app.superset.sh", ), + "process.env.NEXT_PUBLIC_DOCS_URL": defineEnv( + process.env.NEXT_PUBLIC_DOCS_URL, + "https://docs.superset.sh", + ), "process.env.GOOGLE_CLIENT_ID": defineEnv(process.env.GOOGLE_CLIENT_ID), "process.env.GH_CLIENT_ID": defineEnv(process.env.GH_CLIENT_ID), "process.env.SENTRY_DSN_DESKTOP": defineEnv( @@ -120,6 +124,10 @@ export default defineConfig({ process.env.NEXT_PUBLIC_WEB_URL, "https://app.superset.sh", ), + "process.env.NEXT_PUBLIC_DOCS_URL": defineEnv( + process.env.NEXT_PUBLIC_DOCS_URL, + "https://docs.superset.sh", + ), "import.meta.env.DEV_SERVER_PORT": defineEnv(String(DEV_SERVER_PORT)), "import.meta.env.NEXT_PUBLIC_POSTHOG_KEY": defineEnv( process.env.NEXT_PUBLIC_POSTHOG_KEY, diff --git a/apps/marketing/src/app/scripts/page.tsx b/apps/marketing/src/app/scripts/page.tsx deleted file mode 100644 index 0b1c8354fd4..00000000000 --- a/apps/marketing/src/app/scripts/page.tsx +++ /dev/null @@ -1,193 +0,0 @@ -"use client"; - -import { motion } from "framer-motion"; - -const CONFIG_EXAMPLE = `{ - "setup": [ - "bun install", - "bun run db:migrate" - ], - "teardown": [ - "docker-compose down" - ] -}`; - -const SHELL_SCRIPT_EXAMPLE = `{ - "setup": ["./.superset/setup.sh"], - "teardown": ["./.superset/teardown.sh"] -}`; - -export default function ScriptsPage() { - return ( -
-
- -

- Setup & Teardown Scripts -

-

- Automate workspace initialization and cleanup with config.json -

- -
-

- Overview -

-

- Superset can automatically run commands when creating or deleting - workspaces. This is useful for: -

-
    -
  • Installing dependencies
  • -
  • Running database migrations
  • -
  • Starting background services
  • -
  • Cleaning up resources when done
  • -
-
- -
-

- Configuration -

-

- Create a{" "} - - config.json - {" "} - file in your project's{" "} - - .superset - {" "} - directory: -

-
-							
-								your-project/.superset/config.json
-							
-						
-
- -
-

- Schema -

-

- The config file has two optional arrays: -

-
-							
-								{CONFIG_EXAMPLE}
-							
-						
- -
-
-

- - setup - -

-

- Array of shell commands to run when a new workspace is - created. Commands run sequentially in the workspace's - worktree directory. -

-
- -
-

- - teardown - -

-

- Array of shell commands to run when a workspace is deleted. - Useful for cleaning up resources like Docker containers or - temporary files. -

-
-
-
- -
-

- Using Shell Scripts -

-

- For complex setup logic, reference shell scripts instead of inline - commands: -

-
-							
-								{SHELL_SCRIPT_EXAMPLE}
-							
-						
-

- Make sure your scripts are executable:{" "} - - chmod +x .superset/setup.sh - -

-
- -
-

- How It Works -

-
    -
  1. - When you create a new workspace, Superset creates a git worktree - for your branch -
  2. -
  3. - If{" "} - - config.json - {" "} - exists with setup commands, they run automatically in the new - worktree -
  4. -
  5. Commands execute in a terminal tab so you can see output
  6. -
  7. - When deleting a workspace, teardown commands run before the - worktree is removed -
  8. -
-
- -
-

- Tips -

-
    -
  • - Keep setup scripts fast - they run every time you create a - workspace -
  • -
  • - Use{" "} - &&{" "} - to chain commands that depend on each other -
  • -
  • - Commit{" "} - - .superset/ - {" "} - to share workspace setup with your team -
  • -
  • - For machine-specific values, use environment variables in your - scripts instead of hardcoding paths -
  • -
-
-
-
-
- ); -} diff --git a/packages/shared/src/constants.ts b/packages/shared/src/constants.ts index 71283dc31f0..468e0de108f 100644 --- a/packages/shared/src/constants.ts +++ b/packages/shared/src/constants.ts @@ -20,7 +20,7 @@ export const COMPANY = { MAIL_TO: "mailto:founders@superset.sh", REPORT_ISSUE_URL: "https://github.com/superset-sh/superset/issues/new", DISCORD_URL: "https://discord.gg/cZeD9WYcV7", - SCRIPTS_URL: "https://superset.sh/scripts", + SCRIPTS_URL: `${process.env.NEXT_PUBLIC_DOCS_URL}/setup-teardown-scripts`, } as const; // Theme From 3a084c72450499842bc14f4b9775b6e530443d18 Mon Sep 17 00:00:00 2001 From: Satya Patel Date: Wed, 14 Jan 2026 19:07:37 -0800 Subject: [PATCH 2/3] refactor: remove SCRIPTS_URL from shared constants - Remove SCRIPTS_URL from packages/shared/src/constants.ts (too targeted) - Update desktop components to construct docs URL directly - Components now use process.env.NEXT_PUBLIC_DOCS_URL inline --- .../components/ConfigFilePreview/ConfigFilePreview.tsx | 4 ++-- .../renderer/components/SetupConfigModal/SetupConfigModal.tsx | 4 ++-- packages/shared/src/constants.ts | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx b/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx index e70e44d40e5..7d77668bf09 100644 --- a/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx +++ b/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx @@ -1,4 +1,3 @@ -import { COMPANY } from "@superset/shared/constants"; import { Button } from "@superset/ui/button"; import { cn } from "@superset/ui/utils"; import { HiArrowTopRightOnSquare } from "react-icons/hi2"; @@ -29,7 +28,8 @@ export function ConfigFilePreview({ ); const handleLearnMore = () => { - window.open(COMPANY.SCRIPTS_URL, "_blank"); + const docsUrl = `${process.env.NEXT_PUBLIC_DOCS_URL}/setup-teardown-scripts`; + window.open(docsUrl, "_blank"); }; const displayContent = diff --git a/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx b/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx index 177e09167d6..dc37e82651f 100644 --- a/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx +++ b/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx @@ -1,4 +1,3 @@ -import { COMPANY } from "@superset/shared/constants"; import { Button } from "@superset/ui/button"; import { Dialog, @@ -40,7 +39,8 @@ export function SetupConfigModal() { const projectName = project?.name ?? "your-project"; const handleLearnMore = () => { - window.open(COMPANY.SCRIPTS_URL, "_blank"); + const docsUrl = `${process.env.NEXT_PUBLIC_DOCS_URL}/setup-teardown-scripts`; + window.open(docsUrl, "_blank"); }; return ( diff --git a/packages/shared/src/constants.ts b/packages/shared/src/constants.ts index 468e0de108f..f218a70d418 100644 --- a/packages/shared/src/constants.ts +++ b/packages/shared/src/constants.ts @@ -20,7 +20,6 @@ export const COMPANY = { MAIL_TO: "mailto:founders@superset.sh", REPORT_ISSUE_URL: "https://github.com/superset-sh/superset/issues/new", DISCORD_URL: "https://discord.gg/cZeD9WYcV7", - SCRIPTS_URL: `${process.env.NEXT_PUBLIC_DOCS_URL}/setup-teardown-scripts`, } as const; // Theme From c4566b48c3e9ce5c3ac2bbc671ac8572c35aba88 Mon Sep 17 00:00:00 2001 From: Satya Patel Date: Wed, 14 Jan 2026 19:18:57 -0800 Subject: [PATCH 3/3] refactor: add EXTERNAL_LINKS constants to desktop app - Create EXTERNAL_LINKS section in desktop shared/constants.ts - Add SETUP_TEARDOWN_SCRIPTS constant pointing to docs site - Update SetupConfigModal to use EXTERNAL_LINKS constant - Update ConfigFilePreview to use EXTERNAL_LINKS constant - Centralized external link management for desktop app --- .../components/ConfigFilePreview/ConfigFilePreview.tsx | 4 ++-- .../components/SetupConfigModal/SetupConfigModal.tsx | 4 ++-- apps/desktop/src/shared/constants.ts | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx b/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx index 7d77668bf09..5f0ec5fd70e 100644 --- a/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx +++ b/apps/desktop/src/renderer/components/ConfigFilePreview/ConfigFilePreview.tsx @@ -6,6 +6,7 @@ import { electronTrpc } from "renderer/lib/electron-trpc"; import { CONFIG_FILE_NAME, CONFIG_TEMPLATE, + EXTERNAL_LINKS, PROJECT_SUPERSET_DIR_NAME, } from "shared/constants"; @@ -28,8 +29,7 @@ export function ConfigFilePreview({ ); const handleLearnMore = () => { - const docsUrl = `${process.env.NEXT_PUBLIC_DOCS_URL}/setup-teardown-scripts`; - window.open(docsUrl, "_blank"); + window.open(EXTERNAL_LINKS.SETUP_TEARDOWN_SCRIPTS, "_blank"); }; const displayContent = diff --git a/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx b/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx index dc37e82651f..f4072621234 100644 --- a/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx +++ b/apps/desktop/src/renderer/components/SetupConfigModal/SetupConfigModal.tsx @@ -14,6 +14,7 @@ import { useConfigModalOpen, useConfigModalProjectId, } from "renderer/stores/config-modal"; +import { EXTERNAL_LINKS } from "shared/constants"; const CONFIG_TEMPLATE = `{ "setup": [], @@ -39,8 +40,7 @@ export function SetupConfigModal() { const projectName = project?.name ?? "your-project"; const handleLearnMore = () => { - const docsUrl = `${process.env.NEXT_PUBLIC_DOCS_URL}/setup-teardown-scripts`; - window.open(docsUrl, "_blank"); + window.open(EXTERNAL_LINKS.SETUP_TEARDOWN_SCRIPTS, "_blank"); }; return ( diff --git a/apps/desktop/src/shared/constants.ts b/apps/desktop/src/shared/constants.ts index fe0b04b5786..dc96eb57bb6 100644 --- a/apps/desktop/src/shared/constants.ts +++ b/apps/desktop/src/shared/constants.ts @@ -48,3 +48,8 @@ export const NOTIFICATION_EVENTS = { // Default user preference values export const DEFAULT_CONFIRM_ON_QUIT = true; export const DEFAULT_TERMINAL_LINK_BEHAVIOR = "external-editor" as const; + +// External links (documentation, help resources, etc.) +export const EXTERNAL_LINKS = { + SETUP_TEARDOWN_SCRIPTS: `${process.env.NEXT_PUBLIC_DOCS_URL}/setup-teardown-scripts`, +} as const;