@marktiderman/genesis-features 0.9.1 → 0.10.1

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/index.d.ts CHANGED
@@ -1,127 +1,7 @@
1
- import { F as Features, b as FeatureRecord, a as Flags } from './model-sTRmrxz3.js';
2
- export { D as DeprecatedFeatureLayer, c as FEATURE_HORIZONS, d as FEATURE_KINDS, e as FEATURE_LAYERS, f as FeatureDef, g as FeatureHorizon, h as FeatureIdOf, i as FeatureKind, j as FeatureLayer, k as FeatureLinks, l as FeatureMedia, m as FeaturePackage, n as FeatureRegistryError, o as FeatureVisibility, p as FindOptions, q as FlagDef, r as defineFeatures, s as defineFlags, t as expiredFlags, u as featureKind, v as featureLayer, w as featurePackageLayer, x as featureSchema, y as findFeatures, z as flagSchema, A as flagsForFeature, B as toRecords } from './model-sTRmrxz3.js';
3
- export { BlockContributions, BlockDataUse, BlockDef, BlockError, BlockMigration, BlockNavItem, BlockPrivacy, BlockRoute, BlockSettingsRow, CONTENT_PACK_FIELD_TARGETS, ContentPackCheckOptions, ContentPackDef, ContentPackError, ContentPackFieldDefinition, ContentPackFieldTarget, ContentPackForm, ContentPackMetricTemplate, ContentPackRoadmapTemplate, ContentPackSectionValidator, ContentPackSections, ContentPackSessionType, Contributed, EnabledBlocks, ResolveBlocksOptions, ResolvedBlocks, contentPackBlocks, contentPackProblems, defineBlock, defineContentPack, resolveBlocks } from './blocks.js';
4
- export { F as FeatureOff, G as GateAnswer, b as GateContext, c as GateFeature, d as GateFlag, e as GateReason, f as GateRegistry, a as GateSnapshot, g as GateSnapshotOptions, I as IdSet, S as SHIPPED_STATUSES, h as featureOn, i as fromSnapshot, j as gateSnapshot, k as isSnapshotStale, r as requireFeature } from './gate-oYFzQKyb.js';
5
- export { L as LayerPackage, M as ModuleMeta, O as OverlayMarker, a as PACKAGE_GROUPS, b as PACKAGE_LAYERS, c as PackageGroup, P as PackageLayer, d as PackageMeta, o as overlayUpstream, p as packageLayerProblems, r as readOverlayMarker, e as readPackageMeta } from './packages-CWhdXtzS.js';
6
- export { a as FEATURE_PLATFORMS, F as FeaturePlatform } from './platforms-NR0liM8L.js';
7
- export { d as FEATURE_STATUSES, e as FLAG_KINDS, b as FeatureAccess, a as FeatureStatus, c as FlagKind, F as FlagValue } from './types-Bd766VxF.js';
8
- export { statusOn } from './gate.js';
9
- import 'zod';
10
-
11
- /** Marks the start of the generated block in AGENTS.md. */
12
- declare const AGENTS_BLOCK_START = "<!-- genesis-features:start -->";
13
- /** Marks the end of the generated block in AGENTS.md. */
14
- declare const AGENTS_BLOCK_END = "<!-- genesis-features:end -->";
15
- /** Marks the start of the generated marketing block (e.g. in README.md). */
16
- declare const MARKETING_BLOCK_START = "<!-- genesis-features:marketing:start -->";
17
- /** Marks the end of the generated marketing block. */
18
- declare const MARKETING_BLOCK_END = "<!-- genesis-features:marketing:end -->";
19
- interface GenerateOptions {
20
- /** The file the registry lives in, named in the "generated from" notes. Default `src/features.ts`. */
21
- source?: string;
22
- /** How agents run the CLI here, e.g. `genesis features` or `bun run features`. Default `genesis features`. */
23
- command?: string;
24
- /** Where the skill lives, named in the AGENTS.md pointer. Default `.claude/skills/features/SKILL.md`. */
25
- skill?: string | false;
26
- }
27
1
  /**
28
- * The registry as JSON, for tools that can't import TypeScript. Stable: no
29
- * timestamps, features in declaration order, so `check` can compare it. It is
30
- * also the record of every id ever used, which keeps ids permanent.
2
+ * `@marktiderman/genesis-features`: renamed to `@marktiderman/genesis-config`.
31
3
  *
32
- * @stability Beta
4
+ * @deprecated Import from `@marktiderman/genesis-config` instead: `npx genesis codemod
5
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
33
6
  */
