@forumone/throughline-design-contract 0.4.0 → 0.5.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # @forumone/throughline-design-contract
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 957403b: One `@types/node`, so a host does not end up with two copies of `@payloadcms/ui`
8
+
9
+ Twelve packages asked for `@types/node@^20.17.0` and `design-system-payload`
10
+ asked for `^24.13.2`. Inside this repository that is untidy. Inside a host that
11
+ consumes the suite from source — which is how `forumone/forumone-2026` uses it,
12
+ as a git submodule in one pnpm workspace — it is a runtime failure.
13
+
14
+ pnpm hashes a package's identity with its resolved peers. `publishing` and
15
+ `integrations` both take `@payloadcms/ui` as a peer _and_ as a devDependency, so
16
+ each got its own copy resolved against `@types/node@20`, while the host's copy
17
+ resolved against `@types/node@24`. Same version, 3.87.1, two directories:
18
+
19
+ apps/web → @payloadcms+ui@3.87.1_…_9ce0de5c…
20
+ packages/publishing → @payloadcms+ui@3.87.1_…_13184ec4…
21
+ packages/integrations → @payloadcms+ui@3.87.1_…_13184ec4…
22
+
23
+ Two directories are two module instances. Two instances of `@payloadcms/ui` are
24
+ two `ConfigContext` objects, and `PublishButton` read the one the admin's
25
+ provider had never populated:
26
+
27
+ TypeError: Cannot destructure property 'config' of useConfig() as it is undefined
28
+
29
+ The host saw an intermittent 500 on every admin document view — `PublishButton`
30
+ is installed on each collection with a publish policy, so lists, `/admin` and
31
+ the login screen were all fine and only editing broke. Nothing caught it:
32
+ install, `--frozen-lockfile`, typecheck, lint and every test passed, because the
33
+ two copies are byte-identical and the split exists only at module resolution.
34
+ forumone/forumone-2026#498.
35
+
36
+ Aligning on `^24.13.2` collapses them to one instance. Nothing here targets a
37
+ Node 20 API deliberately; the packages typecheck and test unchanged against the
38
+ newer types.
39
+
40
+ `create-throughline` keeps `^20.17.0` on purpose. It is the one package
41
+ declaring `engines.node: >=20.9.0`, and typechecking a CLI against types newer
42
+ than the runtime it promises to support is how a Node 24-only call ships to
43
+ somebody on Node 20.
44
+
45
+ ## 0.5.0
46
+
47
+ ### Minor Changes
48
+
49
+ - 45724ee: A contract can say a boolean starts ticked, and be believed
50
+
51
+ `boolean` fields were generated as `{ type: 'checkbox', defaultValue: false }`,
52
+ with the `false` hardcoded. That made a component's own default unreachable from
53
+ the CMS. A checkbox is stored ticked or unticked and never absent, so `coerce`
54
+ always had a value to turn into a real boolean, the prop was never `undefined`,
55
+ and a signature default like `hasFacade = true` could not apply. Every boolean a
56
+ contract described arrived at its component as `false`, whatever the component
57
+ said.
58
+
59
+ It was not theoretical. `VideoEmbed.hasFacade` exists to keep a provider's
60
+ iframe — several hundred kilobytes and its third-party cookies — off the page
61
+ until a reader presses play, and its contract says "Leave on". Every embed an
62
+ author added shipped with it off: the YouTube iframe was in the server HTML from
63
+ first paint, setting cookies on readers who never pressed play, on a site whose
64
+ stated rule is that no third-party tracking runs before consent.
65
+
66
+ So `ContentField` gains an optional `defaultValue`, read by the checkbox branch
67
+ and rejected on any other field type — anywhere else it is a value the author
68
+ expects to take effect and nothing ever would.
69
+
70
+ `allOrNothing` had to learn about it too. That rule treats `false` as "nobody
71
+ touched this", which is right for a checkbox that starts unticked and exactly
72
+ wrong for one that starts ticked: left alone, a group holding a ticked-by-default
73
+ boolean would never look empty, and the rule would demand the group's required
74
+ children of an author who had typed nothing. It now takes a field's declared
75
+ default into account rather than the value alone.
76
+
77
+ **Existing stored values are untouched.** `defaultValue` applies to a field an
78
+ author has not yet filled in, so blocks already saved keep whatever is in the
79
+ database; a `VideoEmbed` saved before this change still renders without its
80
+ facade until someone edits it.
81
+
3
82
  ## 0.4.0
4
83
 
5
84
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forumone/throughline-design-contract",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "The contract every AI-ready design system satisfies to be consumable by Throughline.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -43,12 +43,12 @@
43
43
  "zod": "^3.23.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@types/node": "^20.17.0",
46
+ "@types/node": "^24.13.2",
47
47
  "eslint": "^9.15.0",
48
48
  "typescript": "^5.6.0",
49
49
  "vitest": "^2.1.0",
50
- "@forumone/throughline-tsconfig": "0.0.0",
51
- "@forumone/throughline-eslint-config": "0.0.0"
50
+ "@forumone/throughline-eslint-config": "0.0.0",
51
+ "@forumone/throughline-tsconfig": "0.0.0"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsc -b",