@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,258 +1,262 @@
|
|
|
1
1
|
* {
|
|
2
|
-
|
|
2
|
+
box-sizing: border-box;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
html,
|
|
6
6
|
body,
|
|
7
7
|
app-root {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
height: 100%;
|
|
11
|
+
width: 100%;
|
|
12
|
+
overflow: hidden;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
:root {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
--background: oklch(17.88% 0.0075 229.38);
|
|
17
|
+
--foreground: oklch(98.69% 0.0093 99.98);
|
|
18
|
+
--muted-foreground: oklch(86.03% 0.0056 95.11);
|
|
19
|
+
--border: oklch(1 0 0 / 10%);
|
|
20
|
+
--primary: oklch(97.02% 0 0);
|
|
21
|
+
--primary-foreground: oklch(36.94% 0.0053 236.64);
|
|
22
|
+
--destructive: oklch(68.04% 0.1386 21.38);
|
|
23
|
+
--ring: oklch(79.43% 0.0084 98.91);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
body {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
background: var(--background);
|
|
28
|
+
color: var(--foreground);
|
|
29
|
+
font-family:
|
|
30
|
+
system-ui,
|
|
31
|
+
-apple-system,
|
|
32
|
+
sans-serif;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
code {
|
|
33
|
-
|
|
36
|
+
font-family: inherit;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
.bg-background {
|
|
37
|
-
|
|
40
|
+
background-color: var(--background);
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
.text-foreground {
|
|
41
|
-
|
|
44
|
+
color: var(--foreground);
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
.text-muted-foreground {
|
|
45
|
-
|
|
48
|
+
color: var(--muted-foreground);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
.border-border {
|
|
49
|
-
|
|
52
|
+
border-color: var(--border);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
.bg-primary {
|
|
53
|
-
|
|
56
|
+
background-color: var(--primary);
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
.text-primary-foreground {
|
|
57
|
-
|
|
60
|
+
color: var(--primary-foreground);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
.text-destructive {
|
|
61
|
-
|
|
64
|
+
color: var(--destructive);
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
.focus\:ring-ring:focus {
|
|
65
|
-
|
|
68
|
+
--tw-ring-color: var(--ring);
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
.hover\:bg-primary\/90:hover {
|
|
69
|
-
|
|
72
|
+
background-color: oklch(from var(--primary) calc(l * 0.9) c h);
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
.hover\:text-foreground:hover {
|
|
73
|
-
|
|
76
|
+
color: var(--foreground);
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
.mx-auto {
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
margin-left: auto;
|
|
81
|
+
margin-right: auto;
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
.m-0 {
|
|
82
|
-
|
|
85
|
+
margin: 0;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
.flex {
|
|
86
|
-
|
|
89
|
+
display: flex;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
.min-h-0 {
|
|
90
|
-
|
|
93
|
+
min-height: 0;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
.min-h-screen {
|
|
94
|
-
|
|
97
|
+
min-height: 100vh;
|
|
95
98
|
}
|
|
96
99
|
|
|
97
100
|
.h-full {
|
|
98
|
-
|
|
101
|
+
height: 100%;
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
.w-full {
|
|
102
|
-
|
|
105
|
+
width: 100%;
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
.max-w-2xl {
|
|
106
|
-
|
|
109
|
+
max-width: 42rem;
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
.max-w-3xl {
|
|
110
|
-
|
|
113
|
+
max-width: 48rem;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
.shrink-0 {
|
|
114
|
-
|
|
117
|
+
flex-shrink: 0;
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
.flex-1 {
|
|
118
|
-
|
|
121
|
+
flex: 1 1 0%;
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
.flex-col {
|
|
122
|
-
|
|
125
|
+
flex-direction: column;
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
.flex-wrap {
|
|
126
|
-
|
|
129
|
+
flex-wrap: wrap;
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
.items-center {
|
|
130
|
-
|
|
133
|
+
align-items: center;
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
.justify-center {
|
|
134
|
-
|
|
137
|
+
justify-content: center;
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
.gap-0 {
|
|
138
|
-
|
|
141
|
+
gap: 0;
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
.gap-1 {
|
|
142
|
-
|
|
145
|
+
gap: 0.25rem;
|
|
143
146
|
}
|
|
144
147
|
|
|
145
148
|
.gap-2 {
|
|
146
|
-
|
|
149
|
+
gap: 0.5rem;
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
.gap-3 {
|
|
150
|
-
|
|
153
|
+
gap: 0.75rem;
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
.gap-4 {
|
|
154
|
-
|
|
157
|
+
gap: 1rem;
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
.overflow-hidden {
|
|
158
|
-
|
|
161
|
+
overflow: hidden;
|
|
159
162
|
}
|
|
160
163
|
|
|
161
164
|
.overflow-auto {
|
|
162
|
-
|
|
165
|
+
overflow: auto;
|
|
163
166
|
}
|
|
164
167
|
|
|
165
168
|
.rounded {
|
|
166
|
-
|
|
169
|
+
border-radius: 0.25rem;
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
.rounded-xl {
|
|
170
|
-
|
|
173
|
+
border-radius: 0.75rem;
|
|
171
174
|
}
|
|
172
175
|
|
|
173
176
|
.border {
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
border-width: 1px;
|
|
178
|
+
border-style: solid;
|
|
176
179
|
}
|
|
177
180
|
|
|
178
181
|
.border-b {
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
border-bottom-width: 1px;
|
|
183
|
+
border-bottom-style: solid;
|
|
181
184
|
}
|
|
182
185
|
|
|
183
186
|
.p-3 {
|
|
184
|
-
|
|
187
|
+
padding: 0.75rem;
|
|
185
188
|
}
|
|
186
189
|
|
|
187
190
|
.p-4 {
|
|
188
|
-
|
|
191
|
+
padding: 1rem;
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
.px-3 {
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
padding-left: 0.75rem;
|
|
196
|
+
padding-right: 0.75rem;
|
|
194
197
|
}
|
|
195
198
|
|
|
196
199
|
.py-1 {
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
padding-top: 0.25rem;
|
|
201
|
+
padding-bottom: 0.25rem;
|
|
199
202
|
}
|
|
200
203
|
|
|
201
204
|
.pb-2 {
|
|
202
|
-
|
|
205
|
+
padding-bottom: 0.5rem;
|
|
203
206
|
}
|
|
204
207
|
|
|
205
208
|
.text-center {
|
|
206
|
-
|
|
209
|
+
text-align: center;
|
|
207
210
|
}
|
|
208
211
|
|
|
209
212
|
.text-2xl {
|
|
210
|
-
|
|
211
|
-
|
|
213
|
+
font-size: 1.5rem;
|
|
214
|
+
line-height: 2rem;
|
|
212
215
|
}
|
|
213
216
|
|
|
214
217
|
.text-xs {
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
font-size: 0.75rem;
|
|
219
|
+
line-height: 1rem;
|
|
217
220
|
}
|
|
218
221
|
|
|
219
222
|
.text-\[11px\] {
|
|
220
|
-
|
|
223
|
+
font-size: 11px;
|
|
221
224
|
}
|
|
222
225
|
|
|
223
226
|
.font-medium {
|
|
224
|
-
|
|
227
|
+
font-weight: 500;
|
|
225
228
|
}
|
|
226
229
|
|
|
227
230
|
.font-semibold {
|
|
228
|
-
|
|
231
|
+
font-weight: 600;
|
|
229
232
|
}
|
|
230
233
|
|
|
231
234
|
.font-mono {
|
|
232
|
-
|
|
233
|
-
|
|
235
|
+
font-family:
|
|
236
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
|
237
|
+
monospace;
|
|
234
238
|
}
|
|
235
239
|
|
|
236
240
|
.leading-5 {
|
|
237
|
-
|
|
241
|
+
line-height: 1.25rem;
|
|
238
242
|
}
|
|
239
243
|
|
|
240
244
|
.whitespace-pre-wrap {
|
|
241
|
-
|
|
245
|
+
white-space: pre-wrap;
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
.break-all {
|
|
245
|
-
|
|
249
|
+
word-break: break-all;
|
|
246
250
|
}
|
|
247
251
|
|
|
248
252
|
.bg-muted\/20 {
|
|
249
|
-
|
|
253
|
+
background-color: oklch(from var(--muted-foreground) l c h / 0.2);
|
|
250
254
|
}
|
|
251
255
|
|
|
252
256
|
.disabled\:opacity-50:disabled {
|
|
253
|
-
|
|
257
|
+
opacity: 0.5;
|
|
254
258
|
}
|
|
255
259
|
|
|
256
260
|
.disabled\:cursor-not-allowed:disabled {
|
|
257
|
-
|
|
261
|
+
cursor: not-allowed;
|
|
258
262
|
}
|
package/templates/manifest.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# Hosted app slug used by local runtime/dev-auth wiring.
|
|
1
2
|
NEXT_PUBLIC_APP_NAME={{APP_NAME}}
|
|
2
3
|
|
|
3
|
-
#
|
|
4
|
+
# Paste the dev secret from the BardiocOS AppStore after registering your app.
|
|
5
|
+
# Used by the dev-auth proxy (scripts/dev-auth-proxy.mjs) to sign requests to the BFF.
|
|
4
6
|
DEV_SECRET=
|
|
5
7
|
|
|
6
|
-
# Base URL of the Bardioc
|
|
8
|
+
# Base URL of the Bardioc BFF / backend-for-frontend (e.g. https://your-host).
|
|
7
9
|
API_BASE_URL=
|
|
@@ -1,75 +1,78 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
overflow: hidden;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
:root {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
--background: oklch(17.88% 0.0075 229.38);
|
|
18
|
+
--foreground: oklch(98.69% 0.0093 99.98);
|
|
19
|
+
--muted-foreground: oklch(86.03% 0.0056 95.11);
|
|
20
|
+
--border: oklch(1 0 0 / 10%);
|
|
21
|
+
--primary: oklch(97.02% 0 0);
|
|
22
|
+
--primary-foreground: oklch(36.94% 0.0053 236.64);
|
|
23
|
+
--destructive: oklch(68.04% 0.1386 21.38);
|
|
24
|
+
--ring: oklch(79.43% 0.0084 98.91);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
body {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
background: var(--background);
|
|
29
|
+
color: var(--foreground);
|
|
30
|
+
font-family:
|
|
31
|
+
system-ui,
|
|
32
|
+
-apple-system,
|
|
33
|
+
sans-serif;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
code {
|
|
34
|
-
|
|
37
|
+
font-family: inherit;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
.bg-background {
|
|
38
|
-
|
|
41
|
+
background-color: var(--background);
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
.text-foreground {
|
|
42
|
-
|
|
45
|
+
color: var(--foreground);
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
.text-muted-foreground {
|
|
46
|
-
|
|
49
|
+
color: var(--muted-foreground);
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
.border-border {
|
|
50
|
-
|
|
53
|
+
border-color: var(--border);
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
.bg-primary {
|
|
54
|
-
|
|
57
|
+
background-color: var(--primary);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
.text-primary-foreground {
|
|
58
|
-
|
|
61
|
+
color: var(--primary-foreground);
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
.text-destructive {
|
|
62
|
-
|
|
65
|
+
color: var(--destructive);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
.focus\:ring-ring:focus {
|
|
66
|
-
|
|
69
|
+
--tw-ring-color: var(--ring);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
.hover\:bg-primary\/90:hover {
|
|
70
|
-
|
|
73
|
+
background-color: oklch(from var(--primary) calc(l * 0.9) c h);
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
.hover\:text-foreground:hover {
|
|
74
|
-
|
|
77
|
+
color: var(--foreground);
|
|
75
78
|
}
|
|
@@ -9,6 +9,8 @@ export default function RootLayout({ children }: Readonly<{ children: React.Reac
|
|
|
9
9
|
return (
|
|
10
10
|
<html lang="en" className="dark" style={{ height: '100%', margin: 0 }}>
|
|
11
11
|
<head>
|
|
12
|
+
{/* Platform font contract — a fixed absolute URL the host serves, not a bundled asset. */}
|
|
13
|
+
{/* eslint-disable-next-line @next/next/no-css-tags */}
|
|
12
14
|
<link rel="stylesheet" href="/fonts/bardioc-fonts.css" />
|
|
13
15
|
</head>
|
|
14
16
|
<body style={{ height: '100%', margin: 0 }}>{children}</body>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { installDevBridge, isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
4
4
|
import { AppSdkProvider, useNotify, useSdk } from '@bardioc/app-sdk/react';
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
@@ -12,6 +12,9 @@ type ResultState =
|
|
|
12
12
|
|
|
13
13
|
const APP_NAME = process.env.NEXT_PUBLIC_APP_NAME?.trim();
|
|
14
14
|
|
|
15
|
+
// scripts/dev-auth-proxy.mjs listens on the app port + 100 for standalone dev auth.
|
|
16
|
+
const DEV_PROXY_PORT = Number('{{PORT}}') + 100;
|
|
17
|
+
|
|
15
18
|
function SdkDemo() {
|
|
16
19
|
const bridge = useSdk();
|
|
17
20
|
const notify = useNotify();
|
|
@@ -63,14 +66,14 @@ function SdkDemo() {
|
|
|
63
66
|
|
|
64
67
|
<div className="flex flex-wrap gap-2">
|
|
65
68
|
<button
|
|
66
|
-
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"
|
|
67
70
|
onClick={() => void runGetProfile()}
|
|
68
71
|
disabled={running}
|
|
69
72
|
>
|
|
70
73
|
Get Profile
|
|
71
74
|
</button>
|
|
72
75
|
<button
|
|
73
|
-
className="bg-primary text-primary-foreground hover:bg-primary/90
|
|
76
|
+
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"
|
|
74
77
|
onClick={handleNotify}
|
|
75
78
|
disabled={running}
|
|
76
79
|
>
|
|
@@ -103,7 +106,7 @@ function SdkDemo() {
|
|
|
103
106
|
<div className="text-muted-foreground border-border border-b pb-2 font-mono text-xs">
|
|
104
107
|
{result.request}
|
|
105
108
|
</div>
|
|
106
|
-
<div className="text-destructive whitespace-pre-wrap
|
|
109
|
+
<div className="text-destructive break-all whitespace-pre-wrap">{result.message}</div>
|
|
107
110
|
</div>
|
|
108
111
|
)}
|
|
109
112
|
{result.status === 'success' && (
|
|
@@ -144,7 +147,7 @@ export default function Page() {
|
|
|
144
147
|
|
|
145
148
|
useEffect(() => {
|
|
146
149
|
if (isDevStandalone()) {
|
|
147
|
-
installDevBridge();
|
|
150
|
+
installDevBridge({ apiBaseUrl: `http://127.0.0.1:${DEV_PROXY_PORT}/rest` });
|
|
148
151
|
}
|
|
149
152
|
}, []);
|
|
150
153
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
declare module '*.css';
|
|
1
|
+
declare module '*.css';
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
import type { NextConfig } from 'next';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
// Standalone dev auth lives in scripts/dev-auth-proxy.mjs (the SDK dev-auth proxy), not here:
|
|
4
|
+
// the BFF needs Origin dropped and X-Requested-With stamped, which rewrites cannot do.
|
|
6
5
|
const nextConfig: NextConfig = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
async headers() {
|
|
13
|
-
if (!devSecret) return [];
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
source: '/rest/:path*',
|
|
17
|
-
headers: [{ key: 'X-Dev-Secret', value: devSecret }],
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
},
|
|
21
|
-
async rewrites() {
|
|
22
|
-
if (!apiBaseUrl) return [];
|
|
23
|
-
return [
|
|
24
|
-
{
|
|
25
|
-
source: '/rest/:path*',
|
|
26
|
-
destination: `${apiBaseUrl}/:path*`,
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
},
|
|
6
|
+
output: 'export',
|
|
7
|
+
images: {
|
|
8
|
+
unoptimized: true,
|
|
9
|
+
},
|
|
10
|
+
trailingSlash: true,
|
|
30
11
|
};
|
|
31
12
|
|
|
32
13
|
export default nextConfig;
|
|
@@ -3,29 +3,34 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"dev": "next dev --port {{PORT}}",
|
|
7
|
-
"dev:live": "BARDIOC_TUNNEL=1 next dev --port {{PORT}}",
|
|
6
|
+
"dev": "node ./scripts/dev-auth-proxy.mjs & PROXY_PID=$!; next dev --port {{PORT}}; EXIT_CODE=$?; kill $PROXY_PID 2>/dev/null; exit $EXIT_CODE",
|
|
8
7
|
"build": "next build && node scripts/stamp-manifest.mjs out",
|
|
9
8
|
"bundle": "next build && node scripts/stamp-manifest.mjs out && cd out && zip -r ../{{APP_NAME}}.zip .",
|
|
10
9
|
"start": "next start",
|
|
11
10
|
"check-types": "tsc --noEmit",
|
|
11
|
+
"lint": "eslint .",
|
|
12
|
+
"format": "prettier --write .",
|
|
13
|
+
"format:check": "prettier --check .",
|
|
12
14
|
"changeset": "changeset",
|
|
13
15
|
"release:status": "changeset status --verbose",
|
|
14
16
|
"release:version": "changeset version && npm install",
|
|
15
17
|
"release:publish": "changeset publish"
|
|
16
18
|
},
|
|
17
19
|
"dependencies": {
|
|
18
|
-
"@bardioc/app-sdk": "
|
|
20
|
+
"@bardioc/app-sdk": "^0.4.9",
|
|
19
21
|
"next": "^15.3.2",
|
|
20
22
|
"react": "^19.2.5",
|
|
21
23
|
"react-dom": "^19.2.5"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
26
|
+
"@bardioc/configs": "^0.2.1",
|
|
24
27
|
"@changesets/cli": "^2.31.0",
|
|
25
28
|
"@tailwindcss/postcss": "^4.2.4",
|
|
26
29
|
"@types/node": "^22.10.0",
|
|
27
30
|
"@types/react": "^19.2.14",
|
|
28
31
|
"@types/react-dom": "^19.2.3",
|
|
32
|
+
"eslint": "^10.0.0",
|
|
33
|
+
"prettier": "^3.6.2",
|
|
29
34
|
"tailwindcss": "^4.2.4",
|
|
30
35
|
"typescript": "^6.0.3"
|
|
31
36
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@bardioc/configs/prettier';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { startDevAuthProxy } from '@bardioc/app-sdk/dev-proxy';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const projectDir = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
|
+
|
|
9
|
+
// `next dev` cannot host the SDK Vite plugin, so the proxy runs beside it on the app
|
|
10
|
+
// port + 100 — the same origin app/page.tsx points installDevBridge at.
|
|
11
|
+
const server = await startDevAuthProxy({ projectDir, port: {{PORT}} + 100 });
|
|
12
|
+
|
|
13
|
+
// Without DEV_SECRET / API_BASE_URL there is nothing to serve — exit and let the dev server run
|
|
14
|
+
// on its own, matching how the SDK Vite plugin disables itself.
|
|
15
|
+
if (!server) {
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|