34
- declare function toJson(features: Features, flags?: Flags, options?: GenerateOptions): string;
35
- /** The schema an OpenFeature CLI flag manifest points at. */
36
- declare const OPENFEATURE_MANIFEST_SCHEMA = "https://raw.githubusercontent.com/open-feature/cli/refs/heads/main/schema/v0/flag-manifest.json";
37
- /**
38
- * The flags as an OpenFeature CLI flag manifest (`flags.json`), so
39
- * `openfeature generate` can make typed accessors from the same registry.
40
- *
41
- * @stability Beta
42
- */
43
- declare function toOpenFeatureManifest(flags: Flags, features?: Features): string;
44
- /**
45
- * The marker-delimited block for AGENTS.md: deliberately short. It points
46
- * agents at `find` and the skill and gives counts, never the whole list, so
47
- * AGENTS.md stays small however many features there are.
48
- *
49
- * @stability Beta
50
- */
51
- declare function toAgentsMarkdown(features: Features, flags?: Flags, options?: GenerateOptions): string;
52
- /** The public, shipped features a marketing page shows: visibility public, a tagline, live or beta. */
53
- declare function marketingRecords(features: Features): FeatureRecord[];
54
- /**
55
- * A benefit-led feature list for a README or a marketing page: public, shipped
56
- * features with a tagline, highlights first, grouped by category.
57
- *
58
- * @stability Beta
59
- */
60
- declare function toMarketingMarkdown(features: Features, options?: {
61
- heading?: string;
62
- source?: string;
63
- }): string;
64
- /** Thrown when a generated block's markers are broken: one is missing, repeated or out of order. */
65
- declare class BrokenBlockError extends Error {
66
- constructor(start: string);
67
- }
68
- /** The generated AGENTS.md block inside `doc`, or null. */
69
- declare const readAgentsBlock: (doc: string) => string | null;
70
- /**
71
- * `doc` with its generated AGENTS.md block replaced by `block`, or with
72
- * `block` appended when it has none yet.
73
- *
74
- * @stability Beta
75
- */
76
- declare const replaceAgentsBlock: (doc: string, block: string) => string;
77
- /**
78
- * The agent skill for working with the registry, written to
79
- * `.claude/skills/features/SKILL.md` by `genesis features build`. `outputs`
80
- * names what the build writes in this repo, so the skill never claims a file
81
- * the repo turned off.
82
- *
83
- * @stability Beta
84
- */
85
- declare function toSkillMarkdown(options?: GenerateOptions & {
86
- outputs?: readonly string[];
87
- }): string;
88
-
89
- /**
90
- * The `requires` graph checks shared by the feature registry
91
- * (`defineFeatures`) and blocks (`resolveBlocks`). No zod here: blocks import
92
- * this from a platform-neutral entry that ships to phones.
93
- */
94
- /** A node with the ids it needs. */
95
- interface RequiresNode {
96
- readonly requires?: readonly string[];
97
- }
98
- interface RequiresProblemsOptions {
99
- /** What a node is called in messages: `feature` or `block`. */
100
- noun: string;
101
- /** Whether an id may be required. Default: it is a node of the graph. */
102
- isKnown?: (id: string) => boolean;
103
- /** The message for a requirement `isKnown` refuses. Default `"x" is not a <noun>`. */
104
- unknown?: (req: string, id: string) => string;
105
- /** Nodes already reported invalid: their edges can't be trusted, so they are skipped. */
106
- skip?: ReadonlySet<string>;
107
- }
108
- /**
109
- * Self-requirements, unknown requirements and cycles through `requires`, as
110
- * problem strings (`a.requires: …`). Each cycle is reported once, from where
111
- * the depth-first search found it: `a.requires: a cycle: a → b → a`.
112
- *
113
- * @stability Beta
114
- */
115
- declare function requiresProblems(nodes: Readonly<Record<string, RequiresNode>>, options: RequiresProblemsOptions): string[];
116
- /** One requirement's problem (itself, or an unknown id), or undefined when it is fine. @stability Beta */
117
- declare function requirementProblem(nodes: Readonly<Record<string, RequiresNode>>, id: string, req: string, options: RequiresProblemsOptions): string | undefined;
118
- /** Cycles through `requires`, each reported once, from where the depth-first search found it. @stability Beta */
119
- declare function cycleProblems(nodes: Readonly<Record<string, RequiresNode>>, skip?: ReadonlySet<string>): string[];
120
- /**
121
- * The ids in dependency order (what a node requires comes first), ties kept
122
- * in the given order. Requirements outside `nodes` are ignored. Assumes no
123
- * cycles ({@link requiresProblems} reports them).
124
- */
125
- declare function dependencyOrder(nodes: Readonly<Record<string, RequiresNode>>): string[];
126
-
127
- export { AGENTS_BLOCK_END, AGENTS_BLOCK_START, BrokenBlockError, FeatureRecord, Features, Flags, type GenerateOptions, MARKETING_BLOCK_END, MARKETING_BLOCK_START, OPENFEATURE_MANIFEST_SCHEMA, type RequiresNode, type RequiresProblemsOptions, cycleProblems, dependencyOrder, marketingRecords, readAgentsBlock, replaceAgentsBlock, requirementProblem, requiresProblems, toAgentsMarkdown, toJson, toMarketingMarkdown, toOpenFeatureManifest, toSkillMarkdown };
7
+ export * from "@marktiderman/genesis-config";
package/dist/index.js CHANGED
@@ -1,8 +1,7 @@
1
- export { BlockError, CONTENT_PACK_FIELD_TARGETS, ContentPackError, PACKAGE_GROUPS, PACKAGE_LAYERS, contentPackBlocks, contentPackProblems, defineBlock, defineContentPack, overlayUpstream, packageLayerProblems, readOverlayMarker, readPackageMeta, resolveBlocks } from './chunk-Z3TTDIVM.js';
2
- export { FeatureOff, SHIPPED_STATUSES, featureOn, fromSnapshot, gateSnapshot, isSnapshotStale, requireFeature } from './chunk-YTPGUU5F.js';
3
- export { AGENTS_BLOCK_END, AGENTS_BLOCK_START, BrokenBlockError, FEATURE_HORIZONS, FEATURE_KINDS, FEATURE_LAYERS, FEATURE_STATUSES, FLAG_KINDS, FeatureRegistryError, MARKETING_BLOCK_END, MARKETING_BLOCK_START, OPENFEATURE_MANIFEST_SCHEMA, defineFeatures, defineFlags, expiredFlags, featureKind, featureLayer, featurePackageLayer, featureSchema, findFeatures, flagSchema, flagsForFeature, marketingRecords, readAgentsBlock, replaceAgentsBlock, toAgentsMarkdown, toJson, toMarketingMarkdown, toOpenFeatureManifest, toRecords, toSkillMarkdown } from './chunk-SEFG2QV6.js';
4
- export { cycleProblems, dependencyOrder, requirementProblem, requiresProblems } from './chunk-VYUX7VAX.js';
5
- export { FEATURE_PLATFORMS } from './chunk-B6WRD3WF.js';
6
- export { statusOn } from './chunk-OW46SL2G.js';
7
- //# sourceMappingURL=index.js.map
8
- //# sourceMappingURL=index.js.map
1
+ /**
2
+ * `@marktiderman/genesis-features`: renamed to `@marktiderman/genesis-config`.
3
+ *
4
+ * @deprecated Import from `@marktiderman/genesis-config` 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";
package/dist/node.d.ts CHANGED
@@ -1,159 +1,7 @@
1
- import { F as Features, a as Flags } from './model-sTRmrxz3.js';
2
- import 'zod';
3
- import './platforms-NR0liM8L.js';
4
- import './types-Bd766VxF.js';
5
- import './packages-CWhdXtzS.js';
6
-
7
1
  /**
8
- * Where a repo keeps its registry's outputs and what `check` scans. Every
9
- * path is relative to `root`; `false` turns an output or a scan off. The CLI
10
- * reads these from genesis.config.json → `features` (or package.json → `"genesisFeatures"`), and its options win.
2
+ * `@marktiderman/genesis-features/node`: renamed to `@marktiderman/genesis-config/node`.
11
3
  *
12
- * @stability Beta
4
+ * @deprecated Import from `@marktiderman/genesis-config/node` instead: `npx genesis codemod
5
+ * genesis-features-renamed-genesis-config` moves an app's imports. This alias goes after 0.11.
13
6
  */
