diff --git a/assertions.test.ts b/assertions.test.ts index 2ff81193779..753f81c79ca 100644 --- a/assertions.test.ts +++ b/assertions.test.ts @@ -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 () { diff --git a/assertions.ts b/assertions.ts index 11bfbd5c22e..30cc85bd856 100644 --- a/assertions.ts +++ b/assertions.ts @@ -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 diff --git a/index.ts b/index.ts index cd9a441237b..c7121c8d343 100644 --- a/index.ts +++ b/index.ts @@ -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; diff --git a/scripts/dist.ts b/scripts/dist.ts index f1a5c9806c4..56dfffcd0d0 100644 --- a/scripts/dist.ts +++ b/scripts/dist.ts @@ -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(); diff --git a/scripts/find-ranged-headline-statuses.ts b/scripts/find-ranged-headline-statuses.ts index e60f21efd00..242cb38f38e 100644 --- a/scripts/find-ranged-headline-statuses.ts +++ b/scripts/find-ranged-headline-statuses.ts @@ -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)) { diff --git a/scripts/inspect-feature.ts b/scripts/inspect-feature.ts index ae344f7910e..6cd89413241 100644 --- a/scripts/inspect-feature.ts +++ b/scripts/inspect-feature.ts @@ -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") diff --git a/scripts/remove-tagged-compat-features.ts b/scripts/remove-tagged-compat-features.ts index 88171eac20b..15da594cb74 100644 --- a/scripts/remove-tagged-compat-features.ts +++ b/scripts/remove-tagged-compat-features.ts @@ -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(); diff --git a/scripts/validate.ts b/scripts/validate.ts index 8c88eecfef1..b57790c5cc1 100644 --- a/scripts/validate.ts +++ b/scripts/validate.ts @@ -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" }; diff --git a/tsconfig.json b/tsconfig.json index e41e938e6e1..f741ce9d6d9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "esnext", - "module": "esnext", - "moduleResolution": "Bundler", + "module": "nodenext", + "moduleResolution": "nodenext", "esModuleInterop": true, "resolveJsonModule": true, "noEmit": true diff --git a/type-guards.ts b/type-guards.ts index 806a88139d4..4111d23ab96 100644 --- a/type-guards.ts +++ b/type-guards.ts @@ -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"; diff --git a/types.ts b/types.ts index 24256c80498..14d44ef4e0f 100644 --- a/types.ts +++ b/types.ts @@ -18,7 +18,7 @@ import type { Release, SnapshotData, Support, -} from "./types.quicktype"; +} from "./types.quicktype.js"; // Passthrough types export type {