diff --git a/package.json b/package.json index 371914c..1614471 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.0.1", "private": true, "scripts": { - "deploy": "wrangler pages deploy dist --project-name cffyin", + "deploy": "wrangler pages deploy dist --project-name cffyin --branch main --commit-dirty=true", + "preview": "wrangler pages deploy dist --project-name cffyin --branch master --commit-dirty=true", "dev": "wrangler pages dev dist", "start": "wrangler pages dev dist", "cf-typegen": "wrangler types", diff --git a/scripts/build.js b/scripts/build.js index ca78784..dc00306 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -48,10 +48,61 @@ function processHtml(filePath, outPath) { content = NAV_TEMPLATE + content; } + // Inject Apps Grid if placeholder exists + if (content.includes('')) { + const appsGridHtml = generateAppsGridHtml(); + content = content.replace('', appsGridHtml); + } + fs.writeFileSync(outPath, content); console.log(`Processed ${filePath} -> ${outPath}`); } +function generateAppsGridHtml() { + if (!fs.existsSync(APPS_DIR)) return ''; + + const apps = fs.readdirSync(APPS_DIR).filter(item => { + const itemPath = path.join(APPS_DIR, item); + return !item.startsWith('.') && fs.statSync(itemPath).isDirectory(); + }); + + return apps.map(app => { + const metadataPath = path.join(APPS_DIR, app, 'metadata.json'); + let metadata = { + title: app, + description: 'A cool app.', + emoji: '📱', + color: 'gray', + path: `/${app}/` + }; + + if (fs.existsSync(metadataPath)) { + try { + const data = JSON.parse(fs.readFileSync(metadataPath, 'utf-8')); + metadata = { ...metadata, ...data }; + } catch (e) { + console.error(`Error reading metadata for ${app}:`, e); + } + } + + return ` +
+ `; + }).join('\n'); +} + + function buildLanding() { const landingSrc = path.join(SRC_DIR, 'landing', 'index.html'); const landingDist = path.join(DIST_DIR, 'index.html'); diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100755 index 0000000..3d8319d Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/apps/.gitignore b/src/apps/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/src/apps/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/src/apps/bridge-builder-math/metadata.json b/src/apps/bridge-builder-math/metadata.json index a563be8..9e3e5a3 100644 --- a/src/apps/bridge-builder-math/metadata.json +++ b/src/apps/bridge-builder-math/metadata.json @@ -1,5 +1,7 @@ { - "name": "Bridge Builder Math", - "description": "An educational math game where players solve addition and subtraction problems to build a bridge for a character to cross a canyon.", - "requestFramePermissions": [] -} \ No newline at end of file + "title": "Bridge Builder", + "description": "Construct bridges using the power of math!", + "emoji": "🌉", + "color": "purple", + "path": "/bridge-builder-math/" +} diff --git a/src/apps/bridge-builder-math/vite.config.ts b/src/apps/bridge-builder-math/vite.config.ts index ee5fb8d..950e2e2 100644 --- a/src/apps/bridge-builder-math/vite.config.ts +++ b/src/apps/bridge-builder-math/vite.config.ts @@ -5,6 +5,7 @@ import react from '@vitejs/plugin-react'; export default defineConfig(({ mode }) => { const env = loadEnv(mode, '.', ''); return { + base: './', server: { port: 3000, host: '0.0.0.0', diff --git a/src/apps/components/Button.tsx b/src/apps/components/Button.tsx deleted file mode 100644 index a31fe38..0000000 --- a/src/apps/components/Button.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; - -interface ButtonProps extends React.ButtonHTMLAttributesThe problem was
-Thinking...
-{data.explanation}
-"{data.encouragement}"
-Could not load explanation.
- )} - -Welcome to the Playground
A collection of small, delightful web experiments where education meets fun meets art.
No ads. No tracking. Just vibes.
Pick your adventure!
Welcome to the Playground
A collection of small, delightful web experiments where education meets fun meets art.
No ads. No tracking. Just vibes.
Pick your adventure!