@bardioc/create-bardioc-app 0.5.5 → 0.5.8
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 +1 -3
- package/bin/create.mjs +2 -4
- package/package.json +1 -1
- package/templates/_base/README.md +17 -3
- package/templates/_base/scripts/stamp-manifest.mjs +1 -1
- package/templates/_opt-link/scripts/link-source.mjs +7 -5
- package/templates/angular/.env.example +7 -2
- package/templates/angular/_gitignore +1 -0
- package/templates/angular/package.json +2 -4
- package/templates/angular/scripts/dev-env.mjs +41 -0
- package/templates/angular/scripts/dev.mjs +27 -0
- package/templates/angular/scripts/sync-runtime-env.mjs +3 -48
- package/templates/angular/src/app/app.component.ts +6 -6
- package/templates/angular/src/styles.css +4 -0
- package/templates/angular/tsconfig.json +1 -0
- package/templates/nextjs/.env.example +7 -2
- package/templates/nextjs/_gitignore +1 -0
- package/templates/nextjs/app/layout.tsx +2 -0
- package/templates/nextjs/app/page.tsx +13 -7
- package/templates/nextjs/eslint.config.mjs +4 -0
- package/templates/nextjs/next.config.ts +2 -21
- package/templates/nextjs/package.json +8 -3
- package/templates/nextjs/prettier.config.mjs +1 -0
- package/templates/nextjs/scripts/dev-env.mjs +41 -0
- package/templates/nextjs/scripts/dev.mjs +27 -0
- package/templates/nextjs/tsconfig.json +3 -18
- package/templates/preact/.env.example +3 -0
- package/templates/preact/eslint.config.mjs +3 -0
- package/templates/preact/package.json +8 -3
- package/templates/preact/prettier.config.mjs +1 -0
- package/templates/preact/src/App.tsx +6 -6
- package/templates/preact/tsconfig.json +4 -10
- package/templates/preact/vite.config.ts +9 -1
- package/templates/solid/.env.example +3 -0
- package/templates/solid/eslint.config.mjs +3 -0
- package/templates/solid/package.json +8 -4
- package/templates/solid/prettier.config.mjs +1 -0
- package/templates/solid/src/App.tsx +7 -7
- package/templates/solid/tsconfig.json +4 -9
- package/templates/solid/vite.config.ts +10 -2
- package/templates/svelte/.env.example +3 -0
- package/templates/svelte/_gitignore +1 -0
- package/templates/svelte/eslint.config.mjs +3 -0
- package/templates/svelte/package.json +8 -3
- package/templates/svelte/prettier.config.mjs +1 -0
- package/templates/svelte/src/App.svelte +6 -6
- package/templates/svelte/tsconfig.json +4 -4
- package/templates/svelte/vite.config.ts +9 -1
- package/templates/vite/.env.example +3 -0
- package/templates/vite/CLAUDE.md +40 -8
- package/templates/vite/eslint.config.mjs +3 -0
- package/templates/vite/package.json +9 -3
- package/templates/vite/prettier.config.mjs +1 -0
- package/templates/vite/src/auth/onboarding.tsx +4 -4
- package/templates/vite/src/climate/climate-data.ts +13 -6
- package/templates/vite/src/climate/conditions-chart.tsx +2 -2
- package/templates/vite/src/climate/overview-view.tsx +1 -1
- package/templates/vite/src/climate/stations-view.tsx +3 -3
- package/templates/vite/src/climate/use-climate.ts +2 -2
- package/templates/vite/src/events/live-events-view.tsx +2 -2
- package/templates/vite/src/graph/explorer-view.tsx +4 -4
- package/templates/vite/src/graph/requests.ts +2 -1
- package/templates/vite/src/locales/de.json +4 -4
- package/templates/vite/src/locales/en.json +44 -44
- package/templates/vite/src/profile/profile-view.tsx +5 -5
- package/templates/vite/src/shell/about-dialog.tsx +3 -3
- package/templates/vite/src/shell/app-shell.tsx +16 -12
- package/templates/vite/src/shell/header.tsx +24 -24
- package/templates/vite/tsconfig.json +4 -10
- package/templates/vite/vite.config.ts +10 -2
- package/templates/vue/.env.example +3 -0
- package/templates/vue/_gitignore +1 -0
- package/templates/vue/eslint.config.mjs +3 -0
- package/templates/vue/package.json +8 -3
- package/templates/vue/prettier.config.mjs +1 -0
- package/templates/vue/src/App.vue +6 -6
- package/templates/vue/tsconfig.json +5 -9
- package/templates/vue/vite.config.ts +10 -2
- package/templates/angular/scripts/dev-auth-proxy.mjs +0 -91
|
@@ -7,3 +7,6 @@ DEV_SECRET=
|
|
|
7
7
|
|
|
8
8
|
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
9
9
|
API_BASE_URL=
|
|
10
|
+
|
|
11
|
+
# By default, the app will start on port {{PORT}}. Feel free to uncomment the following variable and change it to match your local setup preferences.
|
|
12
|
+
#LOCALHOST_PORT={{PORT}}
|
|
@@ -5,26 +5,31 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
|
-
"dev:live": "BARDIOC_TUNNEL=1 vite",
|
|
9
8
|
"build": "tsc && vite build && node scripts/stamp-manifest.mjs dist",
|
|
10
9
|
"bundle": "tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
10
|
"preview": "vite preview",
|
|
12
11
|
"check-types": "tsc --noEmit",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"format": "prettier --write .",
|
|
14
|
+
"format:check": "prettier --check .",
|
|
13
15
|
"changeset": "changeset",
|
|
14
16
|
"release:status": "changeset status --verbose",
|
|
15
17
|
"release:version": "changeset version && npm install",
|
|
16
18
|
"release:publish": "changeset publish"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"@bardioc/app-sdk": "
|
|
21
|
+
"@bardioc/app-sdk": "^0.5.0",
|
|
20
22
|
"preact": "^10.26.7"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
25
|
+
"@bardioc/configs": "0.2.1",
|
|
23
26
|
"@changesets/cli": "^2.31.0",
|
|
24
|
-
"@preact/preset-vite": "^2.10.
|
|
27
|
+
"@preact/preset-vite": "^2.10.6",
|
|
25
28
|
"@tailwindcss/vite": "^4.3.0",
|
|
26
29
|
"@types/node": "^22.19.19",
|
|
30
|
+
"eslint": "^10.0.0",
|
|
27
31
|
"preact-render-to-string": "^6.6.1",
|
|
32
|
+
"prettier": "^3.6.2",
|
|
28
33
|
"tailwindcss": "4.3.0",
|
|
29
34
|
"typescript": "6.0.3",
|
|
30
35
|
"vite": "8.0.13"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@bardioc/configs/prettier';
|
|
@@ -22,13 +22,13 @@ function SdkDemo() {
|
|
|
22
22
|
setResult({ status: 'loading', request });
|
|
23
23
|
|
|
24
24
|
const startTime = Date.now();
|
|
25
|
-
notify('Getting user profile', 'info');
|
|
25
|
+
notify('Getting user profile…', 'info');
|
|
26
26
|
|
|
27
27
|
try {
|
|
28
28
|
const data = await bridge.transport.os.profile.get();
|
|
29
29
|
|
|
30
30
|
const duration = Date.now() - startTime;
|
|
31
|
-
notify(`Profile loaded (${duration}ms)
|
|
31
|
+
notify(`Profile loaded (${duration}ms).`, 'success');
|
|
32
32
|
setResult({ status: 'success', request, data });
|
|
33
33
|
} catch (err) {
|
|
34
34
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -40,7 +40,7 @@ function SdkDemo() {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function handleNotify() {
|
|
43
|
-
notify('Hello from {{DISPLAY_NAME}}', 'info');
|
|
43
|
+
notify('Hello from {{DISPLAY_NAME}}.', 'info');
|
|
44
44
|
setResult({
|
|
45
45
|
status: 'success',
|
|
46
46
|
request: 'SDK_NOTIFY',
|
|
@@ -99,7 +99,7 @@ function SdkDemo() {
|
|
|
99
99
|
<div className="text-muted-foreground border-border border-b pb-2 font-mono text-xs">
|
|
100
100
|
{result.request}
|
|
101
101
|
</div>
|
|
102
|
-
<div className="text-destructive whitespace-pre-wrap
|
|
102
|
+
<div className="text-destructive break-all whitespace-pre-wrap">{result.message}</div>
|
|
103
103
|
</div>
|
|
104
104
|
)}
|
|
105
105
|
{result.status === 'success' && (
|
|
@@ -121,14 +121,14 @@ export function App() {
|
|
|
121
121
|
const showSdkDemo = isInsideIframe() || isDevStandalone();
|
|
122
122
|
|
|
123
123
|
return (
|
|
124
|
-
<div className="bg-background text-foreground min-h-screen">
|
|
124
|
+
<div className="bg-background text-foreground @container/app min-h-screen">
|
|
125
125
|
{showSdkDemo ? (
|
|
126
126
|
<SdkDemo />
|
|
127
127
|
) : (
|
|
128
128
|
<div className="mx-auto flex min-h-screen w-full max-w-3xl flex-col gap-4 p-4">
|
|
129
129
|
<h1 className="m-0 text-2xl font-semibold">Hello Bardioc App</h1>
|
|
130
130
|
<p className="text-muted-foreground m-0 max-w-2xl text-xs leading-5">
|
|
131
|
-
Open this app inside Bardioc
|
|
131
|
+
Open this app inside Bardioc to use transport requests and send host notifications.
|
|
132
132
|
</p>
|
|
133
133
|
<div className="border-border bg-muted/20 rounded-xl border p-3 text-xs leading-5">
|
|
134
134
|
Outside the host iframe this page is only a local preview shell.
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@bardioc/configs/typescript/react-library.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
+
"declaration": false,
|
|
5
|
+
"declarationMap": false,
|
|
4
6
|
"module": "ESNext",
|
|
5
7
|
"moduleResolution": "Bundler",
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"jsx": "react-jsx",
|
|
8
|
-
"jsxImportSource": "preact",
|
|
9
|
-
"strict": true,
|
|
10
8
|
"noEmit": true,
|
|
11
|
-
"
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"isolatedModules": true
|
|
9
|
+
"jsxImportSource": "preact"
|
|
16
10
|
},
|
|
17
11
|
"include": ["src"],
|
|
18
12
|
"exclude": ["node_modules", "dist"]
|
|
@@ -3,15 +3,23 @@ import preact from '@preact/preset-vite';
|
|
|
3
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
4
4
|
import { defineConfig, loadEnv } from 'vite';
|
|
5
5
|
|
|
6
|
+
const DEFAULT_PORT = {{PORT}};
|
|
7
|
+
|
|
6
8
|
export default defineConfig(({ mode }) => {
|
|
7
9
|
const env = loadEnv(mode, __dirname, '');
|
|
8
10
|
const appName = env.VITE_APP_NAME?.trim();
|
|
11
|
+
const port = Number(env.LOCALHOST_PORT) || DEFAULT_PORT;
|
|
9
12
|
|
|
10
13
|
if (!appName) {
|
|
11
14
|
throw new Error('Missing VITE_APP_NAME for Vite config');
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
return {
|
|
15
|
-
plugins: [
|
|
18
|
+
plugins: [
|
|
19
|
+
bardiocDevAuth({ appName }),
|
|
20
|
+
preact(),
|
|
21
|
+
bardiocApp({ appName, port }),
|
|
22
|
+
tailwindcss(),
|
|
23
|
+
],
|
|
16
24
|
};
|
|
17
25
|
});
|
|
@@ -7,3 +7,6 @@ DEV_SECRET=
|
|
|
7
7
|
|
|
8
8
|
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
9
9
|
API_BASE_URL=
|
|
10
|
+
|
|
11
|
+
# By default, the app will start on port {{PORT}}. Feel free to uncomment the following variable and change it to match your local setup preferences.
|
|
12
|
+
#LOCALHOST_PORT={{PORT}}
|
|
@@ -5,28 +5,32 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
|
-
"dev:live": "BARDIOC_TUNNEL=1 vite",
|
|
9
8
|
"build": "tsc && vite build && node scripts/stamp-manifest.mjs dist",
|
|
10
9
|
"bundle": "tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
10
|
"preview": "vite preview",
|
|
12
11
|
"check-types": "tsc --noEmit",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"format": "prettier --write .",
|
|
14
|
+
"format:check": "prettier --check .",
|
|
13
15
|
"changeset": "changeset",
|
|
14
16
|
"release:status": "changeset status --verbose",
|
|
15
17
|
"release:version": "changeset version && npm install",
|
|
16
18
|
"release:publish": "changeset publish"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"@bardioc/app-sdk": "
|
|
21
|
+
"@bardioc/app-sdk": "^0.5.0",
|
|
20
22
|
"solid-js": "^1.9.7"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
25
|
+
"@bardioc/configs": "0.2.1",
|
|
23
26
|
"@changesets/cli": "^2.31.0",
|
|
24
27
|
"@tailwindcss/vite": "^4.3.0",
|
|
25
28
|
"@types/node": "^22.19.19",
|
|
26
|
-
"
|
|
29
|
+
"eslint": "^10.0.0",
|
|
30
|
+
"prettier": "^3.6.2",
|
|
27
31
|
"tailwindcss": "4.3.0",
|
|
28
32
|
"typescript": "6.0.3",
|
|
29
33
|
"vite": "8.0.13",
|
|
30
|
-
"vite-plugin-solid": "^2.11.
|
|
34
|
+
"vite-plugin-solid": "^2.11.14"
|
|
31
35
|
}
|
|
32
36
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@bardioc/configs/prettier';
|
|
@@ -22,13 +22,13 @@ function SdkDemo() {
|
|
|
22
22
|
setResult({ status: 'loading', request });
|
|
23
23
|
|
|
24
24
|
const startTime = Date.now();
|
|
25
|
-
notify('Getting user profile', 'info');
|
|
25
|
+
notify('Getting user profile…', 'info');
|
|
26
26
|
|
|
27
27
|
try {
|
|
28
28
|
const data = await bridge.transport.os.profile.get();
|
|
29
29
|
|
|
30
30
|
const duration = Date.now() - startTime;
|
|
31
|
-
notify(`Profile loaded (${duration}ms)
|
|
31
|
+
notify(`Profile loaded (${duration}ms).`, 'success');
|
|
32
32
|
setResult({ status: 'success', request, data });
|
|
33
33
|
} catch (err) {
|
|
34
34
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -40,7 +40,7 @@ function SdkDemo() {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
function handleNotify() {
|
|
43
|
-
notify('Hello from {{DISPLAY_NAME}}', 'info');
|
|
43
|
+
notify('Hello from {{DISPLAY_NAME}}.', 'info');
|
|
44
44
|
setResult({
|
|
45
45
|
status: 'success',
|
|
46
46
|
request: 'SDK_NOTIFY',
|
|
@@ -60,7 +60,7 @@ function SdkDemo() {
|
|
|
60
60
|
<div class="flex flex-wrap gap-2">
|
|
61
61
|
<button
|
|
62
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
|
-
onclick={runGetProfile}
|
|
63
|
+
onclick={() => void runGetProfile()}
|
|
64
64
|
disabled={running()}
|
|
65
65
|
>
|
|
66
66
|
Get Profile
|
|
@@ -106,7 +106,7 @@ function SdkDemo() {
|
|
|
106
106
|
<div class="text-muted-foreground border-border border-b pb-2 font-mono text-xs">
|
|
107
107
|
{r.request}
|
|
108
108
|
</div>
|
|
109
|
-
<div class="text-destructive whitespace-pre-wrap
|
|
109
|
+
<div class="text-destructive break-all whitespace-pre-wrap">{r.message}</div>
|
|
110
110
|
</div>
|
|
111
111
|
);
|
|
112
112
|
}
|
|
@@ -132,14 +132,14 @@ export function App() {
|
|
|
132
132
|
const showSdkDemo = isInsideIframe() || isDevStandalone();
|
|
133
133
|
|
|
134
134
|
return (
|
|
135
|
-
<div class="bg-background text-foreground min-h-screen">
|
|
135
|
+
<div class="bg-background text-foreground @container/app min-h-screen">
|
|
136
136
|
{showSdkDemo ? (
|
|
137
137
|
<SdkDemo />
|
|
138
138
|
) : (
|
|
139
139
|
<div class="mx-auto flex min-h-screen w-full max-w-3xl flex-col gap-4 p-4">
|
|
140
140
|
<h1 class="m-0 text-2xl font-semibold">Hello Bardioc App</h1>
|
|
141
141
|
<p class="text-muted-foreground m-0 max-w-2xl text-xs leading-5">
|
|
142
|
-
Open this app inside Bardioc
|
|
142
|
+
Open this app inside Bardioc to use transport requests and send host notifications.
|
|
143
143
|
</p>
|
|
144
144
|
<div class="border-border bg-muted/20 rounded-xl border p-3 text-xs leading-5">
|
|
145
145
|
Outside the host iframe this page is only a local preview shell.
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@bardioc/configs/typescript/base.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
+
"declaration": false,
|
|
5
|
+
"declarationMap": false,
|
|
4
6
|
"module": "ESNext",
|
|
5
7
|
"moduleResolution": "Bundler",
|
|
6
|
-
"
|
|
8
|
+
"noEmit": true,
|
|
7
9
|
"jsx": "preserve",
|
|
8
10
|
"jsxImportSource": "solid-js",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"noEmit": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"isolatedModules": true,
|
|
16
11
|
"types": ["vite/client"]
|
|
17
12
|
},
|
|
18
13
|
"include": ["src"],
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { bardiocApp, bardiocDevAuth } from '@bardioc/app-sdk/vite';
|
|
2
2
|
import tailwindcss from '@tailwindcss/vite';
|
|
3
|
-
import solid from 'vite-plugin-solid';
|
|
4
3
|
import { defineConfig, loadEnv } from 'vite';
|
|
4
|
+
import solid from 'vite-plugin-solid';
|
|
5
|
+
|
|
6
|
+
const DEFAULT_PORT = {{PORT}};
|
|
5
7
|
|
|
6
8
|
export default defineConfig(({ mode }) => {
|
|
7
9
|
const env = loadEnv(mode, __dirname, '');
|
|
8
10
|
const appName = env.VITE_APP_NAME?.trim();
|
|
11
|
+
const port = Number(env.LOCALHOST_PORT) || DEFAULT_PORT;
|
|
9
12
|
|
|
10
13
|
if (!appName) {
|
|
11
14
|
throw new Error('Missing VITE_APP_NAME for Vite config');
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
return {
|
|
15
|
-
plugins: [
|
|
18
|
+
plugins: [
|
|
19
|
+
bardiocDevAuth({ appName }),
|
|
20
|
+
solid(),
|
|
21
|
+
bardiocApp({ appName, port }),
|
|
22
|
+
tailwindcss(),
|
|
23
|
+
],
|
|
16
24
|
};
|
|
17
25
|
});
|
|
@@ -7,3 +7,6 @@ DEV_SECRET=
|
|
|
7
7
|
|
|
8
8
|
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
9
9
|
API_BASE_URL=
|
|
10
|
+
|
|
11
|
+
# By default, the app will start on port {{PORT}}. Feel free to uncomment the following variable and change it to match your local setup preferences.
|
|
12
|
+
#LOCALHOST_PORT={{PORT}}
|
|
@@ -5,25 +5,30 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
|
-
"dev:live": "BARDIOC_TUNNEL=1 vite",
|
|
9
8
|
"build": "svelte-check && vite build && node scripts/stamp-manifest.mjs dist",
|
|
10
9
|
"bundle": "svelte-check && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
10
|
"preview": "vite preview",
|
|
12
11
|
"check-types": "svelte-check",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"format": "prettier --write .",
|
|
14
|
+
"format:check": "prettier --check .",
|
|
13
15
|
"changeset": "changeset",
|
|
14
16
|
"release:status": "changeset status --verbose",
|
|
15
17
|
"release:version": "changeset version && npm install",
|
|
16
18
|
"release:publish": "changeset publish"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"@bardioc/app-sdk": "
|
|
21
|
+
"@bardioc/app-sdk": "^0.5.0",
|
|
20
22
|
"svelte": "^5.33.14"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
25
|
+
"@bardioc/configs": "0.2.1",
|
|
23
26
|
"@changesets/cli": "^2.31.0",
|
|
24
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
27
|
+
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
25
28
|
"@tailwindcss/vite": "^4.3.0",
|
|
26
29
|
"@types/node": "^22.19.19",
|
|
30
|
+
"eslint": "^10.0.0",
|
|
31
|
+
"prettier": "^3.6.2",
|
|
27
32
|
"svelte-check": "^4.2.1",
|
|
28
33
|
"tailwindcss": "4.3.0",
|
|
29
34
|
"typescript": "6.0.3",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@bardioc/configs/prettier';
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
result = { status: 'loading', request };
|
|
30
30
|
|
|
31
31
|
const startTime = Date.now();
|
|
32
|
-
notify('Getting user profile', 'info');
|
|
32
|
+
notify('Getting user profile…', 'info');
|
|
33
33
|
|
|
34
34
|
try {
|
|
35
35
|
const data = await bridge.transport.os.profile.get();
|
|
36
36
|
|
|
37
37
|
const duration = Date.now() - startTime;
|
|
38
|
-
notify(`Profile loaded (${duration}ms)
|
|
38
|
+
notify(`Profile loaded (${duration}ms).`, 'success');
|
|
39
39
|
result = { status: 'success', request, data };
|
|
40
40
|
} catch (err) {
|
|
41
41
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function handleNotify() {
|
|
50
|
-
notify('Hello from {{DISPLAY_NAME}}', 'info');
|
|
50
|
+
notify('Hello from {{DISPLAY_NAME}}.', 'info');
|
|
51
51
|
result = {
|
|
52
52
|
status: 'success',
|
|
53
53
|
request: 'SDK_NOTIFY',
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
|
-
<div class="bg-background text-foreground min-h-screen">
|
|
63
|
+
<div class="bg-background text-foreground @container/app min-h-screen">
|
|
64
64
|
{#if showSdkDemo}
|
|
65
65
|
<div class="mx-auto flex min-h-screen w-full max-w-3xl flex-col gap-3 p-4">
|
|
66
66
|
<div class="flex flex-col gap-1">
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
<div class="text-muted-foreground border-border border-b pb-2 font-mono text-xs">
|
|
110
110
|
{result.request}
|
|
111
111
|
</div>
|
|
112
|
-
<div class="text-destructive whitespace-pre-wrap
|
|
112
|
+
<div class="text-destructive break-all whitespace-pre-wrap">{result.message}</div>
|
|
113
113
|
</div>
|
|
114
114
|
{:else if result.status === 'success'}
|
|
115
115
|
<div class="flex h-full flex-col gap-0 overflow-hidden">
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
<div class="mx-auto flex min-h-screen w-full max-w-3xl flex-col gap-4 p-4">
|
|
126
126
|
<h1 class="m-0 text-2xl font-semibold">Hello Bardioc App</h1>
|
|
127
127
|
<p class="text-muted-foreground m-0 max-w-2xl text-xs leading-5">
|
|
128
|
-
Open this app inside Bardioc
|
|
128
|
+
Open this app inside Bardioc to use transport requests and send host notifications.
|
|
129
129
|
</p>
|
|
130
130
|
<div class="border-border bg-muted/20 rounded-xl border p-3 text-xs leading-5">
|
|
131
131
|
Outside the host iframe this page is only a local preview shell.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@bardioc/configs/typescript/base.json",
|
|
2
3
|
"compilerOptions": {
|
|
4
|
+
"declaration": false,
|
|
5
|
+
"declarationMap": false,
|
|
3
6
|
"target": "ESNext",
|
|
4
7
|
"module": "ESNext",
|
|
5
8
|
"moduleResolution": "bundler",
|
|
6
|
-
"strict": true,
|
|
7
9
|
"noEmit": true,
|
|
8
|
-
"
|
|
9
|
-
"verbatimModuleSyntax": true,
|
|
10
|
-
"isolatedModules": true
|
|
10
|
+
"verbatimModuleSyntax": true
|
|
11
11
|
},
|
|
12
12
|
"include": ["src/**/*.ts", "src/**/*.svelte"]
|
|
13
13
|
}
|
|
@@ -3,15 +3,23 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
|
|
|
3
3
|
import tailwindcss from '@tailwindcss/vite';
|
|
4
4
|
import { defineConfig, loadEnv } from 'vite';
|
|
5
5
|
|
|
6
|
+
const DEFAULT_PORT = {{PORT}};
|
|
7
|
+
|
|
6
8
|
export default defineConfig(({ mode }) => {
|
|
7
9
|
const env = loadEnv(mode, __dirname, '');
|
|
8
10
|
const appName = env.VITE_APP_NAME?.trim();
|
|
11
|
+
const port = Number(env.LOCALHOST_PORT) || DEFAULT_PORT;
|
|
9
12
|
|
|
10
13
|
if (!appName) {
|
|
11
14
|
throw new Error('Missing VITE_APP_NAME for Vite config');
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
return {
|
|
15
|
-
plugins: [
|
|
18
|
+
plugins: [
|
|
19
|
+
bardiocDevAuth({ appName }),
|
|
20
|
+
svelte(),
|
|
21
|
+
bardiocApp({ appName, port }),
|
|
22
|
+
tailwindcss(),
|
|
23
|
+
],
|
|
16
24
|
};
|
|
17
25
|
});
|
|
@@ -7,3 +7,6 @@ DEV_SECRET=
|
|
|
7
7
|
|
|
8
8
|
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
9
9
|
API_BASE_URL=
|
|
10
|
+
|
|
11
|
+
# By default, the app will start on port {{PORT}}. Feel free to uncomment the following variable and change it to match your local setup preferences.
|
|
12
|
+
#LOCALHOST_PORT={{PORT}}
|
package/templates/vite/CLAUDE.md
CHANGED
|
@@ -35,9 +35,9 @@ src/
|
|
|
35
35
|
auth/
|
|
36
36
|
onboarding.tsx # Empty full-page screen with the DEV_SECRET dev-auth steps
|
|
37
37
|
shell/
|
|
38
|
-
app-shell.tsx # Sidebar + view routing + Toaster + OS top-menu
|
|
38
|
+
app-shell.tsx # Sidebar + Page + view routing + Toaster + OS top-menu (useCommandMenu)
|
|
39
39
|
about-dialog.tsx # "About" Dialog — reads public/app-manifest.json at runtime (manifest example)
|
|
40
|
-
header.tsx # location combobox + language switcher + sync
|
|
40
|
+
header.tsx # Page actions: location combobox + language switcher + sync
|
|
41
41
|
climate/
|
|
42
42
|
types.ts # Station/ClimateState + METRICS config (icon, unit, color)
|
|
43
43
|
climate-data.ts # demo-data generator (replace with your real source)
|
|
@@ -69,11 +69,16 @@ an `app`-kind root next to the host's About / Version entries — the example of
|
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
71
|
pnpm dev # http://localhost:{{PORT}}
|
|
72
|
-
pnpm dev:live # public tunnel
|
|
73
72
|
pnpm build # → dist/
|
|
74
73
|
pnpm bundle # → {{APP_NAME}}.zip
|
|
74
|
+
pnpm check-types # tsc
|
|
75
|
+
pnpm lint # eslint (@bardioc/configs preset)
|
|
76
|
+
pnpm format # prettier (@bardioc/configs preset)
|
|
75
77
|
```
|
|
76
78
|
|
|
79
|
+
ESLint, Prettier and the `tsconfig.json` base come from `@bardioc/configs` — edit
|
|
80
|
+
`eslint.config.mjs` / `prettier.config.mjs` only to add app-specific overrides on top of the preset.
|
|
81
|
+
|
|
77
82
|
`npm run dev` runs plain Vite — a local preview shell (no transport): the dashboard renders, but
|
|
78
83
|
live SDK data comes only when the app is opened inside the host, or when `DEV_SECRET` and
|
|
79
84
|
`API_BASE_URL` are set for standalone dev auth (see `.env.example`).
|
|
@@ -82,9 +87,10 @@ live SDK data comes only when the app is opened inside the host, or when `DEV_SE
|
|
|
82
87
|
|
|
83
88
|
## UI — `@bardioc/ui`
|
|
84
89
|
|
|
85
|
-
Tailwind v4 + the Bardioc design system. **
|
|
86
|
-
|
|
87
|
-
|
|
90
|
+
Tailwind v4 + the Bardioc design system. **Before writing any UI, read
|
|
91
|
+
`node_modules/@bardioc/ui/docs/INDEX.md`** — component choice, design tokens, layout and spacing
|
|
92
|
+
patterns, and copy rules ship with the installed package, so they match its version. Theme is wired
|
|
93
|
+
in `src/index.css`:
|
|
88
94
|
|
|
89
95
|
```css
|
|
90
96
|
@import 'tailwindcss';
|
|
@@ -108,6 +114,7 @@ import {
|
|
|
108
114
|
Empty,
|
|
109
115
|
FilterDropdown,
|
|
110
116
|
Kbd,
|
|
117
|
+
Page,
|
|
111
118
|
SidebarBasic,
|
|
112
119
|
SidebarContainedProvider,
|
|
113
120
|
SortableColumnHeader,
|
|
@@ -121,10 +128,33 @@ import type { ChartConfig } from '@bardioc/ui/shadcn/chart';
|
|
|
121
128
|
import type { TReactTable } from '@bardioc/ui/types'; // TReactTable.ColumnDef<Row>
|
|
122
129
|
```
|
|
123
130
|
|
|
124
|
-
|
|
125
|
-
sidebar uses `SidebarBasic` inside a `SidebarContainedProvider` (the contained variant for
|
|
131
|
+
The sidebar uses `SidebarBasic` inside a `SidebarContainedProvider` (the contained variant for
|
|
126
132
|
OS windows); the language switcher is `ConnectedLanguageSwitcher useI18n={useI18n}`.
|
|
127
133
|
|
|
134
|
+
### Layout — the container contract
|
|
135
|
+
|
|
136
|
+
The app root opens `@container/app`; `Page` opens its own `@container/page` inside it. Keep both:
|
|
137
|
+
sizing that should follow the whole app reads `@container/app`, and anything inside the page column
|
|
138
|
+
— the page header included — reads `@container/page`, so it responds to the column rather than the
|
|
139
|
+
window.
|
|
140
|
+
|
|
141
|
+
`Page` is the scrolling column, a **sibling of the sidebar** — it owns the header, the scroller and
|
|
142
|
+
the padding that lines them up. Don't compose a header and a `ScrollArea` by hand, and don't wrap
|
|
143
|
+
the sidebar in it:
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
<div className="bg-background text-foreground @container/app flex h-full min-h-0">
|
|
147
|
+
<SidebarBasic … />
|
|
148
|
+
<Page title={pageTitle} actions={<Header />} actionsClassName="gap-2" sticky className="min-w-0">
|
|
149
|
+
<ViewContent view={view} />
|
|
150
|
+
</Page>
|
|
151
|
+
</div>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Collapse your own `actions` against the same container (e.g. `@3xl/page:hidden`) so both sides agree
|
|
155
|
+
on what "wide enough" means. `sticky` keeps the header at the top while the body scrolls under it,
|
|
156
|
+
compacting once it does; drop it if you want the header to scroll away instead.
|
|
157
|
+
|
|
128
158
|
---
|
|
129
159
|
|
|
130
160
|
## i18n — `@bardioc/i18n-core`
|
|
@@ -145,6 +175,8 @@ t('overview.updated', { fallback: 'Updated {time}', params: { time } });
|
|
|
145
175
|
- Always pass a `fallback` so a missing key degrades gracefully.
|
|
146
176
|
- `@bardioc/ui` component strings ship with the `@bardioc/ui` package itself — the app only
|
|
147
177
|
carries its own `en/de.json`.
|
|
178
|
+
- Copy style (Title Case labels, sentence-case messages, American English):
|
|
179
|
+
`node_modules/@bardioc/ui/docs/copy.md`.
|
|
148
180
|
|
|
149
181
|
---
|
|
150
182
|
|
|
@@ -9,26 +9,32 @@
|
|
|
9
9
|
"bundle": "rm -f {{APP_NAME}}.zip && tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
10
10
|
"preview": "vite preview",
|
|
11
11
|
"check-types": "tsc --noEmit",
|
|
12
|
+
"lint": "eslint .",
|
|
13
|
+
"format": "prettier --write .",
|
|
14
|
+
"format:check": "prettier --check .",
|
|
12
15
|
"changeset": "changeset",
|
|
13
16
|
"release:status": "changeset status --verbose",
|
|
14
17
|
"release:version": "changeset version && npm install",
|
|
15
18
|
"release:publish": "changeset publish"
|
|
16
19
|
},
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"@bardioc/app-sdk": "
|
|
19
|
-
"@bardioc/i18n-core": "
|
|
20
|
-
"@bardioc/ui": "
|
|
21
|
+
"@bardioc/app-sdk": "^0.5.0",
|
|
22
|
+
"@bardioc/i18n-core": "^0.1.1",
|
|
23
|
+
"@bardioc/ui": "^0.7.29",
|
|
21
24
|
"lucide-react": "^0.544.0",
|
|
22
25
|
"react": "19.2.6",
|
|
23
26
|
"react-dom": "19.2.6"
|
|
24
27
|
},
|
|
25
28
|
"devDependencies": {
|
|
29
|
+
"@bardioc/configs": "0.2.1",
|
|
26
30
|
"@changesets/cli": "^2.31.0",
|
|
27
31
|
"@tailwindcss/vite": "^4.3.0",
|
|
28
32
|
"@types/node": "^22.19.19",
|
|
29
33
|
"@types/react": "^19.2.14",
|
|
30
34
|
"@types/react-dom": "^19.2.3",
|
|
31
35
|
"@vitejs/plugin-react": "5.2.0",
|
|
36
|
+
"eslint": "^10.0.0",
|
|
37
|
+
"prettier": "^3.6.2",
|
|
32
38
|
"tailwindcss": "4.3.0",
|
|
33
39
|
"typescript": "6.0.3",
|
|
34
40
|
"vite": "8.0.13"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@bardioc/configs/prettier';
|