@fvc/utils 3.0.2 → 3.0.3-next-d4799a7fa99a8ef4e7e8adfc3793fd349346277e

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +288 -0
  2. package/package.json +3 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,288 @@
1
+ # @fvc/utils
2
+
3
+ ## 3.0.3-next-d4799a7fa99a8ef4e7e8adfc3793fd349346277e
4
+
5
+ ### Patch Changes
6
+
7
+ - 51a1a4c: Include `CHANGELOG.md` inside every published `@fvc/*` tarball.
8
+
9
+ Until this patch, `packages/<pkg>/package.json#files` only declared
10
+ `dist/lib/index.js`, `dist/lib/<pkg>`, and `package.json`, which
11
+ meant `npm pack` skipped the package's `CHANGELOG.md` even though
12
+ it is generated by Changesets at release time and lives at the
13
+ package root. Consumers had no way to read the changelog after
14
+ installing the package — they had to visit GitLab.
15
+
16
+ This patch adds `"CHANGELOG.md"` to every publishable package's
17
+ `files` array, including the scaffolder template
18
+ (`codegen/templates/component/package.json.hbs`) so new packages
19
+ inherit the setting from day one. After this ships, running
20
+ `npm view @fvc/<pkg>@<latest>` returns a tarball whose manifest
21
+ includes `CHANGELOG.md`, and `cat node_modules/@fvc/<pkg>/CHANGELOG.md`
22
+ on the consumer side returns the changelog content directly.
23
+
24
+ No component source changes. This is metadata-only, but it is a
25
+ patch bump on every package because the published-tarball contents
26
+ change — a deliberately conservative semver choice for a release
27
+ that materially affects what consumers receive on `npm install`.
28
+
29
+ ## 3.0.2
30
+
31
+ ### Patch Changes
32
+
33
+ - e601138: readme changes
34
+ - cd80d11: readme and keywords file
35
+
36
+ ## 3.0.2-rc.1
37
+
38
+ ### Patch Changes
39
+
40
+ - e601138: readme changes
41
+
42
+ ## 3.0.2-rc.0
43
+
44
+ ### Patch Changes
45
+
46
+ - cd80d11: readme and keywords file
47
+
48
+ ## 3.0.1
49
+
50
+ ### Patch Changes
51
+
52
+ - f176af2: Clean up stale pre-release suffix from @fvc/\* peer dependency ranges
53
+
54
+ The v3.0.0 release shipped to npm with peer dependency ranges still
55
+ carrying the `-rc.0` pre-release suffix from the release branch's
56
+ pre-mode bump. Concretely, `@fvc/card@3.0.0`'s manifest on npm
57
+ @latest declared:
58
+
59
+ ```json
60
+ "peerDependencies": {
61
+ "@fvc/utils": "^3.0.0-rc.0",
62
+ "@fvc/typography": "^3.0.0-rc.0"
63
+ }
64
+ ```
65
+
66
+ Root cause is the interaction between Changesets' exit-mode behaviour
67
+ and the `onlyUpdatePeerDependentsWhenOutOfRange` experimental flag,
68
+ which we had set to `true`. Inside `@changesets/apply-release-plan`'s
69
+ `shouldUpdateDependencyBasedOnConfig`:
70
+
71
+ ```js
72
+ if (!semverSatisfies(release.version, depVersionRange)) {
73
+ // out of range → always update
74
+ return true;
75
+ }
76
+ if (depType === 'peerDependencies') {
77
+ shouldUpdate = !onlyUpdatePeerDependentsWhenOutOfRange;
78
+ }
79
+ ```
80
+
81
+ In exit mode `utils` goes from `3.0.0-rc.0` to `3.0.0`. The
82
+ peer-range `^3.0.0-rc.0` still semver-satisfies `3.0.0` (rc.0 sorts
83
+ before stable per semver), so the `out-of-range` branch is skipped.
84
+ With the flag set to `true`, `shouldUpdate` collapses to `false`
85
+ and peer ranges are intentionally left untouched. The package then
86
+ ships to @latest with a stale pre-release range.
87
+
88
+ This is not a Changesets bug — the library is correctly honouring
89
+ its configured behaviour — but the combination is wrong for our
90
+ monorepo's lifecycle. This patch:
91
+ 1. Removes the `___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH`
92
+ block from `.changeset/config.json`, restoring Changesets' default
93
+ behaviour of updating internal peer-dep ranges on every bump of
94
+ the peer package. This eliminates the stale-suffix path
95
+ permanently: every future release of `@fvc/utils` (or any other
96
+ internal peer) will refresh its dependents' peer ranges
97
+ deterministically.
98
+ 2. Patch-bumps every package whose peer-deps need to be refreshed
99
+ on `@latest`: `utils` (driver of the cascade), plus `card`,
100
+ `input`, `provider`, and `typography` (the four packages whose
101
+ on-disk peer ranges still carry the `-rc.0` suffix from the
102
+ v3.0.0 cycle). When `prepare:latest` runs `bunx changeset
103
+ version` against this changeset under the new config, the
104
+ pre-release suffix is rewritten away as part of the normal
105
+ peer-range update path.
106
+
107
+ Trade-off accepted: every future bump of an internal peer (utils
108
+ in particular) will trigger a peer-range refresh in its dependents.
109
+ At our current scale (~5 internal-peer relationships) this is a
110
+ non-issue and produces tighter peer pinning, which is desirable for
111
+ a controlled monorepo. The alternative — a custom CI sanitiser
112
+ script — would have been a permanent workaround for a config we
113
+ were never supposed to set in the first place.
114
+
115
+ No source code in any package changes.
116
+
117
+ ## 3.0.0
118
+
119
+ ### Major Changes
120
+
121
+ - f3dcc20: Synthetic release-flow validation for the v3.0.0 cycle
122
+
123
+ Exercise the new master-side `prepare:latest` job end-to-end, with
124
+ emphasis on:
125
+ - The `changeset pre exit` step (the pre.json mode flip) on master,
126
+ which only fires when the merged release branch carries a
127
+ `pre.json` in `mode: "pre"`.
128
+ - The `changeset version` step in exit mode, which is supposed to
129
+ strip the `-rc.X` suffix from each affected package's `version`
130
+ field and from internal `@fvc/*` peer dependency ranges (the
131
+ latter is the Faz 2 candidate — this test will tell us whether
132
+ a sanitiser step is needed in `prepare:latest`).
133
+ - The peer-dependency cascade triggered by an out-of-range major
134
+ bump. `@fvc/utils` going from `2.0.0` to `3.0.0` is out of range
135
+ for every `^2.0.0` peer dep on it, so Changesets'
136
+ `onlyUpdatePeerDependentsWhenOutOfRange` flag should propagate
137
+ the major to every package that lists `@fvc/utils` as a peer.
138
+
139
+ No public API of `@fvc/utils` changes in this commit. The marker
140
+ comment in `packages/utils/src/index.ts` exists solely to satisfy
141
+ the `changeset:required` gate (which trips on `packages/**`
142
+ changes) and to provide a real, reviewable file change to
143
+ accompany the changeset.
144
+
145
+ ## 3.0.0-rc.0
146
+
147
+ ### Major Changes
148
+
149
+ - f3dcc20: Synthetic release-flow validation for the v3.0.0 cycle
150
+
151
+ Exercise the new master-side `prepare:latest` job end-to-end, with
152
+ emphasis on:
153
+ - The `changeset pre exit` step (the pre.json mode flip) on master,
154
+ which only fires when the merged release branch carries a
155
+ `pre.json` in `mode: "pre"`.
156
+ - The `changeset version` step in exit mode, which is supposed to
157
+ strip the `-rc.X` suffix from each affected package's `version`
158
+ field and from internal `@fvc/*` peer dependency ranges (the
159
+ latter is the Faz 2 candidate — this test will tell us whether
160
+ a sanitiser step is needed in `prepare:latest`).
161
+ - The peer-dependency cascade triggered by an out-of-range major
162
+ bump. `@fvc/utils` going from `2.0.0` to `3.0.0` is out of range
163
+ for every `^2.0.0` peer dep on it, so Changesets'
164
+ `onlyUpdatePeerDependentsWhenOutOfRange` flag should propagate
165
+ the major to every package that lists `@fvc/utils` as a peer.
166
+
167
+ No public API of `@fvc/utils` changes in this commit. The marker
168
+ comment in `packages/utils/src/index.ts` exists solely to satisfy
169
+ the `changeset:required` gate (which trips on `packages/**`
170
+ changes) and to provide a real, reviewable file change to
171
+ accompany the changeset.
172
+
173
+ ## 2.0.0
174
+
175
+ ### Major Changes
176
+
177
+ - 45936ec: **BREAKING**: `clamp` now accepts a single options object instead of three
178
+ positional arguments.
179
+
180
+ **Why**: Named arguments remove the "which order are min and max in?"
181
+ guessing that positional calls require, and the new exported `ClampOptions`
182
+ type gives consumers a stable surface to extend (e.g. for future
183
+ `precision`, `inclusive`, or unit options) without another breaking change
184
+ later. Positional signatures are also harder to read at call sites where
185
+ all three arguments are numeric literals.
186
+
187
+ **Migration**: replace every positional call with an options-object call.
188
+
189
+ ```ts
190
+ // Before
191
+ import { clamp } from '@fvc/utils';
192
+
193
+ clamp(5, 0, 10); // -> 5
194
+ clamp(-100, -10, 10); // -> -10
195
+ clamp(15, 0, 10); // -> 10
196
+
197
+ // After
198
+ import { clamp } from '@fvc/utils';
199
+
200
+ clamp({ value: 5, min: 0, max: 10 }); // -> 5
201
+ clamp({ value: -100, min: -10, max: 10 }); // -> -10
202
+ clamp({ value: 15, min: 0, max: 10 }); // -> 10
203
+ ```
204
+
205
+ If you wrap `clamp` in a helper, the new `ClampOptions` type is exported
206
+ from `@fvc/utils` for the wrapper's argument type:
207
+
208
+ ```ts
209
+ import { clamp, type ClampOptions } from '@fvc/utils';
210
+
211
+ export const clampOpacity = (value: number): number =>
212
+ clamp({ value, min: 0, max: 1 });
213
+
214
+ export const wrapClamp = (opts: ClampOptions): number => clamp(opts);
215
+ ```
216
+
217
+ Throw behaviour is unchanged: passing `min > max` still throws
218
+ `Error("clamp: min cannot be greater than max")`.
219
+
220
+ ### Minor Changes
221
+
222
+ - 0d71f57: Add clamp utility that constrains a number between a minimum and maximum bound
223
+
224
+ ### Patch Changes
225
+
226
+ - e0a3c27: Tighten isNumeric type safety: explicit boolean return, null/undefined guard, no as cast
227
+ - 2f5263f: Add explicit return type annotation to cssVarResolver for type safety
228
+
229
+ ## 2.0.0-rc.1
230
+
231
+ ### Patch Changes
232
+
233
+ - 2f5263f: Add explicit return type annotation to cssVarResolver for type safety
234
+
235
+ ## 2.0.0-rc.0
236
+
237
+ ### Major Changes
238
+
239
+ - 45936ec: **BREAKING**: `clamp` now accepts a single options object instead of three
240
+ positional arguments.
241
+
242
+ **Why**: Named arguments remove the "which order are min and max in?"
243
+ guessing that positional calls require, and the new exported `ClampOptions`
244
+ type gives consumers a stable surface to extend (e.g. for future
245
+ `precision`, `inclusive`, or unit options) without another breaking change
246
+ later. Positional signatures are also harder to read at call sites where
247
+ all three arguments are numeric literals.
248
+
249
+ **Migration**: replace every positional call with an options-object call.
250
+
251
+ ```ts
252
+ // Before
253
+ import { clamp } from '@fvc/utils';
254
+
255
+ clamp(5, 0, 10); // -> 5
256
+ clamp(-100, -10, 10); // -> -10
257
+ clamp(15, 0, 10); // -> 10
258
+
259
+ // After
260
+ import { clamp } from '@fvc/utils';
261
+
262
+ clamp({ value: 5, min: 0, max: 10 }); // -> 5
263
+ clamp({ value: -100, min: -10, max: 10 }); // -> -10
264
+ clamp({ value: 15, min: 0, max: 10 }); // -> 10
265
+ ```
266
+
267
+ If you wrap `clamp` in a helper, the new `ClampOptions` type is exported
268
+ from `@fvc/utils` for the wrapper's argument type:
269
+
270
+ ```ts
271
+ import { clamp, type ClampOptions } from '@fvc/utils';
272
+
273
+ export const clampOpacity = (value: number): number =>
274
+ clamp({ value, min: 0, max: 1 });
275
+
276
+ export const wrapClamp = (opts: ClampOptions): number => clamp(opts);
277
+ ```
278
+
279
+ Throw behaviour is unchanged: passing `min > max` still throws
280
+ `Error("clamp: min cannot be greater than max")`.
281
+
282
+ ### Minor Changes
283
+
284
+ - 0d71f57: Add clamp utility that constrains a number between a minimum and maximum bound
285
+
286
+ ### Patch Changes
287
+
288
+ - e0a3c27: Tighten isNumeric type safety: explicit boolean return, null/undefined guard, no as cast
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fvc/utils",
3
- "version": "3.0.2",
3
+ "version": "3.0.3-next-d4799a7fa99a8ef4e7e8adfc3793fd349346277e",
4
4
  "main": "./dist/lib/index.js",
5
5
  "types": "./dist/lib/utils/src/index.d.ts",
6
6
  "exports": {
@@ -13,7 +13,8 @@
13
13
  "files": [
14
14
  "dist/lib/index.js",
15
15
  "dist/lib/utils",
16
- "package.json"
16
+ "package.json",
17
+ "CHANGELOG.md"
17
18
  ],
18
19
  "scripts": {
19
20
  "build": "rollup -c ./rollup.config.mjs",