create-bridgething 0.14.0 → 0.15.0

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 CHANGED
@@ -1,13 +1,16 @@
1
1
  # create-bridgething
2
2
 
3
- Scaffold a [bridgething](https://github.com/JoeyEamigh/bridgething) webapp for
4
- the Spotify Car Thing: React, Vite, Tailwind v4, and
5
- [`@bridgething/client`](https://www.npmjs.com/package/@bridgething/client).
3
+ Scaffold a [bridgething](https://github.com/JoeyEamigh/bridgething) app source
4
+ for the Spotify Car Thing: a GitHub repo of webapps (React, Vite, Tailwind v4,
5
+ [`@bridgething/client`](https://www.npmjs.com/package/@bridgething/client)) that
6
+ publishes a store catalog to GitHub Pages.
6
7
 
7
8
  ```sh
8
- bun create bridgething my-app
9
+ bun create bridgething my-apps
9
10
  ```
10
11
 
12
+ Run it again inside the source to add another app.
13
+
11
14
  | flag | what you get |
12
15
  | -------------- | --------------------------------------------- |
13
16
  | `--launcher` | A replacement home screen |
@@ -18,9 +21,9 @@ bun create bridgething my-app
18
21
 
19
22
  `--extension` combines with `--launcher`, `--overlay`, or a plain webapp.
20
23
 
21
- The project ships `bun run dev`, `build`, `push` (install on a connected Car
22
- Thing), `share` (zip for the store), and `update` (bring the device to the
23
- latest release).
24
+ The source ships `bun run dev`, `push` (install on a connected Car Thing),
25
+ `share` (zip to hand to someone directly), `bump`, `check`, and `submit` (list
26
+ the source in the bridgething store). Pushing to main publishes the catalog.
24
27
 
25
28
  - Docs: <https://bridgething.com/docs>
26
29
  - Source: <https://github.com/JoeyEamigh/bridgething>
package/dist/index.mjs CHANGED
@@ -133,6 +133,7 @@ const TEMPLATE_DIR = join(PACKAGE_ROOT, "template");
133
133
  const SOURCE_TEMPLATE_DIR = join(PACKAGE_ROOT, "template-source");
134
134
  const SKILL_IN_APP = join(".claude", "skills", "bridgething");
135
135
  const SDK_VERSIONS = readJson(join(PACKAGE_ROOT, "template-versions.json"));
136
+ const OWN = readJson(join(PACKAGE_ROOT, "package.json"));
136
137
  const EXTENSION = {
137
138
  dir: "template-extension",
138
139
  manifest: {
@@ -366,7 +367,14 @@ function scaffoldApp(root, spec) {
366
367
  function linkAgentGuides(root, appDir) {
367
368
  const rootSkill = join(root, SKILL_IN_APP);
368
369
  const appSkill = join(appDir, SKILL_IN_APP);
369
- if (!existsSync(rootSkill)) move(appSkill, rootSkill);
370
+ if (!existsSync(rootSkill)) {
371
+ move(appSkill, rootSkill);
372
+ writeJson(join(rootSkill, ".source.json"), {
373
+ package: OWN.name,
374
+ version: OWN.version,
375
+ fetched_at: (/* @__PURE__ */ new Date()).toISOString()
376
+ });
377
+ }
370
378
  linkOrCopy(relative(dirname(appSkill), rootSkill), appSkill, rootSkill);
371
379
  for (const link of [join(root, "AGENTS.md"), join(appDir, "AGENTS.md")]) {
372
380
  if (existsSync(link) || !existsSync(join(dirname(link), "CLAUDE.md"))) continue;
@@ -479,7 +487,7 @@ Done. ${target}
479
487
  Fill in the description in apps/${details.app}/public/manifest.json.
480
488
 
481
489
  Push to ${repoUrl}, then in Settings > Pages set the branch to gh-pages, folder / (root).
482
- Your catalog ends up at at ${base}/catalog.v1.json, which you can submit to the bridgething store.
490
+ Your catalog ends up at ${base}/catalog.v1.json. Once it loads, "bun run submit" lists it in the bridgething store.
483
491
 
484
492
  bun run new <slug> add another app to this source
485
493
  bun run bump ${details.app} [version]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bridgething",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "description": "Scaffold a bridgething app source: webapps for the Spotify Car Thing, published as a catalog.v1 on GitHub Pages.",
6
6
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bridgething
3
- description: Build, run, and ship a bridgething webapp for the Spotify Car Thing. Use for @bridgething/client calls (now-playing, transport, artwork, storage, user settings, networking, every surface), running the dev server and driving the 800x480 screen and its physical controls, pushing the built app to a device or packaging a shareable zip, and writing the desktop-side Deno extension a webapp can ship.
3
+ description: Build, run, and ship a bridgething webapp for the Spotify Car Thing. Use for @bridgething/client calls (now-playing, transport, artwork, storage, user settings, networking, every surface), running the dev server and driving the 800x480 screen and its physical controls, pushing the built app to a device, packaging a shareable zip, or publishing and listing it in the bridgething store, and writing the desktop-side Deno extension a webapp can ship.
4
4
  ---
5
5
 
6
6
  # Building a bridgething webapp
@@ -11,8 +11,8 @@ description: Build, run, and ship a bridgething webapp for the Spotify Car Thing
11
11
  - Running the app, screenshotting the 800x480 screen, and pressing the physical
12
12
  controls locally and over CDP on the device:
13
13
  [reference/develop.md](reference/develop.md)
14
- - Installing onto a connected Car Thing, packaging a zip, and updating the
15
- device: [reference/ship.md](reference/ship.md)
14
+ - Installing onto a connected Car Thing, packaging a zip, publishing to the
15
+ store, and updating the device: [reference/ship.md](reference/ship.md)
16
16
  - The desktop-side Deno extension, its `ctx` contract, and its permission model,
17
17
  when the project has an `extension/` directory:
18
18
  [reference/extension.md](reference/extension.md)
@@ -31,6 +31,26 @@ Anyone with a bridgething Car Thing installs that zip from the companion app.
31
31
 
32
32
  Raise `version` in `public/manifest.json` before you share an update. Keep `id`.
33
33
 
34
+ ## Publish to the store
35
+
36
+ From the repo root, `bun run bump <slug> <major | minor | patch>` moves the
37
+ version, then a push to main runs the publish workflow. It builds every new
38
+ version into `catalog.v1.json` on the `gh-pages` branch. GitHub Pages has to
39
+ serve that branch from `/ (root)` (repo Settings > Pages), and the catalog lands
40
+ at `base_url` from `source.json` plus `/catalog.v1.json`.
41
+
42
+ Until the source is submitted, the store does not show it, and only people who
43
+ paste that URL into the companion app can install from it. Once the first
44
+ publish is live and the catalog URL loads, ask the user whether they want it in
45
+ the bridgething store. A listing is public, so submit only on a yes:
46
+
47
+ ```bash
48
+ bun run submit # lists the source, or refreshes an existing listing
49
+ ```
50
+
51
+ The store rechecks every listed source on its own, so later versions appear
52
+ without another submit. Run it again to pick one up right away.
53
+
34
54
  ## Keep the device on the latest bridgething
35
55
 
36
56
  ```bash
@@ -36,7 +36,7 @@ Now-playing and library data come from the phone's Spotify, so render a placehol
36
36
 
37
37
  Every surface: `player asset config store doc blob capabilities library audio notifications phone peer geo net hardware bluetooth system time voice lyrics webapp forward`. Each method is an event, a request, or a command.
38
38
 
39
- Methods, types, and examples: `.claude/skills/bridgething/reference/sdk.md`. That skill lives once at the repo root and every app symlinks it, so it is one copy for the whole workspace. `bun run skills` refreshes it from the published `create-bridgething`; `bun run check` says when it is behind.
39
+ Methods, types, and examples: `.claude/skills/bridgething/reference/sdk.md`. That skill lives once at the repo root and every app symlinks it, so it is one copy for the whole workspace. `bun run skills` refreshes it from the published `create-bridgething`; it and `bun run check` say when the skill is behind, when `@bridgething/source` is older than the skill expects, and when `package.json` lacks a script the skill uses.
40
40
 
41
41
  ## Working on one app
42
42
 
@@ -54,7 +54,7 @@ bun run --cwd apps/<slug> update # brings the device to the latest bridget
54
54
 
55
55
  An app with a variant or an extension carries its own `apps/<slug>/CLAUDE.md` with the parts specific to it.
56
56
 
57
- Running and driving the app: `.claude/skills/bridgething/reference/develop.md`. Push, zip, update: `.claude/skills/bridgething/reference/ship.md`. The desktop-side Deno extension and its permission model, for an app with an `extension/` directory: `.claude/skills/bridgething/reference/extension.md`.
57
+ Running and driving the app: `.claude/skills/bridgething/reference/develop.md`. Push, zip, publish to the store, update: `.claude/skills/bridgething/reference/ship.md`. The desktop-side Deno extension and its permission model, for an app with an `extension/` directory: `.claude/skills/bridgething/reference/extension.md`.
58
58
 
59
59
  ## The three files that describe an app
60
60
 
@@ -92,6 +92,8 @@ bun run check
92
92
 
93
93
  Pushing to main publishes. `bun run publish --dry-run` assembles the exact bytes that would be pushed, into `site/`, without pushing.
94
94
 
95
+ The store only shows a source that has been submitted to it. Once the first publish is live, ask the user whether they want it in the bridgething store, and run `bun run submit` only on a yes, because a listing is public. The store rechecks listed sources on its own, so a later version needs no second submit.
96
+
95
97
  ## Publishing rules that are not negotiable
96
98
 
97
99
  - **A published version is immutable.** `published.json` on the `gh-pages` branch records the sha256 clients verify against. Changing an app means a new version, always. `check` fails a pull request that changed an app without bumping it.
@@ -9,7 +9,7 @@ Webapps for the Spotify Car Thing running [bridgething](https://bridgething.com)
9
9
  1. Push this repo to `https://github.com/__REPO_OWNER__/__REPO_NAME__`.
10
10
  2. In **Settings > Pages**, set the source to **Deploy from a branch**, branch `gh-pages`, folder `/ (root)`.
11
11
 
12
- The catalog is published to `__BASE_URL__/catalog.v1.json`, which can be submitted to <bridgething.com/apps>
12
+ The catalog is published to `__BASE_URL__/catalog.v1.json`. Once it loads, `bun run submit` lists it in the [bridgething store](https://bridgething.com/apps).
13
13
 
14
14
  ## Develop
15
15
 
@@ -45,7 +45,7 @@ bun run bump __APP_SLUG__ patch -m "Fix the wind direction arrow"
45
45
  git commit -am "__APP_SLUG__: fix the wind direction arrow" && git push
46
46
  ```
47
47
 
48
- Pushing to main builds the apps and regenerates the catalog.
48
+ Pushing to main builds the apps and regenerates the catalog. The store rechecks listed sources on its own; `bun run submit` refreshes right away.
49
49
 
50
50
  ## Agent skill
51
51
 
@@ -53,5 +53,5 @@ Pushing to main builds the apps and regenerates the catalog.
53
53
 
54
54
  ```sh
55
55
  bun run skills # refresh it from the published create-bridgething
56
- bun run skills --check # check whether it is behind
56
+ bun run skills --check # check whether it, the toolkit, or the scripts it uses are behind
57
57
  ```
@@ -17,6 +17,7 @@
17
17
  "shot": "bridgething-source shot",
18
18
  "catalog": "bridgething-source catalog",
19
19
  "publish": "bridgething-source publish",
20
+ "submit": "bridgething-source submit",
20
21
  "skills": "bridgething-source skills",
21
22
  "format": "prettier --write \"*.json\" \"*.js\""
22
23
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@bridgething/client": "^0.14.0",
3
3
  "@bridgething/extension": "^0.14.0",
4
- "@bridgething/source": "^0.14.0",
5
- "libbridgething": "0.14.0"
4
+ "@bridgething/source": "^0.15.0",
5
+ "libbridgething": "0.14.1"
6
6
  }