Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion assertions.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "node:assert/strict";
import { assertValidFeatureReference } from "./assertions";
import { assertValidFeatureReference } from "./assertions.js";

describe("assertValidReference()", function () {
it("throws if target ID is a move", function () {
Expand Down
6 changes: 3 additions & 3 deletions assertions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isOrdinaryFeatureData } from "./type-guards";
import { FeatureData } from "./types";
import { WebFeaturesData } from "./types.quicktype";
import { isOrdinaryFeatureData } from "./type-guards.js";
import { FeatureData } from "./types.js";
import { WebFeaturesData } from "./types.quicktype.js";

/**
* Assert that a reference from one feature to another is an ordinary feature
Expand Down
8 changes: 4 additions & 4 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import path from 'path';
import { Temporal } from '@js-temporal/polyfill';
import { fdir } from 'fdir';
import YAML from 'yaml';
import { convertMarkdown } from "./text";
import { GroupData, SnapshotData, WebFeaturesData } from './types';
import { convertMarkdown } from "./text.js";
import { GroupData, SnapshotData, WebFeaturesData } from './types.js';

import { BASELINE_LOW_TO_HIGH_DURATION, coreBrowserSet, getStatus, parseRangedDateString } from 'compute-baseline';
import { Compat } from 'compute-baseline/browser-compat-data';
import { assertRequiredRemovalDateSet, assertValidFeatureReference } from './assertions';
import { isMoved, isOrdinaryFeatureData, isSplit } from './type-guards';
import { assertRequiredRemovalDateSet, assertValidFeatureReference } from './assertions.js';
import { isMoved, isOrdinaryFeatureData, isSplit } from './type-guards.js';

// The longest name allowed, to allow for compact display.
const nameMaxLength = 80;
Expand Down
6 changes: 5 additions & 1 deletion scripts/dist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import { isDeepStrictEqual } from "node:util";
import winston from "winston";
import YAML, { Document, Scalar, YAMLSeq } from "yaml";
import yargs from "yargs";
import type { FeatureData, FeatureMovedData, FeatureSplitData } from "../types";
import type {
FeatureData,
FeatureMovedData,
FeatureSplitData,
} from "../types.js";

const compat = new Compat();

Expand Down
4 changes: 2 additions & 2 deletions scripts/find-ranged-headline-statuses.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { features } from "../index";
import { isOrdinaryFeatureData } from "../type-guards";
import { features } from "../index.js";
import { isOrdinaryFeatureData } from "../type-guards.js";

for (const [key, data] of Object.entries(features)) {
if (isOrdinaryFeatureData(data)) {
Expand Down
12 changes: 6 additions & 6 deletions scripts/inspect-feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { fileURLToPath } from "node:url";
import winston from "winston";
import YAML from "yaml";
import yargs from "yargs";
import { features } from "..";
import { defaultCompat } from "../packages/compute-baseline/dist/browser-compat-data/compat";
import { feature } from "../packages/compute-baseline/dist/browser-compat-data/feature";
import { SupportStatement } from "../packages/compute-baseline/dist/browser-compat-data/supportStatements";
import { convertHTML } from "../text";
import { FeatureData } from "../types";
import { features } from "../index.js";
import { defaultCompat } from "../packages/compute-baseline/dist/browser-compat-data/compat.js";
import { feature } from "../packages/compute-baseline/dist/browser-compat-data/feature.js";
import { SupportStatement } from "../packages/compute-baseline/dist/browser-compat-data/supportStatements.js";
import { convertHTML } from "../text.js";
import { FeatureData } from "../types.js";

const argv = yargs(process.argv.slice(2))
.scriptName("dist")
Expand Down
2 changes: 1 addition & 1 deletion scripts/remove-tagged-compat-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { isDeepStrictEqual } from "node:util";
import winston from "winston";
import YAML from "yaml";
import yargs from "yargs";
import { checkForStaleCompat } from "./dist";
import { checkForStaleCompat } from "./dist.js";

const compat = new Compat();

Expand Down
2 changes: 1 addition & 1 deletion scripts/validate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Ajv from "ajv";
import { Ajv } from "ajv";
import assert from "node:assert/strict";

import * as schema from "../schemas/data.schema.json" with { type: "json" };
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "Bundler",
"module": "nodenext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"resolveJsonModule": true,
"noEmit": true
Expand Down
6 changes: 5 additions & 1 deletion type-guards.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { FeatureData, FeatureMovedData, FeatureSplitData } from "./types";
import type {
FeatureData,
FeatureMovedData,
FeatureSplitData,
} from "./types.js";

export function isOrdinaryFeatureData(x: unknown): x is FeatureData {
return typeof x === "object" && "kind" in x && x.kind === "feature";
Expand Down
2 changes: 1 addition & 1 deletion types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
Release,
SnapshotData,
Support,
} from "./types.quicktype";
} from "./types.quicktype.js";

// Passthrough types
export type {
Expand Down