@jomae/catalog 0.1.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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -0
  3. package/dist/baseline.d.ts +51 -0
  4. package/dist/baseline.d.ts.map +1 -0
  5. package/dist/baseline.js +123 -0
  6. package/dist/baseline.js.map +1 -0
  7. package/dist/detect.d.ts +81 -0
  8. package/dist/detect.d.ts.map +1 -0
  9. package/dist/detect.js +155 -0
  10. package/dist/detect.js.map +1 -0
  11. package/dist/format.d.ts +20 -0
  12. package/dist/format.d.ts.map +1 -0
  13. package/dist/format.js +45 -0
  14. package/dist/format.js.map +1 -0
  15. package/dist/generated/baseline.d.ts +22 -0
  16. package/dist/generated/baseline.d.ts.map +1 -0
  17. package/dist/generated/baseline.js +240 -0
  18. package/dist/generated/baseline.js.map +1 -0
  19. package/dist/generated/sizes.d.ts +18 -0
  20. package/dist/generated/sizes.d.ts.map +1 -0
  21. package/dist/generated/sizes.js +474 -0
  22. package/dist/generated/sizes.js.map +1 -0
  23. package/dist/index.d.ts +13 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +13 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/rules/accordion.d.ts +3 -0
  28. package/dist/rules/accordion.d.ts.map +1 -0
  29. package/dist/rules/accordion.js +50 -0
  30. package/dist/rules/accordion.js.map +1 -0
  31. package/dist/rules/aspect-ratio.d.ts +3 -0
  32. package/dist/rules/aspect-ratio.d.ts.map +1 -0
  33. package/dist/rules/aspect-ratio.js +33 -0
  34. package/dist/rules/aspect-ratio.js.map +1 -0
  35. package/dist/rules/carousel.d.ts +3 -0
  36. package/dist/rules/carousel.d.ts.map +1 -0
  37. package/dist/rules/carousel.js +78 -0
  38. package/dist/rules/carousel.js.map +1 -0
  39. package/dist/rules/color-functions.d.ts +3 -0
  40. package/dist/rules/color-functions.d.ts.map +1 -0
  41. package/dist/rules/color-functions.js +42 -0
  42. package/dist/rules/color-functions.js.map +1 -0
  43. package/dist/rules/container-queries.d.ts +3 -0
  44. package/dist/rules/container-queries.d.ts.map +1 -0
  45. package/dist/rules/container-queries.js +53 -0
  46. package/dist/rules/container-queries.js.map +1 -0
  47. package/dist/rules/dialog.d.ts +3 -0
  48. package/dist/rules/dialog.d.ts.map +1 -0
  49. package/dist/rules/dialog.js +51 -0
  50. package/dist/rules/dialog.js.map +1 -0
  51. package/dist/rules/discrete-transitions.d.ts +3 -0
  52. package/dist/rules/discrete-transitions.d.ts.map +1 -0
  53. package/dist/rules/discrete-transitions.js +57 -0
  54. package/dist/rules/discrete-transitions.js.map +1 -0
  55. package/dist/rules/field-sizing.d.ts +3 -0
  56. package/dist/rules/field-sizing.d.ts.map +1 -0
  57. package/dist/rules/field-sizing.js +37 -0
  58. package/dist/rules/field-sizing.js.map +1 -0
  59. package/dist/rules/fluid-type.d.ts +3 -0
  60. package/dist/rules/fluid-type.d.ts.map +1 -0
  61. package/dist/rules/fluid-type.js +30 -0
  62. package/dist/rules/fluid-type.js.map +1 -0
  63. package/dist/rules/height-animation.d.ts +3 -0
  64. package/dist/rules/height-animation.d.ts.map +1 -0
  65. package/dist/rules/height-animation.js +46 -0
  66. package/dist/rules/height-animation.js.map +1 -0
  67. package/dist/rules/index.d.ts +14 -0
  68. package/dist/rules/index.d.ts.map +1 -0
  69. package/dist/rules/index.js +56 -0
  70. package/dist/rules/index.js.map +1 -0
  71. package/dist/rules/masonry.d.ts +3 -0
  72. package/dist/rules/masonry.d.ts.map +1 -0
  73. package/dist/rules/masonry.js +56 -0
  74. package/dist/rules/masonry.js.map +1 -0
  75. package/dist/rules/popover.d.ts +3 -0
  76. package/dist/rules/popover.d.ts.map +1 -0
  77. package/dist/rules/popover.js +62 -0
  78. package/dist/rules/popover.js.map +1 -0
  79. package/dist/rules/scroll-animations.d.ts +3 -0
  80. package/dist/rules/scroll-animations.d.ts.map +1 -0
  81. package/dist/rules/scroll-animations.js +58 -0
  82. package/dist/rules/scroll-animations.js.map +1 -0
  83. package/dist/rules/scroll-lock.d.ts +3 -0
  84. package/dist/rules/scroll-lock.d.ts.map +1 -0
  85. package/dist/rules/scroll-lock.js +40 -0
  86. package/dist/rules/scroll-lock.js.map +1 -0
  87. package/dist/rules/scrollbars.d.ts +3 -0
  88. package/dist/rules/scrollbars.d.ts.map +1 -0
  89. package/dist/rules/scrollbars.js +44 -0
  90. package/dist/rules/scrollbars.js.map +1 -0
  91. package/dist/rules/select.d.ts +3 -0
  92. package/dist/rules/select.d.ts.map +1 -0
  93. package/dist/rules/select.js +54 -0
  94. package/dist/rules/select.js.map +1 -0
  95. package/dist/rules/smooth-scroll.d.ts +3 -0
  96. package/dist/rules/smooth-scroll.d.ts.map +1 -0
  97. package/dist/rules/smooth-scroll.js +41 -0
  98. package/dist/rules/smooth-scroll.js.map +1 -0
  99. package/dist/rules/sticky.d.ts +3 -0
  100. package/dist/rules/sticky.d.ts.map +1 -0
  101. package/dist/rules/sticky.js +39 -0
  102. package/dist/rules/sticky.js.map +1 -0
  103. package/dist/rules/text-box-trim.d.ts +3 -0
  104. package/dist/rules/text-box-trim.d.ts.map +1 -0
  105. package/dist/rules/text-box-trim.js +32 -0
  106. package/dist/rules/text-box-trim.js.map +1 -0
  107. package/dist/rules/text-wrap-balance.d.ts +3 -0
  108. package/dist/rules/text-wrap-balance.d.ts.map +1 -0
  109. package/dist/rules/text-wrap-balance.js +34 -0
  110. package/dist/rules/text-wrap-balance.js.map +1 -0
  111. package/dist/rules/view-transitions.d.ts +3 -0
  112. package/dist/rules/view-transitions.d.ts.map +1 -0
  113. package/dist/rules/view-transitions.js +53 -0
  114. package/dist/rules/view-transitions.js.map +1 -0
  115. package/dist/schema.d.ts +91 -0
  116. package/dist/schema.d.ts.map +1 -0
  117. package/dist/schema.js +124 -0
  118. package/dist/schema.js.map +1 -0
  119. package/package.json +52 -0
