@roughapp/feature 0.1.0 → 0.2.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/CHANGELOG.md ADDED
@@ -0,0 +1,160 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@roughapp/feature`.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+ This package is pre-1.0, so a minor version bump can contain breaking changes.
7
+
8
+ ## 0.2.1 - 2026-08-05
9
+
10
+ Add `CHANGELOG.md` to the published package.
11
+
12
+ ## 0.2.0 - 2026-08-05
13
+
14
+ **Upgrade from 0.1.0 as soon as you can.** Every read and write 0.1.0 performs
15
+ goes through gateway REST routes that are being deleted. When that lands, a
16
+ 0.1.0 install can no longer list, create, build or publish features. 0.2.0 does
17
+ not call any of those routes.
18
+
19
+ Upgrading needs no configuration change. `initRough` takes the same
20
+ `projectId`, `fetchUserToken` and optional `baseUrl` it always did, and no
21
+ export was added or removed. The work is in the type and theme changes below.
22
+
23
+ ### Changed
24
+
25
+ - **Breaking: sprite, surface and ping traffic now syncs through Replicache
26
+ instead of the REST API.** 0.1.0 called ten routes under
27
+ `/api/v1/project/{projectId}/` to list sprites, fetch a sprite, list and
28
+ create builds, read a build and its logs, publish, register a surface and
29
+ ping. 0.2.0 calls none of them. It syncs over
30
+ `/api/v1/internal/replicache/pull` and `/api/v1/internal/replicache/push`,
31
+ and the session token exchange at `/api/v1/project/{projectId}/session-token`
32
+ is the only other request it makes. The ten legacy routes are removed in
33
+ [#2181](https://github.com/build-great-products/rough.app/pull/2181), which
34
+ is what makes this upgrade time sensitive.
35
+
36
+ One consequence worth planning for: the SDK now keeps a sync loop open and
37
+ polls for changes every 5 seconds for as long as the page is mounted, where
38
+ 0.1.0 issued one request per call and then went quiet.
39
+
40
+ - **Breaking: `Sprite` and `SpriteBuild` reference related records by ID
41
+ instead of nesting them.**
42
+
43
+ ```ts
44
+ // 0.1.0
45
+ type Sprite = {
46
+ id: string
47
+ name: string
48
+ ownedByPersonId: string
49
+ publishedSpriteBuild: SpriteBuild | null // full nested record
50
+ }
51
+ type SpriteBuild = {
52
+ createdByPerson: { id: string; name: string }
53
+ // ...
54
+ }
55
+
56
+ // 0.2.0
57
+ type Sprite = {
58
+ id: SpriteId
59
+ name: string
60
+ ownedByPersonId: PersonId
61
+ publishedSpriteBuildId: SpriteBuildId | null // ID only
62
+ }
63
+ type SpriteBuild = {
64
+ createdByPersonId: PersonId
65
+ // ...
66
+ }
67
+ ```
68
+
69
+ Anything reading `sprite.publishedSpriteBuild.artifactUrl`,
70
+ `.status` or `.prompt` off a `getRoughFeatures` result must be reworked, and
71
+ `SpriteBuild` no longer carries the build author's display name. There is no
72
+ replacement for that name in the public API.
73
+
74
+ - **Breaking: ID fields are branded string types.** `SpriteId`,
75
+ `SpriteBuildId`, `SurfaceId` and `PersonId` are now `string & { __brand: … }`
76
+ rather than `string`, on `RoughFeature`'s `featureId` and `buildId`,
77
+ `RoughCreateModal`'s and `SpriteBuildMenu`'s `surfaceId`, `SpriteFrame`'s
78
+ `spriteBuildId`, and `registerSurfaceEntry`'s `surfaceId`.
79
+
80
+ Reading is unaffected, because a branded string is still assignable to
81
+ `string`. Passing one in is not: an ID you hold as a plain `string`, from
82
+ your own database or a URL parameter, is rejected. The brand types are not
83
+ themselves exported, so reach them through the types that are:
84
+
85
+ ```ts
86
+ type SpriteId = Sprite['id']
87
+ type SpriteBuildId = NonNullable<Sprite['publishedSpriteBuildId']>
88
+ type SurfaceId = RoughCreateModalElement['surfaceId']
89
+ ```
90
+
91
+ IDs that flow straight out of `getRoughFeatures` into a component still
92
+ typecheck with no cast.
93
+
94
+ - **Breaking: the stylesheet ships a different set of design tokens.** The
95
+ Solarized palette was replaced with a ShadCN-style token set, so any host
96
+ theming Rough through CSS custom properties needs to remap. These eight are
97
+ gone, with their nearest replacement:
98
+
99
+ | Removed in 0.2.0 | Closest 0.2.0 token |
100
+ | ------------------------- | ---------------------------------------------- |
101
+ | `--rough-text` | `--rough-foreground` |
102
+ | `--rough-text-secondary` | `--rough-muted-foreground` |
103
+ | `--rough-surface` | `--rough-card` |
104
+ | `--rough-surface-border` | `--rough-border` |
105
+ | `--rough-background-muted` | `--rough-muted` |
106
+ | `--rough-danger` | `--rough-destructive` |
107
+ | `--rough-shadow` | `--rough-shadow-xs`, `-md`, `-lg` |
108
+ | `--rough-accent-secondary` | no equivalent; `--rough-brand` is the saturated brand colour |
109
+
110
+ Watch `--rough-accent` in particular. The name survived but the meaning did
111
+ not: it was the primary action colour (Solarized blue) and is now the subtle
112
+ hover background that ShadCN uses the name for. A host that set it to their
113
+ brand colour to tint buttons will find it tinting hover states instead.
114
+ `--rough-primary` is the token that now drives primary actions.
115
+ `--rough-background` and `--rough-border` also kept their names with new
116
+ values. Twenty-eight tokens were added, including a `--rough-radius` scale
117
+ and `--rough-success` variants.
118
+
119
+ - **`getRoughFeatures` is a live subscription rather than a one-shot fetch.**
120
+ In 0.1.0 the callback fired once and only fired again when something called
121
+ `triggerRefresh`. It now re-fires on every relevant change that syncs in, so
122
+ a feature published in another tab or by another user appears without the
123
+ host doing anything.
124
+
125
+ - **A feature becomes visible on a published build rather than on a built
126
+ artifact.** 0.1.0 listed a sprite only if its published build had an
127
+ `artifactUrl`; 0.2.0 lists it as soon as a build is marked published. A
128
+ published build with no artifact, which should not normally occur, now
129
+ reaches the host and renders an empty frame instead of being filtered out.
130
+
131
+ - The bundle is roughly three times larger, because the Replicache client is
132
+ compiled into it: `index.js` goes from 105 kB to 320 kB raw, 27 kB to 77 kB
133
+ gzipped. The stylesheet grows from 324 B to 5.2 kB with the larger token set.
134
+
135
+ - The declared `svelte` dependency range moves from `^5.56.4` to `^5.56.8`.
136
+ Every other runtime dependency is unchanged, `capnweb` included, so the
137
+ version compatibility required between the two ends of the iframe bridge has
138
+ not moved.
139
+
140
+ ### Removed
141
+
142
+ - **`onpublish` is gone from `RoughCreateModal`, `RoughEditButton` and
143
+ `RoughEditModal`.** Because `getRoughFeatures` is now a live subscription, a
144
+ publish already reaches the host through that callback, which is what the
145
+ prop existed to signal. Move any publish handling into the
146
+ `getRoughFeatures` callback. Note that the prop was optional, so depending on
147
+ your setup this may fail quietly rather than at compile time.
148
+
149
+ - **`triggerRefresh` is gone from the `SurfaceEntry` passed to
150
+ `registerSurfaceEntry`.** It was the manual refresh hook for the old
151
+ fetch-once model and has nothing to do now. Delete it from the object you
152
+ pass in; leaving it there is an excess property and will be rejected.
153
+
154
+ ### Added
155
+
156
+ - A light and dark mode toggle in the Feature Builder. The stylesheet now
157
+ carries a `.rough-dark` class holding the dark values for every token.
158
+ - The Feature Builder's build log now reports token usage and estimated cost
159
+ per agent step, formatted in cents below one dollar
160
+ ([#2187](https://github.com/build-great-products/rough.app/pull/2187)).