Skip to content

Commit 9fb99cd

Browse files
Add Svelte wrapper and configure() no-op bail
Completes the workspace restructure (file moves landed in the previous commit) with the substantive changes: - @hyperplexed/bubbles-svelte (packages/svelte): declarative <Bubbles>/ <Bubble> components over the core manager. <Bubbles> owns the manager (props -> configure(), destroy on unmount, reactive state/active via getBubbles()); <Bubble> maps presence to add()/remove() and prop changes to in-place re-adds. Snippets mount through a host with getAllContexts() propagated and $state-backed props, so app context flows in and content stays reactive. Published to npm as 0.1.0. - Core: configure() bails when the resolved options are unchanged (sameOptions comparator), so props-driven consumers can call it every render for free. Documented as a guarantee; comparator tests added. - Workspace plumbing: root package.json/tsconfig/vite.config aliases resolve @hyperplexed/bubbles and $src to live sources; packages/core gains its own package.json/tsconfig; publish.yml publishes both packages; e2e configs repointed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ebc274d commit 9fb99cd

30 files changed

Lines changed: 1113 additions & 348 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
# Guards the published artifact: SSR frameworks (Vite SSR, Next)
1919
# load externalized deps through Node's resolver, so the build
2020
# must import cleanly outside a bundler.
21-
- name: Verify dist resolves under Node ESM
22-
run: node --input-type=module -e "await import('./dist/index.js')"
21+
- name: Verify core dist resolves under Node ESM
22+
run: node --input-type=module -e "await import('./packages/core/dist/index.js')"
2323

2424
# Browser tests for the interaction choreography (drag, dismiss, tap-away,
2525
# focus) that the happy-dom unit tests can't reach. Separate job so a

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ jobs:
3535
- run: bun run test
3636
- run: bun run build
3737
- run: npm publish --provenance --access public
38+
working-directory: packages/core
39+
# @hyperplexed/bubbles-svelte. Requires its own npm Trusted Publishing
40+
# config (set per-package on npmjs.com) plus a manual first publish to
41+
# create the package — OIDC can't publish a package's initial version.
42+
- run: npm publish --provenance --access public
43+
working-directory: packages/svelte

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules/
22
dist/
3+
.svelte-kit/
34
*.log
45
.claude/
56
dist-site/

README.md

Lines changed: 14 additions & 270 deletions
Large diffs are not rendered by default.

bun.lock

Lines changed: 43 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/RELEASING.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ context needed.
55

66
## Identity
77

