diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 107c3bbb5..9ee85452d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,19 +17,6 @@ jobs: with: node-version: '20' - # Fetch the chat-widget from the landing-page repo (pre-built dist is committed) - - name: Fetch @futureagi/chat-widget - run: | - git clone --depth 1 \ - https://x-access-token:${{ secrets.GH_PAT }}@github.com/future-agi/landing-page.git .landing-tmp - cp -r .landing-tmp/docs-agent/packages/chat-widget ./chat-widget - rm -rf .landing-tmp - - # Replace workspace:* with local file reference so npm can install it - - name: Patch chat-widget dependency - run: | - sed -i 's|"@futureagi/chat-widget": "workspace:\*"|"@futureagi/chat-widget": "file:./chat-widget"|' package.json - - name: Cache npm dependencies uses: actions/cache@v4 with: diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index bf912b578..99fe72cf9 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -19,27 +19,8 @@ jobs: with: node-version: '20' - - name: Fetch @futureagi/chat-widget - run: | - git clone --depth 1 \ - https://x-access-token:${{ secrets.GH_PAT }}@github.com/future-agi/landing-page.git .landing-tmp - cp -r .landing-tmp/docs-agent/packages/chat-widget ./chat-widget - rm -rf .landing-tmp - - - name: Patch chat-widget dependency - run: | - sed -i 's|"@futureagi/chat-widget": "workspace:\*"|"@futureagi/chat-widget": "file:./chat-widget"|' package.json - - - name: Cache npm dependencies - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json', 'package.json') }} - restore-keys: ${{ runner.os }}-npm- - - - name: Install dependencies - run: npm install - + # The audit scripts use only Node built-ins: no install, no secrets, + # so this job also runs on fork PRs, which never receive repo secrets - name: Check broken nav & content links run: node scripts/audit-links.mjs diff --git a/package.json b/package.json index ca5a3a6e7..e8c55a42a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "@astrojs/mdx": "^4.3.12", "@astrojs/react": "^4.3.1", "@astrojs/sitemap": "^3.6.0", - "@futureagi/chat-widget": "workspace:*", "@giscus/react": "^3.1.0", "@tailwindcss/vite": "^4.1.17", "astro": "^5.16.3", diff --git a/public/images/docs/billing/guides/upgrade-to-payg.png b/public/images/docs/billing/guides/upgrade-to-payg.png new file mode 100644 index 000000000..c317163ee Binary files /dev/null and b/public/images/docs/billing/guides/upgrade-to-payg.png differ diff --git a/public/images/docs/billing/guides/usage-overview.png b/public/images/docs/billing/guides/usage-overview.png new file mode 100644 index 000000000..199aeb1a3 Binary files /dev/null and b/public/images/docs/billing/guides/usage-overview.png differ diff --git a/scripts/check-deleted-pages.mjs b/scripts/check-deleted-pages.mjs index 5361750dd..a638d17e4 100644 --- a/scripts/check-deleted-pages.mjs +++ b/scripts/check-deleted-pages.mjs @@ -6,7 +6,7 @@ * Default base branch: dev */ import { execSync } from 'child_process'; -import { readFileSync } from 'fs'; +import { existsSync, readFileSync } from 'fs'; const baseBranch = process.argv[2] || 'dev'; @@ -48,6 +48,14 @@ function fileToPath(file) { .replace(/\/index$/, '') || '/'; } +// A deleted file needs no redirect when its route is still served by another +// page file (e.g. deleting foo.mdx while foo/index.mdx exists) +function routeStillServed(urlPath) { + const base = `src/pages${urlPath === '/' ? '' : urlPath}`; + return ['.mdx', '.astro', '.md', '/index.mdx', '/index.astro', '/index.md'] + .some(suffix => existsSync(`${base}${suffix}`)); +} + // Load redirects map const redirectsRaw = readFileSync('src/lib/redirects.ts', 'utf-8'); const redirectEntries = [...redirectsRaw.matchAll(/["']([^"']+)["']:\s*["']([^"']+)["']/g)]; @@ -57,6 +65,10 @@ const redirectMap = new Set(redirectEntries.map(([, from]) => from)); const missing = []; for (const file of deletedPages) { const urlPath = fileToPath(file); + if (routeStillServed(urlPath)) { + console.log(` ${urlPath} still served by another page file, no redirect needed. ✓`); + continue; + } if (!redirectMap.has(urlPath)) { missing.push({ file, urlPath }); } diff --git a/src/components/AiChatWidget.astro b/src/components/AiChatWidget.astro index 0ca8ec5c7..4c497458d 100644 --- a/src/components/AiChatWidget.astro +++ b/src/components/AiChatWidget.astro @@ -36,6 +36,7 @@ const turnstileSiteKey = import.meta.env.PUBLIC_TURNSTILE_SITE_KEY || '';