@taggor/contract 0.0.0-stage → 0.2.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 (343) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -2
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/artifact-keys.d.ts +169 -0
  5. package/dist/artifact-keys.d.ts.map +1 -0
  6. package/dist/artifact-keys.js +195 -0
  7. package/dist/artifact-keys.js.map +1 -0
  8. package/dist/assets.d.ts +72 -0
  9. package/dist/assets.d.ts.map +1 -0
  10. package/dist/assets.js +94 -0
  11. package/dist/assets.js.map +1 -0
  12. package/dist/bounded-path.d.ts +29 -0
  13. package/dist/bounded-path.d.ts.map +1 -0
  14. package/dist/bounded-path.js +57 -0
  15. package/dist/bounded-path.js.map +1 -0
  16. package/dist/bounded.d.ts +47 -0
  17. package/dist/bounded.d.ts.map +1 -0
  18. package/dist/bounded.js +93 -0
  19. package/dist/bounded.js.map +1 -0
  20. package/dist/build-diagnostic.d.ts +89 -0
  21. package/dist/build-diagnostic.d.ts.map +1 -0
  22. package/dist/build-diagnostic.js +91 -0
  23. package/dist/build-diagnostic.js.map +1 -0
  24. package/dist/component-types.d.ts +61 -0
  25. package/dist/component-types.d.ts.map +1 -0
  26. package/dist/component-types.js +277 -0
  27. package/dist/component-types.js.map +1 -0
  28. package/dist/consent-text.d.ts +31 -0
  29. package/dist/consent-text.d.ts.map +1 -0
  30. package/dist/consent-text.js +41 -0
  31. package/dist/consent-text.js.map +1 -0
  32. package/dist/contract-version.d.ts +150 -0
  33. package/dist/contract-version.d.ts.map +1 -0
  34. package/dist/contract-version.js +198 -0
  35. package/dist/contract-version.js.map +1 -0
  36. package/dist/credential-fields.d.ts +31 -0
  37. package/dist/credential-fields.d.ts.map +1 -0
  38. package/dist/credential-fields.js +36 -0
  39. package/dist/credential-fields.js.map +1 -0
  40. package/dist/css-tokens.d.ts +46 -0
  41. package/dist/css-tokens.d.ts.map +1 -0
  42. package/dist/css-tokens.js +189 -0
  43. package/dist/css-tokens.js.map +1 -0
  44. package/dist/css-value.d.ts +42 -0
  45. package/dist/css-value.d.ts.map +1 -0
  46. package/dist/css-value.js +78 -0
  47. package/dist/css-value.js.map +1 -0
  48. package/dist/data-api.d.ts +127 -0
  49. package/dist/data-api.d.ts.map +1 -0
  50. package/dist/data-api.js +167 -0
  51. package/dist/data-api.js.map +1 -0
  52. package/dist/denylist-keys.d.ts +19 -0
  53. package/dist/denylist-keys.d.ts.map +1 -0
  54. package/dist/denylist-keys.js +48 -0
  55. package/dist/denylist-keys.js.map +1 -0
  56. package/dist/diagnostic-catalog.d.ts +1402 -0
  57. package/dist/diagnostic-catalog.d.ts.map +1 -0
  58. package/dist/diagnostic-catalog.js +1311 -0
  59. package/dist/diagnostic-catalog.js.map +1 -0
  60. package/dist/dom-members.snapshot.d.ts +33 -0
  61. package/dist/dom-members.snapshot.d.ts.map +1 -0
  62. package/dist/dom-members.snapshot.js +760 -0
  63. package/dist/dom-members.snapshot.js.map +1 -0
  64. package/dist/early-loading.d.ts +27 -0
  65. package/dist/early-loading.d.ts.map +1 -0
  66. package/dist/early-loading.js +44 -0
  67. package/dist/early-loading.js.map +1 -0
  68. package/dist/error-catalog.d.ts +749 -0
  69. package/dist/error-catalog.d.ts.map +1 -0
  70. package/dist/error-catalog.js +720 -0
  71. package/dist/error-catalog.js.map +1 -0
  72. package/dist/executable-config.d.ts +35 -0
  73. package/dist/executable-config.d.ts.map +1 -0
  74. package/dist/executable-config.js +44 -0
  75. package/dist/executable-config.js.map +1 -0
  76. package/dist/freeze.d.ts +17 -0
  77. package/dist/freeze.d.ts.map +1 -0
  78. package/dist/freeze.js +29 -0
  79. package/dist/freeze.js.map +1 -0
  80. package/dist/gunzip.d.ts +33 -0
  81. package/dist/gunzip.d.ts.map +1 -0
  82. package/dist/gunzip.js +330 -0
  83. package/dist/gunzip.js.map +1 -0
  84. package/dist/hostname.d.ts +74 -0
  85. package/dist/hostname.d.ts.map +1 -0
  86. package/dist/hostname.js +215 -0
  87. package/dist/hostname.js.map +1 -0
  88. package/dist/human-actions.d.ts +49 -0
  89. package/dist/human-actions.d.ts.map +1 -0
  90. package/dist/human-actions.js +272 -0
  91. package/dist/human-actions.js.map +1 -0
  92. package/dist/index.d.ts +73 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +73 -0
  95. package/dist/index.js.map +1 -0
  96. package/dist/json-schema.d.ts +108 -0
  97. package/dist/json-schema.d.ts.map +1 -0
  98. package/dist/json-schema.js +240 -0
  99. package/dist/json-schema.js.map +1 -0
  100. package/dist/key-checksum.d.ts +33 -0
  101. package/dist/key-checksum.d.ts.map +1 -0
  102. package/dist/key-checksum.js +67 -0
  103. package/dist/key-checksum.js.map +1 -0
  104. package/dist/libraries.d.ts +60 -0
  105. package/dist/libraries.d.ts.map +1 -0
  106. package/dist/libraries.js +120 -0
  107. package/dist/libraries.js.map +1 -0
  108. package/dist/limit-catalog.d.ts +381 -0
  109. package/dist/limit-catalog.d.ts.map +1 -0
  110. package/dist/limit-catalog.js +429 -0
  111. package/dist/limit-catalog.js.map +1 -0
  112. package/dist/limits.d.ts +167 -0
  113. package/dist/limits.d.ts.map +1 -0
  114. package/dist/limits.js +175 -0
  115. package/dist/limits.js.map +1 -0
  116. package/dist/locale-tag.d.ts +21 -0
  117. package/dist/locale-tag.d.ts.map +1 -0
  118. package/dist/locale-tag.js +21 -0
  119. package/dist/locale-tag.js.map +1 -0
  120. package/dist/make-diagnostic.d.ts +74 -0
  121. package/dist/make-diagnostic.d.ts.map +1 -0
  122. package/dist/make-diagnostic.js +100 -0
  123. package/dist/make-diagnostic.js.map +1 -0
  124. package/dist/manifest-compat-diagnostics.d.ts +23 -0
  125. package/dist/manifest-compat-diagnostics.d.ts.map +1 -0
  126. package/dist/manifest-compat-diagnostics.js +150 -0
  127. package/dist/manifest-compat-diagnostics.js.map +1 -0
  128. package/dist/manifest-compat.d.ts +58 -0
  129. package/dist/manifest-compat.d.ts.map +1 -0
  130. package/dist/manifest-compat.js +377 -0
  131. package/dist/manifest-compat.js.map +1 -0
  132. package/dist/manifest.d.ts +1769 -0
  133. package/dist/manifest.d.ts.map +1 -0
  134. package/dist/manifest.js +421 -0
  135. package/dist/manifest.js.map +1 -0
  136. package/dist/metering.d.ts +126 -0
  137. package/dist/metering.d.ts.map +1 -0
  138. package/dist/metering.js +147 -0
  139. package/dist/metering.js.map +1 -0
  140. package/dist/migrate.d.ts +70 -0
  141. package/dist/migrate.d.ts.map +1 -0
  142. package/dist/migrate.js +159 -0
  143. package/dist/migrate.js.map +1 -0
  144. package/dist/money.d.ts +41 -0
  145. package/dist/money.d.ts.map +1 -0
  146. package/dist/money.js +52 -0
  147. package/dist/money.js.map +1 -0
  148. package/dist/names.d.ts +37 -0
  149. package/dist/names.d.ts.map +1 -0
  150. package/dist/names.js +55 -0
  151. package/dist/names.js.map +1 -0
  152. package/dist/overage-pricing.d.ts +89 -0
  153. package/dist/overage-pricing.d.ts.map +1 -0
  154. package/dist/overage-pricing.js +170 -0
  155. package/dist/overage-pricing.js.map +1 -0
  156. package/dist/plan-ids.d.ts +10 -0
  157. package/dist/plan-ids.d.ts.map +1 -0
  158. package/dist/plan-ids.js +8 -0
  159. package/dist/plan-ids.js.map +1 -0
  160. package/dist/plan-limits.d.ts +138 -0
  161. package/dist/plan-limits.d.ts.map +1 -0
  162. package/dist/plan-limits.js +112 -0
  163. package/dist/plan-limits.js.map +1 -0
  164. package/dist/plan-pricing.d.ts +145 -0
  165. package/dist/plan-pricing.d.ts.map +1 -0
  166. package/dist/plan-pricing.js +172 -0
  167. package/dist/plan-pricing.js.map +1 -0
  168. package/dist/plan-usage.d.ts +112 -0
  169. package/dist/plan-usage.d.ts.map +1 -0
  170. package/dist/plan-usage.js +134 -0
  171. package/dist/plan-usage.js.map +1 -0
  172. package/dist/preview-token.d.ts +52 -0
  173. package/dist/preview-token.d.ts.map +1 -0
  174. package/dist/preview-token.js +106 -0
  175. package/dist/preview-token.js.map +1 -0
  176. package/dist/prop-names.d.ts +51 -0
  177. package/dist/prop-names.d.ts.map +1 -0
  178. package/dist/prop-names.js +150 -0
  179. package/dist/prop-names.js.map +1 -0
  180. package/dist/prop-type-docs.d.ts +20 -0
  181. package/dist/prop-type-docs.d.ts.map +1 -0
  182. package/dist/prop-type-docs.js +89 -0
  183. package/dist/prop-type-docs.js.map +1 -0
  184. package/dist/prop-types.d.ts +97 -0
  185. package/dist/prop-types.d.ts.map +1 -0
  186. package/dist/prop-types.js +299 -0
  187. package/dist/prop-types.js.map +1 -0
  188. package/dist/props.d.ts +996 -0
  189. package/dist/props.d.ts.map +1 -0
  190. package/dist/props.js +183 -0
  191. package/dist/props.js.map +1 -0
  192. package/dist/proto-guard.d.ts +29 -0
  193. package/dist/proto-guard.d.ts.map +1 -0
  194. package/dist/proto-guard.js +79 -0
  195. package/dist/proto-guard.js.map +1 -0
  196. package/dist/runtime-errors.d.ts +42 -0
  197. package/dist/runtime-errors.d.ts.map +1 -0
  198. package/dist/runtime-errors.js +42 -0
  199. package/dist/runtime-errors.js.map +1 -0
  200. package/dist/runtime-pointers.d.ts +58 -0
  201. package/dist/runtime-pointers.d.ts.map +1 -0
  202. package/dist/runtime-pointers.js +84 -0
  203. package/dist/runtime-pointers.js.map +1 -0
  204. package/dist/secret-scan.d.ts +191 -0
  205. package/dist/secret-scan.d.ts.map +1 -0
  206. package/dist/secret-scan.js +542 -0
  207. package/dist/secret-scan.js.map +1 -0
  208. package/dist/semver.d.ts +89 -0
  209. package/dist/semver.d.ts.map +1 -0
  210. package/dist/semver.js +400 -0
  211. package/dist/semver.js.map +1 -0
  212. package/dist/server-key.d.ts +68 -0
  213. package/dist/server-key.d.ts.map +1 -0
  214. package/dist/server-key.js +150 -0
  215. package/dist/server-key.js.map +1 -0
  216. package/dist/site-manifest-keys.d.ts +107 -0
  217. package/dist/site-manifest-keys.d.ts.map +1 -0
  218. package/dist/site-manifest-keys.js +146 -0
  219. package/dist/site-manifest-keys.js.map +1 -0
  220. package/dist/site-manifest.d.ts +286 -0
  221. package/dist/site-manifest.d.ts.map +1 -0
  222. package/dist/site-manifest.js +100 -0
  223. package/dist/site-manifest.js.map +1 -0
  224. package/dist/source-archive.d.ts +119 -0
  225. package/dist/source-archive.d.ts.map +1 -0
  226. package/dist/source-archive.js +644 -0
  227. package/dist/source-archive.js.map +1 -0
  228. package/dist/source-package-corpus.d.ts +55 -0
  229. package/dist/source-package-corpus.d.ts.map +1 -0
  230. package/dist/source-package-corpus.js +303 -0
  231. package/dist/source-package-corpus.js.map +1 -0
  232. package/dist/source-package.d.ts +227 -0
  233. package/dist/source-package.d.ts.map +1 -0
  234. package/dist/source-package.js +361 -0
  235. package/dist/source-package.js.map +1 -0
  236. package/dist/source-secrets.d.ts +21 -0
  237. package/dist/source-secrets.d.ts.map +1 -0
  238. package/dist/source-secrets.js +43 -0
  239. package/dist/source-secrets.js.map +1 -0
  240. package/dist/ssr-cap.d.ts +61 -0
  241. package/dist/ssr-cap.d.ts.map +1 -0
  242. package/dist/ssr-cap.js +107 -0
  243. package/dist/ssr-cap.js.map +1 -0
  244. package/dist/ssr-kv.d.ts +18 -0
  245. package/dist/ssr-kv.d.ts.map +1 -0
  246. package/dist/ssr-kv.js +18 -0
  247. package/dist/ssr-kv.js.map +1 -0
  248. package/dist/ssr-version-ledger.d.ts +53 -0
  249. package/dist/ssr-version-ledger.d.ts.map +1 -0
  250. package/dist/ssr-version-ledger.js +88 -0
  251. package/dist/ssr-version-ledger.js.map +1 -0
  252. package/dist/style-references.d.ts +58 -0
  253. package/dist/style-references.d.ts.map +1 -0
  254. package/dist/style-references.js +241 -0
  255. package/dist/style-references.js.map +1 -0
  256. package/dist/tag-name.d.ts +87 -0
  257. package/dist/tag-name.d.ts.map +1 -0
  258. package/dist/tag-name.js +222 -0
  259. package/dist/tag-name.js.map +1 -0
  260. package/dist/tar-writer.d.ts +74 -0
  261. package/dist/tar-writer.d.ts.map +1 -0
  262. package/dist/tar-writer.js +148 -0
  263. package/dist/tar-writer.js.map +1 -0
  264. package/dist/testing.d.ts +11 -0
  265. package/dist/testing.d.ts.map +1 -0
  266. package/dist/testing.js +11 -0
  267. package/dist/testing.js.map +1 -0
  268. package/dist/text-codec.d.ts +36 -0
  269. package/dist/text-codec.d.ts.map +1 -0
  270. package/dist/text-codec.js +32 -0
  271. package/dist/text-codec.js.map +1 -0
  272. package/dist/url-value.d.ts +41 -0
  273. package/dist/url-value.d.ts.map +1 -0
  274. package/dist/url-value.js +147 -0
  275. package/dist/url-value.js.map +1 -0
  276. package/dist/usage-guard.d.ts +99 -0
  277. package/dist/usage-guard.d.ts.map +1 -0
  278. package/dist/usage-guard.js +104 -0
  279. package/dist/usage-guard.js.map +1 -0
  280. package/dist/usage-mirror.d.ts +55 -0
  281. package/dist/usage-mirror.d.ts.map +1 -0
  282. package/dist/usage-mirror.js +52 -0
  283. package/dist/usage-mirror.js.map +1 -0
  284. package/dist/value-check.d.ts +88 -0
  285. package/dist/value-check.d.ts.map +1 -0
  286. package/dist/value-check.js +279 -0
  287. package/dist/value-check.js.map +1 -0
  288. package/dist/value-patterns.d.ts +9 -0
  289. package/dist/value-patterns.d.ts.map +1 -0
  290. package/dist/value-patterns.js +17 -0
  291. package/dist/value-patterns.js.map +1 -0
  292. package/dist/value-schema.d.ts +796 -0
  293. package/dist/value-schema.d.ts.map +1 -0
  294. package/dist/value-schema.js +231 -0
  295. package/dist/value-schema.js.map +1 -0
  296. package/dist/zod-free.d.ts +60 -0
  297. package/dist/zod-free.d.ts.map +1 -0
  298. package/dist/zod-free.js +59 -0
  299. package/dist/zod-free.js.map +1 -0
  300. package/package.json +75 -3
  301. package/schema/DEPLOYED +12 -0
  302. package/schema/build-diagnostic.v1.json +63 -0
  303. package/schema/component-manifest.v1.json +1000 -0
  304. package/schema/data-api.v1.json +194 -0
  305. package/schema/library-manifest.v1.json +60 -0
  306. package/schema/published/SHA256SUMS +36 -0
  307. package/schema/published/build-diagnostic/v1.10.json +83 -0
  308. package/schema/published/build-diagnostic/v1.3.json +83 -0
  309. package/schema/published/build-diagnostic/v1.4.json +83 -0
  310. package/schema/published/build-diagnostic/v1.5.json +83 -0
  311. package/schema/published/build-diagnostic/v1.6.json +83 -0
  312. package/schema/published/build-diagnostic/v1.7.json +83 -0
  313. package/schema/published/build-diagnostic/v1.8.json +83 -0
  314. package/schema/published/build-diagnostic/v1.9.json +83 -0
  315. package/schema/published/component-manifest/v1.10.json +1443 -0
  316. package/schema/published/component-manifest/v1.3.json +1411 -0
  317. package/schema/published/component-manifest/v1.4.json +1419 -0
  318. package/schema/published/component-manifest/v1.5.json +1437 -0
  319. package/schema/published/component-manifest/v1.6.json +1437 -0
  320. package/schema/published/component-manifest/v1.7.json +1437 -0
  321. package/schema/published/component-manifest/v1.8.json +1437 -0
  322. package/schema/published/component-manifest/v1.9.json +1437 -0
  323. package/schema/published/data-api/v1.10.json +282 -0
  324. package/schema/published/data-api/v1.3.json +281 -0
  325. package/schema/published/data-api/v1.4.json +281 -0
  326. package/schema/published/data-api/v1.5.json +281 -0
  327. package/schema/published/data-api/v1.6.json +281 -0
  328. package/schema/published/data-api/v1.7.json +281 -0
  329. package/schema/published/data-api/v1.8.json +282 -0
  330. package/schema/published/data-api/v1.9.json +282 -0
  331. package/schema/published/library-manifest/v1.10.json +68 -0
  332. package/schema/published/library-manifest/v1.5.json +68 -0
  333. package/schema/published/library-manifest/v1.6.json +68 -0
  334. package/schema/published/library-manifest/v1.7.json +68 -0
  335. package/schema/published/library-manifest/v1.8.json +68 -0
  336. package/schema/published/library-manifest/v1.9.json +68 -0
  337. package/schema/published/taggor-config/v1.10.json +56 -0
  338. package/schema/published/taggor-config/v1.5.json +56 -0
  339. package/schema/published/taggor-config/v1.6.json +56 -0
  340. package/schema/published/taggor-config/v1.7.json +56 -0
  341. package/schema/published/taggor-config/v1.8.json +56 -0
  342. package/schema/published/taggor-config/v1.9.json +56 -0
  343. package/schema/taggor-config.v1.json +39 -0
