@freeappstore/cli 0.4.59 → 0.4.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface StoreConfig {
|
|
2
|
+
store: 'apps' | 'games';
|
|
3
|
+
r2Bucket: string;
|
|
4
|
+
nounPlural: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const APP_STARTER_CONFIG: StoreConfig;
|
|
7
|
+
export type AppPreset = 'standalone' | 'connected';
|
|
8
|
+
export type AppArchetype = 'dashboard' | 'tracker' | 'calculator' | 'generic';
|
|
9
|
+
export declare const APP_ARCHETYPES: readonly AppArchetype[];
|
|
10
|
+
export declare function getArchetypeFiles(archetype: AppArchetype): Record<string, string>;
|
|
11
|
+
export declare function getTemplateFiles(config: StoreConfig, archetype?: AppArchetype, preset?: AppPreset): Record<string, string>;
|
|
12
|
+
export declare function substituteAppName(files: Record<string, string>, appId: string, displayName: string): Record<string, string>;
|
|
13
|
+
//# sourceMappingURL=starter-foundation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starter-foundation.d.ts","sourceRoot":"","sources":["../../src/lib/starter-foundation.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,eAAO,MAAM,kBAAkB,EAAE,WAIhC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,WAAW,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAE9E,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAKjD,CAAC;AAw6BF,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEjF;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,EACnB,SAAS,CAAC,EAAE,YAAY,EACxB,MAAM,GAAE,SAAwB,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8ExB;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBxB"}
|
|
@@ -0,0 +1,991 @@
|
|
|
1
|
+
/** Canonical worker-safe editable starter foundation. */
|
|
2
|
+
import { planCapabilityChanges } from './capability-definitions.js';
|
|
3
|
+
import { resolveStarterPreset } from './starter-presets.js';
|
|
4
|
+
export const APP_STARTER_CONFIG = {
|
|
5
|
+
store: 'apps',
|
|
6
|
+
r2Bucket: 'fas-apps',
|
|
7
|
+
nounPlural: 'apps',
|
|
8
|
+
};
|
|
9
|
+
export const APP_ARCHETYPES = [
|
|
10
|
+
'dashboard',
|
|
11
|
+
'tracker',
|
|
12
|
+
'calculator',
|
|
13
|
+
'generic',
|
|
14
|
+
];
|
|
15
|
+
// ── Shared template files (identical for apps and games) ──
|
|
16
|
+
const SHARED_FILES = {
|
|
17
|
+
'pnpm-workspace.yaml': `packages:\n - web\n`,
|
|
18
|
+
'package.json': `{
|
|
19
|
+
"name": "APPNAME",
|
|
20
|
+
"private": true,
|
|
21
|
+
"packageManager": "pnpm@10.30.3",
|
|
22
|
+
"engines": { "node": ">=22" },
|
|
23
|
+
"pnpm": { "onlyBuiltDependencies": ["esbuild"] },
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "pnpm --filter @APPNAME/web dev",
|
|
26
|
+
"build": "pnpm --filter @APPNAME/web build",
|
|
27
|
+
"preview": "pnpm --filter @APPNAME/web preview",
|
|
28
|
+
"typecheck": "pnpm --filter @APPNAME/web exec tsc -b",
|
|
29
|
+
"test": "pnpm --filter @APPNAME/web test"
|
|
30
|
+
}
|
|
31
|
+
}`,
|
|
32
|
+
'web/package.json': `{
|
|
33
|
+
"name": "@APPNAME/web",
|
|
34
|
+
"private": true,
|
|
35
|
+
"type": "module",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "vite",
|
|
38
|
+
"build": "vite build",
|
|
39
|
+
"preview": "vite preview",
|
|
40
|
+
"test": "vitest run"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"react": "^19",
|
|
44
|
+
"react-dom": "^19",
|
|
45
|
+
"@freeappstore/sdk": "^0.16.32"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@tailwindcss/vite": "^4.1",
|
|
49
|
+
"@types/react": "^19",
|
|
50
|
+
"@types/react-dom": "^19",
|
|
51
|
+
"@vitejs/plugin-react": "^4.3",
|
|
52
|
+
"tailwindcss": "^4.1",
|
|
53
|
+
"typescript": "^5.7",
|
|
54
|
+
"vite": "^6"
|
|
55
|
+
}
|
|
56
|
+
}`,
|
|
57
|
+
'web/vite.config.ts': `
|
|
58
|
+
import { defineConfig } from "vite";
|
|
59
|
+
import react from "@vitejs/plugin-react";
|
|
60
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
61
|
+
|
|
62
|
+
export default defineConfig({
|
|
63
|
+
plugins: [react(), tailwindcss()],
|
|
64
|
+
});`,
|
|
65
|
+
'web/tsconfig.json': `{
|
|
66
|
+
"files": [],
|
|
67
|
+
"references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
|
|
68
|
+
}`,
|
|
69
|
+
'web/tsconfig.app.json': `{
|
|
70
|
+
"compilerOptions": {
|
|
71
|
+
"target": "ES2020",
|
|
72
|
+
"useDefineForClassFields": true,
|
|
73
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
74
|
+
"module": "ESNext",
|
|
75
|
+
"skipLibCheck": true,
|
|
76
|
+
"moduleResolution": "bundler",
|
|
77
|
+
"allowImportingTsExtensions": true,
|
|
78
|
+
"isolatedModules": true,
|
|
79
|
+
"moduleDetection": "force",
|
|
80
|
+
"noEmit": true,
|
|
81
|
+
"jsx": "react-jsx",
|
|
82
|
+
"strict": true,
|
|
83
|
+
"noUnusedLocals": false,
|
|
84
|
+
"noUnusedParameters": true,
|
|
85
|
+
"noFallthroughCasesInSwitch": true,
|
|
86
|
+
"noUncheckedSideEffectImports": true
|
|
87
|
+
},
|
|
88
|
+
"include": ["src"]
|
|
89
|
+
}`,
|
|
90
|
+
'web/tsconfig.node.json': `{
|
|
91
|
+
"compilerOptions": {
|
|
92
|
+
"target": "ES2022",
|
|
93
|
+
"lib": ["ES2023"],
|
|
94
|
+
"module": "ESNext",
|
|
95
|
+
"skipLibCheck": true,
|
|
96
|
+
"moduleResolution": "bundler",
|
|
97
|
+
"allowImportingTsExtensions": true,
|
|
98
|
+
"isolatedModules": true,
|
|
99
|
+
"moduleDetection": "force",
|
|
100
|
+
"noEmit": true,
|
|
101
|
+
"strict": true,
|
|
102
|
+
"noUnusedLocals": true,
|
|
103
|
+
"noUnusedParameters": true,
|
|
104
|
+
"noFallthroughCasesInSwitch": true,
|
|
105
|
+
"noUncheckedSideEffectImports": true
|
|
106
|
+
},
|
|
107
|
+
"include": ["vite.config.ts"]
|
|
108
|
+
}`,
|
|
109
|
+
'web/src/main.tsx': `import { StrictMode } from "react";
|
|
110
|
+
import { createRoot } from "react-dom/client";
|
|
111
|
+
import "./index.css";
|
|
112
|
+
import App from "./App";
|
|
113
|
+
|
|
114
|
+
createRoot(document.getElementById("root")!).render(
|
|
115
|
+
<StrictMode>
|
|
116
|
+
<App />
|
|
117
|
+
</StrictMode>,
|
|
118
|
+
);`,
|
|
119
|
+
'.gitignore': `node_modules\ndist\n.DS_Store\n*.local\n`,
|
|
120
|
+
};
|
|
121
|
+
// ── Apps-specific template files ──
|
|
122
|
+
const APP_FILES = {
|
|
123
|
+
'CLAUDE.md': `# Editable FreeAppStore starter
|
|
124
|
+
|
|
125
|
+
This source is app-owned after scaffolding. Keep existing screens, layouts and data.
|
|
126
|
+
The SDK Shell is the supported default; a custom accessible frame is supported.
|
|
127
|
+
Keep a reachable Profile in both auth states, shared theme/text preferences,
|
|
128
|
+
keyboard navigation, visible focus, loading/error feedback and page zoom.
|
|
129
|
+
Public screens stay public; gate private features at their data boundary.
|
|
130
|
+
Share the existing SDK/Auth instance with Shell, Profile and connected features.
|
|
131
|
+
|
|
132
|
+
Choose device-local, private-account, public-shared or room storage for the feature.
|
|
133
|
+
Never treat collections or room broadcasts as private storage. Do not ask end users
|
|
134
|
+
for developer API keys: the SDK proxy supports server-side key injection.
|
|
135
|
+
No payments, ads or direct trackers. Preserve SDK Tailwind @source and @theme wiring.
|
|
136
|
+
|
|
137
|
+
Use fas add <capability> --dry-run for infrastructure changes. Resolve reported
|
|
138
|
+
package prerequisites before applying; root recipe imports need a root SDK dependency.
|
|
139
|
+
Keep edited capability files and review conflicts rather than overwriting them.
|
|
140
|
+
Keep one PWA controller and register busy guards for unsaved work and capture.
|
|
141
|
+
|
|
142
|
+
Canonical source and guidance:
|
|
143
|
+
https://github.com/freeappstore-online/platform/blob/main/docs/composable-starter-contract.md
|
|
144
|
+
https://github.com/freeappstore-online/platform/blob/main/docs/starter-release.md
|
|
145
|
+
`,
|
|
146
|
+
'web/src/vite-env.d.ts': `/// <reference types="vite/client" />\n`,
|
|
147
|
+
'web/index.html': `<!DOCTYPE html>
|
|
148
|
+
<html lang="en">
|
|
149
|
+
<head>
|
|
150
|
+
<meta charset="UTF-8" />
|
|
151
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
152
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
153
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
154
|
+
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,700;9..144,800&display=swap" rel="stylesheet" />
|
|
155
|
+
<link rel="manifest" href="/manifest.json" />
|
|
156
|
+
<meta name="theme-color" content="#2563eb" />
|
|
157
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
158
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
159
|
+
<title>APPNAME — FreeAppStore</title>
|
|
160
|
+
<link rel="canonical" href="https://APPID.freeappstore.online/" />
|
|
161
|
+
<meta property="og:title" content="APPNAME — FreeAppStore" />
|
|
162
|
+
<meta property="og:url" content="https://APPID.freeappstore.online/" />
|
|
163
|
+
<meta name="twitter:card" content="summary" />
|
|
164
|
+
</head>
|
|
165
|
+
<body>
|
|
166
|
+
<div id="root"></div>
|
|
167
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
168
|
+
</body>
|
|
169
|
+
</html>`,
|
|
170
|
+
'web/public/manifest.json': `{
|
|
171
|
+
"name": "APPNAME",
|
|
172
|
+
"short_name": "APPNAME",
|
|
173
|
+
"start_url": "/",
|
|
174
|
+
"display": "standalone",
|
|
175
|
+
"background_color": "#ffffff",
|
|
176
|
+
"theme_color": "#2563eb",
|
|
177
|
+
"orientation": "any"
|
|
178
|
+
}`,
|
|
179
|
+
'web/src/index.css': `@import "tailwindcss";
|
|
180
|
+
@source "../node_modules/@freeappstore/sdk/dist";
|
|
181
|
+
@source "../../node_modules/@freeappstore/sdk/dist";
|
|
182
|
+
|
|
183
|
+
@theme inline {
|
|
184
|
+
--color-paper: var(--paper);
|
|
185
|
+
--color-paper-deep: var(--paper-deep, var(--paper));
|
|
186
|
+
--color-ink: var(--ink);
|
|
187
|
+
--color-ink-strong: var(--ink-strong, var(--ink));
|
|
188
|
+
--color-muted: var(--muted);
|
|
189
|
+
--color-line: var(--line);
|
|
190
|
+
--color-line-strong: var(--line-strong, var(--line));
|
|
191
|
+
--color-panel: var(--panel);
|
|
192
|
+
--color-panel-glass: var(--panel-glass, var(--panel));
|
|
193
|
+
--color-popover: var(--popover, var(--paper));
|
|
194
|
+
--color-accent: var(--accent);
|
|
195
|
+
--color-accent-soft: var(--accent-soft, var(--accent));
|
|
196
|
+
--color-accent-deep: var(--accent-deep, var(--accent));
|
|
197
|
+
--color-accent-hover: var(--accent-hover, var(--accent));
|
|
198
|
+
--color-sky: var(--sky, #0ea5e9);
|
|
199
|
+
--color-sky-soft: var(--sky-soft, #e0f2fe);
|
|
200
|
+
--color-sky-deep: var(--sky-deep, #0369a1);
|
|
201
|
+
--color-mint: var(--mint, #10b981);
|
|
202
|
+
--color-mint-soft: var(--mint-soft, #d1fae5);
|
|
203
|
+
--color-mint-deep: var(--mint-deep, #047857);
|
|
204
|
+
--color-success: var(--success);
|
|
205
|
+
--color-success-soft: var(--success-soft, var(--success));
|
|
206
|
+
--color-warning: var(--warning);
|
|
207
|
+
--color-warning-soft: var(--warning-soft, var(--warning));
|
|
208
|
+
--color-danger: var(--danger);
|
|
209
|
+
--color-danger-soft: var(--danger-soft, var(--danger));
|
|
210
|
+
--color-scrim: var(--scrim, rgb(0 0 0 / 45%));
|
|
211
|
+
--radius: var(--radius, 12px);
|
|
212
|
+
--radius-sm: var(--radius-sm, 8px);
|
|
213
|
+
--radius-lg: var(--radius-lg, var(--radius));
|
|
214
|
+
--shadow-sm: var(--shadow, 0 1px 2px rgb(0 0 0 / 8%));
|
|
215
|
+
--shadow-lg: var(--shadow-lg, 0 12px 32px rgb(0 0 0 / 18%));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@theme {
|
|
219
|
+
--animate-sdk-fade-in: sdk-fade-in 150ms ease-out;
|
|
220
|
+
--animate-sdk-slide-up: sdk-slide-up 200ms ease-out;
|
|
221
|
+
--animate-sdk-drawer: sdk-drawer 200ms ease-out;
|
|
222
|
+
@keyframes sdk-fade-in { from { opacity: 0; } to { opacity: 1; } }
|
|
223
|
+
@keyframes sdk-slide-up {
|
|
224
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
225
|
+
to { opacity: 1; transform: translateY(0); }
|
|
226
|
+
}
|
|
227
|
+
@keyframes sdk-drawer {
|
|
228
|
+
from { transform: translateX(100%); }
|
|
229
|
+
to { transform: translateX(0); }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:root {
|
|
234
|
+
--paper: #ffffff;
|
|
235
|
+
--ink: #1a1a1a;
|
|
236
|
+
--muted: #6b7280;
|
|
237
|
+
--line: #e5e7eb;
|
|
238
|
+
--line-strong: #d1d5db;
|
|
239
|
+
--panel: #f9fafb;
|
|
240
|
+
--success: #16a34a;
|
|
241
|
+
--warning: #d97706;
|
|
242
|
+
--danger: #dc2626;
|
|
243
|
+
--accent: #2563eb;
|
|
244
|
+
--paper-deep: #f3f4f6;
|
|
245
|
+
--ink-strong: var(--ink);
|
|
246
|
+
--panel-glass: rgba(255, 255, 255, 0.72);
|
|
247
|
+
--popover: var(--paper);
|
|
248
|
+
--scrim: rgba(0, 0, 0, 0.5);
|
|
249
|
+
--accent-soft: #dbeafe;
|
|
250
|
+
--accent-deep: #1e40af;
|
|
251
|
+
--accent-hover: var(--accent-deep);
|
|
252
|
+
--sky: #0284c7;
|
|
253
|
+
--sky-soft: #e0f2fe;
|
|
254
|
+
--sky-deep: #075985;
|
|
255
|
+
--mint: #059669;
|
|
256
|
+
--mint-soft: #d1fae5;
|
|
257
|
+
--mint-deep: #065f46;
|
|
258
|
+
--success-soft: color-mix(in srgb, var(--success) 15%, var(--paper));
|
|
259
|
+
--warning-soft: color-mix(in srgb, var(--warning) 15%, var(--paper));
|
|
260
|
+
--danger-soft: color-mix(in srgb, var(--danger) 15%, var(--paper));
|
|
261
|
+
--radius: 0.75rem;
|
|
262
|
+
--radius-sm: 0.5rem;
|
|
263
|
+
--radius-lg: 1rem;
|
|
264
|
+
--shadow: 0 12px 28px rgba(26, 41, 81, 0.08);
|
|
265
|
+
--shadow-lg: var(--shadow);
|
|
266
|
+
--font-display: "Fraunces", Georgia, serif;
|
|
267
|
+
font-family: "Manrope", system-ui, sans-serif;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Dark mode: the SDK sets data-theme="dark" on <html> when the system is dark
|
|
271
|
+
or the user picks dark in the Shell's theme toggle. */
|
|
272
|
+
:root[data-theme="dark"] {
|
|
273
|
+
color-scheme: dark;
|
|
274
|
+
--paper: #0f0f0f;
|
|
275
|
+
--ink: #f5f5f5;
|
|
276
|
+
--muted: #9ca3af;
|
|
277
|
+
--line: #2d2d2d;
|
|
278
|
+
--line-strong: #404040;
|
|
279
|
+
--panel: #1a1a1a;
|
|
280
|
+
--success: #22c55e;
|
|
281
|
+
--warning: #fbbf24;
|
|
282
|
+
--danger: #ef4444;
|
|
283
|
+
--paper-deep: #0a0a0a;
|
|
284
|
+
--panel-glass: rgba(26, 26, 26, 0.8);
|
|
285
|
+
--accent: #60a5fa;
|
|
286
|
+
--accent-soft: #172554;
|
|
287
|
+
--accent-deep: #bfdbfe;
|
|
288
|
+
--sky: #38bdf8;
|
|
289
|
+
--sky-soft: #082f49;
|
|
290
|
+
--sky-deep: #bae6fd;
|
|
291
|
+
--mint: #34d399;
|
|
292
|
+
--mint-soft: #022c22;
|
|
293
|
+
--mint-deep: #a7f3d0;
|
|
294
|
+
--shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* Shell text preferences scale rem-based typography without blocking zoom. */
|
|
298
|
+
:root[data-text="lg"] { font-size: 112.5%; }
|
|
299
|
+
:root[data-text="sm"] { font-size: 87.5%; }
|
|
300
|
+
|
|
301
|
+
body {
|
|
302
|
+
margin: 0;
|
|
303
|
+
background: var(--paper);
|
|
304
|
+
color: var(--ink);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
h1,
|
|
308
|
+
h2,
|
|
309
|
+
h3 {
|
|
310
|
+
font-family: var(--font-display);
|
|
311
|
+
}`,
|
|
312
|
+
'web/src/App.tsx': `import { useEffect, useState } from "react";
|
|
313
|
+
import { initApp } from "@freeappstore/sdk";
|
|
314
|
+
import { type NavItem, PageHeader, Shell } from "@freeappstore/sdk/ui";
|
|
315
|
+
|
|
316
|
+
// "APPID" is replaced with this app's id when it deploys.
|
|
317
|
+
const fas = initApp({ appId: "APPID" });
|
|
318
|
+
|
|
319
|
+
// The app's screens. Shell renders them as the navbar: a <nav> in its topbar
|
|
320
|
+
// with the current screen highlighted, collapsing to a menu on phones.
|
|
321
|
+
// Add one entry per primary screen; \`title\` becomes the browser tab title.
|
|
322
|
+
const NAV: NavItem[] = [
|
|
323
|
+
{ label: "Home", href: "/", title: "APPNAME" },
|
|
324
|
+
{ label: "About", href: "/about", title: "About — APPNAME" },
|
|
325
|
+
];
|
|
326
|
+
|
|
327
|
+
export default function App() {
|
|
328
|
+
const [path, setPath] = useState(() => window.location.pathname);
|
|
329
|
+
|
|
330
|
+
// Keep the screen in step with the browser's back and forward buttons.
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
const sync = () => setPath(window.location.pathname);
|
|
333
|
+
window.addEventListener("popstate", sync);
|
|
334
|
+
return () => window.removeEventListener("popstate", sync);
|
|
335
|
+
}, []);
|
|
336
|
+
|
|
337
|
+
// Nav clicks switch screens without a page load. Shell scrolls to the top
|
|
338
|
+
// and moves focus to the new screen's PageHeader.
|
|
339
|
+
const navigate = (href: string) => {
|
|
340
|
+
window.history.pushState(null, "", href);
|
|
341
|
+
setPath(href);
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
return (
|
|
345
|
+
<Shell app={fas} appName="APPNAME" nav={NAV} onNavigate={navigate}>
|
|
346
|
+
<div className="mx-auto w-full max-w-3xl p-4 sm:p-8">
|
|
347
|
+
{path === "/about" ? <About /> : <Home />}
|
|
348
|
+
</div>
|
|
349
|
+
</Shell>
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function Home() {
|
|
354
|
+
return <PageHeader title="Welcome to APPNAME" description="Edit web/src/App.tsx to get started." />;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function About() {
|
|
358
|
+
return (
|
|
359
|
+
<>
|
|
360
|
+
<PageHeader title="About" />
|
|
361
|
+
<p style={{ color: "var(--muted)" }}>
|
|
362
|
+
APPNAME is a free app on <a href="https://freeappstore.online">FreeAppStore</a>.
|
|
363
|
+
</p>
|
|
364
|
+
</>
|
|
365
|
+
);
|
|
366
|
+
}`,
|
|
367
|
+
LICENSE: `MIT License
|
|
368
|
+
|
|
369
|
+
Copyright (c) 2025 FreeAppStore
|
|
370
|
+
|
|
371
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
372
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
373
|
+
in the Software without restriction, including without limitation the rights
|
|
374
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
375
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
376
|
+
furnished to do so, subject to the following conditions:
|
|
377
|
+
|
|
378
|
+
The above copyright notice and this permission notice shall be included in all
|
|
379
|
+
copies or substantial portions of the Software.
|
|
380
|
+
|
|
381
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
382
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
383
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
384
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
385
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
386
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
387
|
+
SOFTWARE.`,
|
|
388
|
+
};
|
|
389
|
+
const DASHBOARD_FILES = {
|
|
390
|
+
'web/src/components/Dashboard.tsx': `const stats = [
|
|
391
|
+
{ label: "Revenue", value: "$24.8k", delta: "+12%" },
|
|
392
|
+
{ label: "Active users", value: "1,284", delta: "+8%" },
|
|
393
|
+
{ label: "Conversion", value: "6.2%", delta: "+1.4%" },
|
|
394
|
+
{ label: "Open tasks", value: "17", delta: "-3" },
|
|
395
|
+
];
|
|
396
|
+
|
|
397
|
+
export function Dashboard() {
|
|
398
|
+
return (
|
|
399
|
+
<section className="space-y-6">
|
|
400
|
+
<div>
|
|
401
|
+
<h2 className="text-2xl font-bold" style={{ fontFamily: "Fraunces, serif" }}>
|
|
402
|
+
Dashboard
|
|
403
|
+
</h2>
|
|
404
|
+
<p className="mt-1 text-sm" style={{ color: "var(--muted)" }}>
|
|
405
|
+
Track the signals that matter most.
|
|
406
|
+
</p>
|
|
407
|
+
</div>
|
|
408
|
+
<div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-4">
|
|
409
|
+
{stats.map((stat) => (
|
|
410
|
+
<article
|
|
411
|
+
key={stat.label}
|
|
412
|
+
className="rounded-2xl border p-4"
|
|
413
|
+
style={{ borderColor: "var(--line)", background: "var(--panel)" }}
|
|
414
|
+
>
|
|
415
|
+
<p className="text-sm font-medium" style={{ color: "var(--muted)" }}>
|
|
416
|
+
{stat.label}
|
|
417
|
+
</p>
|
|
418
|
+
<div className="mt-3 flex items-end justify-between gap-3">
|
|
419
|
+
<strong className="text-2xl">{stat.value}</strong>
|
|
420
|
+
<span className="rounded-full px-2 py-1 text-xs font-semibold" style={{ color: "var(--success)", background: "var(--paper)" }}>
|
|
421
|
+
{stat.delta}
|
|
422
|
+
</span>
|
|
423
|
+
</div>
|
|
424
|
+
</article>
|
|
425
|
+
))}
|
|
426
|
+
</div>
|
|
427
|
+
<div className="grid gap-4 lg:grid-cols-[2fr_1fr]">
|
|
428
|
+
<article className="min-h-72 rounded-2xl border p-5" style={{ borderColor: "var(--line)", background: "var(--panel)" }}>
|
|
429
|
+
<div className="flex items-center justify-between">
|
|
430
|
+
<h3 className="font-semibold">Trend overview</h3>
|
|
431
|
+
<span className="text-sm" style={{ color: "var(--muted)" }}>Last 30 days</span>
|
|
432
|
+
</div>
|
|
433
|
+
<div className="mt-8 flex h-44 items-end gap-3">
|
|
434
|
+
{[42, 68, 52, 76, 64, 86, 72, 94].map((height, index) => (
|
|
435
|
+
<div key={index} className="flex-1 rounded-t-xl" style={{ height: height + "%", background: "var(--accent)" }} />
|
|
436
|
+
))}
|
|
437
|
+
</div>
|
|
438
|
+
</article>
|
|
439
|
+
<article className="rounded-2xl border p-5" style={{ borderColor: "var(--line)", background: "var(--panel)" }}>
|
|
440
|
+
<h3 className="font-semibold">Next actions</h3>
|
|
441
|
+
<ul className="mt-4 space-y-3 text-sm">
|
|
442
|
+
{["Review weekly progress", "Prioritize stalled work", "Share update"].map((item) => (
|
|
443
|
+
<li key={item} className="rounded-xl border px-3 py-2" style={{ borderColor: "var(--line)", background: "var(--paper)" }}>
|
|
444
|
+
{item}
|
|
445
|
+
</li>
|
|
446
|
+
))}
|
|
447
|
+
</ul>
|
|
448
|
+
</article>
|
|
449
|
+
</div>
|
|
450
|
+
</section>
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
`,
|
|
454
|
+
};
|
|
455
|
+
const TRACKER_FILES = {
|
|
456
|
+
'web/src/components/Tracker.tsx': `import { useMemo, useState } from "react";
|
|
457
|
+
|
|
458
|
+
interface Item {
|
|
459
|
+
id: string;
|
|
460
|
+
title: string;
|
|
461
|
+
done: boolean;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const initialItems: Item[] = [
|
|
465
|
+
{ id: "welcome", title: "Define the first thing to track", done: false },
|
|
466
|
+
{ id: "sample", title: "Mark an item complete", done: true },
|
|
467
|
+
];
|
|
468
|
+
|
|
469
|
+
export function Tracker() {
|
|
470
|
+
const [items, setItems] = useState<Item[]>(initialItems);
|
|
471
|
+
const [draft, setDraft] = useState("");
|
|
472
|
+
const [editingId, setEditingId] = useState<string | null>(null);
|
|
473
|
+
|
|
474
|
+
const remaining = useMemo(() => items.filter((item) => !item.done).length, [items]);
|
|
475
|
+
const editingItem = items.find((item) => item.id === editingId);
|
|
476
|
+
|
|
477
|
+
function saveItem() {
|
|
478
|
+
const title = draft.trim();
|
|
479
|
+
if (!title) return;
|
|
480
|
+
if (editingId) {
|
|
481
|
+
setItems((current) => current.map((item) => (item.id === editingId ? { ...item, title } : item)));
|
|
482
|
+
setEditingId(null);
|
|
483
|
+
} else {
|
|
484
|
+
setItems((current) => [{ id: crypto.randomUUID(), title, done: false }, ...current]);
|
|
485
|
+
}
|
|
486
|
+
setDraft("");
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function startEdit(item: Item) {
|
|
490
|
+
setEditingId(item.id);
|
|
491
|
+
setDraft(item.title);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
function cancelEdit() {
|
|
495
|
+
setEditingId(null);
|
|
496
|
+
setDraft("");
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return (
|
|
500
|
+
<section className="space-y-5">
|
|
501
|
+
<div className="flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
|
|
502
|
+
<div>
|
|
503
|
+
<h2 className="text-2xl font-bold" style={{ fontFamily: "Fraunces, serif" }}>
|
|
504
|
+
Tracker
|
|
505
|
+
</h2>
|
|
506
|
+
<p className="text-sm" style={{ color: "var(--muted)" }}>
|
|
507
|
+
{remaining} open item{remaining === 1 ? "" : "s"}
|
|
508
|
+
</p>
|
|
509
|
+
</div>
|
|
510
|
+
</div>
|
|
511
|
+
<div className="rounded-2xl border p-4" style={{ borderColor: "var(--line)", background: "var(--panel)" }}>
|
|
512
|
+
<label className="text-sm font-semibold" htmlFor="tracker-item">
|
|
513
|
+
{editingItem ? "Edit item" : "Add item"}
|
|
514
|
+
</label>
|
|
515
|
+
<div className="mt-3 flex flex-col gap-2 sm:flex-row">
|
|
516
|
+
<input
|
|
517
|
+
id="tracker-item"
|
|
518
|
+
value={draft}
|
|
519
|
+
onChange={(event) => setDraft(event.target.value)}
|
|
520
|
+
onKeyDown={(event) => {
|
|
521
|
+
if (event.key === "Enter") saveItem();
|
|
522
|
+
if (event.key === "Escape") cancelEdit();
|
|
523
|
+
}}
|
|
524
|
+
placeholder="What needs tracking?"
|
|
525
|
+
className="min-h-11 flex-1 rounded-xl border px-3 outline-none"
|
|
526
|
+
style={{ borderColor: "var(--line)", background: "var(--paper)", color: "var(--ink)" }}
|
|
527
|
+
/>
|
|
528
|
+
<button type="button" onClick={saveItem} className="min-h-11 rounded-xl px-4 font-semibold text-white" style={{ background: "var(--accent)" }}>
|
|
529
|
+
{editingItem ? "Save" : "Add"}
|
|
530
|
+
</button>
|
|
531
|
+
{editingItem && (
|
|
532
|
+
<button type="button" onClick={cancelEdit} className="min-h-11 rounded-xl border px-4 font-semibold" style={{ borderColor: "var(--line)" }}>
|
|
533
|
+
Cancel
|
|
534
|
+
</button>
|
|
535
|
+
)}
|
|
536
|
+
</div>
|
|
537
|
+
</div>
|
|
538
|
+
<ul className="space-y-3">
|
|
539
|
+
{items.map((item) => (
|
|
540
|
+
<li key={item.id} className="rounded-2xl border p-4" style={{ borderColor: "var(--line)", background: "var(--panel)" }}>
|
|
541
|
+
<div className="flex flex-col gap-3 sm:flex-row sm:items-center">
|
|
542
|
+
<label className="flex flex-1 items-center gap-3">
|
|
543
|
+
<input
|
|
544
|
+
type="checkbox"
|
|
545
|
+
checked={item.done}
|
|
546
|
+
onChange={() => setItems((current) => current.map((entry) => (entry.id === item.id ? { ...entry, done: !entry.done } : entry)))}
|
|
547
|
+
className="size-5"
|
|
548
|
+
/>
|
|
549
|
+
<span className={item.done ? "line-through" : ""} style={{ color: item.done ? "var(--muted)" : "var(--ink)" }}>
|
|
550
|
+
{item.title}
|
|
551
|
+
</span>
|
|
552
|
+
</label>
|
|
553
|
+
<div className="flex gap-2">
|
|
554
|
+
<button type="button" onClick={() => startEdit(item)} className="rounded-xl border px-3 py-2 text-sm font-semibold" style={{ borderColor: "var(--line)" }}>
|
|
555
|
+
Edit
|
|
556
|
+
</button>
|
|
557
|
+
<button
|
|
558
|
+
type="button"
|
|
559
|
+
onClick={() => setItems((current) => current.filter((entry) => entry.id !== item.id))}
|
|
560
|
+
className="rounded-xl border px-3 py-2 text-sm font-semibold"
|
|
561
|
+
style={{ borderColor: "var(--line)", color: "var(--danger)" }}
|
|
562
|
+
>
|
|
563
|
+
Delete
|
|
564
|
+
</button>
|
|
565
|
+
</div>
|
|
566
|
+
</div>
|
|
567
|
+
</li>
|
|
568
|
+
))}
|
|
569
|
+
</ul>
|
|
570
|
+
</section>
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
`,
|
|
574
|
+
};
|
|
575
|
+
const CALCULATOR_FILES = {
|
|
576
|
+
'web/src/components/Calculator.tsx': `import { useMemo, useState } from "react";
|
|
577
|
+
|
|
578
|
+
const buttons = ["7", "8", "9", "/", "4", "5", "6", "*", "1", "2", "3", "-", "0", ".", "=", "+"];
|
|
579
|
+
|
|
580
|
+
function evaluateExpression(expression: string): string {
|
|
581
|
+
if (!/^[0-9+\\-*/. ()]+$/.test(expression)) return "Error";
|
|
582
|
+
try {
|
|
583
|
+
const value = Function('"use strict"; return (' + expression + ')')();
|
|
584
|
+
return Number.isFinite(value) ? String(Number(value.toFixed(8))) : "Error";
|
|
585
|
+
} catch {
|
|
586
|
+
return "Error";
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export function Calculator() {
|
|
591
|
+
const [display, setDisplay] = useState("0");
|
|
592
|
+
const isError = display === "Error";
|
|
593
|
+
const preview = useMemo(() => {
|
|
594
|
+
if (isError || display === "0" || /[+\\-*/.]$/.test(display)) return "";
|
|
595
|
+
const result = evaluateExpression(display);
|
|
596
|
+
return result !== "Error" && result !== display ? result : "";
|
|
597
|
+
}, [display, isError]);
|
|
598
|
+
|
|
599
|
+
function press(key: string) {
|
|
600
|
+
if (key === "=") {
|
|
601
|
+
setDisplay((current) => evaluateExpression(current));
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
setDisplay((current) => (current === "0" || current === "Error" ? key : current + key));
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
return (
|
|
608
|
+
<section className="mx-auto max-w-sm space-y-4">
|
|
609
|
+
<div>
|
|
610
|
+
<h2 className="text-2xl font-bold" style={{ fontFamily: "Fraunces, serif" }}>
|
|
611
|
+
Calculator
|
|
612
|
+
</h2>
|
|
613
|
+
<p className="text-sm" style={{ color: "var(--muted)" }}>
|
|
614
|
+
A compact expression calculator.
|
|
615
|
+
</p>
|
|
616
|
+
</div>
|
|
617
|
+
<div className="rounded-2xl border p-4 shadow-sm" style={{ borderColor: "var(--line)", background: "var(--panel)" }}>
|
|
618
|
+
<div className="min-h-28 rounded-2xl border p-4 text-right" style={{ borderColor: "var(--line)", background: "var(--paper)" }}>
|
|
619
|
+
<div className="break-all text-3xl font-bold">{display}</div>
|
|
620
|
+
<div className="mt-2 min-h-5 text-sm" style={{ color: "var(--muted)" }}>
|
|
621
|
+
{preview}
|
|
622
|
+
</div>
|
|
623
|
+
</div>
|
|
624
|
+
<div className="mt-4 grid grid-cols-4 gap-2">
|
|
625
|
+
<button
|
|
626
|
+
type="button"
|
|
627
|
+
onClick={() => setDisplay("0")}
|
|
628
|
+
className="col-span-2 min-h-12 rounded-xl border font-semibold"
|
|
629
|
+
style={{ borderColor: "var(--line)" }}
|
|
630
|
+
>
|
|
631
|
+
Clear
|
|
632
|
+
</button>
|
|
633
|
+
<button
|
|
634
|
+
type="button"
|
|
635
|
+
onClick={() => setDisplay((current) => (current.length > 1 && current !== "Error" ? current.slice(0, -1) : "0"))}
|
|
636
|
+
className="col-span-2 min-h-12 rounded-xl border font-semibold"
|
|
637
|
+
style={{ borderColor: "var(--line)" }}
|
|
638
|
+
>
|
|
639
|
+
Back
|
|
640
|
+
</button>
|
|
641
|
+
{buttons.map((button) => (
|
|
642
|
+
<button
|
|
643
|
+
key={button}
|
|
644
|
+
type="button"
|
|
645
|
+
onClick={() => press(button)}
|
|
646
|
+
className="min-h-12 rounded-xl border text-lg font-semibold"
|
|
647
|
+
style={{
|
|
648
|
+
borderColor: "var(--line)",
|
|
649
|
+
background: button === "=" ? "var(--accent)" : "var(--paper)",
|
|
650
|
+
color: button === "=" ? "#fff" : "var(--ink)",
|
|
651
|
+
}}
|
|
652
|
+
>
|
|
653
|
+
{button}
|
|
654
|
+
</button>
|
|
655
|
+
))}
|
|
656
|
+
</div>
|
|
657
|
+
</div>
|
|
658
|
+
</section>
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
`,
|
|
662
|
+
};
|
|
663
|
+
const APP_ARCHETYPE_FILES = {
|
|
664
|
+
dashboard: DASHBOARD_FILES,
|
|
665
|
+
tracker: TRACKER_FILES,
|
|
666
|
+
calculator: CALCULATOR_FILES,
|
|
667
|
+
generic: {},
|
|
668
|
+
};
|
|
669
|
+
// ── Games-specific template files ──
|
|
670
|
+
const GAME_FILES = {
|
|
671
|
+
'web/index.html': `<!DOCTYPE html>
|
|
672
|
+
<html lang="en">
|
|
673
|
+
<head>
|
|
674
|
+
<meta charset="UTF-8" />
|
|
675
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
676
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
677
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
678
|
+
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,700;9..144,800&display=swap" rel="stylesheet" />
|
|
679
|
+
<link rel="manifest" href="/manifest.json" />
|
|
680
|
+
<meta name="theme-color" content="#10b981" />
|
|
681
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
682
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
683
|
+
<title>APPNAME — FreeGameStore</title>
|
|
684
|
+
</head>
|
|
685
|
+
<body>
|
|
686
|
+
<div id="root"></div>
|
|
687
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
688
|
+
</body>
|
|
689
|
+
</html>`,
|
|
690
|
+
'web/public/manifest.json': `{
|
|
691
|
+
"name": "APPNAME",
|
|
692
|
+
"short_name": "APPNAME",
|
|
693
|
+
"start_url": "/",
|
|
694
|
+
"display": "standalone",
|
|
695
|
+
"background_color": "#0f0f0f",
|
|
696
|
+
"theme_color": "#10b981",
|
|
697
|
+
"orientation": "any"
|
|
698
|
+
}`,
|
|
699
|
+
'web/src/index.css': `@import "tailwindcss";
|
|
700
|
+
|
|
701
|
+
:root {
|
|
702
|
+
/* Games use the same canonical token names as apps (DESIGN-SYSTEM.md bans
|
|
703
|
+
the old background alias everywhere); only the values are game-dark. */
|
|
704
|
+
--paper: #0f0f0f;
|
|
705
|
+
--panel: #1a1a1a;
|
|
706
|
+
--ink: #f0f0f0;
|
|
707
|
+
--muted: #999;
|
|
708
|
+
--accent: #10b981;
|
|
709
|
+
--line: #2a2a2a;
|
|
710
|
+
--success: #22c55e;
|
|
711
|
+
--warning: #fbbf24;
|
|
712
|
+
--danger: #ef4444;
|
|
713
|
+
font-family: "Manrope", system-ui, sans-serif;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
body {
|
|
717
|
+
margin: 0;
|
|
718
|
+
background: var(--paper);
|
|
719
|
+
color: var(--ink);
|
|
720
|
+
overflow: hidden;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
#root {
|
|
724
|
+
width: 100vw;
|
|
725
|
+
height: 100dvh;
|
|
726
|
+
overflow: hidden;
|
|
727
|
+
}`,
|
|
728
|
+
'web/src/components/GameShell.tsx': `import type { ReactNode } from "react";
|
|
729
|
+
|
|
730
|
+
interface GameShellProps {
|
|
731
|
+
title: string;
|
|
732
|
+
children: ReactNode;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/** GameShell: full-viewport wrapper with a 44px top bar and game canvas area.
|
|
736
|
+
* The topbar shows the game name and a link to FreeGameStore.
|
|
737
|
+
* The children fill the remaining viewport height. */
|
|
738
|
+
export function GameShell({ title, children }: GameShellProps) {
|
|
739
|
+
return (
|
|
740
|
+
<div style={{ width: "100vw", height: "100dvh", display: "flex", flexDirection: "column", overflow: "hidden", background: "var(--paper)" }}>
|
|
741
|
+
<header style={{ height: 44, minHeight: 44, display: "flex", alignItems: "center", justifyContent: "space-between", padding: "0 1rem", background: "var(--panel)", borderBottom: "1px solid var(--line)", fontSize: "0.85rem" }}>
|
|
742
|
+
<span style={{ fontWeight: 700, fontFamily: "Fraunces, serif" }}>{title}</span>
|
|
743
|
+
<a href="https://freegamestore.online" target="_blank" rel="noopener noreferrer" style={{ color: "var(--muted)", fontSize: "0.75rem", textDecoration: "none" }}>
|
|
744
|
+
FreeGameStore
|
|
745
|
+
</a>
|
|
746
|
+
</header>
|
|
747
|
+
<main style={{ flex: 1, overflow: "hidden", position: "relative" }}>
|
|
748
|
+
{children}
|
|
749
|
+
</main>
|
|
750
|
+
</div>
|
|
751
|
+
);
|
|
752
|
+
}`,
|
|
753
|
+
'web/src/App.tsx': `import { GameShell } from "./components/GameShell";
|
|
754
|
+
|
|
755
|
+
export default function App() {
|
|
756
|
+
return (
|
|
757
|
+
<GameShell title="APPNAME">
|
|
758
|
+
<div style={{ display: "flex", alignItems: "center", justifyContent: "center", height: "100%", flexDirection: "column", gap: "1rem" }}>
|
|
759
|
+
<h1 style={{ fontFamily: "Fraunces, serif", fontSize: "2rem", margin: 0 }}>
|
|
760
|
+
APPNAME
|
|
761
|
+
</h1>
|
|
762
|
+
<p style={{ color: "var(--muted)" }}>
|
|
763
|
+
Edit <code>src/App.tsx</code> to build your game.
|
|
764
|
+
</p>
|
|
765
|
+
</div>
|
|
766
|
+
</GameShell>
|
|
767
|
+
);
|
|
768
|
+
}`,
|
|
769
|
+
LICENSE: `MIT License
|
|
770
|
+
|
|
771
|
+
Copyright (c) 2025 FreeGameStore
|
|
772
|
+
|
|
773
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
774
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
775
|
+
in the Software without restriction, including without limitation the rights
|
|
776
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
777
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
778
|
+
furnished to do so, subject to the following conditions:
|
|
779
|
+
|
|
780
|
+
The above copyright notice and this permission notice shall be included in all
|
|
781
|
+
copies or substantial portions of the Software.
|
|
782
|
+
|
|
783
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
784
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
785
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
786
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
787
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
788
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
789
|
+
SOFTWARE.`,
|
|
790
|
+
};
|
|
791
|
+
// ── Deploy workflow (R2) ──
|
|
792
|
+
//
|
|
793
|
+
// Every agent-pushed repo carries this so GitHub Actions builds web/dist and
|
|
794
|
+
// syncs it to r2://<bucket>/<nounPlural>/<repo>/ — the prefix the host Worker
|
|
795
|
+
// (freeappstore-host / freegamestore-host) serves once the publish step writes
|
|
796
|
+
// the D1 routes row. Mirrors the proven template-standalone deploy.yml.
|
|
797
|
+
//
|
|
798
|
+
// Uses plain `pnpm install` (NOT --frozen-lockfile): the agent scaffold ships
|
|
799
|
+
// no lockfile. Org-level R2_* secrets (R2_ACCESS_KEY_ID / R2_SECRET_ACCESS_KEY /
|
|
800
|
+
// R2_ACCOUNT_ID) are inherited from the store org — public repos get them
|
|
801
|
+
// (console/notes already deploy this way). Contains no APPNAME placeholder.
|
|
802
|
+
function deployWorkflow(config) {
|
|
803
|
+
return `name: Deploy to R2
|
|
804
|
+
|
|
805
|
+
on:
|
|
806
|
+
push:
|
|
807
|
+
branches: [main]
|
|
808
|
+
workflow_dispatch:
|
|
809
|
+
|
|
810
|
+
concurrency:
|
|
811
|
+
group: deploy-\${{ github.repository }}
|
|
812
|
+
cancel-in-progress: true
|
|
813
|
+
|
|
814
|
+
jobs:
|
|
815
|
+
deploy:
|
|
816
|
+
if: \${{ !startsWith(github.event.repository.name, 'template-') }}
|
|
817
|
+
runs-on: ubuntu-latest
|
|
818
|
+
permissions:
|
|
819
|
+
contents: read
|
|
820
|
+
steps:
|
|
821
|
+
- uses: actions/checkout@v4
|
|
822
|
+
- uses: pnpm/action-setup@v4
|
|
823
|
+
- uses: actions/setup-node@v4
|
|
824
|
+
with:
|
|
825
|
+
node-version: 22
|
|
826
|
+
- name: Install
|
|
827
|
+
run: pnpm install --no-frozen-lockfile
|
|
828
|
+
${config.store === 'apps'
|
|
829
|
+
? ` - name: Resolve build target
|
|
830
|
+
id: target
|
|
831
|
+
run: npx @freeappstore/cli build-target --app-id "\${GITHUB_REPOSITORY##*/}" --github-output
|
|
832
|
+
- name: Build
|
|
833
|
+
env:
|
|
834
|
+
BUILD_COMMAND: \${{ steps.target.outputs.build-command }}
|
|
835
|
+
run: bash -e -c "$BUILD_COMMAND"
|
|
836
|
+
- name: Verify build output
|
|
837
|
+
run: npx @freeappstore/cli build-target --artifact --app-id "\${GITHUB_REPOSITORY##*/}"
|
|
838
|
+
`
|
|
839
|
+
: `\
|
|
840
|
+
- name: Build
|
|
841
|
+
run: pnpm build
|
|
842
|
+
- name: Verify build output
|
|
843
|
+
run: |
|
|
844
|
+
test -d ./web/dist || { echo "::error::No build output at web/dist"; exit 1; }
|
|
845
|
+
test -n "$(ls -A ./web/dist)" || { echo "::error::web/dist is empty"; exit 1; }
|
|
846
|
+
`}\
|
|
847
|
+
- name: Upload to R2
|
|
848
|
+
env:
|
|
849
|
+
${config.store === 'apps' ? ` OUTPUT_PATH: \${{ steps.target.outputs.output-path }}\n` : ''}\
|
|
850
|
+
AWS_ACCESS_KEY_ID: \${{ secrets.R2_ACCESS_KEY_ID }}
|
|
851
|
+
AWS_SECRET_ACCESS_KEY: \${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
852
|
+
AWS_DEFAULT_REGION: auto
|
|
853
|
+
R2_ACCOUNT_ID: \${{ secrets.R2_ACCOUNT_ID }}
|
|
854
|
+
run: |
|
|
855
|
+
aws s3 sync ${config.store === 'apps' ? '"$OUTPUT_PATH"' : './web/dist'} "s3://${config.r2Bucket}/${config.nounPlural}/\${GITHUB_REPOSITORY##*/}/" \\
|
|
856
|
+
--endpoint-url "https://$R2_ACCOUNT_ID.r2.cloudflarestorage.com" \\
|
|
857
|
+
--delete \\
|
|
858
|
+
--no-progress
|
|
859
|
+
echo "Deployed ${config.nounPlural}/\${GITHUB_REPOSITORY##*/} from \${GITHUB_SHA::7} to R2"
|
|
860
|
+
`;
|
|
861
|
+
}
|
|
862
|
+
// ── Public API ──
|
|
863
|
+
const CONNECTED_DRAFT = `import { useEffect, useRef } from 'react';
|
|
864
|
+
import { useConnectedKvDraft } from '@freeappstore/sdk/hooks';
|
|
865
|
+
import { SignInButton } from '@freeappstore/sdk/ui';
|
|
866
|
+
import type { FreeAppStore } from '@freeappstore/sdk';
|
|
867
|
+
import { pwa } from '../fas-capabilities/pwa';
|
|
868
|
+
|
|
869
|
+
/** Keep the sign-in gate on this private-data feature, not on public app screens. */
|
|
870
|
+
export function ConnectedDraft({ app: fas }: { app: FreeAppStore }) {
|
|
871
|
+
const draft = useConnectedKvDraft(fas, 'private-draft', '');
|
|
872
|
+
const busy = useRef(false);
|
|
873
|
+
busy.current = draft.dirty || draft.saving;
|
|
874
|
+
useEffect(() => pwa.addBusyGuard(() => busy.current), []);
|
|
875
|
+
|
|
876
|
+
if (!draft.user) {
|
|
877
|
+
return (
|
|
878
|
+
<section aria-labelledby="draft-title">
|
|
879
|
+
<h2 id="draft-title">Private draft</h2>
|
|
880
|
+
<p>Sign in to load or save your private draft. Public parts of the app remain available.</p>
|
|
881
|
+
<SignInButton app={fas} />
|
|
882
|
+
</section>
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
return (
|
|
887
|
+
<section aria-labelledby="draft-title">
|
|
888
|
+
<h2 id="draft-title">Private draft</h2>
|
|
889
|
+
{draft.loading ? <p role="status">Loading your draft…</p> : null}
|
|
890
|
+
{draft.error ? (
|
|
891
|
+
<p role="alert">
|
|
892
|
+
{draft.error}{' '}
|
|
893
|
+
<button type="button" onClick={draft.retry}>
|
|
894
|
+
Retry
|
|
895
|
+
</button>
|
|
896
|
+
</p>
|
|
897
|
+
) : null}
|
|
898
|
+
<label htmlFor="private-draft">Your notes</label>
|
|
899
|
+
<textarea
|
|
900
|
+
id="private-draft"
|
|
901
|
+
style={{ display: 'block', boxSizing: 'border-box', width: '100%', minWidth: 0, maxWidth: '100%', resize: 'vertical' }}
|
|
902
|
+
value={draft.draft}
|
|
903
|
+
onChange={(event) => draft.setDraft(event.currentTarget.value)}
|
|
904
|
+
/>
|
|
905
|
+
<button
|
|
906
|
+
type="button"
|
|
907
|
+
disabled={!draft.dirty || draft.saving}
|
|
908
|
+
onClick={() => void draft.save()}
|
|
909
|
+
>
|
|
910
|
+
{draft.saving ? 'Saving…' : 'Save'}
|
|
911
|
+
</button>
|
|
912
|
+
{draft.dirty ? <span>Unsaved changes</span> : null}
|
|
913
|
+
</section>
|
|
914
|
+
);
|
|
915
|
+
}
|
|
916
|
+
`;
|
|
917
|
+
export function getArchetypeFiles(archetype) {
|
|
918
|
+
return APP_ARCHETYPE_FILES[archetype];
|
|
919
|
+
}
|
|
920
|
+
export function getTemplateFiles(config, archetype, preset = 'standalone') {
|
|
921
|
+
const appArchetypeFiles = config.store === 'games' ? {} : getArchetypeFiles(archetype ?? 'generic');
|
|
922
|
+
const capabilities = config.store === 'apps' ? resolveStarterPreset(preset) : [];
|
|
923
|
+
const foundationFiles = { ...SHARED_FILES, ...APP_FILES };
|
|
924
|
+
const capabilityPlan = planCapabilityChanges(capabilities, foundationFiles, {}, () => false);
|
|
925
|
+
const capabilityFiles = capabilityPlan.writes;
|
|
926
|
+
const files = {
|
|
927
|
+
...SHARED_FILES,
|
|
928
|
+
...(config.store === 'games' ? GAME_FILES : APP_FILES),
|
|
929
|
+
...(config.store === 'apps'
|
|
930
|
+
? {
|
|
931
|
+
'web/package.json': SHARED_FILES['web/package.json'].replace('"vite": "^6"', '"vite": "^6",\n "vite-plugin-pwa": "^1.0"'),
|
|
932
|
+
'web/vite.config.ts': `import { defineConfig } from 'vite';
|
|
933
|
+
import react from '@vitejs/plugin-react';
|
|
934
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
935
|
+
import { VitePWA } from 'vite-plugin-pwa';
|
|
936
|
+
import { pwaOptions } from '@freeappstore/sdk/pwa-config';
|
|
937
|
+
export default defineConfig({ plugins: [react(), tailwindcss(), VitePWA(pwaOptions())] });`,
|
|
938
|
+
'web/src/pwa.ts': `// Compatibility path: the canonical app-owned controller lives in fas-capabilities/pwa.ts.
|
|
939
|
+
export { pwa } from './fas-capabilities/pwa';
|
|
940
|
+
`,
|
|
941
|
+
'web/src/main.tsx': `import './fas-capabilities/pwa';\n${SHARED_FILES['web/src/main.tsx']}`,
|
|
942
|
+
'web/public/icon.svg': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><rect width="512" height="512" rx="64" fill="#2563eb"/><path d="M160 160h192v48H208v48h120v48H208v48h-48z" fill="white"/></svg>`,
|
|
943
|
+
'web/public/manifest.json': JSON.stringify({
|
|
944
|
+
...JSON.parse(APP_FILES['web/public/manifest.json']),
|
|
945
|
+
id: '/',
|
|
946
|
+
scope: '/',
|
|
947
|
+
min_viewport_width: 320,
|
|
948
|
+
icons: [
|
|
949
|
+
{ src: '/icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any maskable' },
|
|
950
|
+
],
|
|
951
|
+
}, null, 2),
|
|
952
|
+
'web/index.html': APP_FILES['web/index.html'].replace('initial-scale=1.0', 'initial-scale=1.0, viewport-fit=cover'),
|
|
953
|
+
'web/src/index.css': `${APP_FILES['web/src/index.css']}
|
|
954
|
+
html { overflow-wrap: anywhere; }
|
|
955
|
+
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
|
|
956
|
+
img, video, canvas { max-width: 100%; }
|
|
957
|
+
`,
|
|
958
|
+
'fas.json': JSON.stringify({
|
|
959
|
+
appId: 'APPID',
|
|
960
|
+
applicationRoot: 'web',
|
|
961
|
+
outputPath: 'web/dist',
|
|
962
|
+
buildCommand: 'pnpm build',
|
|
963
|
+
}, null, 2),
|
|
964
|
+
...capabilityFiles,
|
|
965
|
+
}
|
|
966
|
+
: {}),
|
|
967
|
+
...appArchetypeFiles,
|
|
968
|
+
'.github/workflows/deploy.yml': deployWorkflow(config),
|
|
969
|
+
};
|
|
970
|
+
if (config.store === 'apps' && preset === 'connected') {
|
|
971
|
+
files['web/src/App.tsx'] = files['web/src/App.tsx'].replace('import { initApp }', 'import { ConnectedDraft } from "./components/ConnectedDraft";\nimport { initApp }').replace(' return <PageHeader title="Welcome to APPNAME" description="Edit web/src/App.tsx to get started." />;', ' return <><PageHeader title="Welcome to APPNAME" description="Editable app-owned starter screen." /><ConnectedDraft app={fas} /></>;');
|
|
972
|
+
files['web/src/components/ConnectedDraft.tsx'] = CONNECTED_DRAFT;
|
|
973
|
+
}
|
|
974
|
+
return files;
|
|
975
|
+
}
|
|
976
|
+
export function substituteAppName(files, appId, displayName) {
|
|
977
|
+
const out = {};
|
|
978
|
+
for (const [path, content] of Object.entries(files)) {
|
|
979
|
+
out[path] = content.replace(/APPNAME/g, path.includes('package.json') || path.includes('pnpm-workspace') ? appId : displayName);
|
|
980
|
+
out[path] = out[path].replace(/APPID/g, appId);
|
|
981
|
+
}
|
|
982
|
+
// Fix package.json files to use the ID (lowercase, no spaces)
|
|
983
|
+
if (out['package.json']) {
|
|
984
|
+
out['package.json'] = out['package.json'].replace(new RegExp(displayName, 'g'), appId);
|
|
985
|
+
}
|
|
986
|
+
if (out['web/package.json']) {
|
|
987
|
+
out['web/package.json'] = out['web/package.json'].replace(new RegExp(displayName, 'g'), appId);
|
|
988
|
+
}
|
|
989
|
+
return out;
|
|
990
|
+
}
|
|
991
|
+
//# sourceMappingURL=starter-foundation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starter-foundation.js","sourceRoot":"","sources":["../../src/lib/starter-foundation.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAO5D,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,MAAM;CACnB,CAAC;AAMF,MAAM,CAAC,MAAM,cAAc,GAA4B;IACrD,WAAW;IACX,SAAS;IACT,YAAY;IACZ,SAAS;CACV,CAAC;AAEF,6DAA6D;AAE7D,MAAM,YAAY,GAA2B;IAC3C,qBAAqB,EAAE,sBAAsB;IAE7C,cAAc,EAAE;;;;;;;;;;;;;EAahB;IAEA,kBAAkB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;EAwBpB;IAEA,oBAAoB,EAAE;;;;;;;IAOpB;IAEF,mBAAmB,EAAE;;;EAGrB;IAEA,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;EAoBzB;IAEA,wBAAwB,EAAE;;;;;;;;;;;;;;;;;;EAkB1B;IAEA,kBAAkB,EAAE;;;;;;;;;GASnB;IAED,YAAY,EAAE,0CAA0C;CACzD,CAAC;AAEF,qCAAqC;AAErC,MAAM,SAAS,GAA2B;IACxC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBd;IACC,uBAAuB,EAAE,yCAAyC;IAClE,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;QAsBZ;IAEN,0BAA0B,EAAE;;;;;;;;EAQ5B;I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