@marktiderman/genesis-features 0.9.0 → 0.10.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 (43) hide show
  1. package/README.md +14 -279
  2. package/dist/blocks.d.ts +4 -470
  3. package/dist/blocks.js +7 -5
  4. package/dist/gate-react.d.ts +4 -45
  5. package/dist/gate-react.js +7 -36
  6. package/dist/gate.d.ts +4 -15
  7. package/dist/gate.js +7 -5
  8. package/dist/index.d.ts +4 -124
  9. package/dist/index.js +7 -8
  10. package/dist/node.d.ts +4 -156
  11. package/dist/node.js +7 -486
  12. package/dist/react.d.ts +4 -57
  13. package/dist/react.js +7 -235
  14. package/dist/settings-protocol.d.ts +7 -0
  15. package/dist/settings-protocol.js +7 -0
  16. package/dist/settings-react.d.ts +7 -0
  17. package/dist/settings-react.js +8 -0
  18. package/dist/settings.d.ts +7 -0
  19. package/dist/settings.js +7 -0
  20. package/package.json +35 -51
  21. package/dist/blocks.js.map +0 -1
  22. package/dist/chunk-B6WRD3WF.js +0 -6
  23. package/dist/chunk-B6WRD3WF.js.map +0 -1
  24. package/dist/chunk-OW46SL2G.js +0 -10
  25. package/dist/chunk-OW46SL2G.js.map +0 -1
  26. package/dist/chunk-SEFG2QV6.js +0 -413
  27. package/dist/chunk-SEFG2QV6.js.map +0 -1
  28. package/dist/chunk-VYUX7VAX.js +0 -52
  29. package/dist/chunk-VYUX7VAX.js.map +0 -1
  30. package/dist/chunk-YTPGUU5F.js +0 -121
  31. package/dist/chunk-YTPGUU5F.js.map +0 -1
  32. package/dist/chunk-Z3TTDIVM.js +0 -494
  33. package/dist/chunk-Z3TTDIVM.js.map +0 -1
  34. package/dist/gate-oYFzQKyb.d.ts +0 -199
  35. package/dist/gate-react.js.map +0 -1
  36. package/dist/gate.js.map +0 -1
  37. package/dist/index.js.map +0 -1
  38. package/dist/model-sTRmrxz3.d.ts +0 -437
  39. package/dist/node.js.map +0 -1
  40. package/dist/packages-CWhdXtzS.d.ts +0 -203
  41. package/dist/platforms-NR0liM8L.d.ts +0 -10
  42. package/dist/react.js.map +0 -1
  43. package/dist/types-Bd766VxF.d.ts +0 -39
package/dist/react.js CHANGED
@@ -1,236 +1,8 @@
1
1
  "use client";