8-
- **Package:** `@hyperplexed/bubbles` (scoped, public)
8+
- **Package:** `@hyperplexed/bubbles` (scoped, public), living at `packages/core` of a
9+
bun workspace. (`packages/svelte` holds `@hyperplexed/bubbles-svelte`, not yet wired
10+
into the publish workflow — see the note at the bottom.)
911
- **Repo:** https://github.com/githyperplexed/bubbles
10-
- **Versioning:** pre-`1.0`. Additive changes are minor bumps; the `CHANGELOG.md`
11-
category (`Added` / `Changed` / `Fixed`) is the source of truth for what a release contains.
12+
- **Versioning:** pre-`1.0`. Additive changes are minor bumps; the
13+
`packages/core/CHANGELOG.md` category (`Added` / `Changed` / `Fixed`) is the source of
14+
truth for what a release contains.
1215
- **Current state:** check `npm view @hyperplexed/bubbles version` for the published
13-
`latest`, and `package.json`'s `version` for what's staged locally. These can differ —
16+
`latest`, and `packages/core/package.json`'s `version` for what's staged locally. These can differ —
1417
a version bump committed to `main` is **not** published until a GitHub Release is cut
1518
(see below).
1619
- **Toolchain:** Bun (package manager + script runner), Vite, TypeScript, vitest.
@@ -43,14 +46,14 @@ Consequences:
4346
bun install
4447
bun run check # svelte-check, 0 errors
4548
bun run test # vitest
46-
bun run build # tsc → dist/ ; must succeed
47-
node --input-type=module -e "await import('./dist/index.js')" # dist resolves under bare Node ESM
49+
bun run build # builds every package's dist/ ; must succeed
50+
node --input-type=module -e "await import('./packages/core/dist/index.js')" # dist resolves under bare Node ESM
4851
```
4952

50-
2. **Bump the version** in `package.json` (`version` field) to the target, e.g. `0.4.1` or
51-
`0.5.0`.
53+
2. **Bump the version** in `packages/core/package.json` (`version` field) to the target,
54+
e.g. `0.4.1` or `0.5.0`.
5255

53-
3. **Promote the changelog** in `CHANGELOG.md`: rename `## [Unreleased]` to
56+
3. **Promote the changelog** in `packages/core/CHANGELOG.md`: rename `## [Unreleased]` to
5457
`## [X.Y.Z] - <date>` and add a fresh empty `## [Unreleased]` above it. Format is
5558
[Keep a Changelog](https://keepachangelog.com/).
5659

@@ -60,7 +63,7 @@ Consequences:
6063
5. **Commit, tag, push** — the tag must point at the commit carrying the bumped version:
6164

6265
```sh
63-
git add package.json CHANGELOG.md bun.lock
66+
git add packages/core/package.json packages/core/CHANGELOG.md bun.lock
6467
git commit -m "Release X.Y.Z"
6568
git tag -a vX.Y.Z -m "vX.Y.Z"
6669
git push origin main
@@ -86,23 +89,30 @@ Consequences:
8689
- **`.github/workflows/publish.yml`**`on: release: published`, with `id-token: write`.
8790
Checkout → setup Bun → setup Node 24 → `npm install -g npm@latest` (Trusted Publishing
8891
needs npm 11.5.1+) → `bun install --frozen-lockfile``bun run test``bun run build`
89-
`npm publish --provenance --access public`.
92+
`npm publish --provenance --access public` from `packages/core`.
9093
- **`.github/workflows/ci.yml`**`on: push (main)` and `pull_request`. Runs
91-
`check``test``build`, then verifies `dist/index.js` imports cleanly under bare Node
92-
ESM (guards SSR consumers).
93-
- **`package.json` `prepublishOnly`**`bun run test && bun run build`, a backstop.
94+
`check``test``build`, then verifies `packages/core/dist/index.js` imports cleanly
95+
under bare Node ESM (guards SSR consumers).
96+
- **each package's `prepublishOnly`** — re-runs the root `check` + `test` gate and its own
97+
build, a backstop for any publish path that skips the workflow.
9498

9599
## Gotchas
96100

97101
- **Tag push ≠ publish.** You must create the GitHub Release.
98102
- **`package.json` `version` must match the tag** — the workflow publishes whatever version
99103
is in the checked-out tag.
100104
- **Lockfile must be in sync**, or `--frozen-lockfile` aborts the run.
101-
- **Only `dist/` is published** (`files: ["dist"]`); `src/` and the playground are not.
105+
- **Only a package's `files` list is published** (`dist/` plus non-test `src/`); the
106+
playground and e2e tests never ship.
102107
- **A published version can't be overwritten.** If a release is botched, bump to the next
103108
patch — npm forbids re-publishing the same version.
104109
- **If `npm publish` fails on auth/OIDC in the workflow**, the npm Trusted Publisher config
105110
on npmjs.com doesn't match this repo + workflow. Fix it in the package settings on
106111
npmjs.com (web UI) — it isn't controlled by the workflow or local environment.
107112
- On Windows, Git's `LF will be replaced by CRLF` warnings on `bun.lock` / `package.json`
108113
are harmless.
114+
- **`@hyperplexed/bubbles-svelte` is not published yet.** Before its first release: create
115+
the package on npmjs.com with a Trusted Publisher config matching this repo + workflow,
116+
then uncomment its publish step in `publish.yml`. Its `dependencies` pin
117+
`@hyperplexed/bubbles` by semver range (not `workspace:`), so `npm publish` needs no
118+
rewriting.

package.json

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,22 @@
11
{
2-
"name": "@hyperplexed/bubbles",
3-
"version": "0.8.1",
4-
"description": "Android-style app bubbles for the web — floating, draggable, expandable overlay bubbles",
5-
"author": "Hyperplexed",
6-
"repository": {
7-
"type": "git",
8-
"url": "git+https://github.com/githyperplexed/bubbles.git"
9-
},
10-
"homepage": "https://bubbles.hyperplexed.io",
11-
"bugs": "https://github.com/githyperplexed/bubbles/issues",
2+
"name": "bubbles-workspace",
3+
"private": true,
4+
"description": "Workspace root for @hyperplexed/bubbles — packages, playground site, and e2e tests",
125
"type": "module",
13-
"main": "./dist/index.js",
14-
"module": "./dist/index.js",
15-
"types": "./dist/index.d.ts",
16-
"exports": {
17-
".": {
18-
"types": "./dist/index.d.ts",
19-
"import": "./dist/index.js",
20-
"default": "./dist/index.js"
21-
}
22-
},
23-
"files": [
24-
"dist",
25-
"src",
26-
"!src/**/*.test.ts"
6+
"workspaces": [
7+
"packages/*"
278
],
28-
"sideEffects": false,
29-
"publishConfig": {
30-
"access": "public"
31-
},
329
"scripts": {
3310
"dev": "vite",
34-
"build": "rimraf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
11+
"build": "bun run --cwd packages/core build && bun run --cwd packages/svelte build",
3512
"build:site": "vite build",
3613
"test": "vitest run",
3714
"test:watch": "vitest",
3815
"test:e2e": "playwright test",
3916
"test:e2e:ui": "playwright test --ui",
4017
"check": "svelte-check --tsconfig ./tsconfig.json",
41-
"format": "prettier --write .",
42-
"prepublishOnly": "bun run check && bun run test && bun run build"
18+
"format": "prettier --write ."
4319
},
44-
"keywords": [
45-
"bubbles",
46-
"chat-heads",
47-
"floating",
48-
"overlay",
49-
"ui",
50-
"draggable",
51-
"widget",
52-
"vanilla",
53-
"typescript"
54-
],
5520
"license": "MIT",
5621
"engines": {
5722
"node": ">=18"
@@ -68,11 +33,9 @@
6833
"prettier": "^3.8.4",
6934
"prettier-plugin-svelte": "^4.1.0",
7035
"prettier-plugin-tailwindcss": "^0.8.0",
71-
"rimraf": "^6.1.3",
7236
"svelte": "^5.56.3",
7337
"svelte-check": "^4.6.0",
7438
"tailwindcss": "^4.3.0",
75-
"tsc-alias": "^1.8.17",
7639
"typescript": "^6.0.3",
7740
"vite": "^8.0.16",
7841
"vitest": "^4.1.8"

packages/core/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Hyperplexed
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)