@ramme-io/create-app 3.1.0 → 3.3.0
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.
- package/index.js +98 -12
- package/package.json +4 -4
- package/template/.env.example +6 -0
- package/template/CHANGELOG.md +175 -0
- package/template/gitignore +6 -0
- package/template/index.html +4 -2
- package/template/package.json +3 -2
- package/template/public/rocket.svg +18 -0
- package/template/src/components/AddItemsModal.tsx +0 -1
- package/template/src/components/AppFooter.tsx +2 -1
- package/template/src/components/AppHeader.tsx +2 -1
- package/template/src/components/PageTitleUpdater.tsx +8 -4
- package/template/src/components/ProtectedAppShell.tsx +11 -6
- package/template/src/components/SettingsModal.tsx +1 -1
- package/template/src/config/app.config.ts +36 -0
- package/template/src/config/app.manifest.ts +5 -4
- package/template/src/features/about/pages/AboutPage.tsx +0 -2
- package/template/src/features/config/AppConfigContext.tsx +24 -9
- package/template/src/pages/SettingsPage.tsx +0 -2
- package/template/src/templates/dashboard/DashboardLayout.tsx +2 -1
- package/template/src/tests/smoke.test.tsx +0 -1
- package/template-device/AGENTS.md +20 -0
- package/template-device/CHANGELOG.md +26 -0
- package/template-device/README.md +41 -0
- package/template-device/apps/hello.json +10 -0
- package/template-device/apps/probe.json +26 -0
- package/template-device/gitignore +5 -0
- package/template-device/package.json +17 -0
- package/template-device/page.html +86 -0
- package/template-device/server.mjs +242 -0
- package/template-device/server.test.mjs +117 -0
- package/template/public/orange.png +0 -0
- package/template/src/assets/orange.png +0 -0
package/index.js
CHANGED
|
@@ -15,17 +15,42 @@ console.log('║ The AI-Native App Builder ║');
|
|
|
15
15
|
console.log('║ ║');
|
|
16
16
|
console.log('╚═══════════════════════════════════════╝\n');
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
// Which starter. `app` (the default) is a web app on the framework; `device`
|
|
19
|
+
// is a Ramme server for boards on your own network — "Ramme local" in the
|
|
20
|
+
// monorepo's docs/superpowers/community-platform-plan.md.
|
|
21
|
+
const TEMPLATES = { app: 'template', device: 'template-device' };
|
|
22
|
+
|
|
23
|
+
const args = process.argv.slice(2);
|
|
24
|
+
const flag = args.indexOf('--template');
|
|
25
|
+
const templateName = flag === -1 ? 'app' : args[flag + 1];
|
|
26
|
+
const projectName = args.filter((_, i) => flag === -1 || (i !== flag && i !== flag + 1))[0];
|
|
27
|
+
if (!projectName || !TEMPLATES[templateName]) {
|
|
28
|
+
if (!TEMPLATES[templateName]) console.error(`❌ Error: No template called "${templateName}". There is: ${Object.keys(TEMPLATES).join(', ')}.`);
|
|
29
|
+
else console.error('❌ Error: Please specify the project directory.');
|
|
21
30
|
console.log('\n📖 Usage:');
|
|
22
|
-
console.log(' npm create @ramme-io/app@latest <project-name
|
|
31
|
+
console.log(' npm create @ramme-io/app@latest <project-name>');
|
|
32
|
+
console.log(' npm create @ramme-io/app@latest <project-name> --template device\n');
|
|
23
33
|
process.exit(1);
|
|
24
34
|
}
|
|
25
35
|
|
|
26
|
-
const templatePath = path.resolve(__dirname,
|
|
36
|
+
const templatePath = path.resolve(__dirname, TEMPLATES[templateName]);
|
|
27
37
|
const destinationPath = path.resolve(process.cwd(), projectName);
|
|
28
38
|
|
|
39
|
+
// What the new app calls itself, in package.json and on screen.
|
|
40
|
+
//
|
|
41
|
+
// `projectName` is a destination path — `my-app`, `./apps/my-app`, or something
|
|
42
|
+
// with a capital and a space in it. An npm name may be none of those, so the
|
|
43
|
+
// last segment is lowercased and stripped to the characters npm accepts. This
|
|
44
|
+
// is also what the tab title and the header wordmark say, which is why it is
|
|
45
|
+
// derived once here rather than twice with different rules.
|
|
46
|
+
const appSlug =
|
|
47
|
+
path
|
|
48
|
+
.basename(projectName)
|
|
49
|
+
.trim()
|
|
50
|
+
.toLowerCase()
|
|
51
|
+
.replace(/[^a-z0-9._-]+/g, '-')
|
|
52
|
+
.replace(/^[-_.]+|[-_.]+$/g, '') || 'app';
|
|
53
|
+
|
|
29
54
|
// THE STABILITY PACT: pinned target ranges for the public release.
|
|
30
55
|
//
|
|
31
56
|
// One shared constant used to cover all three packages, which silently broke
|
|
@@ -40,9 +65,9 @@ const destinationPath = path.resolve(process.cwd(), projectName);
|
|
|
40
65
|
// versions match what was just published, not merely that the build passes —
|
|
41
66
|
// a stale pin builds fine, it just ships the wrong framework.
|
|
42
67
|
const RELEASE_VERSIONS = {
|
|
43
|
-
'@ramme-io/ui': '^
|
|
44
|
-
'@ramme-io/kernel': '^
|
|
45
|
-
'@ramme-io/shared': '^
|
|
68
|
+
'@ramme-io/ui': '^5.0.0',
|
|
69
|
+
'@ramme-io/kernel': '^8.0.0',
|
|
70
|
+
'@ramme-io/shared': '^4.0.0',
|
|
46
71
|
};
|
|
47
72
|
|
|
48
73
|
try {
|
|
@@ -80,11 +105,72 @@ try {
|
|
|
80
105
|
}
|
|
81
106
|
}
|
|
82
107
|
|
|
108
|
+
// The copied template is named after the template ("ramme-starter"), which
|
|
109
|
+
// is the monorepo's workspace name and has nothing to do with the app being
|
|
110
|
+
// created. Left alone, every scaffolded app on earth shares one name.
|
|
111
|
+
pkg.name = appSlug;
|
|
112
|
+
|
|
83
113
|
fs.writeJsonSync(targetPkgPath, pkg, { spaces: 2 });
|
|
84
114
|
console.log('✅ Supply chain hardened. Workspace dependencies stripped.');
|
|
85
115
|
}
|
|
86
116
|
|
|
87
|
-
// 4.
|
|
117
|
+
// 4. IDENTITY — the app is called what the user named it.
|
|
118
|
+
//
|
|
119
|
+
// The template is branded for the monorepo it lives in: index.html carries
|
|
120
|
+
// the framework's own title, and vercel.json installs and builds from three
|
|
121
|
+
// directories up through a turbo filter naming this template's workspace.
|
|
122
|
+
// None of that is true of the app being created, and the title is visible
|
|
123
|
+
// before React has even mounted.
|
|
124
|
+
//
|
|
125
|
+
// src/config/app.config.ts is the one place the running app reads its name
|
|
126
|
+
// from, so setting it here is what makes `pnpm dev` show the right name with
|
|
127
|
+
// no .env file and no edit.
|
|
128
|
+
const identity = [
|
|
129
|
+
{
|
|
130
|
+
file: 'index.html',
|
|
131
|
+
find: /<title>[\s\S]*?<\/title>/,
|
|
132
|
+
replace: `<title>${appSlug}</title>`,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
file: 'src/config/app.config.ts',
|
|
136
|
+
find: /name: import\.meta\.env\.VITE_APP_NAME \?\? '[^']*'/,
|
|
137
|
+
replace: `name: import.meta.env.VITE_APP_NAME ?? '${appSlug}'`,
|
|
138
|
+
},
|
|
139
|
+
];
|
|
140
|
+
|
|
141
|
+
for (const { file, find, replace } of identity) {
|
|
142
|
+
const target = path.join(destinationPath, file);
|
|
143
|
+
if (!fs.existsSync(target)) continue;
|
|
144
|
+
|
|
145
|
+
const before = fs.readFileSync(target, 'utf8');
|
|
146
|
+
const after = before.replace(find, replace);
|
|
147
|
+
|
|
148
|
+
// Loud rather than silent. If a template edit moves one of these lines, the
|
|
149
|
+
// substitution stops matching and every app scaffolded after it is called
|
|
150
|
+
// "App Name" — which looks like a design choice rather than a bug.
|
|
151
|
+
if (after === before) {
|
|
152
|
+
console.warn(` ⚠️ Could not set the app name in ${file} — its name line has moved.`);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
fs.writeFileSync(target, after);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// The monorepo's build commands cannot work in a standalone repo: there is no
|
|
159
|
+
// directory three levels up and no turbo filter to resolve. Removing them
|
|
160
|
+
// lets Vercel use the app's own `build` script. Deliberately NO
|
|
161
|
+
// ignoreCommand — see deploy-ignore.test.ts; it would ship a turborepo
|
|
162
|
+
// assumption into a repo that has no turbo.json.
|
|
163
|
+
const vercelPath = path.join(destinationPath, 'vercel.json');
|
|
164
|
+
if (fs.existsSync(vercelPath)) {
|
|
165
|
+
const vercel = fs.readJsonSync(vercelPath);
|
|
166
|
+
delete vercel.installCommand;
|
|
167
|
+
delete vercel.buildCommand;
|
|
168
|
+
fs.writeJsonSync(vercelPath, vercel, { spaces: 2 });
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
console.log(` 🏷️ App name set to "${appSlug}"`);
|
|
172
|
+
|
|
173
|
+
// 5. AGENT RULES — one file, under every name an agent looks for.
|
|
88
174
|
//
|
|
89
175
|
// The monorepo does this with symlinks (.clinerules -> AGENTS.md, git mode
|
|
90
176
|
// 120000), which is drift-proof and completely useless here: npm pack DROPS
|
|
@@ -119,13 +205,13 @@ try {
|
|
|
119
205
|
console.warn(' ⚠️ AGENTS.md missing from the template — no agent rules were written.');
|
|
120
206
|
}
|
|
121
207
|
|
|
122
|
-
//
|
|
208
|
+
// 6. Handle Gitignore
|
|
123
209
|
const gitignorePath = path.join(destinationPath, 'gitignore');
|
|
124
210
|
if (fs.existsSync(gitignorePath)) {
|
|
125
211
|
fs.renameSync(gitignorePath, path.join(destinationPath, '.gitignore'));
|
|
126
212
|
}
|
|
127
213
|
|
|
128
|
-
//
|
|
214
|
+
// 7. ONBOARDING INSTRUCTIONS — Premium Unboxing Experience
|
|
129
215
|
console.log('\n╔═══════════════════════════════════════╗');
|
|
130
216
|
console.log('║ ║');
|
|
131
217
|
console.log('║ ✨ Your project is ready! ║');
|
|
@@ -135,7 +221,7 @@ try {
|
|
|
135
221
|
console.log('📋 What\'s Next? (Copy & Paste)\n');
|
|
136
222
|
console.log(` cd ${projectName}`);
|
|
137
223
|
console.log(' pnpm install');
|
|
138
|
-
console.log(' pnpm run dev\n');
|
|
224
|
+
console.log(templateName === 'device' ? ' pnpm start\n' : ' pnpm run dev\n');
|
|
139
225
|
|
|
140
226
|
console.log('🎨 Happy Creating!\n');
|
|
141
227
|
console.log('📚 Docs: https://ramme.io/docs');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ramme-io/create-app",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "The official CLI to create Ramme applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"index.js",
|
|
16
16
|
"template",
|
|
17
|
+
"template-device",
|
|
18
|
+
"!template-device/node_modules",
|
|
19
|
+
"!template-device/data.json*",
|
|
17
20
|
"!template/node_modules",
|
|
18
21
|
"!template/dist",
|
|
19
22
|
"!template/.turbo",
|
|
@@ -22,8 +25,5 @@
|
|
|
22
25
|
],
|
|
23
26
|
"dependencies": {
|
|
24
27
|
"fs-extra": "^11.2.0"
|
|
25
|
-
},
|
|
26
|
-
"scripts": {
|
|
27
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Copy to .env and edit. Vite only exposes variables prefixed VITE_.
|
|
2
|
+
|
|
3
|
+
# What the app calls itself: tab title, header wordmark, footer, assistant.
|
|
4
|
+
# Unset falls back to the `name` in src/config/app.config.ts, which the
|
|
5
|
+
# scaffolder already set to your project name.
|
|
6
|
+
VITE_APP_NAME="App Name"
|
package/template/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,180 @@
|
|
|
1
1
|
# ramme-starter
|
|
2
2
|
|
|
3
|
+
## 2.0.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2f995f7]
|
|
8
|
+
- Updated dependencies [1128071]
|
|
9
|
+
- Updated dependencies [0ec373c]
|
|
10
|
+
- Updated dependencies [c945eba]
|
|
11
|
+
- Updated dependencies [0c314cf]
|
|
12
|
+
- Updated dependencies [627f42a]
|
|
13
|
+
- Updated dependencies [b47f4b8]
|
|
14
|
+
- Updated dependencies [46f9a91]
|
|
15
|
+
- Updated dependencies [2494184]
|
|
16
|
+
- Updated dependencies [c1e5b05]
|
|
17
|
+
- Updated dependencies [d1d8c66]
|
|
18
|
+
- Updated dependencies [a6e89cc]
|
|
19
|
+
- Updated dependencies [24c6258]
|
|
20
|
+
- Updated dependencies [a2a516c]
|
|
21
|
+
- Updated dependencies [8a9919e]
|
|
22
|
+
- Updated dependencies [28b8475]
|
|
23
|
+
- Updated dependencies [aa806ca]
|
|
24
|
+
- Updated dependencies [f733861]
|
|
25
|
+
- Updated dependencies [59486f7]
|
|
26
|
+
- Updated dependencies [9a16afd]
|
|
27
|
+
- Updated dependencies [e900e1e]
|
|
28
|
+
- Updated dependencies [f222678]
|
|
29
|
+
- Updated dependencies [956663a]
|
|
30
|
+
- Updated dependencies [4fcd843]
|
|
31
|
+
- Updated dependencies [9d95cf2]
|
|
32
|
+
- @ramme-io/shared@4.0.0
|
|
33
|
+
- @ramme-io/kernel@8.0.0
|
|
34
|
+
- @ramme-io/ui@5.0.0
|
|
35
|
+
|
|
36
|
+
## 2.0.24
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [57ffcf6]
|
|
41
|
+
- Updated dependencies [3f68c51]
|
|
42
|
+
- @ramme-io/shared@3.10.0
|
|
43
|
+
- @ramme-io/kernel@7.8.1
|
|
44
|
+
- @ramme-io/ui@4.2.10
|
|
45
|
+
|
|
46
|
+
## 2.0.23
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [57daaea]
|
|
51
|
+
- @ramme-io/shared@3.9.0
|
|
52
|
+
- @ramme-io/kernel@7.8.0
|
|
53
|
+
- @ramme-io/ui@4.2.9
|
|
54
|
+
|
|
55
|
+
## 2.0.22
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [c47a3dc]
|
|
60
|
+
- Updated dependencies [4d994ec]
|
|
61
|
+
- @ramme-io/shared@3.8.0
|
|
62
|
+
- @ramme-io/kernel@7.7.1
|
|
63
|
+
- @ramme-io/ui@4.2.8
|
|
64
|
+
|
|
65
|
+
## 2.0.21
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [2220f2d]
|
|
70
|
+
- @ramme-io/shared@3.7.0
|
|
71
|
+
- @ramme-io/kernel@7.7.0
|
|
72
|
+
- @ramme-io/ui@4.2.7
|
|
73
|
+
|
|
74
|
+
## 2.0.20
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- Updated dependencies [64ef780]
|
|
79
|
+
- Updated dependencies [f124573]
|
|
80
|
+
- @ramme-io/shared@3.6.0
|
|
81
|
+
- @ramme-io/kernel@7.6.0
|
|
82
|
+
- @ramme-io/ui@4.2.6
|
|
83
|
+
|
|
84
|
+
## 2.0.19
|
|
85
|
+
|
|
86
|
+
### Patch Changes
|
|
87
|
+
|
|
88
|
+
- Updated dependencies [e61017c]
|
|
89
|
+
- Updated dependencies [9c7ec2a]
|
|
90
|
+
- @ramme-io/kernel@7.5.0
|
|
91
|
+
|
|
92
|
+
## 2.0.18
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- Updated dependencies [b1710ca]
|
|
97
|
+
- @ramme-io/shared@3.5.0
|
|
98
|
+
- @ramme-io/kernel@7.4.0
|
|
99
|
+
- @ramme-io/ui@4.2.5
|
|
100
|
+
|
|
101
|
+
## 2.0.17
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- Updated dependencies [942892d]
|
|
106
|
+
- @ramme-io/shared@3.4.0
|
|
107
|
+
- @ramme-io/kernel@7.3.2
|
|
108
|
+
- @ramme-io/ui@4.2.4
|
|
109
|
+
|
|
110
|
+
## 2.0.16
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- Updated dependencies [1342f1c]
|
|
115
|
+
- @ramme-io/shared@3.3.1
|
|
116
|
+
- @ramme-io/kernel@7.3.1
|
|
117
|
+
- @ramme-io/ui@4.2.3
|
|
118
|
+
|
|
119
|
+
## 2.0.15
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- Updated dependencies [73306a0]
|
|
124
|
+
- Updated dependencies [e543c11]
|
|
125
|
+
- @ramme-io/shared@3.3.0
|
|
126
|
+
- @ramme-io/kernel@7.3.0
|
|
127
|
+
- @ramme-io/ui@4.2.2
|
|
128
|
+
|
|
129
|
+
## 2.0.14
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Updated dependencies [94f9b84]
|
|
134
|
+
- @ramme-io/kernel@7.2.0
|
|
135
|
+
|
|
136
|
+
## 2.0.13
|
|
137
|
+
|
|
138
|
+
### Patch Changes
|
|
139
|
+
|
|
140
|
+
- Updated dependencies [304992d]
|
|
141
|
+
- Updated dependencies [82add86]
|
|
142
|
+
- @ramme-io/shared@3.2.0
|
|
143
|
+
- @ramme-io/kernel@7.1.0
|
|
144
|
+
- @ramme-io/ui@4.2.1
|
|
145
|
+
|
|
146
|
+
## 2.0.12
|
|
147
|
+
|
|
148
|
+
### Patch Changes
|
|
149
|
+
|
|
150
|
+
- Updated dependencies [185bca7]
|
|
151
|
+
- Updated dependencies [a153685]
|
|
152
|
+
- @ramme-io/ui@4.2.0
|
|
153
|
+
- @ramme-io/kernel@7.0.0
|
|
154
|
+
|
|
155
|
+
## 2.0.11
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- Updated dependencies [9b17f09]
|
|
160
|
+
- @ramme-io/kernel@6.0.3
|
|
161
|
+
|
|
162
|
+
## 2.0.10
|
|
163
|
+
|
|
164
|
+
### Patch Changes
|
|
165
|
+
|
|
166
|
+
- Updated dependencies [e5b42ef]
|
|
167
|
+
- Updated dependencies [61d9ab7]
|
|
168
|
+
- @ramme-io/ui@4.1.1
|
|
169
|
+
- @ramme-io/kernel@6.0.2
|
|
170
|
+
|
|
171
|
+
## 2.0.9
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- Updated dependencies [bbe9654]
|
|
176
|
+
- @ramme-io/kernel@6.0.1
|
|
177
|
+
|
|
3
178
|
## 2.0.8
|
|
4
179
|
|
|
5
180
|
### Patch Changes
|
package/template/gitignore
CHANGED
package/template/index.html
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/rocket.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
|
|
7
|
+
<!-- Replaced with the project name by `npm create @ramme-io/app <name>`.
|
|
8
|
+
Once React mounts, PageTitleUpdater owns this. -->
|
|
9
|
+
<title>App Name</title>
|
|
8
10
|
</head>
|
|
9
11
|
<body>
|
|
10
12
|
<div id="root"></div>
|
package/template/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ramme-starter",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.25",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
8
|
"dev:agent": "pnpm build && pnpm lint && pnpm test",
|
|
9
|
-
"build": "tsc && vite build",
|
|
9
|
+
"build": "tsc --noEmit -p tsconfig.app.json && vite build",
|
|
10
|
+
"typecheck": "tsc --noEmit -p tsconfig.app.json",
|
|
10
11
|
"lint": "eslint . --max-warnings 0",
|
|
11
12
|
"preview": "vite preview",
|
|
12
13
|
"test": "vitest run",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32" role="img" aria-label="Rocket">
|
|
2
|
+
<!--
|
|
3
|
+
The scaffolded app's default mark. Deliberately generic: a new app should not
|
|
4
|
+
ship somebody else's logo in the browser tab.
|
|
5
|
+
|
|
6
|
+
Drawn rather than an emoji in a <text> node, because an emoji favicon renders
|
|
7
|
+
as whatever the viewer's platform font decides — different on every OS, and
|
|
8
|
+
absent where no emoji font is installed. Flat fills with a dark outline so the
|
|
9
|
+
silhouette survives being scaled to 16px on both light and dark tab bars.
|
|
10
|
+
-->
|
|
11
|
+
<g fill="none" stroke="#2a3142" stroke-width="1.6" stroke-linejoin="round" stroke-linecap="round">
|
|
12
|
+
<path d="M16 2c4 4.2 6 9 6 14v4H10v-4c0-5 2-9.8 6-14z" fill="#e9ecf4" />
|
|
13
|
+
<path d="M10 16l-4 5v4l4-3z" fill="#9aa4bd" />
|
|
14
|
+
<path d="M22 16l4 5v4l-4-3z" fill="#9aa4bd" />
|
|
15
|
+
<path d="M13 22h6l-3 7z" fill="#ff8a3d" />
|
|
16
|
+
<circle cx="16" cy="12" r="3" fill="#5b8def" />
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
// src/components/AppFooter.tsx
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { APP } from '../config/app.config';
|
|
3
4
|
|
|
4
5
|
const AppFooter: React.FC = () => {
|
|
5
6
|
return (
|
|
6
7
|
<footer className="py-6 text-center text-muted-foreground">
|
|
7
|
-
<p>© {new Date().getFullYear()}
|
|
8
|
+
<p>© {new Date().getFullYear()} {APP.name}. All rights reserved.</p>
|
|
8
9
|
</footer>
|
|
9
10
|
);
|
|
10
11
|
};
|
|
@@ -17,6 +17,7 @@ import React from 'react';
|
|
|
17
17
|
import { useNavigate } from 'react-router-dom';
|
|
18
18
|
import { Icon, UserNav, ButtonItem } from '@ramme-io/ui';
|
|
19
19
|
import { useAuth, useSettingsStore } from '@ramme-io/kernel';
|
|
20
|
+
import { APP } from '../config/app.config';
|
|
20
21
|
|
|
21
22
|
interface AppHeaderProps {
|
|
22
23
|
title?: string;
|
|
@@ -78,7 +79,7 @@ const AppHeader: React.FC<AppHeaderProps> = ({
|
|
|
78
79
|
<UserNav
|
|
79
80
|
user={{
|
|
80
81
|
name: user?.name ?? 'Demo Operator',
|
|
81
|
-
email: user?.email ??
|
|
82
|
+
email: user?.email ?? APP.supportEmail,
|
|
82
83
|
}}
|
|
83
84
|
trigger={
|
|
84
85
|
<div className="flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-muted/50 transition-colors">
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import React, { useEffect } from 'react';
|
|
8
8
|
import { useLocation } from 'react-router-dom';
|
|
9
9
|
import { useSitemap, type SitemapEntry } from '@ramme-io/kernel'; // Import our context hook
|
|
10
|
+
import { useAppConfig } from '../features/config/AppConfigContext';
|
|
10
11
|
|
|
11
12
|
// Helper function to recursively find a route by path
|
|
12
13
|
const findRouteByPath = (
|
|
@@ -39,6 +40,9 @@ const findRouteByPath = (
|
|
|
39
40
|
const PageTitleUpdater: React.FC = () => {
|
|
40
41
|
const location = useLocation();
|
|
41
42
|
const sitemap = useSitemap(); // Get the sitemap from the current layout's context
|
|
43
|
+
// The app's own name — seeded from src/config/app.config.ts, and re-read here
|
|
44
|
+
// so renaming the app at runtime retitles the tab without a reload.
|
|
45
|
+
const { appName } = useAppConfig();
|
|
42
46
|
|
|
43
47
|
useEffect(() => {
|
|
44
48
|
// Determine the base path prefix based on the current top-level route
|
|
@@ -54,13 +58,13 @@ const PageTitleUpdater: React.FC = () => {
|
|
|
54
58
|
const currentRoute = findRouteByPath(sitemap, location.pathname, baseRoutePrefix);
|
|
55
59
|
|
|
56
60
|
if (currentRoute) {
|
|
57
|
-
document.title =
|
|
61
|
+
document.title = `${appName} — ${currentRoute.title}`;
|
|
58
62
|
} else {
|
|
59
63
|
// Fallback title if no route is matched (e.g., for 404 or base layout path)
|
|
60
|
-
document.title =
|
|
64
|
+
document.title = appName;
|
|
61
65
|
}
|
|
62
|
-
// Rerun effect whenever the pathname
|
|
63
|
-
}, [location.pathname, sitemap]);
|
|
66
|
+
// Rerun effect whenever the pathname, the sitemap context or the name changes
|
|
67
|
+
}, [location.pathname, sitemap, appName]);
|
|
64
68
|
|
|
65
69
|
return null; // This component doesn't render anything itself
|
|
66
70
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Outlet } from 'react-router-dom';
|
|
2
|
-
import { ChatFAB, AppShell
|
|
2
|
+
import { ChatFAB, AppShell } from '@ramme-io/ui';
|
|
3
3
|
import {
|
|
4
4
|
useWorkflowEngine,
|
|
5
5
|
useSettingsStore,
|
|
@@ -7,12 +7,17 @@ import {
|
|
|
7
7
|
useSpatialStore,
|
|
8
8
|
useInspectorShortcut,
|
|
9
9
|
RammeInspector,
|
|
10
|
-
AIChatPanel
|
|
10
|
+
AIChatPanel,
|
|
11
11
|
} from '@ramme-io/kernel';
|
|
12
|
+
import { APP } from '../config/app.config';
|
|
12
13
|
|
|
14
|
+
// The assistant introduces itself as this app, not as the framework underneath
|
|
15
|
+
// it. Rewrite this for what your app actually does — the more specific it is,
|
|
16
|
+
// the more useful the answers.
|
|
13
17
|
const SYSTEM_PROMPT = `
|
|
14
|
-
You are the
|
|
15
|
-
|
|
18
|
+
You are the assistant embedded in ${APP.name}.
|
|
19
|
+
Help the user operate this app: explain what a screen shows, and answer
|
|
20
|
+
questions about the data in front of them.
|
|
16
21
|
`.trim();
|
|
17
22
|
|
|
18
23
|
export const ProtectedAppShell = () => {
|
|
@@ -34,7 +39,7 @@ export const ProtectedAppShell = () => {
|
|
|
34
39
|
const { mode, toggle } = useSpatialStore();
|
|
35
40
|
|
|
36
41
|
return (
|
|
37
|
-
<
|
|
42
|
+
<AppShell
|
|
38
43
|
isInspectorOpen={isInspectorOpen}
|
|
39
44
|
setInspectorOpen={setInspectorOpen}
|
|
40
45
|
inspectorWidth={inspectorWidth}
|
|
@@ -65,6 +70,6 @@ export const ProtectedAppShell = () => {
|
|
|
65
70
|
isOpen={isSettingsOpen}
|
|
66
71
|
onClose={() => toggleSettings(false)}
|
|
67
72
|
/>
|
|
68
|
-
</
|
|
73
|
+
</AppShell>
|
|
69
74
|
);
|
|
70
75
|
};
|
|
@@ -121,7 +121,7 @@ export const SettingsModal: React.FC<SettingsModalProps> = ({ isOpen, onClose, o
|
|
|
121
121
|
value={keyInput}
|
|
122
122
|
onChange={(e) => { setKeyInput(e.target.value); setError(''); }}
|
|
123
123
|
placeholder="AIzaSy..."
|
|
124
|
-
className="w-full px-3 py-2.5 rounded-md border border-border bg-background text-foreground
|
|
124
|
+
className="w-full px-3 py-2.5 rounded-md border border-border bg-background text-foreground font-mono focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-colors"
|
|
125
125
|
onKeyDown={(e) => e.key === 'Enter' && handleSave()}
|
|
126
126
|
autoFocus
|
|
127
127
|
/>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who this app says it is.
|
|
3
|
+
*
|
|
4
|
+
* One constant, read by every piece of chrome: the header wordmark, the footer,
|
|
5
|
+
* the browser tab, the manifest meta and the assistant's persona. Renaming the
|
|
6
|
+
* app is this file, not a search across nine components.
|
|
7
|
+
*
|
|
8
|
+
* `npm create @ramme-io/app <name>` rewrites `name` below to the project name,
|
|
9
|
+
* so a freshly scaffolded app is already itself. `VITE_APP_NAME` overrides it at
|
|
10
|
+
* build time, which is what a deploy uses when the same source ships under more
|
|
11
|
+
* than one name.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately not a hook and not React state: a build-time constant cannot
|
|
14
|
+
* flicker on first paint the way a value read from localStorage can. The
|
|
15
|
+
* runtime-editable name lives in AppConfigContext and seeds from here.
|
|
16
|
+
*/
|
|
17
|
+
export const APP = {
|
|
18
|
+
/** Wordmark, tab title, footer, and the name the assistant calls itself. */
|
|
19
|
+
name: import.meta.env.VITE_APP_NAME ?? 'App Name',
|
|
20
|
+
|
|
21
|
+
/** One line under the name where a layout offers room for it. */
|
|
22
|
+
tagline: 'Your tagline goes here',
|
|
23
|
+
|
|
24
|
+
/** Fallback shown in the user menu before a real session exists. */
|
|
25
|
+
supportEmail: 'operator@example.com',
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Prefix for this app's localStorage keys.
|
|
29
|
+
*
|
|
30
|
+
* Unscoped keys ('app_name') collide between two apps served from the same
|
|
31
|
+
* origin — a real failure mode on localhost, where every dev server is
|
|
32
|
+
* http://localhost. Change this and the app forgets its saved preferences,
|
|
33
|
+
* which is the correct trade for not reading another app's.
|
|
34
|
+
*/
|
|
35
|
+
storageNamespace: 'app',
|
|
36
|
+
} as const;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { AppSpecification } from '@ramme-io/kernel';
|
|
2
|
+
import { APP } from './app.config';
|
|
2
3
|
|
|
3
4
|
export const appManifest: AppSpecification = {
|
|
4
5
|
meta: {
|
|
5
|
-
name:
|
|
6
|
-
version: "
|
|
7
|
-
description: "
|
|
8
|
-
author: "
|
|
6
|
+
name: APP.name,
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
description: "A starter app — KPI dashboard, CRUD, charts and onboarding, ready to rename.",
|
|
9
|
+
author: "Your Team",
|
|
9
10
|
},
|
|
10
11
|
config: {
|
|
11
12
|
theme: 'dark',
|