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
17 changes: 10 additions & 7 deletions scripts/dist.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { Temporal } from "@js-temporal/polyfill";
import {
BASELINE_LOW_TO_HIGH_DURATION,
computeBaseline,
setLogger,
} from "compute-baseline";
import { computeBaseline, setLogger } from "compute-baseline";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh oops, my editor removed these unused imports. I can move this to a separate PR, if desired.

import { Compat, Feature } from "compute-baseline/browser-compat-data";
import assert from "node:assert/strict";
import fs from "node:fs";
Expand Down Expand Up @@ -224,7 +219,15 @@ function main() {
}
// Start from the source even if dist is given
if (filePath.endsWith(".dist")) {
filePath = filePath.substring(0, filePath.length - 5);
const candidateFilePath = filePath.substring(0, filePath.length - 5);

// Make sure this isn't an orphan dist file
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I should use a different word here? "Orphan catching" sounds truly Dickensian

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the terminology is OK, it's not as funny as https://html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm, but still OK.

I'll land this and rebase #1210 on top, and I suspect this comment will disappear anyway.

if (!fs.existsSync(candidateFilePath)) {
throw new Error(
`${filePath} has no corresponding ${candidateFilePath}`,
);
}
filePath = candidateFilePath;
}
return [filePath, `${filePath}.dist`];
}),
Expand Down