@bardioc/create-bardioc-app 0.5.3 → 0.5.5
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/README.md +10 -13
- package/package.json +5 -5
- package/templates/angular/.env.example +6 -4
- package/templates/angular/public/runtime-env.js +1 -1
- package/templates/angular/scripts/dev-auth-proxy.mjs +6 -7
- package/templates/angular/scripts/sync-runtime-env.mjs +2 -24
- package/templates/angular/src/app/app.component.ts +4 -31
- package/templates/angular/src/app/bardioc-bridge.ts +3 -3
- package/templates/angular/src/index.html +2 -2
- package/templates/angular/src/main.ts +9 -43
- package/templates/angular/src/runtime-env.ts +1 -1
- package/templates/angular/src/styles.css +84 -80
- package/templates/angular/src/vite-env.d.ts +4 -6
- package/templates/manifest.json +2 -10
- package/templates/nextjs/.env.example +5 -6
- package/templates/nextjs/app/globals.css +31 -28
- package/templates/nextjs/app/page.tsx +17 -77
- package/templates/nextjs/global.d.ts +1 -1
- package/templates/nextjs/next.config.ts +27 -16
- package/templates/nextjs/package.json +2 -2
- package/templates/nextjs/tailwind.config.ts +1 -4
- package/templates/preact/.env.example +5 -9
- package/templates/preact/index.html +2 -2
- package/templates/preact/package.json +2 -2
- package/templates/preact/src/App.tsx +6 -5
- package/templates/preact/src/index.css +31 -28
- package/templates/preact/src/main.tsx +13 -29
- package/templates/preact/src/vite-env.d.ts +2 -4
- package/templates/solid/.env.example +5 -9
- package/templates/solid/index.html +2 -2
- package/templates/solid/package.json +2 -2
- package/templates/solid/src/App.tsx +6 -5
- package/templates/solid/src/bardioc-sdk.tsx +18 -18
- package/templates/solid/src/index.css +31 -28
- package/templates/solid/src/main.tsx +17 -33
- package/templates/solid/src/vite-env.d.ts +2 -4
- package/templates/svelte/.env.example +8 -4
- package/templates/svelte/index.html +2 -2
- package/templates/svelte/package.json +2 -2
- package/templates/svelte/src/App.svelte +1 -1
- package/templates/svelte/src/index.css +31 -28
- package/templates/svelte/src/main.ts +9 -25
- package/templates/svelte/src/vite-env.d.ts +2 -4
- package/templates/vite/.env.example +5 -10
- package/templates/vite/CLAUDE.md +8 -10
- package/templates/vite/index.html +2 -2
- package/templates/vite/package.json +2 -4
- package/templates/vite/src/App.tsx +1 -2
- package/templates/vite/src/auth/onboarding.tsx +5 -7
- package/templates/vite/src/climate/conditions-chart.tsx +6 -8
- package/templates/vite/src/events/live-events-view.tsx +1 -3
- package/templates/vite/src/i18n.tsx +7 -9
- package/templates/vite/src/locales/de.json +2 -3
- package/templates/vite/src/locales/en.json +2 -3
- package/templates/vite/src/main.tsx +18 -35
- package/templates/vite/src/shell/header.tsx +1 -2
- package/templates/vite/src/vite-env.d.ts +0 -2
- package/templates/vue/.env.example +8 -4
- package/templates/vue/index.html +2 -2
- package/templates/vue/package.json +2 -2
- package/templates/vue/src/App.vue +26 -10
- package/templates/vue/src/bardioc-sdk.ts +11 -11
- package/templates/vue/src/index.css +31 -28
- package/templates/vue/src/main.ts +8 -24
- package/templates/vue/src/vite-env.d.ts +2 -4
- package/templates/nextjs/app/proxy/route.ts +0 -85
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"dev": "
|
|
7
|
-
"dev:live": "BARDIOC_TUNNEL=1
|
|
6
|
+
"dev": "next dev --port {{PORT}}",
|
|
7
|
+
"dev:live": "BARDIOC_TUNNEL=1 next dev --port {{PORT}}",
|
|
8
8
|
"build": "next build && node scripts/stamp-manifest.mjs out",
|
|
9
9
|
"bundle": "next build && node scripts/stamp-manifest.mjs out && cd out && zip -r ../{{APP_NAME}}.zip .",
|
|
10
10
|
"start": "next start",
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { Config } from 'tailwindcss';
|
|
2
2
|
|
|
3
3
|
const config: Config = {
|
|
4
|
-
content: [
|
|
5
|
-
'./app/**/*.{js,ts,jsx,tsx,mdx}',
|
|
6
|
-
'./components/**/*.{js,ts,jsx,tsx,mdx}',
|
|
7
|
-
],
|
|
4
|
+
content: ['./app/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}'],
|
|
8
5
|
};
|
|
9
6
|
|
|
10
7
|
export default config;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
# Hosted app slug used by local runtime/dev-auth wiring.
|
|
2
2
|
VITE_APP_NAME={{APP_NAME}}
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
|
|
4
|
+
# Paste the dev secret from the BardiocOS AppStore after registering your app.
|
|
5
|
+
# Used by the Vite dev-auth proxy to sign requests to the BFF.
|
|
6
|
+
DEV_SECRET=
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Copy these from the host App Store app details via "Copy Dev Session".
|
|
12
|
-
DEV_AUTH_HOST_URL=
|
|
13
|
-
DEV_SESSION_KEY=
|
|
8
|
+
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
9
|
+
API_BASE_URL=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en" class="dark" style="height: 100%; margin: 0">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark" style="height: 100%; margin: 0; color-scheme: dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -4,8 +4,8 @@
|
|
|
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
10
|
"bundle": "tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
11
|
"preview": "vite preview",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
2
|
-
import {
|
|
2
|
+
import { useNotify, useSdk } from '@bardioc/app-sdk/react';
|
|
3
3
|
import { useState } from 'preact/hooks';
|
|
4
4
|
|
|
5
5
|
type ResultState =
|
|
@@ -59,14 +59,14 @@ function SdkDemo() {
|
|
|
59
59
|
|
|
60
60
|
<div className="flex flex-wrap gap-2">
|
|
61
61
|
<button
|
|
62
|
-
className="bg-primary text-primary-foreground hover:bg-primary/90
|
|
62
|
+
className="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
63
63
|
onClick={() => void runGetProfile()}
|
|
64
64
|
disabled={running}
|
|
65
65
|
>
|
|
66
66
|
Get Profile
|
|
67
67
|
</button>
|
|
68
68
|
<button
|
|
69
|
-
className="bg-primary text-primary-foreground hover:bg-primary/90
|
|
69
|
+
className="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
70
70
|
onClick={handleNotify}
|
|
71
71
|
disabled={running}
|
|
72
72
|
>
|
|
@@ -84,7 +84,8 @@ function SdkDemo() {
|
|
|
84
84
|
<div className="border-border bg-background flex min-h-0 flex-1 flex-col overflow-hidden rounded border">
|
|
85
85
|
{result.status === 'idle' && (
|
|
86
86
|
<div className="text-muted-foreground flex h-full items-center justify-center p-3 text-center text-xs leading-5">
|
|
87
|
-
Run a query to see results. If the host session is missing, the transport route will
|
|
87
|
+
Run a query to see results. If the host session is missing, the transport route will
|
|
88
|
+
return 401.
|
|
88
89
|
</div>
|
|
89
90
|
)}
|
|
90
91
|
{result.status === 'loading' && (
|
|
@@ -117,7 +118,7 @@ function SdkDemo() {
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
export function App() {
|
|
120
|
-
const showSdkDemo = isInsideIframe() ||
|
|
121
|
+
const showSdkDemo = isInsideIframe() || isDevStandalone();
|
|
121
122
|
|
|
122
123
|
return (
|
|
123
124
|
<div className="bg-background text-foreground min-h-screen">
|
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
|
|
3
3
|
* {
|
|
4
|
-
|
|
4
|
+
box-sizing: border-box;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
html,
|
|
8
8
|
body,
|
|
9
9
|
#root {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
:root {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
--background: oklch(17.88% 0.0075 229.38);
|
|
19
|
+
--foreground: oklch(98.69% 0.0093 99.98);
|
|
20
|
+
--muted-foreground: oklch(86.03% 0.0056 95.11);
|
|
21
|
+
--border: oklch(1 0 0 / 10%);
|
|
22
|
+
--primary: oklch(97.02% 0 0);
|
|
23
|
+
--primary-foreground: oklch(36.94% 0.0053 236.64);
|
|
24
|
+
--destructive: oklch(68.04% 0.1386 21.38);
|
|
25
|
+
--ring: oklch(79.43% 0.0084 98.91);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
body {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
background: var(--background);
|
|
30
|
+
color: var(--foreground);
|
|
31
|
+
font-family:
|
|
32
|
+
system-ui,
|
|
33
|
+
-apple-system,
|
|
34
|
+
sans-serif;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
code {
|
|
35
|
-
|
|
38
|
+
font-family: inherit;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.bg-background {
|
|
39
|
-
|
|
42
|
+
background-color: var(--background);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
.text-foreground {
|
|
43
|
-
|
|
46
|
+
color: var(--foreground);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
.text-muted-foreground {
|
|
47
|
-
|
|
50
|
+
color: var(--muted-foreground);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.border-border {
|
|
51
|
-
|
|
54
|
+
border-color: var(--border);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
.bg-primary {
|
|
55
|
-
|
|
58
|
+
background-color: var(--primary);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
.text-primary-foreground {
|
|
59
|
-
|
|
62
|
+
color: var(--primary-foreground);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
.text-destructive {
|
|
63
|
-
|
|
66
|
+
color: var(--destructive);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
.focus\:ring-ring:focus {
|
|
67
|
-
|
|
70
|
+
--tw-ring-color: var(--ring);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
.hover\:bg-primary\/90:hover {
|
|
71
|
-
|
|
74
|
+
background-color: oklch(from var(--primary) calc(l * 0.9) c h);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
.hover\:text-foreground:hover {
|
|
75
|
-
|
|
78
|
+
color: var(--foreground);
|
|
76
79
|
}
|
|
@@ -1,46 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureDevAuthSession,
|
|
3
|
-
installDevBridge,
|
|
4
|
-
isDevStandalone,
|
|
5
|
-
isInsideIframe,
|
|
6
|
-
} from '@bardioc/app-sdk/dev';
|
|
1
|
+
import { installDevBridge, isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
7
2
|
import { AppSdkProvider } from '@bardioc/app-sdk/react';
|
|
8
3
|
import { render } from 'preact';
|
|
9
4
|
import { App } from './App';
|
|
10
5
|
import './index.css';
|
|
11
6
|
|
|
12
7
|
const APP_NAME = import.meta.env.VITE_APP_NAME?.trim();
|
|
13
|
-
const APP_ID = import.meta.env.VITE_APP_ID?.trim();
|
|
14
|
-
const standaloneDevAuthEnabled = import.meta.env.DEV && import.meta.env.VITE_ENABLE_DEV_AUTH === 'true';
|
|
15
8
|
|
|
16
9
|
if (!APP_NAME) {
|
|
17
10
|
throw new Error('Missing VITE_APP_NAME for runtime');
|
|
18
11
|
}
|
|
19
12
|
|
|
20
13
|
const insideIframe = isInsideIframe();
|
|
21
|
-
const devStandalone =
|
|
14
|
+
const devStandalone = isDevStandalone();
|
|
22
15
|
const useSdkProvider = insideIframe || devStandalone;
|
|
23
16
|
|
|
24
|
-
if (
|
|
25
|
-
|
|
17
|
+
if (devStandalone) {
|
|
18
|
+
installDevBridge({ debug: false });
|
|
26
19
|
}
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
installDevBridge({ appId: APP_ID, appName: APP_NAME, debug: false });
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
render(
|
|
35
|
-
useSdkProvider ? (
|
|
36
|
-
<AppSdkProvider appId={APP_ID!}>
|
|
37
|
-
<App />
|
|
38
|
-
</AppSdkProvider>
|
|
39
|
-
) : (
|
|
21
|
+
render(
|
|
22
|
+
useSdkProvider ? (
|
|
23
|
+
<AppSdkProvider appId={APP_NAME}>
|
|
40
24
|
<App />
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
</AppSdkProvider>
|
|
26
|
+
) : (
|
|
27
|
+
<App />
|
|
28
|
+
),
|
|
29
|
+
document.getElementById('root')!
|
|
30
|
+
);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
|
|
3
3
|
interface ImportMetaEnv {
|
|
4
|
-
readonly VITE_APP_NAME: string
|
|
5
|
-
readonly VITE_APP_ID: string
|
|
6
|
-
readonly VITE_ENABLE_DEV_AUTH?: string
|
|
4
|
+
readonly VITE_APP_NAME: string;
|
|
7
5
|
}
|
|
8
6
|
|
|
9
7
|
interface ImportMeta {
|
|
10
|
-
readonly env: ImportMetaEnv
|
|
8
|
+
readonly env: ImportMetaEnv;
|
|
11
9
|
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
# Hosted app slug used by local runtime/dev-auth wiring.
|
|
2
2
|
VITE_APP_NAME={{APP_NAME}}
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
|
|
4
|
+
# Paste the dev secret from the BardiocOS AppStore after registering your app.
|
|
5
|
+
# Used by the Vite dev-auth proxy to sign requests to the BFF.
|
|
6
|
+
DEV_SECRET=
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Copy these from the host App Store app details via "Copy Dev Session".
|
|
12
|
-
DEV_AUTH_HOST_URL=
|
|
13
|
-
DEV_SESSION_KEY=
|
|
8
|
+
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
9
|
+
API_BASE_URL=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en" class="dark" style="height: 100%; margin: 0">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark" style="height: 100%; margin: 0; color-scheme: dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -4,8 +4,8 @@
|
|
|
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
10
|
"bundle": "tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
11
|
"preview": "vite preview",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
2
2
|
import { createSignal } from 'solid-js';
|
|
3
|
-
import {
|
|
3
|
+
import { useNotify, useSdk } from './bardioc-sdk';
|
|
4
4
|
|
|
5
5
|
type ResultState =
|
|
6
6
|
| { status: 'idle' }
|
|
@@ -59,14 +59,14 @@ function SdkDemo() {
|
|
|
59
59
|
|
|
60
60
|
<div class="flex flex-wrap gap-2">
|
|
61
61
|
<button
|
|
62
|
-
class="bg-primary text-primary-foreground hover:bg-primary/90
|
|
62
|
+
class="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
63
63
|
onclick={runGetProfile}
|
|
64
64
|
disabled={running()}
|
|
65
65
|
>
|
|
66
66
|
Get Profile
|
|
67
67
|
</button>
|
|
68
68
|
<button
|
|
69
|
-
class="bg-primary text-primary-foreground hover:bg-primary/90
|
|
69
|
+
class="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
70
70
|
onclick={handleNotify}
|
|
71
71
|
disabled={running()}
|
|
72
72
|
>
|
|
@@ -87,7 +87,8 @@ function SdkDemo() {
|
|
|
87
87
|
if (r.status === 'idle') {
|
|
88
88
|
return (
|
|
89
89
|
<div class="text-muted-foreground flex h-full items-center justify-center p-3 text-center text-xs leading-5">
|
|
90
|
-
Run a query to see results. If the host session is missing, the transport route will
|
|
90
|
+
Run a query to see results. If the host session is missing, the transport route will
|
|
91
|
+
return 401.
|
|
91
92
|
</div>
|
|
92
93
|
);
|
|
93
94
|
}
|
|
@@ -128,7 +129,7 @@ function SdkDemo() {
|
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
export function App() {
|
|
131
|
-
const showSdkDemo = isInsideIframe() ||
|
|
132
|
+
const showSdkDemo = isInsideIframe() || isDevStandalone();
|
|
132
133
|
|
|
133
134
|
return (
|
|
134
135
|
<div class="bg-background text-foreground min-h-screen">
|
|
@@ -4,30 +4,30 @@ import { createContext, onCleanup, onMount, useContext, type JSX } from 'solid-j
|
|
|
4
4
|
const BardiocContext = createContext<HostBridge>();
|
|
5
5
|
|
|
6
6
|
export function AppSdkProvider(props: { appId: string; children: JSX.Element }) {
|
|
7
|
-
|
|
7
|
+
const bridge = createHostBridge({ appId: props.appId });
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
onMount(() => {
|
|
10
|
+
void bridge.connect();
|
|
11
|
+
});
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
onCleanup(() => {
|
|
14
|
+
bridge.destroy();
|
|
15
|
+
});
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
return <BardiocContext.Provider value={bridge}>{props.children}</BardiocContext.Provider>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function useSdk(): HostBridge {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const bridge = useContext(BardiocContext);
|
|
22
|
+
if (!bridge) {
|
|
23
|
+
throw new Error('useSdk() must be used inside AppSdkProvider');
|
|
24
|
+
}
|
|
25
|
+
return bridge;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function useNotify() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
29
|
+
const bridge = useSdk();
|
|
30
|
+
return (message: string, level?: NotifyLevel) => {
|
|
31
|
+
bridge.notify(message, level);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
|
|
3
3
|
* {
|
|
4
|
-
|
|
4
|
+
box-sizing: border-box;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
html,
|
|
8
8
|
body,
|
|
9
9
|
#root {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
:root {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
--background: oklch(17.88% 0.0075 229.38);
|
|
19
|
+
--foreground: oklch(98.69% 0.0093 99.98);
|
|
20
|
+
--muted-foreground: oklch(86.03% 0.0056 95.11);
|
|
21
|
+
--border: oklch(1 0 0 / 10%);
|
|
22
|
+
--primary: oklch(97.02% 0 0);
|
|
23
|
+
--primary-foreground: oklch(36.94% 0.0053 236.64);
|
|
24
|
+
--destructive: oklch(68.04% 0.1386 21.38);
|
|
25
|
+
--ring: oklch(79.43% 0.0084 98.91);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
body {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
background: var(--background);
|
|
30
|
+
color: var(--foreground);
|
|
31
|
+
font-family:
|
|
32
|
+
system-ui,
|
|
33
|
+
-apple-system,
|
|
34
|
+
sans-serif;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
code {
|
|
35
|
-
|
|
38
|
+
font-family: inherit;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.bg-background {
|
|
39
|
-
|
|
42
|
+
background-color: var(--background);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
.text-foreground {
|
|
43
|
-
|
|
46
|
+
color: var(--foreground);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
.text-muted-foreground {
|
|
47
|
-
|
|
50
|
+
color: var(--muted-foreground);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.border-border {
|
|
51
|
-
|
|
54
|
+
border-color: var(--border);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
.bg-primary {
|
|
55
|
-
|
|
58
|
+
background-color: var(--primary);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
.text-primary-foreground {
|
|
59
|
-
|
|
62
|
+
color: var(--primary-foreground);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
.text-destructive {
|
|
63
|
-
|
|
66
|
+
color: var(--destructive);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
.focus\:ring-ring:focus {
|
|
67
|
-
|
|
70
|
+
--tw-ring-color: var(--ring);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
.hover\:bg-primary\/90:hover {
|
|
71
|
-
|
|
74
|
+
background-color: oklch(from var(--primary) calc(l * 0.9) c h);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
.hover\:text-foreground:hover {
|
|
75
|
-
|
|
78
|
+
color: var(--foreground);
|
|
76
79
|
}
|
|
@@ -1,50 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureDevAuthSession,
|
|
3
|
-
installDevBridge,
|
|
4
|
-
isDevStandalone,
|
|
5
|
-
isInsideIframe,
|
|
6
|
-
} from '@bardioc/app-sdk/dev';
|
|
1
|
+
import { installDevBridge, isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
7
2
|
import { render } from 'solid-js/web';
|
|
8
3
|
import { App } from './App';
|
|
9
4
|
import { AppSdkProvider } from './bardioc-sdk';
|
|
10
5
|
import './index.css';
|
|
11
6
|
|
|
12
7
|
const APP_NAME = import.meta.env.VITE_APP_NAME?.trim();
|
|
13
|
-
const APP_ID = import.meta.env.VITE_APP_ID?.trim();
|
|
14
|
-
const standaloneDevAuthEnabled = import.meta.env.DEV && import.meta.env.VITE_ENABLE_DEV_AUTH === 'true';
|
|
15
8
|
|
|
16
9
|
if (!APP_NAME) {
|
|
17
10
|
throw new Error('Missing VITE_APP_NAME for runtime');
|
|
18
11
|
}
|
|
19
12
|
|
|
20
13
|
const insideIframe = isInsideIframe();
|
|
21
|
-
const devStandalone =
|
|
14
|
+
const devStandalone = isDevStandalone();
|
|
22
15
|
const useSdkProvider = insideIframe || devStandalone;
|
|
23
16
|
|
|
24
|
-
if (
|
|
25
|
-
|
|
17
|
+
if (devStandalone) {
|
|
18
|
+
installDevBridge({ debug: false });
|
|
26
19
|
}
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</AppSdkProvider>
|
|
42
|
-
),
|
|
43
|
-
root
|
|
44
|
-
);
|
|
45
|
-
} else {
|
|
46
|
-
render(() => <App />, root);
|
|
47
|
-
}
|
|
21
|
+
const root = document.getElementById('root')!;
|
|
22
|
+
|
|
23
|
+
if (useSdkProvider) {
|
|
24
|
+
render(
|
|
25
|
+
() => (
|
|
26
|
+
<AppSdkProvider appId={APP_NAME}>
|
|
27
|
+
<App />
|
|
28
|
+
</AppSdkProvider>
|
|
29
|
+
),
|
|
30
|
+
root
|
|
31
|
+
);
|
|
32
|
+
} else {
|
|
33
|
+
render(() => <App />, root);
|
|
48
34
|
}
|
|
49
|
-
|
|
50
|
-
bootstrap();
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
|
|
3
3
|
interface ImportMetaEnv {
|
|
4
|
-
readonly VITE_APP_NAME: string
|
|
5
|
-
readonly VITE_APP_ID: string
|
|
6
|
-
readonly VITE_ENABLE_DEV_AUTH?: string
|
|
4
|
+
readonly VITE_APP_NAME: string;
|
|
7
5
|
}
|
|
8
6
|
|
|
9
7
|
interface ImportMeta {
|
|
10
|
-
readonly env: ImportMetaEnv
|
|
8
|
+
readonly env: ImportMetaEnv;
|
|
11
9
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
# Hosted app slug used by local runtime/dev-auth wiring.
|
|
1
2
|
VITE_APP_NAME={{APP_NAME}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
# Paste the dev secret from the BardiocOS AppStore after registering your app.
|
|
5
|
+
# Used by the Vite dev-auth proxy to sign requests to the BFF.
|
|
6
|
+
DEV_SECRET=
|
|
7
|
+
|
|
8
|
+
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
9
|
+
API_BASE_URL=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en" class="dark" style="height: 100%; margin: 0">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark" style="height: 100%; margin: 0; color-scheme: dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -4,8 +4,8 @@
|
|
|
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": "svelte-check && vite build && node scripts/stamp-manifest.mjs dist",
|
|
10
10
|
"bundle": "svelte-check && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
11
|
"preview": "vite preview",
|