Skip to content

Commit c7865eb

Browse files
authored
fix: configure Vercel preset and fix marketplace config loading (#16)
- Add Vercel preset to nuxt.config.ts for proper serverless deployment - Move marketplace-sources.json to server directory and use import instead of fs.readFile - Fix ENOENT error in production by bundling config file at build time - Remove trailing comma in turbo.json outputs array This resolves the marketplace API failure in Vercel's serverless environment where the working directory differs from development.
1 parent 3c901d7 commit c7865eb

4 files changed

Lines changed: 27 additions & 11 deletions

File tree

apps/web/nuxt.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ export default defineNuxtConfig({
33
compatibilityDate: '2025-07-15',
44
devtools: { enabled: true },
55

6+
nitro: {
7+
preset: 'vercel',
8+
},
9+
610
modules: [
711
'@nuxt/ui',
812
'@nuxt/content',

apps/web/server/api/marketplaces.get.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type { AggregatedMarketplace, AggregatedPlugin, MarketplaceAPIResponse, MarketplaceSource } from '~/types/marketplace'
2-
import { readFile } from 'node:fs/promises'
3-
import { resolve } from 'node:path'
4-
import process from 'node:process'
2+
import marketplaceSourcesConfig from '../marketplace-sources.json'
53
import { marketplaceSchema, marketplaceSourcesConfigSchema } from '../utils/marketplace-schema'
64

75
/**
@@ -10,14 +8,8 @@ import { marketplaceSchema, marketplaceSourcesConfigSchema } from '../utils/mark
108
*/
119
const fetchMarketplaces = defineCachedFunction(
1210
async (): Promise<MarketplaceAPIResponse> => {
13-
// Load marketplace sources configuration
14-
// Resolve path from public directory (available in runtime)
15-
const configPath = resolve(process.cwd(), 'public/marketplace-sources.json')
16-
const configData = await readFile(configPath, 'utf-8')
17-
const parsedConfig = JSON.parse(configData)
18-
1911
// Validate configuration with Zod
20-
const validatedConfig = marketplaceSourcesConfigSchema.parse(parsedConfig)
12+
const validatedConfig = marketplaceSourcesConfigSchema.parse(marketplaceSourcesConfig)
2113
const enabledSources = validatedConfig.sources
2214
.filter(s => s.enabled)
2315
.sort((a, b) => a.priority - b.priority)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"sources": [
3+
{
4+
"name": "pleaseai",
5+
"description": "Community-contributed plugins from PleaseAI",
6+
"url": "https://raw.githubusercontent.com/pleaseai/claude-code-plugins/main/.claude-plugin/marketplace.json",
7+
"repo": "pleaseai/claude-code-plugins",
8+
"enabled": true,
9+
"priority": 1
10+
},
11+
{
12+
"name": "claude-code-plugins",
13+
"description": "Bundled plugins for Claude Code including Agent SDK development tools, PR review toolkit, and commit workflows",
14+
"url": "https://raw.githubusercontent.com/anthropics/claude-code/main/.claude-plugin/marketplace.json",
15+
"repo": "anthropics/claude-code",
16+
"enabled": true,
17+
"priority": 2
18+
}
19+
]
20+
}

turbo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"build": {
66
"dependsOn": ["^build"],
77
"inputs": ["$TURBO_DEFAULT$", ".env*"],
8-
"outputs": [".nuxt/**", "!.nuxt/cache/**", "dist/**",".output/**"],
8+
"outputs": [".nuxt/**", "!.nuxt/cache/**", "dist/**",".output/**"]
99
},
1010
"lint": {
1111
"dependsOn": ["^lint"],

0 commit comments

Comments
 (0)