@yahoo/uds-create-config 2.44.0 → 3.0.0

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 (376) hide show
  1. package/README.md +129 -0
  2. package/dist/ai-lanes.d.ts +23 -0
  3. package/dist/ai-lanes.js +34 -0
  4. package/dist/authoring/define-component.d.ts +85 -0
  5. package/dist/configs/CanvasConfig.d.ts +3237 -0
  6. package/dist/configs/CanvasConfig.js +332 -0
  7. package/dist/configs/build-options.d.ts +10 -0
  8. package/dist/configs/build-options.js +68 -0
  9. package/dist/configs/platform.d.ts +15 -0
  10. package/dist/configs/platform.js +17 -0
  11. package/dist/configs/react-native-system.d.ts +3026 -0
  12. package/dist/configs/react-native-system.js +64 -0
  13. package/dist/configs/system.d.ts +2771 -0
  14. package/dist/configs/system.js +74 -0
  15. package/dist/css/properties.generated.d.ts +14 -0
  16. package/dist/css/properties.generated.js +6260 -0
  17. package/dist/css/value-type.d.ts +48 -0
  18. package/dist/css/value-type.js +131 -0
  19. package/dist/css/values.d.ts +33 -0
  20. package/dist/css/values.js +116 -0
  21. package/dist/entities/native/NativeModifier.d.ts +25 -0
  22. package/dist/entities/native/NativeModifier.js +41 -0
  23. package/dist/entities/native/NativeSettings.d.ts +44 -0
  24. package/dist/entities/native/NativeSettings.js +39 -0
  25. package/dist/entities/native/NativeStyleProperty.d.ts +355 -0
  26. package/dist/entities/native/NativeStyleProperty.js +28 -0
  27. package/dist/entities/native/NativeToken.d.ts +31 -0
  28. package/dist/entities/native/NativeToken.js +49 -0
  29. package/dist/entities/system/CanvasRole.d.ts +34 -0
  30. package/dist/entities/system/CanvasRole.js +45 -0
  31. package/dist/entities/system/Component.d.ts +1287 -0
  32. package/dist/entities/system/Component.js +1840 -0
  33. package/dist/entities/system/Composite.d.ts +12 -0
  34. package/dist/entities/system/Composite.js +26 -0
  35. package/dist/entities/system/Device.d.ts +11 -0
  36. package/dist/entities/system/Device.js +18 -0
  37. package/dist/entities/system/File.d.ts +72 -0
  38. package/dist/entities/system/File.js +136 -0
  39. package/dist/entities/system/Font.d.ts +48 -0
  40. package/dist/entities/system/Font.js +56 -0
  41. package/dist/entities/system/GlobalStyle.d.ts +26 -0
  42. package/dist/entities/system/GlobalStyle.js +54 -0
  43. package/dist/entities/system/Guidance.d.ts +85 -0
  44. package/dist/entities/system/Guidance.js +59 -0
  45. package/dist/entities/system/GuidanceStyle.d.ts +14 -0
  46. package/dist/entities/system/GuidanceStyle.js +8 -0
  47. package/dist/entities/system/Icon.d.ts +46 -0
  48. package/dist/entities/system/Icon.js +46 -0
  49. package/dist/entities/system/LinkedSystem.d.ts +504 -0
  50. package/dist/entities/system/LinkedSystem.js +814 -0
  51. package/dist/entities/system/Modifier.d.ts +92 -0
  52. package/dist/entities/system/Modifier.js +120 -0
  53. package/dist/entities/system/Motion.d.ts +28 -0
  54. package/dist/entities/system/Motion.js +48 -0
  55. package/dist/entities/system/Operation.d.ts +100 -0
  56. package/dist/entities/system/Operation.js +236 -0
  57. package/dist/entities/system/Package.d.ts +42 -0
  58. package/dist/entities/system/Package.js +75 -0
  59. package/dist/entities/system/Settings.d.ts +94 -0
  60. package/dist/entities/system/Settings.js +166 -0
  61. package/dist/entities/system/StyleProperty.d.ts +135 -0
  62. package/dist/entities/system/StyleProperty.js +438 -0
  63. package/dist/entities/system/Token.d.ts +67 -0
  64. package/dist/entities/system/Token.js +129 -0
  65. package/dist/entities/system/Tool.d.ts +134 -0
  66. package/dist/entities/system/Tool.js +124 -0
  67. package/dist/entities/system/color.d.ts +64 -0
  68. package/dist/entities/system/color.js +123 -0
  69. package/dist/entities/system/component-module.d.ts +63 -0
  70. package/dist/entities/system/component-module.js +258 -0
  71. package/dist/entities/system/copy-plan.d.ts +98 -0
  72. package/dist/entities/system/copy-plan.js +451 -0
  73. package/dist/entities/system/defineComponent.d.ts +428 -0
  74. package/dist/entities/system/defineComponent.js +337 -0
  75. package/dist/entities/system/element.d.ts +101 -0
  76. package/dist/entities/system/element.js +171 -0
  77. package/dist/entities/system/icon-library.d.ts +64 -0
  78. package/dist/entities/system/icon-library.js +112 -0
  79. package/dist/entities/system/icon-metadata.d.ts +72 -0
  80. package/dist/entities/system/icon-metadata.js +111 -0
  81. package/dist/entities/system/link-declaration.d.ts +27 -0
  82. package/dist/entities/system/link-declaration.js +64 -0
  83. package/dist/entities/system/link-plan.d.ts +160 -0
  84. package/dist/entities/system/link-plan.js +770 -0
  85. package/dist/entities/system/runtime-modules.d.ts +25 -0
  86. package/dist/entities/system/runtime-modules.js +38 -0
  87. package/dist/entities/system/style-bag.d.ts +20 -0
  88. package/dist/entities/system/style-bag.js +246 -0
  89. package/dist/entities/system/token-index.d.ts +89 -0
  90. package/dist/entities/system/token-index.js +112 -0
  91. package/dist/framework/Config.d.ts +2472 -0
  92. package/dist/framework/Config.js +5023 -0
  93. package/dist/framework/Entity.d.ts +127 -0
  94. package/dist/framework/Entity.js +125 -0
  95. package/dist/framework/authoring.d.ts +24 -0
  96. package/dist/framework/authoring.js +7 -0
  97. package/dist/framework/change-hooks.d.ts +119 -0
  98. package/dist/framework/change-hooks.js +131 -0
  99. package/dist/framework/changes.d.ts +88 -0
  100. package/dist/framework/changes.js +246 -0
  101. package/dist/framework/class-names.d.ts +260 -0
  102. package/dist/framework/class-names.js +630 -0
  103. package/dist/framework/coalesce.d.ts +25 -0
  104. package/dist/framework/coalesce.js +60 -0
  105. package/dist/framework/config-op.d.ts +76 -0
  106. package/dist/framework/config-op.js +43 -0
  107. package/dist/framework/config-operation-kind.d.ts +14 -0
  108. package/dist/framework/config-operation-kind.js +14 -0
  109. package/dist/framework/config-ops.d.ts +34 -0
  110. package/dist/framework/config-ops.js +187 -0
  111. package/dist/framework/defineConfig.d.ts +196 -0
  112. package/dist/framework/defineConfig.js +100 -0
  113. package/dist/framework/defineDerivedEntity.d.ts +74 -0
  114. package/dist/framework/defineDerivedEntity.js +83 -0
  115. package/dist/framework/defineEntity.d.ts +318 -0
  116. package/dist/framework/defineEntity.js +183 -0
  117. package/dist/framework/defineSubEntity.d.ts +148 -0
  118. package/dist/framework/defineSubEntity.js +121 -0
  119. package/dist/framework/derived-mutations.d.ts +20 -0
  120. package/dist/framework/derived-mutations.js +38 -0
  121. package/dist/framework/entity-search.d.ts +29 -0
  122. package/dist/framework/entity-search.js +117 -0
  123. package/dist/framework/inline-sources.d.ts +49 -0
  124. package/dist/framework/inline-sources.js +388 -0
  125. package/dist/framework/layer-styles.d.ts +25 -0
  126. package/dist/framework/layer-styles.js +49 -0
  127. package/dist/framework/memo.d.ts +48 -0
  128. package/dist/framework/memo.js +84 -0
  129. package/dist/framework/overlay.d.ts +49 -0
  130. package/dist/framework/overlay.js +17 -0
  131. package/dist/framework/plan.d.ts +49 -0
  132. package/dist/framework/plan.js +73 -0
  133. package/dist/framework/projections.d.ts +480 -0
  134. package/dist/framework/projections.js +974 -0
  135. package/dist/framework/prop-surface.d.ts +132 -0
  136. package/dist/framework/prop-surface.js +278 -0
  137. package/dist/framework/ref-graph.d.ts +71 -0
  138. package/dist/framework/ref-graph.js +158 -0
  139. package/dist/framework/ref-integrity.d.ts +55 -0
  140. package/dist/framework/ref-integrity.js +171 -0
  141. package/dist/framework/registered.d.ts +95 -0
  142. package/dist/framework/registry-dir.d.ts +42 -0
  143. package/dist/framework/registry-dir.js +48 -0
  144. package/dist/framework/registry.d.ts +300 -0
  145. package/dist/framework/registry.js +104 -0
  146. package/dist/framework/rejection.d.ts +58 -0
  147. package/dist/framework/rejection.js +111 -0
  148. package/dist/framework/rename-inference.d.ts +26 -0
  149. package/dist/framework/rename-inference.js +50 -0
  150. package/dist/framework/render-spec.d.ts +296 -0
  151. package/dist/framework/render-spec.js +809 -0
  152. package/dist/framework/schema-version.d.ts +140 -0
  153. package/dist/framework/schema-version.js +214 -0
  154. package/dist/framework/schemas.d.ts +109 -0
  155. package/dist/framework/schemas.js +615 -0
  156. package/dist/framework/session.d.ts +196 -0
  157. package/dist/framework/session.js +367 -0
  158. package/dist/framework/signature.d.ts +15 -0
  159. package/dist/framework/signature.js +83 -0
  160. package/dist/framework/snapshot.d.ts +115 -0
  161. package/dist/framework/snapshot.js +277 -0
  162. package/dist/framework/source-integrity.d.ts +226 -0
  163. package/dist/framework/source-integrity.js +478 -0
  164. package/dist/framework/sources.d.ts +211 -0
  165. package/dist/framework/sources.js +89 -0
  166. package/dist/framework/utils/compiled-schema.d.ts +23 -0
  167. package/dist/framework/utils/compiled-schema.js +46 -0
  168. package/dist/framework/utils/content-key.d.ts +15 -0
  169. package/dist/framework/utils/content-key.js +33 -0
  170. package/dist/framework/utils/enumerated.d.ts +13 -0
  171. package/dist/framework/utils/enumerated.js +19 -0
  172. package/dist/framework/utils/field-path.d.ts +95 -0
  173. package/dist/framework/utils/field-path.js +136 -0
  174. package/dist/framework/utils/field-schema.d.ts +55 -0
  175. package/dist/framework/utils/field-schema.js +183 -0
  176. package/dist/framework/utils/group.d.ts +37 -0
  177. package/dist/framework/utils/group.js +13 -0
  178. package/dist/framework/utils/package-path.d.ts +37 -0
  179. package/dist/framework/utils/package-path.js +61 -0
  180. package/dist/framework/utils/refs.d.ts +194 -0
  181. package/dist/framework/utils/refs.js +403 -0
  182. package/dist/framework/validate-spec.d.ts +27 -0
  183. package/dist/framework/validate-spec.js +45 -0
  184. package/dist/framework/value-domain.d.ts +26 -0
  185. package/dist/framework/value-domain.js +202 -0
  186. package/dist/framework/views-facade.d.ts +15 -0
  187. package/dist/framework/views-facade.js +19 -0
  188. package/dist/index.d.ts +90 -42
  189. package/dist/index.js +86 -37
  190. package/dist/migrations/2.0.0/raw-css.d.ts +11 -0
  191. package/dist/migrations/2.0.0/raw-css.js +72 -0
  192. package/dist/migrations/2.0.0/v1-artifact.d.ts +1559 -0
  193. package/dist/migrations/2.0.0/v1-artifact.js +1018 -0
  194. package/dist/migrations/20260908171448_settings_as_kind.d.ts +22 -0
  195. package/dist/migrations/20260908171448_settings_as_kind.js +89 -0
  196. package/dist/migrations/20260908194245_visible_state_pointer.d.ts +19 -0
  197. package/dist/migrations/20260908194245_visible_state_pointer.js +115 -0
  198. package/dist/migrations/20260909183001_icon_knockout_variants.d.ts +18 -0
  199. package/dist/migrations/20260909183001_icon_knockout_variants.js +8 -0
  200. package/dist/migrations/20260910212453_linked_system_link_ops.d.ts +13 -0
  201. package/dist/migrations/20260910212453_linked_system_link_ops.js +8 -0
  202. package/dist/migrations/index.d.ts +2 -0
  203. package/dist/migrations/index.js +2 -0
  204. package/dist/react-native/style-keys.generated.d.ts +10 -0
  205. package/dist/react-native/style-keys.generated.js +167 -0
  206. package/dist/renderer/RendererErrorBoundary.d.ts +32 -5
  207. package/dist/renderer/RendererErrorBoundary.js +59 -10
  208. package/dist/renderer/UdsRenderer.d.ts +11 -10
  209. package/dist/renderer/UdsRenderer.js +1 -1
  210. package/dist/renderer/assetEntries.d.ts +37 -0
  211. package/dist/renderer/assetEntries.js +39 -0
  212. package/dist/renderer/assetRenderable.d.ts +14 -6
  213. package/dist/renderer/assetRenderable.js +8 -2
  214. package/dist/renderer/componentEntry.d.ts +58 -0
  215. package/dist/renderer/componentEntry.js +71 -0
  216. package/dist/renderer/icon-library.d.ts +20 -0
  217. package/dist/renderer/index.d.ts +7 -7
  218. package/dist/renderer/index.js +5 -5
  219. package/dist/renderer/primitives/SlotRenderer.d.ts +1 -1
  220. package/dist/renderer/primitives/SlotRenderer.js +1 -1
  221. package/dist/renderer/runtimeComponent.d.ts +33 -0
  222. package/dist/renderer/runtimeComponent.js +113 -0
  223. package/dist/renderer/spec-content.d.ts +43 -0
  224. package/dist/renderer/spec-content.js +95 -0
  225. package/dist/renderer/wrapRegistry.d.ts +22 -37
  226. package/dist/renderer/wrapRegistry.js +10 -20
  227. package/dist/renderer/wrappers/event-bridge.js +6 -5
  228. package/dist/renderer/wrappers/hex-normalize.js +6 -5
  229. package/dist/renderer/wrappers/html-aliases.d.ts +7 -2
  230. package/dist/renderer/wrappers/html-aliases.js +36 -19
  231. package/dist/renderer/wrappers/inline-styles.js +7 -6
  232. package/dist/spec/asset-jsx.d.ts +18 -5
  233. package/dist/spec/asset-jsx.js +27 -16
  234. package/dist/spec/collapse-text-labels.d.ts +5 -15
  235. package/dist/spec/collapse-text-labels.js +26 -19
  236. package/dist/spec/empty-node-slots.d.ts +56 -34
  237. package/dist/spec/empty-node-slots.js +87 -47
  238. package/dist/spec/index.d.ts +21 -10
  239. package/dist/spec/index.js +21 -10
  240. package/dist/spec/jsxToSpec.d.ts +14 -9
  241. package/dist/spec/jsxToSpec.js +20 -3
  242. package/dist/spec/preview-elements.d.ts +63 -0
  243. package/dist/spec/preview-elements.js +89 -0
  244. package/dist/spec/rewrite-refs.d.ts +58 -0
  245. package/dist/spec/rewrite-refs.js +250 -0
  246. package/dist/spec/specToJsx.js +18 -29
  247. package/dist/tsconfig.tsbuildinfo +1 -1
  248. package/package.json +39 -52
  249. package/dist/AssetGroup.d.ts +0 -77
  250. package/dist/AssetGroup.js +0 -125
  251. package/dist/Component.d.ts +0 -333
  252. package/dist/Component.js +0 -1061
  253. package/dist/ComponentGroup.d.ts +0 -22
  254. package/dist/ComponentGroup.js +0 -51
  255. package/dist/CompositeStyle.d.ts +0 -30
  256. package/dist/CompositeStyle.js +0 -59
  257. package/dist/Config.d.ts +0 -528
  258. package/dist/Config.js +0 -1712
  259. package/dist/Mode.d.ts +0 -41
  260. package/dist/Mode.js +0 -81
  261. package/dist/Modifier.d.ts +0 -51
  262. package/dist/Modifier.js +0 -97
  263. package/dist/MotionDef.d.ts +0 -81
  264. package/dist/MotionDef.js +0 -212
  265. package/dist/Props.d.ts +0 -332
  266. package/dist/Props.js +0 -35
  267. package/dist/Provider.d.ts +0 -20
  268. package/dist/Provider.js +0 -14
  269. package/dist/StyleProp.d.ts +0 -145
  270. package/dist/StyleProp.js +0 -239
  271. package/dist/Token.d.ts +0 -76
  272. package/dist/Token.js +0 -133
  273. package/dist/TokenGroup.d.ts +0 -33
  274. package/dist/TokenGroup.js +0 -69
  275. package/dist/asset-kind.d.ts +0 -55
  276. package/dist/asset-kind.js +0 -29
  277. package/dist/asset-value.d.ts +0 -23
  278. package/dist/asset-value.js +0 -40
  279. package/dist/brands.d.ts +0 -30
  280. package/dist/brands.js +0 -20
  281. package/dist/captureCallerPath.d.ts +0 -48
  282. package/dist/captureCallerPath.js +0 -95
  283. package/dist/colorExpressions.d.ts +0 -131
  284. package/dist/colorExpressions.js +0 -148
  285. package/dist/component-referrers.d.ts +0 -30
  286. package/dist/component-referrers.js +0 -40
  287. package/dist/config-diagnostics.d.ts +0 -21
  288. package/dist/config-diagnostics.js +0 -12
  289. package/dist/defineAssetGroup.d.ts +0 -200
  290. package/dist/defineAssetGroup.js +0 -323
  291. package/dist/defineProvider.d.ts +0 -29
  292. package/dist/defineProvider.js +0 -60
  293. package/dist/element-marker.d.ts +0 -63
  294. package/dist/element-marker.js +0 -113
  295. package/dist/entity-utils.d.ts +0 -56
  296. package/dist/entity-utils.js +0 -105
  297. package/dist/extension.d.ts +0 -55
  298. package/dist/extension.js +0 -214
  299. package/dist/factories.d.ts +0 -863
  300. package/dist/factories.js +0 -475
  301. package/dist/font-face.d.ts +0 -25
  302. package/dist/font-face.js +0 -72
  303. package/dist/foreign-component-name.d.ts +0 -21
  304. package/dist/foreign-component-name.js +0 -42
  305. package/dist/interpolate.d.ts +0 -20
  306. package/dist/interpolate.js +0 -10
  307. package/dist/jsx/__fixtures__/cross-component-preview.d.ts +0 -3
  308. package/dist/jsx/__fixtures__/cross-component-preview.js +0 -15
  309. package/dist/jsx/jsx-dev-runtime.d.ts +0 -15
  310. package/dist/jsx/jsx-dev-runtime.js +0 -11
  311. package/dist/jsx/jsx-runtime.d.ts +0 -48
  312. package/dist/jsx/jsx-runtime.js +0 -305
  313. package/dist/linked-system-pins.d.ts +0 -30
  314. package/dist/linked-system-pins.js +0 -45
  315. package/dist/linkedNodePrefixes.d.ts +0 -73
  316. package/dist/linkedNodePrefixes.js +0 -99
  317. package/dist/markers.d.ts +0 -235
  318. package/dist/markers.js +0 -70
  319. package/dist/motion-constants.d.ts +0 -37
  320. package/dist/motion-constants.js +0 -61
  321. package/dist/native/NativeConfig.d.ts +0 -56
  322. package/dist/native/NativeConfig.js +0 -162
  323. package/dist/native/assets.d.ts +0 -20
  324. package/dist/native/assets.js +0 -17
  325. package/dist/native/components.d.ts +0 -139
  326. package/dist/native/components.js +0 -67
  327. package/dist/native/index.d.ts +0 -18
  328. package/dist/native/index.js +0 -17
  329. package/dist/native/modes.d.ts +0 -10
  330. package/dist/native/modes.js +0 -11
  331. package/dist/native/types.d.ts +0 -95
  332. package/dist/native/types.js +0 -0
  333. package/dist/native/validation.d.ts +0 -8
  334. package/dist/native/validation.js +0 -885
  335. package/dist/native/values.d.ts +0 -7
  336. package/dist/native/values.js +0 -15
  337. package/dist/native.d.ts +0 -12
  338. package/dist/native.js +0 -10
  339. package/dist/refs.d.ts +0 -204
  340. package/dist/refs.js +0 -129
  341. package/dist/registry-aliases.d.ts +0 -33
  342. package/dist/registry-aliases.js +0 -35
  343. package/dist/registry-dir.d.ts +0 -22
  344. package/dist/registry-dir.js +0 -10
  345. package/dist/renderer/makeRegistry.d.ts +0 -34
  346. package/dist/renderer/makeRegistry.js +0 -52
  347. package/dist/renderer/makeUdsRenderer.d.ts +0 -13
  348. package/dist/renderer/makeUdsRenderer.js +0 -51
  349. package/dist/renderer/wrappers/component-slots.d.ts +0 -41
  350. package/dist/renderer/wrappers/component-slots.js +0 -66
  351. package/dist/renderer/wrappers/slot-resolution.d.ts +0 -25
  352. package/dist/renderer/wrappers/slot-resolution.js +0 -68
  353. package/dist/renderer/wrappers/void-elements.d.ts +0 -37
  354. package/dist/renderer/wrappers/void-elements.js +0 -40
  355. package/dist/spec/layer-props.d.ts +0 -52
  356. package/dist/spec/layer-props.js +0 -149
  357. package/dist/spec/preview-controls.d.ts +0 -44
  358. package/dist/spec/preview-controls.js +0 -139
  359. package/dist/spec/slot-refs.d.ts +0 -39
  360. package/dist/spec/slot-refs.js +0 -56
  361. package/dist/token-override-rows.d.ts +0 -68
  362. package/dist/token-override-rows.js +0 -233
  363. package/dist/tokenValueType.d.ts +0 -34
  364. package/dist/tokenValueType.js +0 -138
  365. package/dist/types/css-properties.d.ts +0 -233
  366. package/dist/types/css-properties.js +0 -14
  367. package/dist/types/css-property-keywords.d.ts +0 -156
  368. package/dist/types/css-property-keywords.js +0 -616
  369. package/dist/types/css-values.d.ts +0 -63
  370. package/dist/types/css-values.js +0 -16
  371. package/dist/types.d.ts +0 -1138
  372. package/dist/types.js +0 -12
  373. package/dist/units.d.ts +0 -14
  374. package/dist/units.js +0 -16
  375. package/dist/utils/index.d.ts +0 -4
  376. package/dist/utils/index.js +0 -4
