Skip to content

Commit 6ad4e80

Browse files
committed
Set kind: feature at runtime, for author convenience
1 parent 66adbd4 commit 6ad4e80

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

features/conic-gradients.yml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Generated from: conic-gradients.yml
22
# Do not edit this file by hand. Edit the source file instead!
33

4-
kind: feature
54
status:
65
baseline: high
76
baseline_low_date: 2020-11-17

features/gradients.yml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Generated from: gradients.yml
22
# Do not edit this file by hand. Edit the source file instead!
33

4-
kind: feature
54
status:
65
baseline: high
76
baseline_low_date: 2015-07-29

features/numeric-separators.yml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Generated from: numeric-separators.yml
22
# Do not edit this file by hand. Edit the source file instead!
33

4-
kind: feature
54
status:
65
baseline: high
76
baseline_low_date: 2020-07-28

index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ for (const [key, data] of yamlEntries('features')) {
129129
continue;
130130
}
131131

132+
// Attach `kind: feature` to ordinary features
133+
if (!isMoved(data) && !isSplit(data)) {
134+
data.kind = "feature";
135+
}
136+
132137
// Convert markdown to text+HTML.
133138
if (data.description) {
134139
const { text, html } = convertMarkdown(data.description);

scripts/dist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ function toDist(sourcePath: string): YAML.Document {
339339
}
340340

341341
// Assemble and return the dist YAML.
342-
const dist = new Document({ kind: "feature" });
342+
const dist = new Document({});
343343

344344
dist.commentBefore = [
345345
`Generated from: ${id}.yml`,

type-guards.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function isOrdinaryFeatureData(x: unknown): x is FeatureData {
55
}
66

77
export function isSplit(x: unknown): x is FeatureSplitData {
8-
return typeof x === "object" && "kind" in x && x.kind === "moved";
8+
return typeof x === "object" && "kind" in x && x.kind === "split";
99
}
1010

1111
export function isMoved(x: unknown): x is FeatureMovedData {

0 commit comments

Comments
 (0)