create-bridgething 0.8.0 → 0.9.1
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/dist/index.mjs +0 -4
- package/package.json +1 -1
- package/template/package.json +1 -1
- package/template/scripts/push.ts +0 -4
- package/template/src/App.tsx +13 -14
- package/template/src/index.css +44 -13
package/dist/index.mjs
CHANGED
|
@@ -5,10 +5,6 @@ import { dirname, extname, join, resolve } from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { v7 } from "uuid";
|
|
7
7
|
//#region src/index.ts
|
|
8
|
-
//! `create-bridgething` - copy the bundled template into a new directory,
|
|
9
|
-
//! substitute the project name, print next steps. Opinionated stack:
|
|
10
|
-
//! React 19 + Vite + Tailwind v4 + TypeScript strict, plus
|
|
11
|
-
//! `@bridgething/client` preinstalled.
|
|
12
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
9
|
const TEMPLATE_DIR = resolve(__dirname, "..", "template");
|
|
14
10
|
const VARIANTS = {
|
package/package.json
CHANGED
package/template/package.json
CHANGED
package/template/scripts/push.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
// Build this webapp and install it onto a connected Car Thing, then make it
|
|
3
|
-
// visible: a plain app becomes active, a launcher takes the home-screen slot,
|
|
4
|
-
// an overlay takes the overlay slot. Run with --help for the flags.
|
|
5
|
-
//
|
|
6
2
|
// Generated from @bridgething/webapp-shared. It is yours now; tweak it freely.
|
|
7
3
|
import { decode as msgpackDecode, encode as msgpackEncode } from '@msgpack/msgpack';
|
|
8
4
|
import { spawn } from 'node:child_process';
|
package/template/src/App.tsx
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { BridgethingClient, type ConnectionState, type PlayerState } from '@bridgething/client';
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
|
|
4
|
-
// Production: the webapp is served by the daemon on the device, so a
|
|
5
|
-
// relative `ws://<location.host>/` reaches it. In dev (vite on your
|
|
6
|
-
// laptop) point at the device explicitly with VITE_BRIDGETHING_URL.
|
|
7
4
|
const wsUrl =
|
|
8
5
|
import.meta.env.VITE_BRIDGETHING_URL ??
|
|
9
6
|
(typeof window !== 'undefined' ? `ws://${window.location.host}/` : 'ws://127.0.0.1:8891/');
|
|
@@ -56,41 +53,43 @@ export default function App() {
|
|
|
56
53
|
const playing = state?.playback.state === 'playing';
|
|
57
54
|
|
|
58
55
|
return (
|
|
59
|
-
<div className="flex h-full w-full items-center justify-center gap-12 bg-
|
|
56
|
+
<div className="flex h-full w-full items-center justify-center gap-12 bg-bg p-12 text-off-white">
|
|
60
57
|
{artUrl ? (
|
|
61
|
-
<img src={artUrl} alt="" className="h-full max-h-96 w-auto
|
|
58
|
+
<img src={artUrl} alt="" className="h-full max-h-96 w-auto border border-rule" />
|
|
62
59
|
) : (
|
|
63
|
-
<div className="grid h-96 w-96 place-items-center
|
|
60
|
+
<div className="grid h-96 w-96 place-items-center border border-rule bg-screen font-mono text-body text-dim">
|
|
64
61
|
{conn === 'open' ? 'no track' : conn}
|
|
65
62
|
</div>
|
|
66
63
|
)}
|
|
67
64
|
<div className="flex flex-col gap-3">
|
|
68
|
-
<div className="text-
|
|
65
|
+
<div className="font-mono text-eyebrow tracking-[0.25em] text-dim uppercase">{conn}</div>
|
|
69
66
|
{track ? (
|
|
70
67
|
<>
|
|
71
|
-
<div className="text-3xl font-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
<div className="font-display text-3xl font-medium leading-tight tracking-display">
|
|
69
|
+
{track.title ?? 'unknown'}
|
|
70
|
+
</div>
|
|
71
|
+
<div className="text-xl text-soft">{track.artist ?? ''}</div>
|
|
72
|
+
<div className="font-mono text-hint text-dim">{track.album ?? ''}</div>
|
|
74
73
|
<div className="mt-6 flex gap-4">
|
|
75
74
|
<button
|
|
76
|
-
className="
|
|
75
|
+
className="border border-edge px-6 py-3 font-mono text-row text-near transition active:bg-neutral-soft"
|
|
77
76
|
onClick={() => client.player.skipPrev()}>
|
|
78
77
|
◀◀
|
|
79
78
|
</button>
|
|
80
79
|
<button
|
|
81
|
-
className="
|
|
80
|
+
className="border border-accent bg-accent px-6 py-3 font-mono text-row text-screen transition active:opacity-80"
|
|
82
81
|
onClick={() => (playing ? client.player.pause() : client.player.resume())}>
|
|
83
82
|
{playing ? '❚❚' : '▶'}
|
|
84
83
|
</button>
|
|
85
84
|
<button
|
|
86
|
-
className="
|
|
85
|
+
className="border border-edge px-6 py-3 font-mono text-row text-near transition active:bg-neutral-soft"
|
|
87
86
|
onClick={() => client.player.skipNext()}>
|
|
88
87
|
▶▶
|
|
89
88
|
</button>
|
|
90
89
|
</div>
|
|
91
90
|
</>
|
|
92
91
|
) : (
|
|
93
|
-
<div className="text-
|
|
92
|
+
<div className="text-title text-soft">connect a phone to see now playing</div>
|
|
94
93
|
)}
|
|
95
94
|
</div>
|
|
96
95
|
</div>
|
package/template/src/index.css
CHANGED
|
@@ -17,36 +17,67 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@theme {
|
|
20
|
-
--color-
|
|
21
|
-
--color-
|
|
22
|
-
--color-
|
|
23
|
-
--color-
|
|
20
|
+
--color-off-white: #efefef;
|
|
21
|
+
--color-bg: #0a0c0e;
|
|
22
|
+
--color-screen: #060809;
|
|
23
|
+
--color-fg: #efefef;
|
|
24
|
+
--color-muted: #a7adb5;
|
|
25
|
+
--color-accent: #00a8e8;
|
|
26
|
+
--color-ok: #3ddc84;
|
|
27
|
+
--color-err: #dc3d3d;
|
|
28
|
+
--color-warn: #ff7070;
|
|
29
|
+
--color-experimental: #ffb066;
|
|
30
|
+
|
|
31
|
+
--color-rule: color-mix(in srgb, var(--color-fg) 10%, transparent);
|
|
32
|
+
--color-rule-strong: color-mix(in srgb, var(--color-fg) 15%, transparent);
|
|
33
|
+
--color-edge: color-mix(in srgb, var(--color-fg) 25%, transparent);
|
|
34
|
+
--color-dim: color-mix(in srgb, var(--color-fg) 35%, transparent);
|
|
35
|
+
--color-soft: color-mix(in srgb, var(--color-fg) 55%, transparent);
|
|
36
|
+
--color-near: color-mix(in srgb, var(--color-fg) 80%, transparent);
|
|
37
|
+
|
|
38
|
+
--color-accent-soft: color-mix(in srgb, var(--color-accent) 14%, transparent);
|
|
39
|
+
--color-ok-soft: color-mix(in srgb, var(--color-ok) 14%, transparent);
|
|
40
|
+
--color-err-soft: color-mix(in srgb, var(--color-err) 14%, transparent);
|
|
41
|
+
--color-warn-soft: color-mix(in srgb, var(--color-warn) 14%, transparent);
|
|
42
|
+
--color-experimental-soft: color-mix(in srgb, var(--color-experimental) 14%, transparent);
|
|
43
|
+
--color-neutral-soft: color-mix(in srgb, var(--color-fg) 8%, transparent);
|
|
44
|
+
|
|
45
|
+
--text-eyebrow: 0.6875rem;
|
|
46
|
+
--text-hint: 0.75rem;
|
|
47
|
+
--text-body: 0.875rem;
|
|
48
|
+
--text-row: 0.9375rem;
|
|
49
|
+
--text-row-lg: 1.0625rem;
|
|
50
|
+
--text-title: 1.25rem;
|
|
51
|
+
--text-hero: 1.375rem;
|
|
52
|
+
--text-screen-title: 2.125rem;
|
|
24
53
|
|
|
25
54
|
--font-display: "Outfit", system-ui, sans-serif;
|
|
26
|
-
--font-
|
|
55
|
+
--font-body: "Inter", system-ui, sans-serif;
|
|
56
|
+
--font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
57
|
+
|
|
58
|
+
--tracking-wordmark: -0.03em;
|
|
59
|
+
--tracking-display: -0.02em;
|
|
60
|
+
--tracking-tight-1: -0.01em;
|
|
61
|
+
|
|
62
|
+
--radius-none: 0;
|
|
27
63
|
}
|
|
28
64
|
|
|
29
65
|
@layer base {
|
|
30
66
|
:root {
|
|
31
67
|
color-scheme: dark;
|
|
32
68
|
}
|
|
69
|
+
|
|
33
70
|
* {
|
|
34
71
|
-webkit-tap-highlight-color: transparent;
|
|
35
72
|
}
|
|
73
|
+
|
|
36
74
|
html,
|
|
37
75
|
body {
|
|
76
|
+
@apply bg-bg text-off-white font-body antialiased scheme-only-dark;
|
|
38
77
|
width: 800px;
|
|
39
78
|
height: 480px;
|
|
40
79
|
margin: 0;
|
|
41
80
|
overflow: hidden;
|
|
42
81
|
overscroll-behavior: none;
|
|
43
|
-
font-family: var(--font-sans);
|
|
44
|
-
background: var(--color-bt-charcoal);
|
|
45
|
-
color: var(--color-bt-off-white);
|
|
46
82
|
}
|
|
47
83
|
}
|
|
48
|
-
|
|
49
|
-
@utility bt-wordmark {
|
|
50
|
-
font-family: var(--font-display);
|
|
51
|
-
letter-spacing: -0.02em;
|
|
52
|
-
}
|