Repository navigation
Commit 8acdd87
committed
fix(plugin-view,plugin-list): hand-list FLAT_MAP_CONFIG_KEYS to stop breaking the console-starter alias-closure gate
PR #5231's CI (job `Test (shard 3/4)`, run 32160288416) went red on
`examples/console-starter/test/vite-alias-closure.test.ts`:
"@object-ui/types/zod (unresolvable under src, imported by packages/plugin-list/src/ListView.tsx)"
"@object-ui/types/zod (unresolvable under src, imported by packages/plugin-view/src/ObjectView.tsx)"
Root cause: that test's walker resolves a bare `@object-ui/*` specifier using
plain `index.<ext>` conventions and cannot find `@object-ui/types/zod`'s real
barrel file (`zod/index.zod.ts` — a non-standard name), regardless of whether
Vite's own alias table covers it (it already does — an explicit
`@object-ui/types/zod` entry has been in
`examples/console-starter/vite.config.ts` since PR #5156). `ObjectView.tsx`
and `ListView.tsx` are both reachable from console-starter's own `src/`, so
the runtime import made them part of the walked graph for the first time;
`ObjectMap.tsx` carries the identical import today without tripping the gate
only because nothing in that graph reaches `@object-ui/plugin-map`.
Per instruction, `vite-alias-closure.test.ts` itself is untouched.
Fix: `FLAT_MAP_CONFIG_KEYS` in `ObjectView.tsx` and `ListView.tsx` is now
HAND-LISTED (no runtime `@object-ui/types/zod` import in either file) rather
than derived from `ObjectMapConfigSchema.shape`. `ObjectMap.tsx` in
`plugin-map` keeps the runtime-derived version — it is safely unreached by
the walker, and it already imports the schema for `safeParse` regardless.
Anti-drift for the two hand lists is a TEST, not just a comment, matching the
established `packages/core/src/actions/__tests__/actionKeys.pin.test.ts`
pattern: each of `ObjectView.mapFlatten.test.tsx` /
`ListView.mapFlatten.test.tsx` now imports `ObjectMapConfigSchema` from
`@object-ui/types/zod` (a TEST file, which the alias-closure walker
explicitly excludes from traversal) and asserts the exported
`FLAT_MAP_CONFIG_KEYS` equals the schema's keys minus `style`. A key added to
or removed from the declaration still fails loudly, by name, without
reintroducing the runtime edge that breaks the console-starter gate.
Both `FLAT_MAP_CONFIG_KEYS` constants are now independently hand-listed
(each pin-tested against the same canonical schema) rather than one literal
array physically shared by both call sites — the walker constraint above
rules out every within-scope way to share one runtime value without either
re-tripping this gate or statically pulling `@object-ui/plugin-map`'s
`maplibre-gl` / `react-map-gl` weight into `ObjectView` / `ListView` (that
package's single lib entry bundles everything together, and console-starter
aliases it whole to `src`). Noted explicitly in the PR body as a deviation
from strict single-sourcing, with the reasoning above.
Reverified locally: `pnpm exec vitest run examples/console-starter/test/vite-alias-closure.test.ts`
green, plus the three package suites, at the new HEAD, rebased onto current
origin/main.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RV6yuVCxymHYE16PL9vQkE1 parent d77dd1e commit 8acdd87
4 files changed
Lines changed: 121 additions & 31 deletions
File tree
- packages
- plugin-list/src
- __tests__
- plugin-view/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
46 | 57 | | |
47 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
48 | 67 | | |
49 | 68 | | |
50 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
114 | 121 | | |
115 | 122 | | |
116 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
87 | 99 | | |
88 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
89 | 109 | | |
90 | 110 | | |
91 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
0 commit comments