package/dist/limits.js ADDED
@@ -0,0 +1,175 @@
1
+ /**
2
+ * Hard limits of component contract v1 (TAG-201).
3
+ *
4
+ * Every list, record and string in the manifest and in the data API is bounded so that a hostile
5
+ * manifest or payload cannot make the runtime, the builder, the edge or the API do unbounded work
6
+ * (golden rules 2 and 5). The schemas read these constants; `SPEC.md` documents them. Changing a
7
+ * value is a contract change: loosening is a minor bump, tightening is a major one (TAG-207).
8
+ */
9
+ /*
10
+ * The four manifest limits the SDK's value checks read (`checkValue` and `isAllowedUrl`, bundled
11
+ * into every component with a data hook) are plain constants as well (TAG-238): esbuild drops an
12
+ * unused object but never one property of a used one, so a check that read `MANIFEST_LIMITS.x`
13
+ * pulled all ~35 manifest limits into the component. `MANIFEST_LIMITS` reads the same constants, so
14
+ * each value still has one source. They are not re-exported by `index.ts` or `zod-free.ts`, so
15
+ * the public API is unchanged; code outside the value checks reads `MANIFEST_LIMITS`.
16
+ */
17
+ /** `MANIFEST_LIMITS.maxJsonLength`: a manifest's JSON length, and a value check's work budget. */
18
+ export const MAX_JSON_LENGTH = 65_536;
19
+ /** `MANIFEST_LIMITS.stringMaxLength`: upper bound of any declared string. */
20
+ export const STRING_MAX_LENGTH = 10_000;
21
+ /** `MANIFEST_LIMITS.arrayMaxItems`: upper bound of any declared array. */
22
+ export const ARRAY_MAX_ITEMS = 1_000;
23
+ /** `MANIFEST_LIMITS.urlMaxLength`: any `url` value. */
24
+ export const URL_MAX_LENGTH = 2_048;
25
+ /**
26
+ * Limits of the component manifest.
27
+ *
28
+ * Inputs: none. Output: frozen numbers used by the manifest schemas. Errors: none. Side effects:
29
+ * none. Marked `@__PURE__` (TAG-238) so a bundler drops it from a component that imports another
30
+ * limit: esbuild keeps an unmarked `Object.freeze` call.
31
+ */
32
+ export const MANIFEST_LIMITS = /* @__PURE__ */ Object.freeze({
33
+ /** Maximum length, in UTF-16 code units, of a manifest serialized as JSON. */
34
+ maxJsonLength: MAX_JSON_LENGTH,
35
+ /** Component `name` and custom element `tag`. */
36
+ nameMaxLength: 64,
37
+ titleMaxLength: 80,
38
+ descriptionMaxLength: 500,
39
+ /** Description attached to a prop, event, slot, part, CSS variable, collection or field. */
40
+ memberDescriptionMaxLength: 300,
41
+ /** Prop names, event names, slot names, part names, collection names, field names. */
42
+ memberNameMaxLength: 40,
43
+ cssVarNameMaxLength: 64,
44
+ cssValueMaxLength: 100,
45
+ maxProps: 50,
46
+ maxEvents: 20,
47
+ maxSlots: 10,
48
+ maxParts: 30,
49
+ maxCssVars: 30,
50
+ maxCollections: 10,
51
+ maxCollectionFields: 50,
52
+ maxTrackEvents: 30,
53
+ maxTrackProps: 8,
54
+ maxEnumValues: 50,
55
+ enumValueMaxLength: 64,
56
+ /** Fields of one declared object value (prop, event detail). */
57
+ maxObjectFields: 50,
58
+ /** Upper bound of any declared string (`maxLength` may only lower it). */
59
+ stringMaxLength: STRING_MAX_LENGTH,
60
+ /** Upper bound of any declared array (`maxItems` may only lower it). */
61
+ arrayMaxItems: ARRAY_MAX_ITEMS,
62
+ /** Nesting levels of arrays and objects inside a value schema. */
63
+ valueSchemaDepth: 3,
64
+ /** Default of a `color` prop (a CSS color, validated by the runtime with `CSS.supports`). */
65
+ colorMaxLength: 64,
66
+ /** Any `url` value: default, attribute or property. */
67
+ urlMaxLength: URL_MAX_LENGTH,
68
+ /** Attribute text of a `number` prop, checked before parsing (TAG-205). */
69
+ numberTextMaxLength: 32,
70
+ /** JSON text of an `array` or `object` prop read from an attribute, checked before parsing. */
71
+ propJsonMaxLength: 32_768,
72
+ maxConnectOrigins: 10,
73
+ /** Pixel bounds of the `size` hints. */
74
+ sizeMaxPixels: 4_000,
75
+ aspectRatioMaxTerm: 100,
76
+ });
77
+ /**
78
+ * Limits only the browser runtime reads (TAG-304), kept out of `MANIFEST_LIMITS`, which the SDK
79
+ * bundle carried whole until TAG-238 (the runtime still does), so a component does not pay for them.
80
+ *
81
+ * Inputs: none. Output: frozen numbers. Errors: none. Side effects: none.
82
+ */
83
+ export const RUNTIME_LIMITS = /* @__PURE__ */ Object.freeze({
84
+ /**
85
+ * JSON text of a `<script type="application/json" data-props>` child (all its props in one
86
+ * object), checked before parsing; nesting is `valueSchemaDepth` + 1 there.
87
+ */
88
+ propsScriptMaxLength: 65_536,
89
+ });
90
+ /**
91
+ * Limits of workspace settings the contract validates (TAG-204).
92
+ *
93
+ * Inputs: none. Output: frozen numbers. The tag prefix stays short so that a prefixed tag still
94
+ * fits `MANIFEST_LIMITS.nameMaxLength` with room for the component's own name. Errors: none. Side
95
+ * effects: none. Marked `@__PURE__` like `MANIFEST_LIMITS` (TAG-238).
96
+ */
97
+ export const WORKSPACE_LIMITS = /* @__PURE__ */ Object.freeze({
98
+ /** Workspace tag prefix, without the trailing hyphen (`acme`). */
99
+ tagPrefixMaxLength: 20,
100
+ });
101
+ /**
102
+ * Limits of the data API (submit, read, track) between a component and the edge.
103
+ *
104
+ * Inputs: none. Output: frozen numbers used by the data API schemas and, later, by the edge
105
+ * (TAG-702) before it parses a body. Errors: none. Side effects: none.
106
+ */
107
+ export const DATA_API_LIMITS = Object.freeze({
108
+ /** Maximum body of `POST /d/<siteKey>/<collection>` in bytes (threat T-76). */
109
+ submitBodyMaxBytes: 32_768,
110
+ /** Maximum body of a `track` beacon in bytes. */
111
+ trackBodyMaxBytes: 2_048,
112
+ /** Maximum keys in the `data` object of a submission before field validation. */
113
+ submitDataMaxKeys: 50,
114
+ idempotencyKeyMinLength: 16,
115
+ idempotencyKeyMaxLength: 64,
116
+ turnstileTokenMaxLength: 2_048,
117
+ honeypotMaxLength: 256,
118
+ /** Page size of `read`. */
119
+ readPageMax: 100,
120
+ readPageDefault: 20,
121
+ cursorMaxLength: 512,
122
+ errorMessageMaxLength: 500,
123
+ maxErrorFields: 50,
124
+ });
125
+ /**
126
+ * Limits of the consent proof a submission carries (TAG-212, `consent` of the data API's
127
+ * `submit`). Apart from `DATA_API_LIMITS` on purpose: the SDK bundles that object (its transports
128
+ * read it), and only the server-side schema reads these; the `@__PURE__` mark lets a bundler drop
129
+ * them from a component that imports another limit (esbuild keeps an unmarked `Object.freeze` call).
130
+ *
131
+ * Inputs: none. Output: frozen numbers used by `consentProofSchema`. Errors: none. Side effects:
132
+ * none.
133
+ */
134
+ export const CONSENT_PROOF_LIMITS = /* @__PURE__ */ Object.freeze({
135
+ /** `consent.text_hash`: SHA-256 in lowercase hex. */
136
+ consentTextHashLength: 64,
137
+ /** `consent.locale`: a BCP 47 language tag such as `pt-BR`. */
138
+ consentLocaleMaxLength: 35,
139
+ });
140
+ /**
141
+ * Limits of the `locales` declaration of a manifest (TAG-211, contract 1.2): the languages a
142
+ * component ships messages for. Apart from `MANIFEST_LIMITS` for the same reason as
143
+ * `CONSENT_PROOF_LIMITS`: the SDK bundled that whole object until TAG-238 (the runtime still
144
+ * does), and only the manifest schema reads these.
145
+ *
146
+ * Inputs: none. Output: frozen numbers used by the manifest schema. Errors: none. Side effects:
147
+ * none.
148
+ */
149
+ export const LOCALE_LIMITS = /* @__PURE__ */ Object.freeze({
150
+ /** Entries of `locales.supported`. */
151
+ maxLocales: 30,
152
+ /** One language tag of `locales` (`supported` entries and `default`), such as `pt-BR`. */
153
+ localeTagMaxLength: 35,
154
+ /**
155
+ * Messages in one catalog (keys of one language), checked by the SDK's build-time
156
+ * `checkMessages` before it compares the catalogs; the catalogs are not in the manifest.
157
+ */
158
+ maxMessagesPerLocale: 2_000,
159
+ });
160
+ /**
161
+ * Limits of the `assets` declaration of a manifest (TAG-213, contract 1.3): the files a component
162
+ * imports (images and fonts), which the builder (TAG-410) lists after bundling. These are the
163
+ * contract's hard bounds; each plan sets tighter ones, which the builder applies. Apart from
164
+ * `MANIFEST_LIMITS` for the same reason as `LOCALE_LIMITS`.
165
+ *
166
+ * Inputs: none. Output: frozen numbers used by the manifest schema. Errors: none. Side effects:
167
+ * none.
168
+ */
169
+ export const ASSET_LIMITS = /* @__PURE__ */ Object.freeze({
170
+ /** Entries of `assets`: distinct files (by content) one component version imports. */
171
+ maxAssets: 50,
172
+ /** Size in bytes of one asset. */
173
+ assetMaxBytes: 2_097_152,
174
+ });
175
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACxC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AACrC,uDAAuD;AACvD,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;IAC3D,8EAA8E;IAC9E,aAAa,EAAE,eAAe;IAC9B,iDAAiD;IACjD,aAAa,EAAE,EAAE;IACjB,cAAc,EAAE,EAAE;IAClB,oBAAoB,EAAE,GAAG;IACzB,4FAA4F;IAC5F,0BAA0B,EAAE,GAAG;IAC/B,sFAAsF;IACtF,mBAAmB,EAAE,EAAE;IACvB,mBAAmB,EAAE,EAAE;IACvB,iBAAiB,EAAE,GAAG;IACtB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,EAAE;IAClB,mBAAmB,EAAE,EAAE;IACvB,cAAc,EAAE,EAAE;IAClB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,EAAE;IACtB,gEAAgE;IAChE,eAAe,EAAE,EAAE;IACnB,0EAA0E;IAC1E,eAAe,EAAE,iBAAiB;IAClC,wEAAwE;IACxE,aAAa,EAAE,eAAe;IAC9B,kEAAkE;IAClE,gBAAgB,EAAE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,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;IACzD,sCAAsC;IACtC,UAAU,EAAE,EAAE;IACd,0FAA0F;IAC1F,kBAAkB,EAAE,EAAE;IACtB;;;OAGG;IACH,oBAAoB,EAAE,KAAK;CAC5B,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;IACxD,sFAAsF;IACtF,SAAS,EAAE,EAAE;IACb,kCAAkC;IAClC,aAAa,EAAE,SAAS;CACzB,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Language tags of the contract (TAG-211), without Zod: the pattern every tag follows and the
3
+ * attribute the SDK reads the visitor's language from. The runtime and the SDK may import these
4
+ * through `@taggor/contract/zod-free`; the manifest's `locales` (contract 1.2) and the consent
5
+ * proof of the data API (TAG-212) validate with the same pattern.
6
+ */
7
+ /**
8
+ * A BCP 47 language tag as the contract writes it (`pt-BR`, `en`, `es-419`, `zh-Hant-TW`): a
9
+ * lowercase language of 2 or 3 letters and subtags of 2 to 8 letters or digits. Shorter than full
10
+ * BCP 47 on purpose (no extensions or private use), so it stays a plain, bounded pattern.
11
+ */
12
+ export declare const LOCALE_TAG_PATTERN: RegExp;
13
+ /** Message of a value that is not a `LOCALE_TAG_PATTERN` tag. */
14
+ export declare const LOCALE_TAG_MESSAGE = "locale must be a language tag such as pt-BR or en";
15
+ /**
16
+ * The attribute of a component's element that picks its language (`<price-card locale="en">`),
17
+ * read by the SDK's `useLocale` before the nearest `lang`. A manifest declaring `locales` cannot
18
+ * also declare a prop of this name.
19
+ */
20
+ export declare const LOCALE_ATTRIBUTE = "locale";
21
+ //# sourceMappingURL=locale-tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-tag.d.ts","sourceRoot":"","sources":["../src/locale-tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAAuC,CAAC;AAEvE,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,sDAAsD,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WAAW,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Language tags of the contract (TAG-211), without Zod: the pattern every tag follows and the
3
+ * attribute the SDK reads the visitor's language from. The runtime and the SDK may import these
4
+ * through `@taggor/contract/zod-free`; the manifest's `locales` (contract 1.2) and the consent
5
+ * proof of the data API (TAG-212) validate with the same pattern.
6
+ */
7
+ /**
8
+ * A BCP 47 language tag as the contract writes it (`pt-BR`, `en`, `es-419`, `zh-Hant-TW`): a
9
+ * lowercase language of 2 or 3 letters and subtags of 2 to 8 letters or digits. Shorter than full
10
+ * BCP 47 on purpose (no extensions or private use), so it stays a plain, bounded pattern.
11
+ */
12
+ export const LOCALE_TAG_PATTERN = /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/;
13
+ /** Message of a value that is not a `LOCALE_TAG_PATTERN` tag. */
14
+ export const LOCALE_TAG_MESSAGE = "locale must be a language tag such as pt-BR or en";
15
+ /**
16
+ * The attribute of a component's element that picks its language (`<price-card locale="en">`),
17
+ * read by the SDK's `useLocale` before the nearest `lang`. A manifest declaring `locales` cannot
18
+ * also declare a prop of this name.
19
+ */
20
+ export const LOCALE_ATTRIBUTE = "locale";
21
+ //# sourceMappingURL=locale-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-tag.js","sourceRoot":"","sources":["../src/locale-tag.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,oCAAoC,CAAC;AAEvE,iEAAiE;AACjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,mDAAmD,CAAC;AAEtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The factory of build diagnostics (TAG-401 in the builder; moved here by TAG-407, its second
3
+ * user being the API, which refuses a source package with the same diagnostics before storing
4
+ * it).
5
+ *
6
+ * Turns a code and a message into a full `BuildDiagnostic`: the severity and the fallback hint
7
+ * come from `diagnosticCatalog`, the `docsUrl` is derived from the code, every string is cut to
8
+ * `BUILD_DIAGNOSTIC_LIMITS` and every path is made relative to the package. Text is untrusted (it
9
+ * can quote the customer's source): control, bidi and line separator characters become visible
10
+ * escapes and lone surrogates U+FFFD, and cuts never split a surrogate pair, so a diagnostic
11
+ * always passes `buildDiagnosticSchema` and fits Postgres `jsonb` (TAG-404 security review, M1
12
+ * and M3). A code that is not in the catalog does not type-check.
13
+ *
14
+ * Zod-free and pure.
15
+ */
16
+ import type { BuildDiagnostic } from "./build-diagnostic.js";
17
+ import { type DiagnosticCode, type DiagnosticSeverity } from "./diagnostic-catalog.js";
18
+ /** Where a diagnostic points and what it suggests; every field is optional. */
19
+ export interface DiagnosticDetails {
20
+ /** Path in the package; a virtual path (`/src/a.ts`) is made relative (`src/a.ts`). */
21
+ readonly file?: string | undefined;
22
+ /** 1-based line. */
23
+ readonly line?: number | undefined;
24
+ /** 1-based column, in UTF-16 code units. */
25
+ readonly column?: number | undefined;
26
+ /** The source line. */
27
+ readonly snippet?: string | undefined;
28
+ /** A fix specific to this case; the catalog's hint is used when absent. */
29
+ readonly hint?: string | undefined;
30
+ /** The manifest field the diagnostic is about (`props.count.default`). */
31
+ readonly manifestPath?: string | undefined;
32
+ /** Overrides the catalog's severity (a CSS error esbuild reports as an error). */
33
+ readonly severity?: DiagnosticSeverity | undefined;
34
+ }
35
+ /**
36
+ * Whether cutting `text` at `index` would split a surrogate pair (the unit there is the low half
37
+ * of one).
38
+ *
39
+ * Inputs: a string and an index. Output: a boolean. Errors: none. Side effects: none.
40
+ */
41
+ export declare function splitsPair(text: string, index: number): boolean;
42
+ /**
43
+ * The first `end` units of `text`, one fewer when `end` would split a surrogate pair.
44
+ *
45
+ * Inputs: a string and a cut position. Output: the prefix. Errors: none. Side effects: none.
46
+ */
47
+ export declare function prefixOf(text: string, end: number): string;
48
+ /**
49
+ * The package-relative form of a path (`/src/a.ts` → `src/a.ts`), or `undefined` when it is not
50
+ * a clean path inside the package (empty, `.`/`..` segments, a backslash, a control or bidi
51
+ * character, a lone surrogate, longer than the limit).
52
+ *
53
+ * Inputs: a virtual or relative path. Output: the relative path or `undefined`. Errors: none.
54
+ * Side effects: none.
55
+ */
56
+ export declare function packagePath(path: string): string | undefined;
57
+ /**
58
+ * Builds a diagnostic.
59
+ *
60
+ * Inputs: a catalog code, the message (English) and the details. Output: a frozen diagnostic
61
+ * with the catalog's severity (unless overridden), the given hint or the catalog's, the code's
62
+ * `docsUrl`, every text made safe (`safeDiagnosticText`) and cut to the contract's limits without
63
+ * splitting a surrogate pair, `file` relative to the package (dropped with its position and
64
+ * snippet when it is not a clean path), positions kept only when they are 1-based integers and a
65
+ * blank snippet dropped. Errors: none. Side effects: none.
66
+ */
67
+ export declare function makeDiagnostic(code: DiagnosticCode, message: string, details?: DiagnosticDetails): BuildDiagnostic;
68
+ /**
69
+ * Builds an error diagnostic: `makeDiagnostic` with severity `error`.
70
+ *
71
+ * Inputs, output, errors and side effects: as `makeDiagnostic`.
72
+ */
73
+ export declare function errorDiagnostic(code: DiagnosticCode, message: string, details?: DiagnosticDetails): BuildDiagnostic;
74
+ //# sourceMappingURL=make-diagnostic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-diagnostic.d.ts","sourceRoot":"","sources":["../src/make-diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,+EAA+E;AAC/E,MAAM,WAAW,iB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Text, } from "./diagnostic-catalog.js";
2
+ const L = BUILD_DIAGNOSTIC_LIMITS;
3
+ /**
4
+ * Whether cutting `text` at `index` would split a surrogate pair (the unit there is the low half
5
+ * of one).
6
+ *
7
+ * Inputs: a string and an index. Output: a boolean. Errors: none. Side effects: none.
8
+ */
9
+ export function splitsPair(text, index) {
10
+ const high = text.charCodeAt(index - 1);
11
+ const low = text.charCodeAt(index);
12
+ return high >= 0xd800 && high <= 0xdbff && low >= 0xdc00 && low <= 0xdfff;
13
+ }
14
+ /**
15
+ * The first `end` units of `text`, one fewer when `end` would split a surrogate pair.
16
+ *
17
+ * Inputs: a string and a cut position. Output: the prefix. Errors: none. Side effects: none.
18
+ */
19
+ export function prefixOf(text, end) {
20
+ return text.slice(0, end > 0 && splitsPair(text, end) ? end - 1 : end);
21
+ }
22
+ /** `text` cut to `max` units, the last one an ellipsis when cut; never splits a pair. */
23
+ function cut(text, max) {
24
+ return text.length <= max ? text : `${prefixOf(text, max - 1)}…`;
25
+ }
26
+ /** Untrusted text made safe and cut: cut first (bounded work), escape, then cut what grew. */
27
+ function clean(text, max) {
28
+ return cut(safeDiagnosticText(cut(text, max)), max);
29
+ }
30
+ /** A 1-based position, or `undefined` when it is not a usable integer. */
31
+ function positionOf(value) {
32
+ return value !== undefined &&
33
+ Number.isInteger(value) &&
34
+ value >= 1 &&
35
+ value <= L.diagnosticPositionMax
36
+ ? value
37
+ : undefined;
38
+ }
39
+ /**
40
+ * The package-relative form of a path (`/src/a.ts` → `src/a.ts`), or `undefined` when it is not
41
+ * a clean path inside the package (empty, `.`/`..` segments, a backslash, a control or bidi
42
+ * character, a lone surrogate, longer than the limit).
43
+ *
44
+ * Inputs: a virtual or relative path. Output: the relative path or `undefined`. Errors: none.
45
+ * Side effects: none.
46
+ */
47
+ export function packagePath(path) {
48
+ const relative = path.startsWith("/") ? path.slice(1) : path;
49
+ if (relative === "" || relative.length > L.diagnosticFileMaxLength)
50
+ return undefined;
51
+ if (relative.includes("\\") || !DIAGNOSTIC_TEXT_PATTERN.test(relative))
52
+ return undefined;
53
+ const segments = relative.split("/");
54
+ return segments.some((segment) => segment === "" || segment === "." || segment === "..")
55
+ ? undefined
56
+ : relative;
57
+ }
58
+ /**
59
+ * Builds a diagnostic.
60
+ *
61
+ * Inputs: a catalog code, the message (English) and the details. Output: a frozen diagnostic
62
+ * with the catalog's severity (unless overridden), the given hint or the catalog's, the code's
63
+ * `docsUrl`, every text made safe (`safeDiagnosticText`) and cut to the contract's limits without
64
+ * splitting a surrogate pair, `file` relative to the package (dropped with its position and
65
+ * snippet when it is not a clean path), positions kept only when they are 1-based integers and a
66
+ * blank snippet dropped. Errors: none. Side effects: none.
67
+ */
68
+ export function makeDiagnostic(code, message, details = {}) {
69
+ const entry = diagnosticEntry(code);
70
+ const file = details.file === undefined ? undefined : packagePath(details.file);
71
+ const line = file === undefined ? undefined : positionOf(details.line);
72
+ const column = line === undefined ? undefined : positionOf(details.column);
73
+ const hint = details.hint?.trim() ?? "";
74
+ const diagnostic = {
75
+ code,
76
+ severity: details.severity ?? entry.severity,
77
+ message: clean(message.trim() === "" ? entry.title.en : message, L.diagnosticMessageMaxLength),
78
+ hint: clean(hint === "" ? entry.hint.en : hint, L.diagnosticHintMaxLength),
79
+ docsUrl: diagnosticDocsUrl(code),
80
+ ...(file === undefined ? {} : { file }),
81
+ ...(line === undefined ? {} : { line }),
82
+ ...(column === undefined ? {} : { column }),
83
+ ...(file === undefined || details.snippet === undefined || details.snippet.trim() === ""
84
+ ? {}
85
+ : { snippet: clean(details.snippet, L.diagnosticSnippetMaxLength) }),
86
+ ...(details.manifestPath === undefined || details.manifestPath === ""
87
+ ? {}
88
+ : { manifestPath: clean(details.manifestPath, L.diagnosticManifestPathMaxLength) }),
89
+ };
90
+ return Object.freeze(diagnostic);
91
+ }
92
+ /**
93
+ * Builds an error diagnostic: `makeDiagnostic` with severity `error`.
94
+ *
95
+ * Inputs, output, errors and side effects: as `makeDiagnostic`.
96
+ */
97
+ export function errorDiagnostic(code, message, details = {}) {
98
+ return makeDiagnostic(code, message, { ...details, severity: "error" });
99
+ }
100
+ //# sourceMappingURL=make-diagnostic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"make-diagnostic.js","sourceRoot":"","sources":["../src/make-diagnostic.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GAGnB,MAAM,yBAAyB,CAAC;AAoBjC,MAAM,CAAC,GAAG,uBAAuB,CAAC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAa;IACpD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,GAAW;IAChD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACzE,CAAC;AAED,yFAAyF;AACzF,SAAS,GAAG,CAAC,IAAY,EAAE,GAAW;IACpC,OAAO,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;AACnE,CAAC;AAED,8FAA8F;AAC9F,SAAS,KAAK,CAAC,IAAY,EAAE,GAAW;IACtC,OAAO,GAAG,CAAC,kBAAkB,C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IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE;YACtF,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,0BAA0B,CAAC,EAAE,CAAC;QACtE,GAAG,CAAC,OAAO,CAAC,YAAY,KAAK,SAAS,IAAI,OAAO,CAAC,YAAY,KAAK,EAAE;YACnE,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,+BAA+B,CAAC,EAAE,CAAC;KACtF,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAoB,EACpB,OAAe,EACf,UAA6B,EAAE;IAE/B,OAAO,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Diagnostics of the breaking changes `compareManifests` finds (TAG-503): one warning per
3
+ * breaking change, for the agent that creates a version, saying which member changed, what a
4
+ * host page loses and how to migrate. Codes by member: `BREAKING_PROP_CHANGE`,
5
+ * `BREAKING_EVENT_CHANGE`, `BREAKING_SLOT_CHANGE` and `BREAKING_STYLE_CHANGE` (parts and CSS
6
+ * variables), with `manifestPath` at the change. Additive changes make no diagnostic.
7
+ *
8
+ * Zod-free and pure. Names and values come from a validated manifest, but enum values are free
9
+ * printable text, so every text goes through `makeDiagnostic` (made safe and cut).
10
+ */
11
+ import type { BuildDiagnostic } from "./build-diagnostic.js";
12
+ import type { ManifestChange } from "./manifest-compat.js";
13
+ /**
14
+ * The diagnostics of the breaking changes of a comparison.
15
+ *
16
+ * Inputs: the changes (`compareManifests(…).changes`, or a stored part of them) and the component's
17
+ * custom element tag (events reach pages as `<tag>:<name>`). Output: one frozen warning per
18
+ * breaking change, in the order of the changes, with the member's code, a message naming the
19
+ * member, a migration hint and `manifestPath` at the change; additive changes are skipped.
20
+ * Errors: none. Side effects: none.
21
+ */
22
+ export declare function compatibilityDiagnostics(changes: readonly ManifestChange[], tag: string): BuildDiagnostic[];
23
+ //# sourceMappingURL=manifest-compat-diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-compat-diagnostics.d.ts","sourceRoot":"","sources":["../src/manifest-compat-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAe,cAAc,EAAkB,MAAM,sBAAsB,CAAC;AAsIxF;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,GAAG,EAAE,MAAM,GACV,eAAe,EAAE,CAenB"}
@@ -0,0 +1,150 @@
1
+ import { makeDiagnostic } from "./make-diagnostic.js";
2
+ import { propAttributeName } from "./prop-names.js";
3
+ /** Most values a message lists before "and N more". */
4
+ const LISTED_VALUES = 10;
5
+ /** The code of a breaking change of each member. */
6
+ const CODE_OF = Object.freeze({
7
+ prop: "BREAKING_PROP_CHANGE",
8
+ event: "BREAKING_EVENT_CHANGE",
9
+ slot: "BREAKING_SLOT_CHANGE",
10
+ part: "BREAKING_STYLE_CHANGE",
11
+ cssVar: "BREAKING_STYLE_CHANGE",
12
+ });
13
+ /** A value of a change as text: JSON for strings, `none` for an absent rule. */
14
+ function shown(value) {
15
+ return value === null || value === undefined ? "none" : JSON.stringify(value);
16
+ }
17
+ /** Values as a quoted list, the first `LISTED_VALUES` of them. */
18
+ function listed(values) {
19
+ const all = values ?? [];
20
+ const head = all.slice(0, LISTED_VALUES).map((value) => JSON.stringify(value));
21
+ const rest = all.length - head.length;
22
+ return rest > 0 ? `${head.join(", ")} and ${String(rest)} more` : head.join(", ");
23
+ }
24
+ /** What happened to a rule, in words (`maxLength from 100 to 50`). */
25
+ function ruleChange(change) {
26
+ switch (change.kind) {
27
+ case "type-changed":
28
+ return `type from ${shown(change.before)} to ${shown(change.after)}`;
29
+ case "values-removed":
30
+ case "values-added":
31
+ return `${change.constraint ?? "values"} ${listed(change.values)} ${change.kind === "values-added" ? "added" : "removed"}`;
32
+ case "field-removed":
33
+ return "field removed";
34
+ case "field-added":
35
+ return "required field added";
36
+ case "field-required":
37
+ return "field now required";
38
+ case "field-optional":
39
+ return "field now optional";
40
+ default:
41
+ return `${change.constraint ?? "rule"} from ${shown(change.before)} to ${shown(change.after)}`;
42
+ }
43
+ }
44
+ /** Message and hint of a breaking prop change. */
45
+ function propTexts(change) {
46
+ const { name } = change;
47
+ const attribute = propAttributeName(name);
48
+ switch (change.kind) {
49
+ case "removed":
50
+ return [
51
+ `Prop "${name}" was removed: pages that set the "${attribute}" attribute or the ${name} property no longer change the component.`,
52
+ `Keep "${name}" in the manifest until no page sets "${attribute}", or remove the attribute from every page and promote with allowBreaking.`,
53
+ ];
54
+ case "renamed": {
55
+ const to = change.renamedTo ?? "";
56
+ const toAttribute = propAttributeName(to);
57
+ return [
58
+ `Prop "${name}" was renamed to "${to}": pages that set the "${attribute}" attribute or the ${name} property no longer change the component.`,
59
+ `Change "${attribute}" to "${toAttribute}" on every page that sets it, or keep "${name}" as well (the same declaration) until they do; then promote with allowBreaking.`,
60
+ ];
61
+ }
62
+ case "type-changed":
63
+ return [
64
+ `Prop "${name}" changed ${ruleChange(change)}: the "${attribute}" value pages set is read as the new type, or falls back to the default.`,
65
+ `Keep "${name}" as a ${shown(change.before)} and add a new prop with the new type, or update "${attribute}" on every page and promote with allowBreaking.`,
66
+ ];
67
+ case "values-removed":
68
+ return [
69
+ `Prop "${name}" no longer accepts ${listed(change.values)} (${change.constraint ?? "values"}, at ${change.path}): pages that set "${attribute}" to them get the default.`,
70
+ `Keep these values, or switch "${attribute}" to a value that remains on every page and promote with allowBreaking.`,
71
+ ];
72
+ default:
73
+ return [
74
+ `Prop "${name}" accepts fewer values (${ruleChange(change)}, at ${change.path}): a "${attribute}" value the old version took may now fall back to the default.`,
75
+ `Keep the old rule, or check the "${attribute}" value on every page and promote with allowBreaking.`,
76
+ ];
77
+ }
78
+ }
79
+ /** Message and hint of a breaking event change. */
80
+ function eventTexts(change, tag) {
81
+ const event = `${tag}:${change.name}`;
82
+ switch (change.kind) {
83
+ case "removed":
84
+ return [
85
+ `Event "${change.name}" was removed: listeners of "${event}" on pages never run again.`,
86
+ `Keep emitting "${event}" until no page listens to it, or move the listeners to the new event and promote with allowBreaking.`,
87
+ ];
88
+ case "propagation-changed":
89
+ return [
90
+ `Event "${change.name}" no longer ${change.constraint === "composed" ? "leaves the shadow root (composed)" : "bubbles"}: listeners of "${event}" on the document or an ancestor of the element stop receiving it.`,
91
+ `Set ${change.constraint ?? "bubbles"} back to true, or listen on the element itself on every page and promote with allowBreaking.`,
92
+ ];
93
+ default:
94
+ return [
95
+ `The detail of event "${change.name}" changed (${ruleChange(change)}, at ${change.path}): listeners of "${event}" may read a value they do not expect, or none.`,
96
+ `Keep the old detail and add new fields beside it, or emit a new event with the new detail and keep "${change.name}" until pages move; otherwise promote with allowBreaking.`,
97
+ ];
98
+ }
99
+ }
100
+ /** Message and hint of a breaking slot, part or CSS variable change. */
101
+ function styleTexts(change, tag) {
102
+ const { name } = change;
103
+ if (change.member === "slot") {
104
+ return [
105
+ `Slot "${name}" was removed: content pages put in slot="${name}" is no longer shown.`,
106
+ `Keep the slot, or move that content on every page and promote with allowBreaking.`,
107
+ ];
108
+ }
109
+ if (change.member === "part") {
110
+ return [
111
+ `Part "${name}" was removed: page CSS that styles ${tag}::part(${name}) no longer applies.`,
112
+ `Keep the part on an element of the component, or update that CSS and promote with allowBreaking.`,
113
+ ];
114
+ }
115
+ if (change.kind === "type-changed") {
116
+ return [
117
+ `CSS variable "${name}" changed ${ruleChange(change)}: values page CSS sets for it may no longer apply.`,
118
+ `Keep the type and add a new variable for the new one, or update the pages' CSS and promote with allowBreaking.`,
119
+ ];
120
+ }
121
+ return [
122
+ `CSS variable "${name}" was removed: page CSS that sets it no longer changes the component.`,
123
+ `Keep reading "${name}", or update the pages' CSS and promote with allowBreaking.`,
124
+ ];
125
+ }
126
+ /**
127
+ * The diagnostics of the breaking changes of a comparison.
128
+ *
129
+ * Inputs: the changes (`compareManifests(…).changes`, or a stored part of them) and the component's
130
+ * custom element tag (events reach pages as `<tag>:<name>`). Output: one frozen warning per
131
+ * breaking change, in the order of the changes, with the member's code, a message naming the
132
+ * member, a migration hint and `manifestPath` at the change; additive changes are skipped.
133
+ * Errors: none. Side effects: none.
134
+ */
135
+ export function compatibilityDiagnostics(changes, tag) {
136
+ return changes
137
+ .filter((change) => change.impact === "breaking")
138
+ .map((change) => {
139
+ const [message, hint] = change.member === "prop"
140
+ ? propTexts(change)
141
+ : change.member === "event"
142
+ ? eventTexts(change, tag)
143
+ : styleTexts(change, tag);
144
+ return makeDiagnostic(CODE_OF[change.member], message, {
145
+ hint,
146
+ manifestPath: change.path,
147
+ });
148
+ });
149
+ }
150
+ //# sourceMappingURL=manifest-compat-diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-compat-diagnostics.js","sourceRoot":"","sources":["../src/manifest-compat-diagnostics.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,uDAAuD;AACvD,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,oDAAoD;AACpD,MAAM,OAAO,GAA0D,MAAM,CAAC,MAAM,CAAC;IACnF,IAAI,EAAE,sBAAsB;IAC5B,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,uBAA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