Skip to content
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 generate-helpers failing in URL-encoded path #13404

Merged
merged 1 commit into from May 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/babel-helpers/scripts/generate-helpers.js
@@ -1,6 +1,6 @@
import fs from "fs";
import { join } from "path";
import { URL } from "url";
import { URL, fileURLToPath } from "url";

const HELPERS_FOLDER = new URL("../src/helpers", import.meta.url);
const IGNORED_FILES = new Set(["package.json"]);
Expand All @@ -23,7 +23,7 @@ import template from "@babel/template";
const varName = isValidId ? helperName : `_${helperName}`;

const fileContents = await fs.promises.readFile(
join(HELPERS_FOLDER.pathname, file),
join(fileURLToPath(HELPERS_FOLDER), file),
"utf8"
);
const { minVersion } = fileContents.match(
Expand Down