2
- import { FEATURE_STATUSES, toRecords, marketingRecords, FEATURE_HORIZONS } from './chunk-SEFG2QV6.js';
3
- import './chunk-VYUX7VAX.js';
4
- import './chunk-B6WRD3WF.js';
5
- import './chunk-OW46SL2G.js';
6
- import { useMemo, useState } from 'react';
7
- import { AppWindow, Users, Eye } from 'lucide-react';
8
- import { StatusBadge, Badge, Section, Card, CardHeader, CardTitle, CardDescription, CardContent } from '@marktiderman/genesis-ui';
9
- import { ResourcePage, DataGrid, KanbanBoard } from '@marktiderman/genesis-ui/data';
10
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
-
12
- var BOARD_STATUS = {
13
- idea: "neutral",
14
- planned: "neutral",
15
- building: "info",
16
- beta: "warning",
17
- live: "success",
18
- deprecated: "destructive",
19
- retired: "neutral"
20
- };
21
- var LABEL = {
22
- idea: "Idea",
23
- planned: "Planned",
24
- building: "Building",
25
- beta: "Beta",
26
- live: "Live",
27
- deprecated: "Deprecated",
28
- retired: "Retired"
29
- };
30
- var HORIZON_LABEL = { now: "Now", next: "Next", later: "Later" };
31
- var SHIPPING = FEATURE_STATUSES.filter((s) => s !== "idea" && s !== "planned");
32
- function FeatureStatusBadge({ status }) {
33
- if (status === "building") return /* @__PURE__ */ jsx(StatusBadge, { status: "inProgress", children: LABEL[status] });
34
- if (status === "beta") return /* @__PURE__ */ jsx(StatusBadge, { status: "atRisk", children: LABEL[status] });
35
- if (status === "live") return /* @__PURE__ */ jsx(StatusBadge, { status: "done", children: LABEL[status] });
36
- if (status === "deprecated") return /* @__PURE__ */ jsx(StatusBadge, { status: "offTrack", children: LABEL[status] });
37
- return /* @__PURE__ */ jsx(Badge, { variant: status === "planned" || status === "idea" ? "secondary" : "outline", children: LABEL[status] });
38
- }
39
- var unique = (values) => [...new Set(values)].sort();
40
- function facet(key, label, icon, values, selected, onChange) {
41
- return { key, label, icon, options: unique(values).map((value) => ({ value })), selected, onChange };
42
- }
43
- function FeatureCard({ feature, onOpen }) {
44
- const body = /* @__PURE__ */ jsxs(Fragment, { children: [
45
- /* @__PURE__ */ jsxs("span", { className: "flex items-start justify-between gap-2", children: [
46
- /* @__PURE__ */ jsx("span", { className: "font-medium leading-tight", children: feature.name }),
47
- /* @__PURE__ */ jsx(FeatureStatusBadge, { status: feature.status })
48
- ] }),
49
- /* @__PURE__ */ jsx("span", { className: "block text-sm text-muted-foreground", children: feature.summary }),
50
- /* @__PURE__ */ jsxs("span", { className: "block text-xs text-muted-foreground", children: [
51
- feature.owner,
52
- " \xB7 ",
53
- feature.apps.join(", "),
54
- " \xB7 ",
55
- feature.audience.join(", ")
56
- ] })
57
- ] });
58
- const look = "block w-full space-y-2 rounded-lg border bg-card p-3 text-left text-card-foreground";
59
- if (!onOpen) return /* @__PURE__ */ jsx("div", { className: look, "data-feature-id": feature.id, children: body });
60
- return /* @__PURE__ */ jsx(
61
- "button",
62
- {
63
- type: "button",
64
- onClick: onOpen,
65
- "aria-label": `Open ${feature.name}`,
66
- "data-feature-id": feature.id,
67
- className: `${look} focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,
68
- children: body
69
- }
70
- );
71
- }
72
- function FeatureBoard(props) {
73
- if (props.viewMode !== "grid") return /* @__PURE__ */ jsx(DataGrid, { ...props });
74
- const { items, renderCard } = props;
75
- const columns = SHIPPING.map((status) => ({
76
- key: status,
77
- label: LABEL[status],
78
- status: BOARD_STATUS[status],
79
- items: items.filter((item) => item.status === status)
80
- }));
81
- return /* @__PURE__ */ jsx(
82
- KanbanBoard,
83
- {
84
- columns,
85
- getKey: (item) => item.id,
86
- emptyMessage: "None",
87
- renderCard: (item) => renderCard(item, items.indexOf(item))
88
- }
89
- );
90
- }
91
- function PathList({ paths, href }) {
92
- return /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: paths.map((path) => {
93
- const url = /^https?:\/\//.test(path) ? path : href?.(path);
94
- return /* @__PURE__ */ jsx("li", { className: "font-mono text-xs", children: url ? /* @__PURE__ */ jsx("a", { className: "underline underline-offset-2", href: url, target: "_blank", rel: "noreferrer", children: path }) : path }, path);
95
- }) });
96
- }
97
- function Row({ label, children }) {
98
- return /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
99
- /* @__PURE__ */ jsx("dt", { className: "text-xs font-medium uppercase tracking-wide text-muted-foreground", children: label }),
100
- /* @__PURE__ */ jsx("dd", { className: "text-sm", children })
101
- ] });
102
- }
103
- function FeatureDetail({ feature, pathHref }) {
104
- const { links } = feature;
105
- return /* @__PURE__ */ jsxs("dl", { className: "space-y-4", children: [
106
- /* @__PURE__ */ jsx(Row, { label: "Status", children: /* @__PURE__ */ jsx(FeatureStatusBadge, { status: feature.status }) }),
107
- /* @__PURE__ */ jsx(Row, { label: "Summary", children: feature.summary }),
108
- /* @__PURE__ */ jsx(Row, { label: "Owner", children: feature.owner }),
109
- /* @__PURE__ */ jsx(Row, { label: "Apps", children: feature.apps.join(", ") }),
110
- /* @__PURE__ */ jsx(Row, { label: "Audience", children: feature.audience.join(", ") }),
111
- /* @__PURE__ */ jsx(Row, { label: "Visibility", children: feature.visibility }),
112
- /* @__PURE__ */ jsx(Row, { label: "Access", children: feature.access === "all" ? "Everyone" : `The ${feature.access.plan} plan` }),
113
- feature.horizon ? /* @__PURE__ */ jsx(Row, { label: "Roadmap", children: HORIZON_LABEL[feature.horizon] }) : null,
114
- feature.claimedBy ? /* @__PURE__ */ jsx(Row, { label: "Being built by", children: feature.claimedBy }) : null,
115
- feature.tagline ? /* @__PURE__ */ jsx(Row, { label: "Tagline", children: feature.tagline }) : null,
116
- feature.acceptance?.length ? /* @__PURE__ */ jsx(Row, { label: "Acceptance", children: /* @__PURE__ */ jsx("ul", { className: "list-disc space-y-1 pl-4", children: feature.acceptance.map((a) => /* @__PURE__ */ jsx("li", { children: a }, a)) }) }) : null,
117
- feature.reviewedAt ? /* @__PURE__ */ jsx(Row, { label: "Reviewed", children: feature.reviewedAt }) : null,
118
- feature.since ? /* @__PURE__ */ jsx(Row, { label: "Since", children: feature.since }) : null,
119
- feature.flags.length ? /* @__PURE__ */ jsx(Row, { label: "Flags", children: feature.flags.join(", ") }) : null,
120
- links?.code?.length ? /* @__PURE__ */ jsx(Row, { label: "Code", children: /* @__PURE__ */ jsx(PathList, { paths: links.code, href: pathHref }) }) : null,
121
- links?.docs?.length ? /* @__PURE__ */ jsx(Row, { label: "Docs", children: /* @__PURE__ */ jsx(PathList, { paths: links.docs, href: pathHref }) }) : null,
122
- links?.issue ? /* @__PURE__ */ jsx(Row, { label: "Issue", children: links.issue }) : null
123
- ] });
124
- }
125
- function Roadmap({ records }) {
126
- const columns = FEATURE_HORIZONS.map((horizon) => ({
127
- key: horizon,
128
- label: HORIZON_LABEL[horizon],
129
- status: horizon === "now" ? "info" : "neutral",
130
- items: records.filter((r) => r.horizon === horizon)
131
- }));
132
- return /* @__PURE__ */ jsx(Section, { title: "Roadmap", description: "What's coming, in order. No dates.", testID: "feature-roadmap", children: /* @__PURE__ */ jsx(
133
- KanbanBoard,
134
- {
135
- columns,
136
- getKey: (r) => r.id,
137
- emptyMessage: "Nothing yet",
138
- className: "xl:grid-cols-3",
139
- renderCard: (r) => /* @__PURE__ */ jsx(FeatureCard, { feature: r })
140
- }
141
- ) });
142
- }
143
- function MarketingList({ features, title }) {
144
- const records = marketingRecords(features);
145
- const groups = [...new Set(records.map((r) => r.highlight ? "" : r.category ?? "More"))];
146
- return /* @__PURE__ */ jsx(Section, { title, testID: "feature-marketing", children: groups.map((group) => /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
147
- group ? /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: group }) : null,
148
- /* @__PURE__ */ jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: records.filter((r) => (r.highlight ? "" : r.category ?? "More") === group).map((r) => /* @__PURE__ */ jsxs(Card, { "data-feature-id": r.id, className: r.highlight ? "border-primary" : void 0, children: [
149
- r.media?.image ? /* @__PURE__ */ jsx("img", { src: r.media.image, alt: r.media.alt, className: "aspect-video w-full rounded-t-lg object-cover" }) : null,
150
- /* @__PURE__ */ jsxs(CardHeader, { children: [
151
- /* @__PURE__ */ jsxs(CardTitle, { children: [
152
- r.name,
153
- r.status === "beta" ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "ml-2", children: "Beta" }) : null
154
- ] }),
155
- /* @__PURE__ */ jsx(CardDescription, { children: r.tagline })
156
- ] }),
157
- r.media?.video ? /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("a", { className: "text-sm underline underline-offset-2", href: r.media.video, target: "_blank", rel: "noreferrer", children: [
158
- "Watch: ",
159
- r.media.alt
160
- ] }) }) : null
161
- ] }, r.id)) })
162
- ] }, group || "highlights")) });
163
- }
164
- function FeatureList({
165
- features,
166
- flags,
167
- title = "Features",
168
- subtitle,
169
- defaultView = "table",
170
- viewSettingsKey,
171
- pathHref,
172
- variant = "admin",
173
- roadmap = true,
174
- resourcePageProps,
175
- className
176
- }) {
177
- const records = useMemo(() => toRecords(features, flags), [features, flags]);
178
- const [apps, setApps] = useState([]);
179
- const [audience, setAudience] = useState([]);
180
- const [visibility, setVisibility] = useState([]);
181
- const data = useMemo(
182
- () => records.filter(
183
- (r) => r.status !== "planned" && r.status !== "idea" && (apps.length === 0 || r.apps.some((a) => apps.includes(a))) && (audience.length === 0 || r.audience.some((a) => audience.includes(a))) && (visibility.length === 0 || visibility.includes(r.visibility))
184
- ),
185
- [records, apps, audience, visibility]
186
- );
187
- if (variant === "marketing") {
188
- return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(MarketingList, { features, title }) });
189
- }
190
- const filters = [
191
- facet("apps", "App", AppWindow, records.flatMap((r) => r.apps), apps, setApps),
192
- facet("audience", "Audience", Users, records.flatMap((r) => r.audience), audience, setAudience),
193
- facet("visibility", "Visibility", Eye, records.map((r) => r.visibility), visibility, setVisibility)
194
- ];
195
- const planned = records.filter((r) => r.horizon);
196
- return /* @__PURE__ */ jsxs("div", { className: className ? `space-y-8 ${className}` : "space-y-8", children: [
197
- /* @__PURE__ */ jsx(
198
- ResourcePage,
199
- {
200
- title,
201
- subtitle,
202
- data,
203
- total: data.length,
204
- getKey: (r) => r.id,
205
- titleField: "name",
206
- subtitleField: "id",
207
- columns: [
208
- { key: "name", header: "Feature" },
209
- { key: "status", header: "Status", render: (r) => /* @__PURE__ */ jsx(FeatureStatusBadge, { status: r.status }) },
210
- { key: "owner", header: "Owner", hideBelow: "md" },
211
- { key: "apps", header: "Apps", hideBelow: "lg", accessor: (r) => r.apps.join(", ") },
212
- { key: "audience", header: "Audience", hideBelow: "lg", accessor: (r) => r.audience.join(", ") },
213
- { key: "visibility", header: "Visibility", hideBelow: "xl" },
214
- { key: "summary", header: "Summary", hideBelow: "xl" }
215
- ],
216
- searchFields: ["id", "name", "summary", "owner", "tagline", "category"],
217
- searchPlaceholder: "Search features",
218
- statusFilter: { field: "status", options: [...SHIPPING] },
219
- filters,
220
- detail: "panel",
221
- renderDetail: (r) => /* @__PURE__ */ jsx(FeatureDetail, { feature: r, pathHref }),
222
- renderCard: (r, _index, actions) => /* @__PURE__ */ jsx(FeatureCard, { feature: r, onOpen: actions.open }),
223
- defaultView: defaultView === "board" ? "grid" : "table",
224
- viewSettingsKey,
225
- emptyMessage: "No features match",
226
- ...resourcePageProps,
227
- slots: { grid: FeatureBoard, ...resourcePageProps?.slots }
228
- }
229
- ),
230
- roadmap && planned.length ? /* @__PURE__ */ jsx(Roadmap, { records: planned }) : null
231
- ] });
232
- }
233
-
234
- export { FeatureList, FeatureStatusBadge };
235
- //# sourceMappingURL=react.js.map
236
- //# sourceMappingURL=react.js.map
2
+ /**
3
+ * `@marktiderman/genesis-features/react`: renamed to `@marktiderman/genesis-config/react`.
4
+ *
5
+ * @deprecated Import from `@marktiderman/genesis-config/react` instead: `npx genesis codemod
6
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
7
+ */
8
+ export * from "@marktiderman/genesis-config/react";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@marktiderman/genesis-features/settings-protocol`: renamed to `@marktiderman/genesis-config/settings-protocol`.
3
+ *
4
+ * @deprecated Import from `@marktiderman/genesis-config/settings-protocol` instead: `npx genesis codemod
5
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
6
+ */
7
+ export * from "@marktiderman/genesis-config/settings-protocol";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@marktiderman/genesis-features/settings-protocol`: renamed to `@marktiderman/genesis-config/settings-protocol`.
3
+ *
4
+ * @deprecated Import from `@marktiderman/genesis-config/settings-protocol` instead: `npx genesis codemod
5
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
6
+ */
7
+ export * from "@marktiderman/genesis-config/settings-protocol";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@marktiderman/genesis-features/settings/react`: renamed to `@marktiderman/genesis-config/settings/react`.
3
+ *
4
+ * @deprecated Import from `@marktiderman/genesis-config/settings/react` instead: `npx genesis codemod
5
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
6
+ */
7
+ export * from "@marktiderman/genesis-config/settings/react";
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ /**
3
+ * `@marktiderman/genesis-features/settings/react`: renamed to `@marktiderman/genesis-config/settings/react`.
4
+ *
5
+ * @deprecated Import from `@marktiderman/genesis-config/settings/react` instead: `npx genesis codemod
6
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
7
+ */
8
+ export * from "@marktiderman/genesis-config/settings/react";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@marktiderman/genesis-features/settings`: renamed to `@marktiderman/genesis-config/settings`.
3
+ *
4
+ * @deprecated Import from `@marktiderman/genesis-config/settings` instead: `npx genesis codemod
5
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
6
+ */
7
+ export * from "@marktiderman/genesis-config/settings";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@marktiderman/genesis-features/settings`: renamed to `@marktiderman/genesis-config/settings`.
3
+ *
4
+ * @deprecated Import from `@marktiderman/genesis-config/settings` instead: `npx genesis codemod
5
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
6
+ */
7
+ export * from "@marktiderman/genesis-config/settings";
package/package.json CHANGED
@@ -1,26 +1,24 @@
1
1
  {
2
2
  "name": "@marktiderman/genesis-features",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
- "description": "A typed feature registry: defineFeatures and defineFlags in one code file that running code imports, defineBlock and resolveBlocks for blocks (/blocks, free of zod), the feature gate (featureOn, /gate, zod-free, with React hooks at /gate/react), generators for AGENTS.md and JSON, a stale-output check, and a FeatureList page. Part of the Genesis framework.",
7
+ "deprecated": "Renamed to @marktiderman/genesis-config. Run `npx genesis codemod genesis-features-renamed-genesis-config` to move your imports and dependency (genesis upgrade runs it too). This alias re-exports genesis-config for two minor versions (0.10 and 0.11), then goes.",
8
+ "description": "Deprecated: renamed to @marktiderman/genesis-config. A thin re-export of genesis-config with the same subpaths, kept for two minor versions. Part of the Genesis framework.",
8
9
  "keywords": [
9
10
  "genesis",
10
11
  "genesis-framework",
11
- "feature-flags",
12
- "feature-registry",
13
- "openfeature",
14
- "typescript"
12
+ "deprecated"
15
13
  ],
16
- "homepage": "https://github.com/marktiderman/genesis/tree/main/packages/features#readme",
14
+ "homepage": "https://github.com/marktiderman/genesis/tree/main/packages/features-alias#readme",
17
15
  "bugs": {
18
16
  "url": "https://github.com/marktiderman/genesis/issues"
19
17
  },
20
18
  "repository": {
21
19
  "type": "git",
22
20
  "url": "git+https://github.com/marktiderman/genesis.git",
23
- "directory": "packages/features"
21
+ "directory": "packages/features-alias"
24
22
  },
25
23
  "license": "MIT",
26
24
  "publishConfig": {
@@ -48,6 +46,18 @@
48
46
  "types": "./dist/gate-react.d.ts",
49
47
  "import": "./dist/gate-react.js"
50
48
  },
49
+ "./settings": {
50
+ "types": "./dist/settings.d.ts",
51
+ "import": "./dist/settings.js"
52
+ },
53
+ "./settings/react": {
54
+ "types": "./dist/settings-react.d.ts",
55
+ "import": "./dist/settings-react.js"
56
+ },
57
+ "./settings-protocol": {
58
+ "types": "./dist/settings-protocol.d.ts",
59
+ "import": "./dist/settings-protocol.js"
60
+ },
51
61
  "./node": {
52
62
  "types": "./dist/node.d.ts",
53
63
  "import": "./dist/node.js"
@@ -62,10 +72,24 @@
62
72
  "README.md"
63
73
  ],
64
74
  "dependencies": {
65
- "zod": "^4.6.6"
75
+ "@marktiderman/genesis-config": "^0.11.0"
76
+ },
77
+ "devDependencies": {
78
+ "@types/node": "^22.9.0",
79
+ "typescript": "~6.0.3",
80
+ "vitest": "^5.0.5"
81
+ },
82
+ "genesis": {
83
+ "layer": "foundation",
84
+ "group": "core",
85
+ "owner": "@marktiderman",
86
+ "doctor": {
87
+ "enforce": false,
88
+ "reason": "A deprecated alias that re-exports @marktiderman/genesis-config, whose declarations carry the rules."
89
+ }
66
90
  },
67
91
  "peerDependencies": {
68
- "@marktiderman/genesis-ui": ">=2.7.0 <3.0.0",
92
+ "@marktiderman/genesis-ui": ">=3.0.0 <4.0.0",
69
93
  "lucide-react": "^1.0.0",
70
94
  "react": "^19.0.0"
71
95
  },
@@ -80,48 +104,8 @@
80
104
  "optional": true
81
105
  }
82
106
  },
83
- "devDependencies": {
84
- "@marktiderman/genesis-core": "^2.15.0",
85
- "@marktiderman/genesis-design-system": "^1.11.0",
86
- "@marktiderman/genesis-ui": "^2.34.0",
87
- "@testing-library/react": "^16.3.2",
88
- "@types/node": "^22.9.0",
89
- "@types/react": "^19.2.14",
90
- "@types/react-dom": "^19.2.3",
91
- "happy-dom": "^21.0.4",
92
- "lucide-react": "^1.0.0",
93
- "radix-ui": "^1.6.7",
94
- "react": "^19.0.0",
95
- "react-dom": "^19.0.0",
96
- "tsup": "^8.3.0",
97
- "typescript": "~6.0.3",
98
- "vitest": "^5.0.5",
99
- "zod": "^4.6.6"
100
- },
101
- "genesis": {
102
- "layer": "foundation",
103
- "group": "core",
104
- "owner": "@marktiderman",
105
- "essential": true,
106
- "doctor": {
107
- "prefer": [
108
- {
109
- "id": "no-env-feature-switches",
110
- "need": "turning a feature on or off",
111
- "level": "warn",
112
- "forbid": {
113
- "pattern": "\\b(?:import\\.meta\\.env|process\\.env)\\.(?:VITE_|NEXT_PUBLIC_|EXPO_PUBLIC_)?(?:FEATURE|FF|ENABLE|FLAG)_[A-Z0-9_]+"
114
- },
115
- "use": "a feature in features.ts read with featureOn / useFeature, or a flag",
116
- "import": "@marktiderman/genesis-features",
117
- "docs": "https://github.com/marktiderman/genesis/blob/main/packages/features/README.md",
118
- "why": "An environment switch needs a redeploy to change and isn't in the feature registry."
119
- }
120
- ]
121
- }
122
- },
123
107
  "scripts": {
124
- "build": "tsup && node ../../scripts/check-exports-resolve.mjs",
108
+ "build": "node scripts/build.mjs && node ../../scripts/check-exports-resolve.mjs",
125
109
  "clean": "rm -rf dist",
126
110
  "typecheck": "tsc --noEmit",
127
111
  "test": "vitest run"
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"blocks.js"}
@@ -1,6 +0,0 @@
1
- // src/platforms.ts
2
- var FEATURE_PLATFORMS = ["web", "native", "server", "cli"];
3
-
4
- export { FEATURE_PLATFORMS };
5
- //# sourceMappingURL=chunk-B6WRD3WF.js.map
6
- //# sourceMappingURL=chunk-B6WRD3WF.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/platforms.ts"],"names":[],"mappings":";AAKO,IAAM,iBAAA,GAAoB,CAAC,KAAA,EAAO,QAAA,EAAU,UAAU,KAAK","file":"chunk-B6WRD3WF.js","sourcesContent":["/**\n * Where a feature runs. `server` covers Node, edge functions and the database.\n *\n * @stability Beta\n */\nexport const FEATURE_PLATFORMS = [\"web\", \"native\", \"server\", \"cli\"] as const;\n\n/** @stability Beta */\nexport type FeaturePlatform = (typeof FEATURE_PLATFORMS)[number];\n"]}
@@ -1,10 +0,0 @@
1
- // src/status.ts
2
- function statusOn(def, platform) {
3
- if (def.platforms) return def.platforms[platform];
4
- const apps = def.apps.map((a) => a === "node" ? "server" : a);
5
- return apps.includes(platform) ? def.status : void 0;
6
- }
7
-
8
- export { statusOn };
9
- //# sourceMappingURL=chunk-OW46SL2G.js.map
10
- //# sourceMappingURL=chunk-OW46SL2G.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/status.ts"],"names":[],"mappings":";AASO,SAAS,QAAA,CACd,KAKA,QAAA,EAC2B;AAC3B,EAAA,IAAI,GAAA,CAAI,SAAA,EAAW,OAAO,GAAA,CAAI,UAAU,QAAQ,CAAA;AAEhD,EAAA,MAAM,IAAA,GAAO,IAAI,IAAA,CAAK,GAAA,CAAI,CAAC,CAAA,KAAO,CAAA,KAAM,MAAA,GAAS,QAAA,GAAW,CAAE,CAAA;AAC9D,EAAA,OAAO,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,GAAI,IAAI,MAAA,GAAS,MAAA;AAChD","file":"chunk-OW46SL2G.js","sourcesContent":["import type { FeatureStatus } from \"./types\";\nimport type { FeaturePlatform } from \"./platforms\";\n\n/**\n * A feature's status on one platform, or undefined when it isn't there.\n * Zod-free so the gate can use it on phones and in browsers.\n *\n * @stability Beta\n */\nexport function statusOn(\n def: {\n status: FeatureStatus;\n apps: readonly string[];\n platforms?: Partial<Record<FeaturePlatform, FeatureStatus>>;\n },\n platform: FeaturePlatform,\n): FeatureStatus | undefined {\n if (def.platforms) return def.platforms[platform];\n // Registries often call the server \"node\" in `apps`.\n const apps = def.apps.map((a) => (a === \"node\" ? \"server\" : a));\n return apps.includes(platform) ? def.status : undefined;\n}\n"]}