-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(validate/webidl): upgrade reffy #155
Conversation
Well that's a jump. The API is same, right? |
blocked by w3c/spec-prod#155
hmm... I recall we did some breaking changes in the CLI, so this probably needs more careful checking; @tidoust would probably know best, but is away this week |
I'll see if we can use |
Breaking changes are documented in major release commits. Also see the -v5.0.0 commit which did not follow the same commit message convention. One breaking change affects spec-prod: v6.0.0 separated the raw IDL and the parsed IDL in the result structure, which means that the following line needs to be updated to spec-prod/src/validate-webidl.ts Line 27 in 29ee061
Other breaking changes should not affect Web IDL extraction. |
Would someone be willing to update reffy further and handle the breaking changes? |
The only breaking change that affects Web IDL validation is the separation between the `idl` and `idlparsed` modules in v6.0.0, which made the extracted IDL available under a different path in the result. A couple of minor improvements have been made to IDL extraction but no other substantive change that would require updating the code.
17c55ac
to
36f3ca9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tidoust! I was expecting more breaking changes 😄
I'll add a test infra for this project sometime! Until then, 🤞🏽 |
@sidvishnoi, I rebased the PR and force-pushed an update that bumps Reffy to its latest major version, and makes the change I raised earlier. As far as I can tell, that should be all that's needed (IDL extraction has not changed significantly in the past few years). Now, I have not checked the resulting code. If there's a simple way to test this before merging, that could prove useful... |
Simplest way to test would be to create a fork of a repo, and use |
I tested locally by diff --git a/src/validate-webidl.ts b/src/validate-webidl.ts
index 40d3c67..1946c41 100644
--- a/src/validate-webidl.ts
+++ b/src/validate-webidl.ts
@@ -4,17 +4,15 @@ import { BuildResult } from "./build.js";
type Input = Pick<BuildResult, "dest" | "file">;
if (module === require.main) {
- if (yesOrNo(env("INPUTS_VALIDATE_WEBIDL")) === false) {
- exit("Skipped", 0);
- }
-
- const input: Input = JSON.parse(env("OUTPUTS_BUILD"));
- main(input).catch(err => exit(err.message || "Failed", err.code));
+ main({
+ dest: process.cwd(),
+ file: "test.html",
+ }).catch(err => exit(err.message || "Failed", err.code));
}
export default async function main({ dest, file }: Input) {
console.log(`Validating Web IDL defined in ${file}...`);
- await install("reffy@4");
+ await install("reffy@15");
const { crawlSpecs } = require("reffy");
const fileurl = new URL(file, `file://${dest}/`).href;
@@ -24,7 +22,7 @@ export default async function main({ dest, file }: Input) {
);
await rm(".cache", { recursive: true, force: true });
- const idl = results[0]?.idl?.idl;
+ const idl = results[0]?.idl;
if (!idl) {
exit("No Web IDL found in spec, skipped validation", 0);
}
|
No description provided.