summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Swithinbank <swithinbank@gmail.com> 2024-12-03 00:16:53 +0100
committerGravatar GitHub <noreply@github.com> 2024-12-03 00:16:53 +0100
commit1dc8f5eb7c515c89aadc85cfa0a300d4f65e8671 (patch)
treee87c430790d94328a1433414b30589bee0ef13bd
parent3a76353248009c1960344a4d2d28d56ccb50bade (diff)
downloadastro-1dc8f5eb7c515c89aadc85cfa0a300d4f65e8671.tar.gz
astro-1dc8f5eb7c515c89aadc85cfa0a300d4f65e8671.tar.zst
astro-1dc8f5eb7c515c89aadc85cfa0a300d4f65e8671.zip
Node 22 housekeeping (#12559)
-rw-r--r--.changeset/tasty-snails-protect.md5
-rw-r--r--packages/internal-helpers/src/fs.ts4
2 files changed, 7 insertions, 2 deletions
diff --git a/.changeset/tasty-snails-protect.md b/.changeset/tasty-snails-protect.md
new file mode 100644
index 000000000..cbd945ca0
--- /dev/null
+++ b/.changeset/tasty-snails-protect.md
@@ -0,0 +1,5 @@
+---
+"@astrojs/internal-helpers": patch
+---
+
+Fixes usage of `fileURLToPath()` to anticipate the changed signature of this method in Node 22.1.0
diff --git a/packages/internal-helpers/src/fs.ts b/packages/internal-helpers/src/fs.ts
index c9f27810a..5630040bb 100644
--- a/packages/internal-helpers/src/fs.ts
+++ b/packages/internal-helpers/src/fs.ts
@@ -45,8 +45,8 @@ export async function copyFilesToFolder(
outDir: URL,
exclude: URL[] = [],
): Promise<string> {
- const excludeList = exclude.map(fileURLToPath);
- const fileList = files.map(fileURLToPath).filter((f) => !excludeList.includes(f));
+ const excludeList = exclude.map((url) => fileURLToPath(url));
+ const fileList = files.map((url) => fileURLToPath(url)).filter((f) => !excludeList.includes(f));
if (files.length === 0) throw new Error('No files found to copy');