@@ -0,0 +1,55 @@
1
+ import { Config } from "./Config.js";
2
+
3
+ //#region src/framework/ref-integrity.d.ts
4
+ /** One ref that names something this config does not have. */
5
+ interface DanglingLocalRef {
6
+ /** The entity holding the ref — `token:color/accent`. */
7
+ readonly from: string;
8
+ /** The ref itself — `token:color/brand`, or `component:Button#props/size` for a member. */
9
+ readonly ref: string;
10
+ }
11
+ /**
12
+ * Every local ref in `config` that resolves to nothing, with the entity holding it.
13
+ *
14
+ * Walks items and group nodes alike — a group carries authored data too, and the rename cascade
15
+ * rewrites both, so a check that only read items would call a fixed config broken and a broken one
16
+ * fixed depending on where the ref sat.
17
+ */
18
+ declare function danglingLocalRefs(config: Config): DanglingLocalRef[];
19
+ /** One bare leaf in a style bag that names nothing the property accepts. */
20
+ interface UnknownStyleLeaf {
21
+ /** The entity holding the bag — `component:Card`. */
22
+ readonly from: string;
23
+ /** The style property the bag sets — `bg`. */
24
+ readonly prop: string;
25
+ /** The leaf as written — `brand`. */
26
+ readonly leaf: string;
27
+ }
28
+ /**
29
+ * Every bare leaf in a style bag that names nothing its property accepts.
30
+ *
31
+ * The companion to {@link danglingLocalRefs}, for the references that were never refs. A leaf that
32
+ * resolves gets STORED as a ref (`bindBagTokens` mints one, which is what puts a component's actual
33
+ * usage in the dep graph); a leaf that resolves to nothing is left as the plain string it is, on
34
+ * purpose — minting a ref to a token that doesn't exist would be a dangling edge, worse than the
35
+ * missing one it replaced. The cost of that choice is that the ref graph cannot see the failure, so
36
+ * `cascadeRename` can never fix it and nothing was reporting it.
37
+ *
38
+ * This is the form a hand-authored token rename leaves behind most often, because `bg: 'brand'` is how
39
+ * most styling is written. It emits a class with no token behind it: dead CSS, and silent.
40
+ *
41
+ * Three gates, each one removing a class of false positive, because a check that refuses a valid build
42
+ * gets deleted rather than fixed:
43
+ *
44
+ * - the KEY must resolve as a style property. A bag may also be keyed by a component's own prop (a
45
+ * variant, a composite), whose domain lives elsewhere.
46
+ * - the VALUE must be name-shaped. See {@link NAME_SHAPED} — raw literals are ordinary here.
47
+ * - the PROP must actually draw on a token group. A colour rename cannot hide behind `cursor`, and
48
+ * reporting as if it could is how one rename produced hundreds of warnings nobody could act on.
49
+ *
50
+ * Judged against `stylePropValueLeaves`, the same list the emitter and the validator read, so a leaf
51
+ * this reports is exactly a leaf that paints nothing.
52
+ */
53
+ declare function unknownStyleLeaves(config: Config): UnknownStyleLeaf[];
54
+ //#endregion
55
+ export { DanglingLocalRef, UnknownStyleLeaf, danglingLocalRefs, unknownStyleLeaves };
@@ -0,0 +1,171 @@
1
+ import { collectRefs, kindOf, memberOf, pathOf, sourceOf } from "./utils/refs.js";
2
+ import { cssValueIssue } from "../css/values.js";
3
+ import { stylePropEntries } from "./projections.js";
4
+ //#region src/framework/ref-integrity.ts
5
+ /**
6
+ * Whether a config's LOCAL refs hold — every `{ __ref }` that names something this config was
7
+ * supposed to own, and doesn't.
8
+ *
9
+ * The sourced direction lives in `source-integrity.ts`, because a broken borrow is a fact about the
10
+ * seam between two systems and reads differently: the other side moved. This is the direction where
11
+ * the AUTHOR moved, and it has one cause worth naming.
12
+ *
13
+ * A rename cascades because it is an OPERATION — `Config.apply`'s rename walks the ref index and
14
+ * rewrites every dependent (`cascadeRename`). Editing `uds.config.ts` by hand performs no operation:
15
+ * the config is simply constructed with the new name, so nothing knows the old one existed and every
16
+ * ref to it is left pointing at nothing. Same for a patch stream that reached storage without its
17
+ * cascade, and for a JS consumer assembling a config by hand.
18
+ *
19
+ * What makes it worth refusing rather than reporting: an unresolvable ref renders as the EMPTY
20
+ * STRING. The stylesheet gets `--x: ;` — syntactically a declaration, semantically nothing — and a
21
+ * component's default reads as absent rather than as broken. The build is the last place that can
22
+ * still tell the difference.
23
+ */
24
+ /**
25
+ * Whether `target` names something this config has.
26
+ *
27
+ * Four ref shapes, and the grammar is not mine to invent — it is the one `memberEntries` reads when it
28
+ * turns a ref into a value domain (`projections.ts`), so a ref this calls broken is exactly a ref that
29
+ * offers no values there:
30
+ *
31
+ * `motion:` a KIND ROOT — "any item of this kind", what a prop declares when the
32
+ * things it can name aren't grouped under anything
33
+ * `token:color/brand` an ITEM
34
+ * `token:color` a GROUP
35
+ * `icon:phosphor#variants` a FACET — a field of the group node listing the values
36
+ * `component:Button#props/size` a MEMBER of a declared sub-entity collection
37
+ *
38
+ * The kind root and the facet are why this can't be `config.resolve` alone. Both appear in a config
39
+ * that is perfectly well-formed — Box's `motion` prop is `motion:`, Icon's `variant` prop is
40
+ * `icon:phosphor#variants` — and reading either as dangling would refuse every build we ship.
41
+ *
42
+ * Exported because a second caller needs the same answer: a spec node's `type` is one of these refs,
43
+ * and `validateSpec` asking `config.resolve` alone accepted `package:@ariakit/react#Menu` for any
44
+ * module that exists, whatever it exports. Two readings of "resolves" is how one of them goes stale.
45
+ */
46
+ function refResolves(config, target) {
47
+ const kind = kindOf(target);
48
+ const path = pathOf(target);
49
+ const member = memberOf(target);
50
+ if (member === void 0 && path === "") return true;
51
+ if (member === void 0) return config.resolve(kind, path) !== void 0 || config.groups(kind).some((group) => group.path === path);
52
+ const slash = member.indexOf("/");
53
+ if (slash === -1) {
54
+ const group = config.groups(kind).find((entry) => entry.path === path);
55
+ if (Array.isArray(group?.meta[member])) return true;
56
+ const bare = config.entityOf(kind)?.bareMember;
57
+ if (bare === void 0) return false;
58
+ const collection = config.resolve(kind, path)?.toJSON()?.[bare];
59
+ return typeof collection === "object" && collection !== null && member in collection;
60
+ }
61
+ const collection = (config.resolve(kind, path)?.toJSON())?.[member.slice(0, slash)];
62
+ if (typeof collection !== "object" || collection === null) return false;
63
+ return member.slice(slash + 1) in collection;
64
+ }
65
+ /**
66
+ * Every local ref in `config` that resolves to nothing, with the entity holding it.
67
+ *
68
+ * Walks items and group nodes alike — a group carries authored data too, and the rename cascade
69
+ * rewrites both, so a check that only read items would call a fixed config broken and a broken one
70
+ * fixed depending on where the ref sat.
71
+ */
72
+ function danglingLocalRefs(config) {
73
+ const found = [];
74
+ const check = (from, data) => {
75
+ for (const target of collectRefs(data)) {
76
+ if (sourceOf(target) !== void 0) continue;
77
+ if (!config.entityOf(kindOf(target))) continue;
78
+ if (!refResolves(config, target)) found.push({
79
+ from,
80
+ ref: target
81
+ });
82
+ }
83
+ };
84
+ for (const kind of config.ownedKinds()) {
85
+ for (const item of config.list(kind)) check(`${kind}:${item.path}`, item.toJSON());
86
+ for (const group of config.groups(kind)) check(`${kind}:${group.path}`, group.meta);
87
+ }
88
+ return found;
89
+ }
90
+ /**
91
+ * A leaf shaped like a NAME — an identifier, not a value.
92
+ *
93
+ * The one distinction that makes this check usable. A style prop with an enumerated domain still
94
+ * accepts a raw CSS value written plainly (`lineHeight: '96px'`, `fontWeight: '300'`, `strokeWidth:
95
+ * '2.5'`); the config we ship is full of them, and reading those as broken names would refuse every
96
+ * build. A stale token name looks nothing like them, so shape is what separates "you meant a token
97
+ * that is gone" from "you meant this literal".
98
+ */
99
+ const NAME_SHAPED = /^[a-zA-Z][\w-]*$/;
100
+ /**
101
+ * Every bare leaf in a style bag that names nothing its property accepts.
102
+ *
103
+ * The companion to {@link danglingLocalRefs}, for the references that were never refs. A leaf that
104
+ * resolves gets STORED as a ref (`bindBagTokens` mints one, which is what puts a component's actual
105
+ * usage in the dep graph); a leaf that resolves to nothing is left as the plain string it is, on
106
+ * purpose — minting a ref to a token that doesn't exist would be a dangling edge, worse than the
107
+ * missing one it replaced. The cost of that choice is that the ref graph cannot see the failure, so
108
+ * `cascadeRename` can never fix it and nothing was reporting it.
109
+ *
110
+ * This is the form a hand-authored token rename leaves behind most often, because `bg: 'brand'` is how
111
+ * most styling is written. It emits a class with no token behind it: dead CSS, and silent.
112
+ *
113
+ * Three gates, each one removing a class of false positive, because a check that refuses a valid build
114
+ * gets deleted rather than fixed:
115
+ *
116
+ * - the KEY must resolve as a style property. A bag may also be keyed by a component's own prop (a
117
+ * variant, a composite), whose domain lives elsewhere.
118
+ * - the VALUE must be name-shaped. See {@link NAME_SHAPED} — raw literals are ordinary here.
119
+ * - the PROP must actually draw on a token group. A colour rename cannot hide behind `cursor`, and
120
+ * reporting as if it could is how one rename produced hundreds of warnings nobody could act on.
121
+ *
122
+ * Judged against `stylePropValueLeaves`, the same list the emitter and the validator read, so a leaf
123
+ * this reports is exactly a leaf that paints nothing.
124
+ */
125
+ function unknownStyleLeaves(config) {
126
+ const found = [];
127
+ const domains = /* @__PURE__ */ new Map();
128
+ const propertiesOf = (prop) => {
129
+ const declared = (config.resolve("style-property", prop)?.toJSON())?.properties;
130
+ return Array.isArray(declared) ? declared : [];
131
+ };
132
+ /** The leaves a token-consuming property accepts, or `undefined` when it isn't one to judge. */
133
+ const domainOf = (prop) => {
134
+ if (domains.has(prop)) return domains.get(prop);
135
+ const entries = stylePropEntries(config, prop);
136
+ const leaves = new Set(entries.map((entry) => entry.leaf));
137
+ const judge = leaves.size > 0 && entries.some((entry) => entry.value !== void 0 && config.resolve("token", entry.value)) ? leaves : void 0;
138
+ domains.set(prop, judge);
139
+ return judge;
140
+ };
141
+ for (const kind of config.ownedKinds()) {
142
+ const sites = config.entityOf(kind)?.styleBags;
143
+ if (!sites) continue;
144
+ for (const item of config.list(kind)) {
145
+ const body = item.toJSON();
146
+ for (const { bag } of sites(body)) {
147
+ const own = bag === body.defaultProps ? body.props : void 0;
148
+ for (const [prop, value] of Object.entries(bag)) {
149
+ if (typeof value !== "string" || !NAME_SHAPED.test(value)) continue;
150
+ if (!config.resolve("style-property", prop)) continue;
151
+ const declared = own?.[prop];
152
+ if (declared && declared.type !== "styleProperty") continue;
153
+ const domain = domainOf(prop);
154
+ if (!domain || domain.has(value)) continue;
155
+ if (propertiesOf(prop).some((css) => cssValueIssue({
156
+ property: css,
157
+ value
158
+ }) === void 0)) continue;
159
+ found.push({
160
+ from: `${kind}:${item.path}`,
161
+ prop,
162
+ leaf: value
163
+ });
164
+ }
165
+ }
166
+ }
167
+ }
168
+ return found;
169
+ }
170
+ //#endregion
171
+ export { danglingLocalRefs, refResolves, unknownStyleLeaves };
@@ -0,0 +1,95 @@
1
+ //#region src/framework/registered.d.ts
2
+ /**
3
+ * The augmentation points a config's emitted `uds-env.d.ts` fills in.
4
+ *
5
+ * All three registries are empty here on purpose. A consumer that has run a build gets an
6
+ * augmentation declaring what its own system actually contains, and every ref helper narrows to
7
+ * those paths; a consumer that hasn't still compiles, because an unaugmented interface falls back to
8
+ * `string`. Type safety appears when there are types to be safe about, and nothing breaks before then.
9
+ *
10
+ * This is the whole point of emitting types at all: `Token.ref('color/brnad')` should be a compile error
11
+ * in a consumer's editor, and a component's `bg` prop should offer that system's colours.
12
+ */
13
+ /**
14
+ * Kind → the paths that kind has, as a string union. Filled per config:
15
+ *
16
+ * ```ts
17
+ * declare module '@yahoo/uds-create-config' {
18
+ * interface RegisteredPaths {
19
+ * token: 'color/brand' | 'spacing/4';
20
+ * component: 'Box' | 'Text';
21
+ * }
22
+ * }
23
+ * ```
24
+ */
25
+ interface RegisteredPaths {}
26
+ /**
27
+ * Style prop → the values it accepts, as a string union (including a bracket template literal when the
28
+ * prop allows off-system values). What a component's JSX props are typed against.
29
+ */
30
+ interface RegisteredStyleProps {}
31
+ /**
32
+ * Accessor name → the entity class that accessor addresses. Filled per config:
33
+ *
34
+ * ```ts
35
+ * declare module '@yahoo/uds-create-config' {
36
+ * interface RegisteredEntities {
37
+ * tokens: typeof Token;
38
+ * components: typeof Component;
39
+ * }
40
+ * }
41
+ * ```
42
+ *
43
+ * A field keyed by accessor, whose values are bodies of the kind that accessor addresses — a linked
44
+ * system's `options`, where `options.tokens['color/brand'].override` is checked against the token
45
+ * schema. The kind can't be recovered from the key by any type written here: a config file is
46
+ * accessor-keyed, and the map from accessor to kind belongs to the config type, which the kind
47
+ * declaring that field is itself a member of — naming it in the schema would be self-referential.
48
+ *
49
+ * The emitted file supplies it, like {@link RegisteredPaths}. Unaugmented, the field stays the open
50
+ * record its schema describes and still compiles.
51
+ *
52
+ * Kinds only — the accessor a source is declared under is absent, since a pin is never borrowed
53
+ * (`EntityKind.linkable`) and so is never something a pin says anything about.
54
+ */
55
+ interface RegisteredEntities {}
56
+ /**
57
+ * Qualified linked component path → the component contract installed for that path.
58
+ *
59
+ * Unlike {@link RegisteredPaths}, this map is deliberately limited to linked components: a local
60
+ * `defineComponent` handle already carries its exact declarations in TypeScript, while a ref to a
61
+ * linked component otherwise carries only a string. The consumer's emitted `uds-env.d.ts` fills the
62
+ * gap from the installed source config.
63
+ *
64
+ * The framework treats the values structurally. `layers` and `props` retain their literal keys and
65
+ * declarations so `Component.ref('Button@web').extend(...).render(...)` can infer the same render
66
+ * arguments a locally authored component would.
67
+ */
68
+ interface RegisteredComponentContracts {}
69
+ /** The generated contract for one qualified linked component, or an open fallback before build. */
70
+ type ComponentContractOf<P extends string> = P extends keyof RegisteredComponentContracts ? RegisteredComponentContracts[P] : {
71
+ layers: Record<string, unknown>;
72
+ props: Record<string, unknown>;
73
+ defaultProps: Record<string, unknown>;
74
+ forwards: Record<string, unknown>;
75
+ };
76
+ /**
77
+ * The path type for a kind — its registered union when a config declared one, else `string`.
78
+ *
79
+ * The fallback is what keeps this optional: an unaugmented consumer, and every test in this repo, goes
80
+ * on passing plain strings.
81
+ *
82
+ * The `#member` form is admitted on top of the emitted union because a FACET ref
83
+ * (`Icon.ref('phosphor#variants')`) addresses a field of a group node rather than an entity, so no
84
+ * path the build enumerates could ever spell it. The entity half still has to be a registered path,
85
+ * which is the half a typo lands in; what follows the `#` is a field name the kind owns and
86
+ * `ref-integrity` is what checks it. The `@source` half needs no such widening — a source's paths are
87
+ * emitted already qualified. A consumer holding a path only known at runtime (a canvas node's type
88
+ * into whatever system it names) asserts at its own call site rather than this type widening for
89
+ * every consumer.
90
+ */
91
+ type PathOf<K extends string> = K extends keyof RegisteredPaths ? RegisteredPaths[K] extends string ? RegisteredPaths[K] | `${RegisteredPaths[K]}#${string}` : string : string;
92
+ /** The value type for a style prop — its registered union, else `string`. */
93
+ type ValueOf<P extends string> = P extends keyof RegisteredStyleProps ? RegisteredStyleProps[P] extends string | number ? RegisteredStyleProps[P] : string : string;
94
+ //#endregion
95
+ export { ComponentContractOf, PathOf, RegisteredComponentContracts, RegisteredEntities, RegisteredPaths, RegisteredStyleProps, ValueOf };
@@ -0,0 +1,42 @@
1
+ //#region src/framework/registry-dir.d.ts
2
+ /**
3
+ * Where a project's build directories live, relative to the project root — the registry it pulls
4
+ * into, the directory it writes to, and the one it is allowed to read from.
5
+ *
6
+ * One resolution rule each, shared by every consumer, because a default spelled at the call site is
7
+ * a default that drifts: `.uds` was written out at eight of them before this.
8
+ *
9
+ * The registry half is shared by `uds pull` (writes the registry), `uds build` (regenerates linked
10
+ * CSS from it), the bundler loaders (skip its files), and the push seal (excludes its files from a
11
+ * consumer's own sealed sources): `build.registryDir` when the consumer sets one, else the schema's
12
+ * default at the project root.
13
+ */
14
+ /** The build setting this reads — structural, so a caller passes `Settings.get(config)?.build`, or
15
+ * the bare `build` record of an artifact it never loaded. */
16
+ interface RegistryDirOptions {
17
+ registryDir?: string;
18
+ }
19
+ /** The build settings the directory resolvers read. Structural for the same reason. */
20
+ interface BuildDirOptions {
21
+ inputDir?: string;
22
+ outDir?: string;
23
+ }
24
+ /** Project-root-relative POSIX path of the linked-system registry. */
25
+ declare function resolveRegistryDir(buildOptions: RegistryDirOptions | undefined): string;
26
+ /**
27
+ * Project-root-relative POSIX path of the build output directory.
28
+ *
29
+ * The schema's default unless the system says otherwise. A CLI `--output-dir` overrides both, which is
30
+ * why this takes only the config: a scratch build is the caller's business, not the system's.
31
+ */
32
+ declare function resolveOutDir(buildOptions: BuildDirOptions | undefined): string;
33
+ /**
34
+ * Config-relative POSIX path of the directory every sealed file must live under, or `undefined` when
35
+ * the system declares none.
36
+ *
37
+ * `undefined` is not a default in disguise — it is the answer that keeps the `uds/components/`
38
+ * anchor convention in charge, so a config that never set this emits exactly what it emitted before.
39
+ */
40
+ declare function resolveInputDir(buildOptions: BuildDirOptions | undefined): string | undefined;
41
+ //#endregion
42
+ export { resolveInputDir, resolveOutDir, resolveRegistryDir };
@@ -0,0 +1,48 @@
1
+ import { BUILD_DEFAULTS } from "../configs/build-options.js";
2
+ //#region src/framework/registry-dir.ts
3
+ /**
4
+ * Where a project's build directories live, relative to the project root — the registry it pulls
5
+ * into, the directory it writes to, and the one it is allowed to read from.
6
+ *
7
+ * One resolution rule each, shared by every consumer, because a default spelled at the call site is
8
+ * a default that drifts: `.uds` was written out at eight of them before this.
9
+ *
10
+ * The registry half is shared by `uds pull` (writes the registry), `uds build` (regenerates linked
11
+ * CSS from it), the bundler loaders (skip its files), and the push seal (excludes its files from a
12
+ * consumer's own sealed sources): `build.registryDir` when the consumer sets one, else the schema's
13
+ * default at the project root.
14
+ */
15
+ /** Scanned rather than matched with `/\/+$/`: anchoring a repeated group at the end makes the engine
16
+ * backtrack across the whole run, which is quadratic on a path that is all slashes. */
17
+ const normalize = (p) => {
18
+ const posix = p.replace(/\\/g, "/");
19
+ let end = posix.length;
20
+ while (end > 0 && posix[end - 1] === "/") end--;
21
+ return posix.slice(0, end);
22
+ };
23
+ /** Project-root-relative POSIX path of the linked-system registry. */
24
+ function resolveRegistryDir(buildOptions) {
25
+ return normalize(buildOptions?.registryDir ?? BUILD_DEFAULTS.registryDir);
26
+ }
27
+ /**
28
+ * Project-root-relative POSIX path of the build output directory.
29
+ *
30
+ * The schema's default unless the system says otherwise. A CLI `--output-dir` overrides both, which is
31
+ * why this takes only the config: a scratch build is the caller's business, not the system's.
32
+ */
33
+ function resolveOutDir(buildOptions) {
34
+ return normalize(buildOptions?.outDir ?? BUILD_DEFAULTS.outDir);
35
+ }
36
+ /**
37
+ * Config-relative POSIX path of the directory every sealed file must live under, or `undefined` when
38
+ * the system declares none.
39
+ *
40
+ * `undefined` is not a default in disguise — it is the answer that keeps the `uds/components/`
41
+ * anchor convention in charge, so a config that never set this emits exactly what it emitted before.
42
+ */
43
+ function resolveInputDir(buildOptions) {
44
+ if (!buildOptions?.inputDir) return void 0;
45
+ return normalize(buildOptions.inputDir);
46
+ }
47
+ //#endregion
48
+ export { resolveInputDir, resolveOutDir, resolveRegistryDir };