@bardioc/create-bardioc-app 0.5.1 → 0.5.3
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/bin/create.mjs +0 -4
- package/package.json +1 -1
- package/templates/_base/README.md +2 -2
- package/templates/vite/.env.example +1 -1
- package/templates/vite/CLAUDE.md +3 -4
- package/templates/vite/package.json +3 -3
- package/templates/vite/src/main.tsx +25 -21
- package/templates/vite/src/vite-env.d.ts +1 -1
package/bin/create.mjs
CHANGED
|
@@ -67,10 +67,6 @@ if (!result.success) {
|
|
|
67
67
|
console.log(` Done! Next steps:\n`);
|
|
68
68
|
console.log(` cd ${name}`);
|
|
69
69
|
console.log(` npm install`);
|
|
70
|
-
console.log(` bardioc login`);
|
|
71
70
|
console.log(` npm run dev\n`);
|
|
72
71
|
console.log(` Open http://localhost:${port} to see your app.`);
|
|
73
|
-
console.log(
|
|
74
|
-
` Standalone host-backed auth now refreshes automatically from your CLI login during npm run dev.`
|
|
75
|
-
);
|
|
76
72
|
console.log(` Use "pnpm dev:live" for a public tunnel/live URL.\n`);
|
package/package.json
CHANGED
|
@@ -17,8 +17,8 @@ npm run dev # http://localhost:{{PORT}}
|
|
|
17
17
|
npm run dev:live # public tunnel (BARDIOC_TUNNEL=1)
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
`npm run dev` runs plain Vite as a local preview shell — live SDK data comes only when the app is
|
|
21
|
+
opened inside the host. See `.env.example` for the required variables.
|
|
22
22
|
|
|
23
23
|
## Develop against `@bardioc/*` source (optional)
|
|
24
24
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
VITE_APP_NAME={{APP_NAME}}
|
|
3
3
|
|
|
4
4
|
# Get this from the BardiocOS AppStore after registering your app.
|
|
5
|
-
# Required for token exchange
|
|
5
|
+
# Required only for standalone dev auth/token exchange; host iframe runtime can omit it.
|
|
6
6
|
VITE_APP_ID=your-app-client-id-here
|
|
7
7
|
|
|
8
8
|
# Opt into the host-backed standalone dev session when running outside the host iframe.
|
package/templates/vite/CLAUDE.md
CHANGED
|
@@ -74,10 +74,9 @@ pnpm build # → dist/
|
|
|
74
74
|
pnpm bundle # → {{APP_NAME}}.zip
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
local preview shell (no transport) — the dashboard renders only inside the host or dev session.
|
|
77
|
+
`npm run dev` runs plain Vite — a local preview shell (no transport): the dashboard renders, but
|
|
78
|
+
live SDK data comes only when the app is opened inside the host. `.env` (see `.env.example`): set
|
|
79
|
+
`VITE_APP_ID` (from the BardiocOS AppStore) when you wire the app up to the host.
|
|
81
80
|
|
|
82
81
|
---
|
|
83
82
|
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "
|
|
8
|
-
"dev:live": "BARDIOC_TUNNEL=1
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"dev:live": "BARDIOC_TUNNEL=1 vite",
|
|
9
9
|
"build": "tsc && vite build && node scripts/stamp-manifest.mjs dist",
|
|
10
|
-
"bundle": "tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
10
|
+
"bundle": "rm -f {{APP_NAME}}.zip && tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
11
|
"preview": "vite preview",
|
|
12
12
|
"check-types": "tsc --noEmit",
|
|
13
13
|
"changeset": "changeset",
|
|
@@ -23,28 +23,32 @@ if (!APP_NAME) {
|
|
|
23
23
|
const insideIframe = isInsideIframe();
|
|
24
24
|
const devStandalone = standaloneDevAuthEnabled && isDevStandalone();
|
|
25
25
|
const useSdkProvider = insideIframe || devStandalone;
|
|
26
|
+
const SDK_APP_ID = APP_ID ?? APP_NAME;
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
28
|
+
async function bootstrap() {
|
|
29
|
+
if (devStandalone) {
|
|
30
|
+
if (!APP_ID) {
|
|
31
|
+
throw new Error('Missing VITE_APP_ID for standalone dev auth');
|
|
32
|
+
}
|
|
33
|
+
await ensureDevAuthSession({ appId: APP_ID, appName: APP_NAME });
|
|
34
|
+
installDevBridge({ appId: APP_ID, appName: APP_NAME, debug: false });
|
|
35
|
+
}
|
|
35
36
|
|
|
36
|
-
createRoot(document.getElementById('root')!).render(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
createRoot(document.getElementById('root')!).render(
|
|
38
|
+
<StrictMode>
|
|
39
|
+
{useSdkProvider ? (
|
|
40
|
+
<AppSdkProvider appId={SDK_APP_ID}>
|
|
41
|
+
<AppI18nProvider syncWithOs>
|
|
42
|
+
<App />
|
|
43
|
+
</AppI18nProvider>
|
|
44
|
+
</AppSdkProvider>
|
|
45
|
+
) : (
|
|
46
|
+
<AppI18nProvider>
|
|
41
47
|
<App />
|
|
42
48
|
</AppI18nProvider>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</StrictMode>
|
|
50
|
-
);
|
|
49
|
+
)}
|
|
50
|
+
</StrictMode>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
bootstrap();
|