Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import fs from 'fs';
import path from 'path';

import { Temporal } from '@js-temporal/polyfill';
import { fdir } from 'fdir';
import YAML from 'yaml';
import { FeatureData, GroupData, SnapshotData } from './types';
import { Temporal } from '@js-temporal/polyfill';

import { toString as hastTreeToString } from 'hast-util-to-string';
import rehypeStringify from 'rehype-stringify';
import remarkParse from 'remark-parse';
import remarkRehype from 'remark-rehype';
import { unified } from 'unified';

import { BASELINE_LOW_TO_HIGH_DURATION } from 'compute-baseline';
import { BASELINE_LOW_TO_HIGH_DURATION, parseRangedDateString } from 'compute-baseline';

// The longest name allowed, to allow for compact display.
const nameMaxLength = 80;
Expand Down Expand Up @@ -135,9 +135,10 @@ for (const [key, data] of yamlEntries('features')) {

// Compute Baseline high date from low date.
if (data.status?.baseline === 'high') {
const lowDate = Temporal.PlainDate.from(data.status.baseline_low_date);
const [date, ranged] = parseRangedDateString(data.status.baseline_low_date);
const lowDate = Temporal.PlainDate.from(date);
const highDate = lowDate.add(BASELINE_LOW_TO_HIGH_DURATION);
data.status.baseline_high_date = String(highDate);
data.status.baseline_high_date = ranged ? `≤${highDate}` : String(highDate);
}

// Ensure name and description are not too long.
Expand Down