From e4cf84e90d9acf6e3f5565fe839d0ecf9180ba6a Mon Sep 17 00:00:00 2001 From: Frank Koenders Date: Sat, 28 Feb 2026 21:15:46 +0100 Subject: [PATCH] Replace join-path dependency with native node:path join-path was only used as a thin wrapper around path.join in both call sites. Switch to the built-in node:path module and remove the now-unnecessary dependency. --- package-lock.json | 26 -------------------------- package.json | 1 - src/loaders/config-file.js | 3 +-- src/providers/fs.ts | 7 +++---- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index cea356b..fa75121 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "destroy": "^1.0.4", "glob-slasher": "^1.0.1", "is-url": "^1.2.2", - "join-path": "^1.1.1", "lodash": "^4.17.19", "mime-types": "^2.1.35", "minimatch": "^6.1.6", @@ -1739,11 +1738,6 @@ "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz", "integrity": "sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==" }, - "node_modules/as-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/as-array/-/as-array-2.0.0.tgz", - "integrity": "sha512-1Sd1LrodN0XYxYeZcN1J4xYZvmvTwD5tDWaPUGPIzH1mFsmzsPnVtd2exWhecMjtZk/wYWjNZJiD3b1SLCeJqg==" - }, "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -4055,16 +4049,6 @@ "node": ">=18" } }, - "node_modules/join-path": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/join-path/-/join-path-1.1.1.tgz", - "integrity": "sha512-jnt9OC34sLXMLJ6YfPQ2ZEKrR9mB5ZbSnQb4LPaOx1c5rTzxpR33L18jjp0r75mGGTJmsil3qwN1B5IBeTnSSA==", - "dependencies": { - "as-array": "^2.0.0", - "url-join": "0.0.1", - "valid-url": "^1" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6743,11 +6727,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url-join": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-0.0.1.tgz", - "integrity": "sha512-H6dnQ/yPAAVzMQRvEvyz01hhfQL5qRWSEt7BX8t9DqnPw9BjMb64fjIRq76Uvf1hkHp+mTZvEVJ5guXOT0Xqaw==" - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -6777,11 +6756,6 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "node_modules/valid-url": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/valid-url/-/valid-url-1.0.9.tgz", - "integrity": "sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==" - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/package.json b/package.json index 876e9a4..849064a 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "destroy": "^1.0.4", "glob-slasher": "^1.0.1", "is-url": "^1.2.2", - "join-path": "^1.1.1", "lodash": "^4.17.19", "mime-types": "^2.1.35", "minimatch": "^6.1.6", diff --git a/src/loaders/config-file.js b/src/loaders/config-file.js index e27ca9b..78c66fb 100644 --- a/src/loaders/config-file.js +++ b/src/loaders/config-file.js @@ -22,7 +22,6 @@ const fs = require("fs"); const _ = require("lodash"); -const join = require("join-path"); const path = require("path"); const CONFIG_FILE = ["superstatic.json", "firebase.json"]; @@ -49,7 +48,7 @@ module.exports = function (filename) { if (_.isArray(filename)) { filename = _.find(filename, (name) => { - return fs.existsSync(join(process.cwd(), name)); + return fs.existsSync(path.join(process.cwd(), name)); }); } diff --git a/src/providers/fs.ts b/src/providers/fs.ts index 5cbd247..ae62588 100644 --- a/src/providers/fs.ts +++ b/src/providers/fs.ts @@ -22,7 +22,7 @@ import * as crypto from "node:crypto"; import { stat as fsStat } from "node:fs/promises"; import * as fs from "node:fs"; -const pathjoin = require("join-path"); +import { join } from "node:path"; async function multiStat( paths: string[], @@ -42,7 +42,7 @@ async function multiStat( module.exports = function provider(options: any) { const etagCache: Record = {}; - const cwd = options.cwd ?? process.cwd(); + const cwd: string = options.cwd ?? process.cwd(); let publicPaths: string[] = options.public ?? ["."]; if (!Array.isArray(publicPaths)) { publicPaths = [publicPaths]; @@ -103,8 +103,7 @@ module.exports = function provider(options: any) { } const fullPathnames: string[] = publicPaths.map((p) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-return - pathjoin(cwd, p, pathname), + join(cwd, p, pathname), ); try {