From a9755eb8dd066fa2c69e3eb87361891b5496d75c Mon Sep 17 00:00:00 2001 From: Thorn Walli Date: Wed, 8 Nov 2023 14:04:29 +0100 Subject: [PATCH] fix(update): replaced `path` with `pathe` --- src/hookFunctions/nitro/init.mjs | 2 +- test/tests/html.mjs | 2 +- test/utils.mjs | 4 ++-- vitest.config.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hookFunctions/nitro/init.mjs b/src/hookFunctions/nitro/init.mjs index 13f5e3939d..7c4271cf5b 100644 --- a/src/hookFunctions/nitro/init.mjs +++ b/src/hookFunctions/nitro/init.mjs @@ -1,5 +1,5 @@ import { promises as fsPromises } from 'fs'; -import { basename, dirname, join, resolve } from 'path'; +import { basename, dirname, join, resolve } from 'pathe'; import { parseDocument } from 'htmlparser2'; import { load } from 'cheerio'; import { render } from 'dom-serializer'; diff --git a/test/tests/html.mjs b/test/tests/html.mjs index 2d269247e4..023f89dd4a 100644 --- a/test/tests/html.mjs +++ b/test/tests/html.mjs @@ -1,6 +1,6 @@ /* eslint-disable no-secrets/no-secrets */ -import { join } from 'path'; +import { join } from 'pathe'; import { describe, it, expect } from 'vitest'; import { getDom, getLinkPreloadKey, getHTML } from '../utils.mjs'; diff --git a/test/utils.mjs b/test/utils.mjs index fc9eed3862..3bc5cf4d63 100644 --- a/test/utils.mjs +++ b/test/utils.mjs @@ -1,6 +1,6 @@ -import { resolve as fsResolve } from 'path'; import { existsSync, promises as fsPromises } from 'fs'; import http from 'http'; +import pathe from 'pathe'; import { JSDOM } from 'jsdom'; import rimraf from 'rimraf'; import finalhandler from 'finalhandler'; @@ -49,7 +49,7 @@ export const deleteDir = path => { export const getHTML = (path = '') => { // eslint-disable-next-line security/detect-non-literal-fs-filename - return fsPromises.readFile(fsResolve(path, 'index.html'), 'utf-8'); + return fsPromises.readFile(pathe.resolve(path, 'index.html'), 'utf-8'); }; export const startStaticServer = async (dist, port, hostname = 'localhost') => { diff --git a/vitest.config.js b/vitest.config.js index c4e5d94266..9b1e1b9960 100644 --- a/vitest.config.js +++ b/vitest.config.js @@ -1,4 +1,4 @@ -import path from 'path'; +import path from 'pathe'; import { defineConfig } from 'vitest/config'; export default defineConfig({