@bardioc/create-bardioc-app 0.5.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bardioc/create-bardioc-app",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Scaffold a Bardioc app with framework templates (vite, react, vue, angular, svelte, solid, preact, nextjs)",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -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.
@@ -7,7 +7,7 @@
7
7
  "dev": "vite",
8
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
- if (useSdkProvider && !APP_ID) {
28
- throw new Error('Missing VITE_APP_ID for SDK runtime');
29
- }
30
-
31
- if (devStandalone) {
32
- await ensureDevAuthSession({ appId: APP_ID, appName: APP_NAME });
33
- installDevBridge({ appId: APP_ID, appName: APP_NAME, debug: false });
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
- <StrictMode>
38
- {useSdkProvider ? (
39
- <AppSdkProvider appId={APP_ID}>
40
- <AppI18nProvider syncWithOs>
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
- </AppSdkProvider>
44
- ) : (
45
- <AppI18nProvider>
46
- <App />
47
- </AppI18nProvider>
48
- )}
49
- </StrictMode>
50
- );
49
+ )}
50
+ </StrictMode>
51
+ );
52
+ }
53
+
54
+ bootstrap();
@@ -2,7 +2,7 @@
2
2
 
3
3
  interface ImportMetaEnv {
4
4
  readonly VITE_APP_NAME: string;
5
- readonly VITE_APP_ID: string;
5
+ readonly VITE_APP_ID?: string;
6
6
  readonly VITE_ENABLE_DEV_AUTH?: string;
7
7
  }
8
8