@@ -0,0 +1,53 @@
1
+ export const viewTransitions = {
2
+ id: "view-transitions",
3
+ title: "Page and state transitions",
4
+ replaces: [
5
+ "next-view-transitions",
6
+ "react-page-transition",
7
+ "barba.js",
8
+ "swup",
9
+ ],
10
+ featureIds: ["view-transitions"],
11
+ native: "The View Transitions API",
12
+ human: {
13
+ explainer: "The browser snapshots the old and new state and cross-fades between them, so a transition no longer means keeping the outgoing DOM mounted while you animate it out. Matching view-transition-name values on both sides give you a shared element transition, where a thumbnail grows into a hero image. For same-document transitions this is well supported; the cross-document version that makes multi-page apps animate is newer, so check it separately.",
14
+ snippet: `/* Same-document: wrap the state change. */
15
+ document.startViewTransition(() => {
16
+ applyTheNewState();
17
+ });
18
+
19
+ /* Shared element: same name on both pages. */
20
+ .thumbnail,
21
+ .hero-image {
22
+ view-transition-name: hero;
23
+ }
24
+
25
+ /* Customise the default cross-fade. */
26
+ ::view-transition-old(hero) {
27
+ animation-duration: 0.3s;
28
+ }
29
+
30
+ @media (prefers-reduced-motion: reduce) {
31
+ ::view-transition-group(*) {
32
+ animation: none;
33
+ }
34
+ }`,
35
+ },
36
+ agent: {
37
+ when: "cross-fading between two states, or growing a thumbnail into a hero image across a navigation",
38
+ unless: [
39
+ "You need cross-document transitions in a multi-page app. That part is less supported than same-document transitions, so verify it separately rather than assuming the whole API is available.",
40
+ "Your framework's router needs the outgoing page kept mounted, or its data fetching happens after the navigation commits, which leaves nothing to snapshot.",
41
+ "You need two elements with the same view-transition-name visible at once. Names must be unique per transition or it throws.",
42
+ "You need to interrupt or reverse a transition partway, for example following a swipe-back gesture.",
43
+ "You need the transition on a long list where every item has a name, which gets expensive.",
44
+ ],
45
+ snippet: `document.startViewTransition(() => applyNewState());
46
+
47
+ .thumb, .hero { view-transition-name: hero; }
48
+ @media (prefers-reduced-motion: reduce) {
49
+ ::view-transition-group(*) { animation: none; }
50
+ }`,
51
+ },
52
+ };
53
+ //# sourceMappingURL=view-transitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-transitions.js","sourceRoot":"","sources":["../../src/rules/view-transitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,4BAA4B;IACnC,QAAQ,EAAE;QACR,uBAAuB;QACvB,uBAAuB;QACvB,UAAU;QACV,MAAM;KACP;IACD,UAAU,EAAE,CAAC,kBAAkB,CAAC;IAChC,MAAM,EAAE,0BAA0B;IAClC,KAAK,EAAE;QACL,SAAS,EACP,gcAAgc;QAClc,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;EAoBX;KACC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,+FAA+F;QACrG,MAAM,EAAE;YACN,+LAA+L;YAC/L,4JAA4J;YAC5J,6HAA6H;YAC7H,oGAAoG;YACpG,2FAA2F;SAC5F;QACD,OAAO,EAAE;;;;;EAKX;KACC;CACF,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Bumped whenever the shape of a rule changes in a way that breaks consumers.
4
+ * Published alongside the catalog so downstream surfaces can refuse data they
5
+ * do not understand.
6
+ */
7
+ export declare const SCHEMA_VERSION = 1;
8
+ /**
9
+ * Support tiers, mirroring the three Baseline states plus an explicit unknown.
10
+ * `unknown` is never authored by hand. It only appears when a `featureId` is
11
+ * missing from the web-features snapshot, which the catalog tests treat as a
12
+ * failure.
13
+ */
14
+ export declare const baselineStatusSchema: z.ZodEnum<{
15
+ limited: "limited";
16
+ newly: "newly";
17
+ unknown: "unknown";
18
+ widely: "widely";
19
+ }>;
20
+ export type BaselineStatus = z.infer<typeof baselineStatusSchema>;
21
+ /**
22
+ * Escape hatch for features that web-features has no ID for yet. Carries the
23
+ * date it was checked by hand so `scripts/check-freshness.ts` can fail CI once
24
+ * the claim goes stale.
25
+ */
26
+ export declare const manualBaselineSchema: z.ZodObject<{
27
+ status: z.ZodEnum<{
28
+ limited: "limited";
29
+ newly: "newly";
30
+ widely: "widely";
31
+ }>;
32
+ verifiedOn: z.ZodString;
33
+ note: z.ZodString;
34
+ }, z.core.$strip>;
35
+ export type ManualBaseline = z.infer<typeof manualBaselineSchema>;
36
+ export declare const ruleSchema: z.ZodObject<{
37
+ id: z.ZodString;
38
+ title: z.ZodString;
39
+ replaces: z.ZodArray<z.ZodString>;
40
+ featureIds: z.ZodArray<z.ZodString>;
41
+ native: z.ZodString;
42
+ human: z.ZodObject<{
43
+ explainer: z.ZodString;
44
+ snippet: z.ZodString;
45
+ demoUrl: z.ZodOptional<z.ZodURL>;
46
+ }, z.core.$strip>;
47
+ agent: z.ZodObject<{
48
+ when: z.ZodString;
49
+ unless: z.ZodArray<z.ZodString>;
50
+ snippet: z.ZodString;
51
+ }, z.core.$strip>;
52
+ manualBaseline: z.ZodOptional<z.ZodObject<{
53
+ status: z.ZodEnum<{
54
+ limited: "limited";
55
+ newly: "newly";
56
+ widely: "widely";
57
+ }>;
58
+ verifiedOn: z.ZodString;
59
+ note: z.ZodString;
60
+ }, z.core.$strip>>;
61
+ }, z.core.$strip>;
62
+ export type Rule = z.infer<typeof ruleSchema>;
63
+ export declare const catalogSchema: z.ZodArray<z.ZodObject<{
64
+ id: z.ZodString;
65
+ title: z.ZodString;
66
+ replaces: z.ZodArray<z.ZodString>;
67
+ featureIds: z.ZodArray<z.ZodString>;
68
+ native: z.ZodString;
69
+ human: z.ZodObject<{
70
+ explainer: z.ZodString;
71
+ snippet: z.ZodString;
72
+ demoUrl: z.ZodOptional<z.ZodURL>;
73
+ }, z.core.$strip>;
74
+ agent: z.ZodObject<{
75
+ when: z.ZodString;
76
+ unless: z.ZodArray<z.ZodString>;
77
+ snippet: z.ZodString;
78
+ }, z.core.$strip>;
79
+ manualBaseline: z.ZodOptional<z.ZodObject<{
80
+ status: z.ZodEnum<{
81
+ limited: "limited";
82
+ newly: "newly";
83
+ widely: "widely";
84
+ }>;
85
+ verifiedOn: z.ZodString;
86
+ note: z.ZodString;
87
+ }, z.core.$strip>>;
88
+ }, z.core.$strip>>;
89
+ /** Throws a readable error if any rule is malformed. Used by tests and CI. */
90
+ export declare function parseCatalog(rules: unknown): Rule[];
91
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;EAK/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAkBlE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;iBAK/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;iBA0DnB,CAAC;AAEL,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;kBA2BxB,CAAC;AAEH,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,CAEnD"}
package/dist/schema.js ADDED
@@ -0,0 +1,124 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Bumped whenever the shape of a rule changes in a way that breaks consumers.
4
+ * Published alongside the catalog so downstream surfaces can refuse data they
5
+ * do not understand.
6
+ */
7
+ export const SCHEMA_VERSION = 1;
8
+ /**
9
+ * Support tiers, mirroring the three Baseline states plus an explicit unknown.
10
+ * `unknown` is never authored by hand. It only appears when a `featureId` is
11
+ * missing from the web-features snapshot, which the catalog tests treat as a
12
+ * failure.
13
+ */
14
+ export const baselineStatusSchema = z.enum([
15
+ "widely",
16
+ "newly",
17
+ "limited",
18
+ "unknown",
19
+ ]);
20
+ const isoDate = z
21
+ .string()
22
+ .regex(/^\d{4}-\d{2}-\d{2}$/, "expected an ISO date, YYYY-MM-DD");
23
+ const slug = z
24
+ .string()
25
+ .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "expected a lowercase kebab-case slug");
26
+ /** npm package names: optionally scoped, lowercase, no URL-unsafe characters. */
27
+ const packageName = z
28
+ .string()
29
+ .regex(/^(?:@[a-z0-9][a-z0-9-._]*\/)?[a-z0-9][a-z0-9-._]*$/, "expected a lowercase npm package name");
30
+ /**
31
+ * Escape hatch for features that web-features has no ID for yet. Carries the
32
+ * date it was checked by hand so `scripts/check-freshness.ts` can fail CI once
33
+ * the claim goes stale.
34
+ */
35
+ export const manualBaselineSchema = z.object({
36
+ status: baselineStatusSchema.exclude(["unknown"]),
37
+ verifiedOn: isoDate,
38
+ /** What was checked, and where. Shown to maintainers, not to users. */
39
+ note: z.string().min(1),
40
+ });
41
+ export const ruleSchema = z
42
+ .object({
43
+ /** Stable identifier. Used in URLs and as the reference filename. */
44
+ id: slug,
45
+ /** Short human label, e.g. "Carousels". */
46
+ title: z.string().min(1),
47
+ /** npm packages this rule can replace. Exact names, lowercase. */
48
+ replaces: z.array(packageName).min(1),
49
+ /**
50
+ * web-features IDs for the features REQUIRED to make the replacement.
51
+ * Baseline status is DERIVED from these, never hardcoded, and a rule
52
+ * reports the least-supported of them. Features that merely make the
53
+ * snippet nicer do not belong here, or they would understate the rule.
54
+ * Call those out in `agent.unless` instead. Empty only when
55
+ * `manualBaseline` is supplied.
56
+ */
57
+ featureIds: z.array(z.string().min(1)),
58
+ /** The native approach, one line. */
59
+ native: z.string().min(1),
60
+ human: z.object({
61
+ /** 2 to 4 sentences of prose. */
62
+ explainer: z.string().min(1),
63
+ /** Copy-pasteable CSS or HTML. */
64
+ snippet: z.string().min(1),
65
+ /** A live demo or a post that walks through it. */
66
+ demoUrl: z.url().optional(),
67
+ }),
68
+ /** Terse projection for LLM surfaces. Budget roughly 200 tokens. */
69
+ agent: z.object({
70
+ /** The situation the native approach covers. */
71
+ when: z.string().min(1),
72
+ /**
73
+ * The refusal conditions: when the dependency is still the right call.
74
+ * A rule with an empty `unless` is not finished, so this is enforced
75
+ * rather than documented.
76
+ */
77
+ unless: z
78
+ .array(z.string().min(1))
79
+ .min(1, "every rule must state when the dependency is still correct"),
80
+ snippet: z.string().min(1),
81
+ }),
82
+ manualBaseline: manualBaselineSchema.optional(),
83
+ })
84
+ .superRefine((rule, ctx) => {
85
+ if (rule.featureIds.length === 0 && !rule.manualBaseline) {
86
+ ctx.addIssue({
87
+ code: "custom",
88
+ path: ["featureIds"],
89
+ message: "a rule needs at least one web-features ID, or an explicit manualBaseline with a verifiedOn date",
90
+ });
91
+ }
92
+ });
93
+ export const catalogSchema = z.array(ruleSchema).superRefine((rules, ctx) => {
94
+ const seenIds = new Set();
95
+ const owners = new Map();
96
+ for (const [index, rule] of rules.entries()) {
97
+ if (seenIds.has(rule.id)) {
98
+ ctx.addIssue({
99
+ code: "custom",
100
+ path: [index, "id"],
101
+ message: `duplicate rule id "${rule.id}"`,
102
+ });
103
+ }
104
+ seenIds.add(rule.id);
105
+ for (const pkg of rule.replaces) {
106
+ const owner = owners.get(pkg);
107
+ if (owner) {
108
+ ctx.addIssue({
109
+ code: "custom",
110
+ path: [index, "replaces"],
111
+ message: `"${pkg}" is already claimed by rule "${owner}". A package may only be claimed once, so a report never shows the same dependency twice.`,
112
+ });
113
+ }
114
+ else {
115
+ owners.set(pkg, rule.id);
116
+ }
117
+ }
118
+ }
119
+ });
120
+ /** Throws a readable error if any rule is malformed. Used by tests and CI. */
121
+ export function parseCatalog(rules) {
122
+ return catalogSchema.parse(rules);
123
+ }
124
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;A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ind youmightnotneed.dev. Maps npm packages to the modern CSS and HTML that replaces them.",
6
+ "license": "MIT",
7
+ "author": "Johannes Maendle",
8
+ "homepage": "https://youmightnotneed.dev",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/jomaendle/youmightnotneed.git",
12
+ "directory": "packages/catalog"
13
+ },
14
+ "keywords": [
15
+ "css",
16
+ "baseline",
17
+ "bundle-size",
18
+ "web-platform",
19
+ "dependencies"
20
+ ],
21
+ "sideEffects": false,
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ }
27
+ },
28
+ "main": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "files": [
31
+ "dist",
32
+ "README.md"
33
+ ],
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "zod": "^4.5.4"
39
+ },
40
+ "devDependencies": {
41
+ "vitest": "^4.1.11",
42
+ "@types/node": "^24.13.3",
43
+ "@vitest/coverage-v8": "^4.1.11"
44
+ },
45
+ "scripts": {
46
+ "build": "tsc -p tsconfig.build.json",
47
+ "typecheck": "tsc -p tsconfig.json --noEmit",
48
+ "test": "vitest run",
49
+ "test:watch": "vitest",
50
+ "test:coverage": "vitest run --coverage"
51
+ }
52
+ }