@bardioc/create-bardioc-app 0.5.4 → 0.5.6
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 +3 -5
- package/bin/create.mjs +2 -4
- package/package.json +5 -5
- 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 +4 -2
- package/templates/angular/_gitignore +1 -0
- package/templates/angular/package.json +2 -4
- package/templates/angular/public/runtime-env.js +1 -1
- package/templates/angular/scripts/dev-auth-proxy.mjs +10 -84
- package/templates/angular/scripts/sync-runtime-env.mjs +17 -36
- package/templates/angular/src/app/app.component.ts +2 -2
- package/templates/angular/src/app/bardioc-bridge.ts +1 -1
- package/templates/angular/src/index.html +2 -2
- 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 +3 -3
- package/templates/angular/tsconfig.json +1 -0
- package/templates/manifest.json +2 -10
- package/templates/nextjs/.env.example +4 -2
- package/templates/nextjs/_gitignore +1 -0
- package/templates/nextjs/app/globals.css +31 -28
- package/templates/nextjs/app/layout.tsx +2 -0
- package/templates/nextjs/app/page.tsx +8 -5
- package/templates/nextjs/eslint.config.mjs +4 -0
- package/templates/nextjs/global.d.ts +1 -1
- package/templates/nextjs/next.config.ts +7 -26
- package/templates/nextjs/package.json +8 -3
- package/templates/nextjs/prettier.config.mjs +1 -0
- package/templates/nextjs/scripts/dev-auth-proxy.mjs +17 -0
- package/templates/nextjs/tailwind.config.ts +1 -4
- package/templates/nextjs/tsconfig.json +3 -18
- package/templates/preact/eslint.config.mjs +3 -0
- package/templates/preact/index.html +2 -2
- package/templates/preact/package.json +8 -3
- package/templates/preact/prettier.config.mjs +1 -0
- package/templates/preact/src/App.tsx +6 -5
- package/templates/preact/src/index.css +31 -28
- package/templates/preact/src/vite-env.d.ts +2 -2
- package/templates/preact/tsconfig.json +4 -10
- package/templates/preact/vite.config.ts +6 -1
- package/templates/solid/eslint.config.mjs +3 -0
- package/templates/solid/index.html +2 -2
- package/templates/solid/package.json +8 -4
- package/templates/solid/prettier.config.mjs +1 -0
- package/templates/solid/src/App.tsx +7 -6
- package/templates/solid/src/bardioc-sdk.tsx +18 -18
- package/templates/solid/src/index.css +31 -28
- package/templates/solid/src/vite-env.d.ts +2 -2
- package/templates/solid/tsconfig.json +4 -9
- package/templates/solid/vite.config.ts +7 -2
- package/templates/svelte/_gitignore +1 -0
- package/templates/svelte/eslint.config.mjs +3 -0
- package/templates/svelte/index.html +2 -2
- package/templates/svelte/package.json +8 -3
- package/templates/svelte/prettier.config.mjs +1 -0
- package/templates/svelte/src/App.svelte +1 -1
- package/templates/svelte/src/index.css +31 -28
- package/templates/svelte/src/main.ts +1 -1
- package/templates/svelte/src/vite-env.d.ts +2 -2
- package/templates/svelte/tsconfig.json +4 -4
- package/templates/svelte/vite.config.ts +6 -1
- package/templates/vite/CLAUDE.md +11 -8
- package/templates/vite/eslint.config.mjs +3 -0
- package/templates/vite/index.html +2 -2
- package/templates/vite/package.json +9 -5
- package/templates/vite/prettier.config.mjs +1 -0
- package/templates/vite/src/climate/climate-data.ts +13 -6
- 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/graph/requests.ts +2 -1
- package/templates/vite/src/i18n.tsx +7 -9
- package/templates/vite/src/shell/header.tsx +1 -2
- package/templates/vite/tsconfig.json +4 -10
- package/templates/vite/vite.config.ts +7 -2
- package/templates/vue/_gitignore +1 -0
- package/templates/vue/eslint.config.mjs +3 -0
- package/templates/vue/index.html +2 -2
- package/templates/vue/package.json +8 -3
- package/templates/vue/prettier.config.mjs +1 -0
- 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/vite-env.d.ts +2 -2
- package/templates/vue/tsconfig.json +5 -9
- package/templates/vue/vite.config.ts +7 -2
|
@@ -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,23 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@bardioc/configs/typescript/nextjs.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "preserve",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [
|
|
17
|
-
{
|
|
18
|
-
"name": "next"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
4
|
+
"declaration": false,
|
|
5
|
+
"declarationMap": false,
|
|
21
6
|
"paths": {
|
|
22
7
|
"@/*": ["./*"]
|
|
23
8
|
}
|
|
@@ -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" />
|
|
@@ -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.4.9",
|
|
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';
|
|
@@ -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' && (
|
|
@@ -98,7 +99,7 @@ function SdkDemo() {
|
|
|
98
99
|
<div className="text-muted-foreground border-border border-b pb-2 font-mono text-xs">
|
|
99
100
|
{result.request}
|
|
100
101
|
</div>
|
|
101
|
-
<div className="text-destructive whitespace-pre-wrap
|
|
102
|
+
<div className="text-destructive break-all whitespace-pre-wrap">{result.message}</div>
|
|
102
103
|
</div>
|
|
103
104
|
)}
|
|
104
105
|
{result.status === 'success' && (
|
|
@@ -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,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"]
|
|
@@ -12,6 +12,11 @@ export default defineConfig(({ mode }) => {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
return {
|
|
15
|
-
plugins: [
|
|
15
|
+
plugins: [
|
|
16
|
+
bardiocDevAuth({ appName }),
|
|
17
|
+
preact(),
|
|
18
|
+
bardiocApp({ appName, port: {{PORT}} }),
|
|
19
|
+
tailwindcss(),
|
|
20
|
+
],
|
|
16
21
|
};
|
|
17
22
|
});
|
|
@@ -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" />
|
|
@@ -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.4.9",
|
|
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';
|
|
@@ -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
|
|
63
|
-
onclick={runGetProfile}
|
|
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={() => void 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
|
}
|
|
@@ -105,7 +106,7 @@ function SdkDemo() {
|
|
|
105
106
|
<div class="text-muted-foreground border-border border-b pb-2 font-mono text-xs">
|
|
106
107
|
{r.request}
|
|
107
108
|
</div>
|
|
108
|
-
<div class="text-destructive whitespace-pre-wrap
|
|
109
|
+
<div class="text-destructive break-all whitespace-pre-wrap">{r.message}</div>
|
|
109
110
|
</div>
|
|
110
111
|
);
|
|
111
112
|
}
|
|
@@ -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,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,7 +1,7 @@
|
|
|
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
5
|
|
|
6
6
|
export default defineConfig(({ mode }) => {
|
|
7
7
|
const env = loadEnv(mode, __dirname, '');
|
|
@@ -12,6 +12,11 @@ export default defineConfig(({ mode }) => {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
return {
|
|
15
|
-
plugins: [
|
|
15
|
+
plugins: [
|
|
16
|
+
bardiocDevAuth({ appName }),
|
|
17
|
+
solid(),
|
|
18
|
+
bardiocApp({ appName, port: {{PORT}} }),
|
|
19
|
+
tailwindcss(),
|
|
20
|
+
],
|
|
16
21
|
};
|
|
17
22
|
});
|
|
@@ -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" />
|