Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "docs-scalekit-com"
}
}
36 changes: 36 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: |
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.draft == false &&
contains(github.event.pull_request.labels.*.name, 'firebase-preview')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: npm install -g pnpm
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Pin pnpm version to ensure consistent builds.

The unpinned npm install -g pnpm could install any version. Per CONTRIBUTING.md, the project requires pnpm ≥ 10. Pin the version to prevent potential breaking changes from future pnpm releases.

♻️ Proposed fix
-      - run: npm install -g pnpm
+      - run: npm install -g pnpm@10

Alternatively, use the official pnpm action which handles caching automatically:

-      - run: npm install -g pnpm
-      - uses: actions/cache@v4
-        with:
-          path: ~/.local/share/pnpm/store
-          key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
-          restore-keys: ${{ runner.os }}-pnpm-
+      - uses: pnpm/action-setup@v4
+        with:
+          version: 10
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run: npm install -g pnpm
- run: npm install -g pnpm@10
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/firebase-hosting-pull-request.yml at line 24, Replace the
unpinned install step "run: npm install -g pnpm" with a pinned installation to
ensure consistent builds; update that workflow step to install a specific pnpm
version (e.g., add the version flag/install command for pnpm@10.x) or swap the
step to use the official "pnpm/action-setup" action to set and cache a fixed
pnpm version (refer to the workflow step that currently runs "npm install -g
pnpm").

- uses: actions/cache@v4
with:
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
Comment on lines +25 to +29
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify pnpm store path on Ubuntu
# Install pnpm and check the actual store path

npm install -g pnpm@10
pnpm store path

Repository: scalekit-inc/developer-docs

Length of output: 1937


🏁 Script executed:

cat -n .github/workflows/firebase-hosting-pull-request.yml | head -50

Repository: scalekit-inc/developer-docs

Length of output: 1528


🏁 Script executed:

# Search for pnpm/action-setup usage in the workflow
rg "pnpm/action-setup" .github/workflows/

Repository: scalekit-inc/developer-docs

Length of output: 53


🌐 Web query:

pnpm/action-setup cache store path best practices GitHub Actions

💡 Result:

The best practice for handling the pnpm store cache path in GitHub Actions with pnpm/action-setup is to use the built-in cache: true input on the action itself (available in v4+), which automatically detects and caches the pnpm store path (typically under the action's dest directory, like ~/setup-pnpm/.../store/v3, or the global default like ~/.local/share/pnpm/store depending on pnpm version and config). The action handles pruning via post-action. Example from official docs: - uses: pnpm/action-setup@v4 with: version: 10 cache: true - run: pnpm install Note: No need for manual actions/cache or pnpm store path; the action manages it. Post-action prunes the store. Alternative (widely recommended, used in pnpm.io CI docs): Leverage actions/setup-node with cache: 'pnpm' AFTER pnpm/action-setup (with run_install: false). This uses setup-node's automatic detection of store path via pnpm store path --silent. Example: - uses: pnpm/action-setup@v4 with: version: 10 run_install: false - uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' - run: pnpm install This caches only the store (not node_modules). For node_modules caching, add manual actions/cache on ./node_modules. Avoid manual store path fetching unless customizing (e.g., env PNPM_STORE_DIR). Use hashFiles('/pnpm-lock.yaml') for cache keys. Recent pnpm versions (v8+) default store to XDG-compliant paths like ~/.local/share/pnpm/store. Prefer setup-node method for simplicity/maintenance (handles pnpm changes); use action's cache: true for standalone pnpm setup without node action.

Citations:


Use pnpm/action-setup with built-in caching instead of manual cache configuration.

The cache path ~/.local/share/pnpm/store does not account for pnpm's version-specific subdirectories (e.g., /v10). This causes cache misses and inefficient builds. Replace the manual npm install -g pnpm and actions/cache approach with pnpm/action-setup@v4 with cache: true, which automatically detects and caches the correct store path. Alternatively, use actions/setup-node@v4 with cache: 'pnpm' after setting up pnpm/action-setup.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/firebase-hosting-pull-request.yml around lines 25 - 29,
Replace the manual pnpm installation and the actions/cache block that uses path
~/.local/share/pnpm/store and key ${{ runner.os }}-pnpm-${{
hashFiles('pnpm-lock.yaml') }} with the official pnpm action: use
pnpm/action-setup@v4 and enable its built-in caching (cache: true) so pnpm's
versioned store (e.g., /v10) is detected and cached correctly; specifically
remove the existing "uses: actions/cache@v4" step and any "npm install -g pnpm"
invocation and add the pnpm/action-setup step with cache enabled (or
alternatively use actions/setup-node@v4 with cache: 'pnpm' after
pnpm/action-setup).

- run: pnpm install
- run: pnpm build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DOCS_SCALEKIT_COM }}
projectId: docs-scalekit-com
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ skills-lock.json

.windsurf/
.tmp/
.firebase/
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -353,5 +353,5 @@ export default defineConfig({
},
},
},
adapter: netlify(),
adapter: netlify({ imageCDN: !!process.env.NETLIFY }),
})
6 changes: 6 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hosting": {
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
Comment on lines +1 to +6
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider adding rewrite rules and cache headers for production readiness.

The basic hosting configuration is correct—dist matches Astro's default output directory. However, for a documentation site, you may want to add:

  1. Rewrite rules for clean URLs (if not handled by Astro's static build)
  2. Cache headers to optimize asset delivery
♻️ Suggested enhanced configuration
 {
   "hosting": {
     "public": "dist",
-    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
+    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
+    "headers": [
+      {
+        "source": "**/*.@(js|css|woff2|png|jpg|webp|svg|gif)",
+        "headers": [
+          {
+            "key": "Cache-Control",
+            "value": "public, max-age=31536000, immutable"
+          }
+        ]
+      }
+    ]
   }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"hosting": {
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
{
"hosting": {
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"headers": [
{
"source": "**/*.@(js|css|woff2|png|jpg|webp|svg|gif)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@firebase.json` around lines 1 - 6, The firebase hosting config currently only
sets "hosting" with "public": "dist" and "ignore" rules; add production-ready
rewrite rules and cache headers by updating the "hosting" block to include a
"rewrites" array (e.g., route all SPA/doc routes to /index.html or appropriate
entry) and a "headers" array to set long cache TTLs for static assets
(css/js/images) and shorter/no-cache for index.html; update the config around
the existing "hosting", "public": "dist", and "ignore" entries to include these
"rewrites" and "headers" entries to enable clean URLs and optimal caching.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Steps, Aside, Tabs, TabItem } from '@astrojs/starlight/components'
import { Image } from 'astro:assets'
import enableClaudePluginGif from '@/assets/docs/ai-assisted-mcp-quickstart/2.gif'
import skillActivationImg from '@/assets/docs/ai-assisted-mcp-quickstart/skill-activation.png'

<Steps>

Expand Down Expand Up @@ -79,7 +80,7 @@ import enableClaudePluginGif from '@/assets/docs/ai-assisted-mcp-quickstart/2.gi
When you submit this prompt, Claude Code loads the MCP authentication skill from the marketplace -> analyzes your existing MCP server structure -> generates authentication middleware with token validation -> creates the OAuth discovery endpoint -> configures environment variable handling.

<Image
src="@/assets/docs/ai-assisted-mcp-quickstart/skill-activation.png"
src={skillActivationImg}
alt="Claude Code activating MCP authentication skill"
/>

Expand Down
Loading