14
- interface FeatureProjectOptions {
15
- /** The repository root. */
16
- root: string;
17
- features: Features;
18
- flags?: Flags;
19
- /** The registry file, named in generated output. Default `src/features.ts`. */
20
- source?: string;
21
- /** How people run the CLI here, named in generated output. Default `genesis features`. */
22
- command?: string;
23
- /** The AGENTS.md that holds the pointer block. Default `AGENTS.md`. */
24
- agents?: string | false;
25
- /** The CLAUDE.md that must import AGENTS.md (`@AGENTS.md`). Default `CLAUDE.md`. */
26
- claude?: string | false;
27
- /** The JSON copy, which is also the record of every id ever used. Default `features.json`. */
28
- json?: string | false;
29
- /** The OpenFeature flag manifest, written when there are flags. Default `flags.json`. */
30
- openfeature?: string | false;
31
- /** The agent skill. Default `.claude/skills/features/SKILL.md`. */
32
- skill?: string | false;
33
- /** A file to keep the marketing block in (e.g. README.md). Default none. */
34
- marketing?: string | false;
35
- /** The marketing block's heading. Default `Features`. */
36
- marketingHeading?: string;
37
- /**
38
- * How code reads a flag: a function name (`useFlag`, read as its first
39
- * argument) or a JSX attribute (`<Flag name>`). Default `useFlag`, `getFlag`
40
- * and `<Flag name>`.
41
- */
42
- flagAccessors?: readonly string[];
43
- /** Code scanned for flag reads. Default `src`, `app` and `packages/*\/src`. */
44
- scan?: readonly string[] | false;
45
- /**
46
- * Files the flag scan skips: the flags runtime that defines the accessors and
47
- * reads by variable, and tests, which build keys on purpose. Default the test
48
- * globs (`tests`).
49
- */
50
- scanIgnore?: readonly string[];
51
- /** Test files scanned for `@feat:<id>` tags. */
52
- tests?: readonly string[] | false;
53
- /** The changesets folder, scanned for `Features: <id>` lines. Default `.changeset`. */
54
- changesets?: string | false;
55
- /** The PR's labels, checked for `feature:<id>`. */
56
- labels?: readonly string[];
57
- /** Route and server-function files every one of which some `links.code` should cover. */
58
- coverage?: readonly string[] | false;
59
- coverageIgnore?: readonly string[];
60
- /** Warn when `reviewedAt` is older than this many days. Default 90. */
61
- reviewDays?: number;
62
- /** `YYYY-MM-DD`. Default today (UTC). */
63
- today?: string;
64
- /**
65
- * Shipped work gathered elsewhere (the CLI's `--prs` reads it with `gh`).
66
- * A planned feature with any of it gets a warning, as do changesets that
67
- * name it.
68
- */
69
- evidence?: FeatureEvidence;
70
- }
71
- /** A merged PR labelled `feature:<id>`. @stability Beta */
72
- interface FeaturePrEvidence {
73
- number: number;
74
- title: string;
75
- }
76
- /** @stability Beta */
77
- interface FeatureEvidence {
78
- /** Merged PRs by the feature id (or alias) on their `feature:<id>` label. */
79
- prs?: Record<string, readonly FeaturePrEvidence[]>;
80
- }
81
- /** A feature still marked planned (or an idea) that already has shipped work tagged with it. @stability Beta */
82
- interface PlannedButShipped {
83
- id: string;
84
- /** Changeset files with a `Features: <id>` line. */
85
- changesets: string[];
86
- prs: FeaturePrEvidence[];
87
- }
88
- /** @stability Beta */
89
- interface FeatureCheckResult {
90
- ok: boolean;
91
- /** Hard failures: stale generated output, missing code paths, flag rules, removed ids, bad tags, no `@AGENTS.md`. */
92
- errors: string[];
93
- /** Everything else: reviews due, untested live features, uncovered routes, missing docs. */
94
- warnings: string[];
95
- /** Generated files that differ from what the generator makes now. */
96
- stale: string[];
97
- expiredFlags: string[];
98
- /** Building features with someone on them: `[id, claimedBy]`. */
99
- claims: [string, string][];
100
- /** Planned features with shipped work; each is also a warning. */
101
- plannedButShipped: PlannedButShipped[];
102
- }
103
- /** A glob (`*`, `**`, `?`, `{a,b}`) as a RegExp over `/`-separated relative paths. */
104
- declare function globToRegExp(glob: string): RegExp;
105
- /**
106
- * `text` with its comments blanked to spaces (newlines kept), so a flag named
107
- * in a comment isn't read as a flag read and line numbers stay right. Strings,
108
- * regex literals and template text are left alone; a template's `${…}` is code.
109
- * With `strings`, string and template-text contents are blanked too (quotes
110
- * stay), so prose in a string ("…the release flag (off)") can't look like a call.
111
- */
112
- declare function blankComments(text: string, strings?: boolean): string;
113
- /**
114
- * Flag reads in `text`: each key read through an accessor with a literal, and
115
- * each read whose key isn't a literal (`dynamic`), as `path:line`. Comments
116
- * don't count.
117
- */
118
- declare function scanFlagReads(path: string, source: string, accessors?: readonly string[]): {
119
- keys: {
120
- key: string;
121
- where: string;
122
- }[];
123
- dynamic: string[];
124
- };
125
- /**
126
- * Writes every generated output (the AGENTS.md block, the JSON, the flag
127
- * manifest, the skill, the marketing block) and adds `@AGENTS.md` to
128
- * CLAUDE.md when it's missing. Refuses, writing nothing, when an id recorded
129
- * in the JSON has disappeared, or the JSON can't be read (each side of a merge
130
- * conflict is read). Returns the paths it changed.
131
- *
132
- * @stability Beta
133
- */
134
- declare function buildFeatureOutputs(options: FeatureProjectOptions): string[];
135
- /**
136
- * Checks the registry against the repo. Errors (exit 1): generated output that
137
- * is stale, `links.code` paths that don't exist, the flag rules (a permission
138
- * flag, an expired flag, a dynamic key, a key read but not defined or defined
139
- * but never read, a missing runbook), an id that disappeared, an unknown id in
140
- * a test, changeset or PR tag, and a CLAUDE.md without `@AGENTS.md`.
141
- * Warnings: reviews due, live features without tagged tests, planned features
142
- * with shipped work (changesets, and `evidence.prs`), route and
143
- * server-function files no feature covers, missing docs.
144
- *
145
- * It only ever compares generated output with the generator, never two
146
- * hand-written files.
147
- *
148
- * @stability Beta
149
- */
150
- declare function checkFeatureOutputs(options: FeatureProjectOptions): FeatureCheckResult;
151
- /**
152
- * A few lines for a session's start: counts, stale output, expired flags,
153
- * planned features with shipped work and open claims. Meant for a SessionStart hook (`genesis features check --summary`).
154
- *
155
- * @stability Beta
156
- */
157
- declare function summarizeCheck(result: FeatureCheckResult, features: Features): string;
158
-
159
- export { type FeatureCheckResult, type FeatureEvidence, type FeaturePrEvidence, type FeatureProjectOptions, type PlannedButShipped, blankComments, buildFeatureOutputs, checkFeatureOutputs, globToRegExp, scanFlagReads, summarizeCheck };
7
+ export * from "@marktiderman/genesis-config/node";