refactor: migrate from upath to pathe (#553)

This commit is contained in:
pooya parsa 2021-09-27 14:49:36 +02:00 committed by GitHub
parent 3bf856830b
commit 6329a681e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
89 changed files with 112 additions and 103 deletions

View File

@ -21,7 +21,7 @@
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"scule": "^0.2.1", "scule": "^0.2.1",
"untyped": "^0.2.9", "untyped": "^0.2.9",
"upath": "^2.0.1", "pathe": "^0.2.0",
"vue-plausible": "^1.2.1" "vue-plausible": "^1.2.1"
} }
} }

View File

@ -1,7 +1,7 @@
import { rm, writeFile } from 'fs/promises' import { rm, writeFile } from 'fs/promises'
import mkdirp from 'mkdirp' import mkdirp from 'mkdirp'
import type { Schema } from 'untyped' import type { Schema } from 'untyped'
import { join, resolve } from 'upath' import { join, resolve } from 'pathe'
import { kebabCase, upperFirst } from 'scule' import { kebabCase, upperFirst } from 'scule'
export async function main () { export async function main () {

View File

@ -47,9 +47,9 @@
"lerna": "^4.0.0", "lerna": "^4.0.0",
"mocha": "^9.1.1", "mocha": "^9.1.1",
"object-hash": "^2.2.0", "object-hash": "^2.2.0",
"pathe": "^0.2.0",
"typescript": "^4.4.3", "typescript": "^4.4.3",
"unbuild": "^0.5.4", "unbuild": "^0.5.4"
"upath": "^2.0.1"
}, },
"packageManager": "yarn@3.0.2" "packageManager": "yarn@3.0.2"
} }

View File

@ -21,8 +21,8 @@
"nuxi": "^0.10.0", "nuxi": "^0.10.0",
"nuxt-swc": "^0.1.0", "nuxt-swc": "^0.1.0",
"nuxt-vite": "^0.2.4", "nuxt-vite": "^0.2.4",
"ufo": "^0.7.9", "pathe": "^0.2.0",
"upath": "^2.0.1" "ufo": "^0.7.9"
}, },
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",

View File

@ -1,5 +1,5 @@
import { useNuxt, resolveModule } from '@nuxt/kit' import { useNuxt, resolveModule } from '@nuxt/kit'
import { resolve } from 'upath' import { resolve } from 'pathe'
import { distDir } from './dirs' import { distDir } from './dirs'
export function setupAppBridge (_options: any) { export function setupAppBridge (_options: any) {

View File

@ -1,5 +1,5 @@
import { useNuxt, addPlugin, addPluginTemplate } from '@nuxt/kit' import { useNuxt, addPluginTemplate, addPlugin } from '@nuxt/kit'
import { resolve } from 'upath' import { resolve } from 'pathe'
import { distDir } from './dirs' import { distDir } from './dirs'
export function setupCAPIBridge (_options: any) { export function setupCAPIBridge (_options: any) {

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
export const distDir = __dirname export const distDir = __dirname
export const pkgDir = resolve(distDir, '..') export const pkgDir = resolve(distDir, '..')

View File

@ -1,7 +1,7 @@
import fetch from 'node-fetch' import fetch from 'node-fetch'
import { addPluginTemplate, useNuxt } from '@nuxt/kit' import { addPluginTemplate, useNuxt } from '@nuxt/kit'
import { stringifyQuery } from 'ufo' import { stringifyQuery } from 'ufo'
import { resolve } from 'upath' import { resolve } from 'pathe'
import { readFile, writeFile } from 'fs-extra' import { readFile, writeFile } from 'fs-extra'
import { build, generate, prepare, getNitroContext, NitroContext, createDevServer, wpfs, resolveMiddleware } from '@nuxt/nitro' import { build, generate, prepare, getNitroContext, NitroContext, createDevServer, wpfs, resolveMiddleware } from '@nuxt/nitro'
import { AsyncLoadingPlugin } from './async-loading' import { AsyncLoadingPlugin } from './async-loading'

View File

@ -24,12 +24,12 @@
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
"hookable": "^5.0.0", "hookable": "^5.0.0",
"jiti": "^1.12.3", "jiti": "^1.12.3",
"pathe": "^0.2.0",
"rc9": "^1.2.0", "rc9": "^1.2.0",
"scule": "^0.2.1", "scule": "^0.2.1",
"std-env": "^2.3.0", "std-env": "^2.3.0",
"ufo": "^0.7.9", "ufo": "^0.7.9",
"unctx": "^1.0.2", "unctx": "^1.0.2",
"untyped": "^0.2.9", "untyped": "^0.2.9"
"upath": "^2.0.1"
} }
} }

View File

@ -1,5 +1,5 @@
import { existsSync, promises as fsp } from 'fs' import { existsSync, promises as fsp } from 'fs'
import { resolve } from 'upath' import { resolve } from 'pathe'
import dotenv from 'dotenv' import dotenv from 'dotenv'
import { LoadNuxtConfigOptions } from './load' import { LoadNuxtConfigOptions } from './load'

View File

@ -1,5 +1,5 @@
import { existsSync } from 'fs' import { existsSync } from 'fs'
import { resolve } from 'upath' import { resolve } from 'pathe'
import defu from 'defu' import defu from 'defu'
import { applyDefaults } from 'untyped' import { applyDefaults } from 'untyped'
import * as rc from 'rc9' import * as rc from 'rc9'

View File

@ -1,4 +1,4 @@
import { resolve, join } from 'upath' import { resolve, join } from 'pathe'
import { existsSync, readdirSync } from 'fs' import { existsSync, readdirSync } from 'fs'
import defu from 'defu' import defu from 'defu'
import { isRelative, joinURL, hasProtocol } from 'ufo' import { isRelative, joinURL, hasProtocol } from 'ufo'

View File

@ -1,4 +1,4 @@
import { join, resolve } from 'upath' import { join, resolve } from 'pathe'
import env from 'std-env' import env from 'std-env'
import createRequire from 'create-require' import createRequire from 'create-require'
import { pascalCase } from 'scule' import { pascalCase } from 'scule'
@ -478,7 +478,7 @@ export default {
* *
* @example * @example
* ```js * ```js
* import { resolve } from 'path' * import { resolve } from 'pathe'
* export default { * export default {
* alias: { * alias: {
* 'images': resolve(__dirname, './assets/images'), * 'images': resolve(__dirname, './assets/images'),
@ -627,7 +627,7 @@ export default {
* @example * @example
* ```js * ```js
* import fs from 'fs' * import fs from 'fs'
* import path from 'path' * import path from 'pathe'
* export default { * export default {
* hooks: { * hooks: {
* build: { * build: {

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import { joinURL } from 'ufo' import { joinURL } from 'ufo'
/** /**

View File

@ -1,4 +1,4 @@
import path from 'upath' import path from 'pathe'
import consola from 'consola' import consola from 'consola'
import type { Nuxt, NuxtPluginTemplate, NuxtTemplate } from '../types/nuxt' import type { Nuxt, NuxtPluginTemplate, NuxtTemplate } from '../types/nuxt'
import { chainFn } from '../utils/task' import { chainFn } from '../utils/task'

View File

@ -1,5 +1,5 @@
import fs from 'fs' import fs from 'fs'
import { basename, parse, resolve } from 'upath' import { basename, parse, resolve } from 'pathe'
import hash from 'hash-sum' import hash from 'hash-sum'
import type { WebpackPluginInstance, Configuration as WebpackConfig } from 'webpack' import type { WebpackPluginInstance, Configuration as WebpackConfig } from 'webpack'
import type { Plugin as VitePlugin, UserConfig as ViteConfig } from 'vite' import type { Plugin as VitePlugin, UserConfig as ViteConfig } from 'vite'

View File

@ -1,4 +1,4 @@
import { join, normalize } from 'upath' import { join, normalize } from 'pathe'
import jiti from 'jiti' import jiti from 'jiti'
// TODO: use create-require for jest environment // TODO: use create-require for jest environment

View File

@ -1,5 +1,5 @@
import { existsSync, lstatSync, readdirSync } from 'fs' import { existsSync, lstatSync, readdirSync } from 'fs'
import { basename, dirname, resolve, join } from 'upath' import { basename, dirname, resolve, join } from 'pathe'
import globby from 'globby' import globby from 'globby'
export interface ResolveOptions { export interface ResolveOptions {

View File

@ -54,6 +54,7 @@
"node-fetch": "^3.0.0", "node-fetch": "^3.0.0",
"ohmyfetch": "^0.3.1", "ohmyfetch": "^0.3.1",
"ora": "^6.0.1", "ora": "^6.0.1",
"pathe": "^0.2.0",
"pretty-bytes": "^5.6.0", "pretty-bytes": "^5.6.0",
"rollup": "^2.57.0", "rollup": "^2.57.0",
"rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-analyzer": "^4.0.0",

View File

@ -1,4 +1,4 @@
import { resolve, join } from 'upath' import { resolve, join } from 'pathe'
import consola from 'consola' import consola from 'consola'
import { rollup, watch as rollupWatch } from 'rollup' import { rollup, watch as rollupWatch } from 'rollup'
import { readFile, emptyDir, copy } from 'fs-extra' import { readFile, emptyDir, copy } from 'fs-extra'
@ -75,7 +75,7 @@ async function _build (nitroContext: NitroContext) {
await nitroContext._internal.hooks.callHook('nitro:compiled', nitroContext) await nitroContext._internal.hooks.callHook('nitro:compiled', nitroContext)
return { return {
entry: resolve(nitroContext.rollupConfig.output.dir, nitroContext.rollupConfig.output.entryFileNames) entry: resolve(nitroContext.rollupConfig.output.dir, nitroContext.rollupConfig.output.entryFileNames as string)
} }
} }

View File

@ -1,6 +1,6 @@
/* eslint-disable no-use-before-define */ /* eslint-disable no-use-before-define */
import { resolve, dirname } from 'upath' import { resolve, dirname } from 'pathe'
import defu from 'defu' import defu from 'defu'
import { createHooks, Hookable, NestedHooks } from 'hookable' import { createHooks, Hookable, NestedHooks } from 'hookable'
import type { Preset } from 'unenv' import type { Preset } from 'unenv'

View File

@ -1,7 +1,7 @@
import consola from 'consola' import consola from 'consola'
import fse from 'fs-extra' import fse from 'fs-extra'
import globby from 'globby' import globby from 'globby'
import { join, resolve } from 'upath' import { join, resolve } from 'pathe'
import { writeFile } from '../utils' import { writeFile } from '../utils'
import { NitroPreset, NitroContext } from '../context' import { NitroPreset, NitroContext } from '../context'

View File

@ -1,7 +1,7 @@
import archiver from 'archiver' import archiver from 'archiver'
import consola from 'consola' import consola from 'consola'
import { createWriteStream } from 'fs-extra' import { createWriteStream } from 'fs-extra'
import { join, resolve } from 'upath' import { join, resolve } from 'pathe'
import { prettyPath, writeFile } from '../utils' import { prettyPath, writeFile } from '../utils'
import { NitroPreset, NitroContext } from '../context' import { NitroPreset, NitroContext } from '../context'

View File

@ -1,5 +1,5 @@
import { existsSync, writeFile } from 'fs-extra' import { existsSync, writeFile } from 'fs-extra'
import { resolve } from 'upath' import { resolve } from 'pathe'
import consola from 'consola' import consola from 'consola'
import { extendPreset, prettyPath } from '../utils' import { extendPreset, prettyPath } from '../utils'
import { NitroPreset, NitroContext, NitroInput } from '../context' import { NitroPreset, NitroContext, NitroInput } from '../context'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import consola from 'consola' import consola from 'consola'
import { extendPreset, writeFile, prettyPath } from '../utils' import { extendPreset, writeFile, prettyPath } from '../utils'
import { NitroContext, NitroPreset } from '../context' import { NitroContext, NitroPreset } from '../context'

View File

@ -1,4 +1,4 @@
import { join, relative, resolve } from 'upath' import { join, relative, resolve } from 'pathe'
import { existsSync, readJSONSync } from 'fs-extra' import { existsSync, readJSONSync } from 'fs-extra'
import consola from 'consola' import consola from 'consola'
import globby from 'globby' import globby from 'globby'

View File

@ -1,4 +1,4 @@
import { join } from 'upath' import { join } from 'pathe'
import { existsSync, readFile, writeFile } from 'fs-extra' import { existsSync, readFile, writeFile } from 'fs-extra'
import consola from 'consola' import consola from 'consola'
import { extendPreset } from '../utils' import { extendPreset } from '../utils'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import { extendPreset, writeFile } from '../utils' import { extendPreset, writeFile } from '../utils'
import { NitroPreset, NitroContext } from '../context' import { NitroPreset, NitroContext } from '../context'
import { node } from './node' import { node } from './node'

View File

@ -1,5 +1,5 @@
import { pathToFileURL } from 'url' import { pathToFileURL } from 'url'
import { dirname, join, normalize, relative, resolve } from 'upath' import { dirname, join, normalize, relative, resolve } from 'pathe'
import type { InputOptions, OutputOptions } from 'rollup' import type { InputOptions, OutputOptions } from 'rollup'
import defu from 'defu' import defu from 'defu'
import { terser } from 'rollup-plugin-terser' import { terser } from 'rollup-plugin-terser'

View File

@ -2,7 +2,7 @@ import { promises as fsp } from 'fs'
import type { Plugin } from 'rollup' import type { Plugin } from 'rollup'
import createEtag from 'etag' import createEtag from 'etag'
import mime from 'mime' import mime from 'mime'
import { resolve } from 'upath' import { resolve } from 'pathe'
import globby from 'globby' import globby from 'globby'
import virtual from './virtual' import virtual from './virtual'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import globby from 'globby' import globby from 'globby'
import type { Plugin } from 'rollup' import type { Plugin } from 'rollup'
import { serializeImportName } from '../../utils' import { serializeImportName } from '../../utils'

View File

@ -1,6 +1,6 @@
// Based on https://github.com/egoist/rollup-plugin-esbuild (MIT) // Based on https://github.com/egoist/rollup-plugin-esbuild (MIT)
import { extname, relative } from 'upath' import { extname, relative } from 'pathe'
import type { Plugin, PluginContext } from 'rollup' import type { Plugin, PluginContext } from 'rollup'
import { Loader, TransformResult, transform } from 'esbuild' import { Loader, TransformResult, transform } from 'esbuild'
import { createFilter } from '@rollup/pluginutils' import { createFilter } from '@rollup/pluginutils'

View File

@ -1,4 +1,4 @@
import { resolve, dirname } from 'upath' import { resolve, dirname } from 'pathe'
import { copyFile, mkdirp } from 'fs-extra' import { copyFile, mkdirp } from 'fs-extra'
import { nodeFileTrace, NodeFileTraceOptions } from '@vercel/nft' import { nodeFileTrace, NodeFileTraceOptions } from '@vercel/nft'
import type { Plugin } from 'rollup' import type { Plugin } from 'rollup'

View File

@ -1,5 +1,5 @@
import hasha from 'hasha' import hasha from 'hasha'
import { relative } from 'upath' import { relative } from 'pathe'
import { table, getBorderCharacters } from 'table' import { table, getBorderCharacters } from 'table'
import isPrimitive from 'is-primitive' import isPrimitive from 'is-primitive'
import stdenv from 'std-env' import stdenv from 'std-env'

View File

@ -1,4 +1,4 @@
import { extname } from 'upath' import { extname } from 'pathe'
import type { Plugin } from 'rollup' import type { Plugin } from 'rollup'
export interface RawOptions { export interface RawOptions {

View File

@ -1,7 +1,7 @@
import createEtag from 'etag' import createEtag from 'etag'
import { readFileSync, statSync } from 'fs-extra' import { readFileSync, statSync } from 'fs-extra'
import mime from 'mime' import mime from 'mime'
import { relative, resolve } from 'upath' import { relative, resolve } from 'pathe'
import virtual from '@rollup/plugin-virtual' import virtual from '@rollup/plugin-virtual'
import globby from 'globby' import globby from 'globby'
import type { Plugin } from 'rollup' import type { Plugin } from 'rollup'
@ -31,8 +31,8 @@ export function staticAssets (context: NitroContext) {
'#static-assets': `export default ${JSON.stringify(assets, null, 2)};`, '#static-assets': `export default ${JSON.stringify(assets, null, 2)};`,
'#static': ` '#static': `
import { promises } from 'fs' import { promises } from 'fs'
import { resolve } from 'path' import { resolve } from 'pathe'
import { dirname } from 'path' import { dirname } from 'pathe'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import assets from '#static-assets' import assets from '#static-assets'

View File

@ -1,4 +1,4 @@
import { extname } from 'upath' import { extname } from 'pathe'
import type { Plugin, RenderedChunk } from 'rollup' import type { Plugin, RenderedChunk } from 'rollup'
export interface Options { } export interface Options { }

View File

@ -1,4 +1,4 @@
import * as path from 'upath' import * as path from 'pathe'
import type { Plugin } from 'rollup' import type { Plugin } from 'rollup'
// Based on https://github.com/rollup/plugins/blob/master/packages/virtual/src/index.ts // Based on https://github.com/rollup/plugins/blob/master/packages/virtual/src/index.ts

View File

@ -10,7 +10,7 @@ import { createProxy } from 'http-proxy'
import { listen, Listener, ListenOptions } from 'listhen' import { listen, Listener, ListenOptions } from 'listhen'
import servePlaceholder from 'serve-placeholder' import servePlaceholder from 'serve-placeholder'
import serveStatic from 'serve-static' import serveStatic from 'serve-static'
import { resolve } from 'upath' import { resolve } from 'pathe'
import type { Server } from 'connect' import type { Server } from 'connect'
import type { NitroContext } from '../context' import type { NitroContext } from '../context'
import { handleVfs } from './vfs' import { handleVfs } from './vfs'

View File

@ -1,4 +1,4 @@
import { resolve, join, extname } from 'upath' import { resolve, join, extname } from 'pathe'
import { joinURL } from 'ufo' import { joinURL } from 'ufo'
import globby from 'globby' import globby from 'globby'
import { watch } from 'chokidar' import { watch } from 'chokidar'

View File

@ -1,4 +1,4 @@
import { relative, dirname, resolve } from 'upath' import { relative, dirname, resolve } from 'pathe'
import fse from 'fs-extra' import fse from 'fs-extra'
import jiti from 'jiti' import jiti from 'jiti'
import defu from 'defu' import defu from 'defu'

View File

@ -1,4 +1,4 @@
import { resolve, dirname, relative } from 'upath' import { resolve, dirname, relative } from 'pathe'
import globby from 'globby' import globby from 'globby'
import prettyBytes from 'pretty-bytes' import prettyBytes from 'pretty-bytes'
import gzipSize from 'gzip-size' import gzipSize from 'gzip-size'

View File

@ -1,4 +1,4 @@
import { join } from 'upath' import { join } from 'pathe'
import fsExtra from 'fs-extra' import fsExtra from 'fs-extra'
export const wpfs = { export const wpfs = {

View File

@ -35,9 +35,9 @@
"jiti": "^1.12.3", "jiti": "^1.12.3",
"listhen": "^0.2.4", "listhen": "^0.2.4",
"mri": "^1.2.0", "mri": "^1.2.0",
"pathe": "^0.2.0",
"scule": "^0.2.1", "scule": "^0.2.1",
"unbuild": "latest", "unbuild": "latest",
"upath": "^2.0.1",
"v8-compile-cache": "^2.3.0" "v8-compile-cache": "^2.3.0"
} }
} }

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import { requireModule } from '../utils/cjs' import { requireModule } from '../utils/cjs'
import { error } from '../utils/log' import { error } from '../utils/log'

View File

@ -1,4 +1,4 @@
import { resolve, relative } from 'upath' import { resolve, relative } from 'pathe'
import chokidar from 'chokidar' import chokidar from 'chokidar'
import debounce from 'debounce-promise' import debounce from 'debounce-promise'
import type { Nuxt } from '@nuxt/kit' import type { Nuxt } from '@nuxt/kit'

View File

@ -1,6 +1,6 @@
import os from 'os' import os from 'os'
import { existsSync, readFileSync } from 'fs' import { existsSync, readFileSync } from 'fs'
import { resolve, dirname } from 'upath' import { resolve, dirname } from 'pathe'
import jiti from 'jiti' import jiti from 'jiti'
import destr from 'destr' import destr from 'destr'
import { splitByCase } from 'scule' import { splitByCase } from 'scule'

View File

@ -1,5 +1,5 @@
import { promises as fsp } from 'fs' import { promises as fsp } from 'fs'
import { relative, resolve } from 'upath' import { relative, resolve } from 'pathe'
import { cyan } from 'colorette' import { cyan } from 'colorette'
import type { TSReference } from '@nuxt/kit' import type { TSReference } from '@nuxt/kit'
import { requireModule, getModulePaths, getNearestPackage } from '../utils/cjs' import { requireModule, getModulePaths, getNearestPackage } from '../utils/cjs'

View File

@ -1,4 +1,4 @@
import { normalize, dirname } from 'upath' import { normalize, dirname } from 'pathe'
export function getModulePaths (paths?: string | string[]): string[] { export function getModulePaths (paths?: string | string[]): string[] {
return [].concat( return [].concat(

View File

@ -36,10 +36,10 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"nuxi": "^0.10.0", "nuxi": "^0.10.0",
"ohmyfetch": "^0.3.1", "ohmyfetch": "^0.3.1",
"pathe": "^0.2.0",
"scule": "^0.2.1", "scule": "^0.2.1",
"ufo": "^0.7.9", "ufo": "^0.7.9",
"unplugin": "^0.2.13", "unplugin": "^0.2.13",
"upath": "^2.0.1",
"vue": "^3.2.16", "vue": "^3.2.16",
"vue-router": "^4.0.11", "vue-router": "^4.0.11",
"vuex5": "^0.5.0-testing.3" "vuex5": "^0.5.0-testing.3"

View File

@ -1,5 +1,5 @@
import { statSync } from 'fs' import { statSync } from 'fs'
import { resolve } from 'upath' import { resolve } from 'pathe'
import { defineNuxtModule, resolveAlias, addVitePlugin, addWebpackPlugin } from '@nuxt/kit' import { defineNuxtModule, resolveAlias, addVitePlugin, addWebpackPlugin } from '@nuxt/kit'
import { componentsTemplate, componentsTypeTemplate } from './templates' import { componentsTemplate, componentsTypeTemplate } from './templates'
import { scanComponents } from './scan' import { scanComponents } from './scan'

View File

@ -1,4 +1,4 @@
import { basename, extname, join, dirname, relative } from 'upath' import { basename, extname, join, dirname, relative } from 'pathe'
import globby from 'globby' import globby from 'globby'
import { pascalCase, splitByCase } from 'scule' import { pascalCase, splitByCase } from 'scule'
import type { ScanDir, Component } from './types' import type { ScanDir, Component } from './types'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import lodashTemplate from 'lodash/template' import lodashTemplate from 'lodash/template'
import defu from 'defu' import defu from 'defu'
import { tryResolvePath, resolveFiles, Nuxt, NuxtApp, NuxtTemplate, normalizePlugin, normalizeTemplate } from '@nuxt/kit' import { tryResolvePath, resolveFiles, Nuxt, NuxtApp, NuxtTemplate, normalizePlugin, normalizeTemplate } from '@nuxt/kit'

View File

@ -1,4 +1,4 @@
import { normalize } from 'upath' import { normalize } from 'pathe'
import { wpfs, getNitroContext, createDevServer, resolveMiddleware, build, prepare, generate } from '@nuxt/nitro' import { wpfs, getNitroContext, createDevServer, resolveMiddleware, build, prepare, generate } from '@nuxt/nitro'
import type { Nuxt } from '@nuxt/kit' import type { Nuxt } from '@nuxt/kit'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import { createHooks } from 'hookable' import { createHooks } from 'hookable'
import { loadNuxtConfig, LoadNuxtOptions, Nuxt, NuxtOptions, nuxtCtx, installModule, ModuleContainer, NuxtHooks } from '@nuxt/kit' import { loadNuxtConfig, LoadNuxtOptions, Nuxt, NuxtOptions, nuxtCtx, installModule, ModuleContainer, NuxtHooks } from '@nuxt/kit'
import pagesModule from '../pages/module' import pagesModule from '../pages/module'

View File

@ -1,4 +1,4 @@
import { basename, extname } from 'upath' import { basename, extname } from 'pathe'
import hash from 'hash-sum' import hash from 'hash-sum'
import { camelCase } from 'scule' import { camelCase } from 'scule'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
export const distDir = __dirname export const distDir = __dirname
export const pkgDir = resolve(distDir, '..') export const pkgDir = resolve(distDir, '..')

View File

@ -1,5 +1,5 @@
import { addVitePlugin, addWebpackPlugin, defineNuxtModule, addTemplate, resolveAlias, addPluginTemplate } from '@nuxt/kit' import { addVitePlugin, addWebpackPlugin, defineNuxtModule, addTemplate, resolveAlias, addPluginTemplate } from '@nuxt/kit'
import { resolve } from 'upath' import { resolve } from 'pathe'
import type { Identifiers, GlobalImportsOptions } from './types' import type { Identifiers, GlobalImportsOptions } from './types'
import { TransformPlugin } from './transform' import { TransformPlugin } from './transform'
import { defaultIdentifiers } from './identifiers' import { defaultIdentifiers } from './identifiers'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import { addPlugin, addTemplate, defineNuxtModule } from '@nuxt/kit' import { addPlugin, addTemplate, defineNuxtModule } from '@nuxt/kit'
import { distDir } from '../dirs' import { distDir } from '../dirs'
import type { MetaObject } from './types' import type { MetaObject } from './types'

View File

@ -1,6 +1,6 @@
import { existsSync } from 'fs' import { existsSync } from 'fs'
import { defineNuxtModule, addTemplate, addPlugin } from '@nuxt/kit' import { defineNuxtModule, addTemplate, addPlugin } from '@nuxt/kit'
import { resolve } from 'upath' import { resolve } from 'pathe'
import { distDir } from '../dirs' import { distDir } from '../dirs'
import { resolveLayouts, resolvePagesRoutes } from './utils' import { resolveLayouts, resolvePagesRoutes } from './utils'

View File

@ -1,4 +1,4 @@
import { basename, extname, relative, resolve } from 'upath' import { basename, extname, relative, resolve } from 'pathe'
import { encodePath } from 'ufo' import { encodePath } from 'ufo'
import { Nuxt, resolveFiles } from '@nuxt/kit' import { Nuxt, resolveFiles } from '@nuxt/kit'
import { kebabCase } from 'scule' import { kebabCase } from 'scule'

View File

@ -24,8 +24,8 @@
"debounce": "^1.2.1", "debounce": "^1.2.1",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"magic-string": "^0.25.7", "magic-string": "^0.25.7",
"pathe": "^0.2.0",
"ufo": "^0.7.9", "ufo": "^0.7.9",
"upath": "^2.0.1",
"vite": "^2.5.10", "vite": "^2.5.10",
"vue": "3.2.16" "vue": "3.2.16"
} }

View File

@ -1,5 +1,5 @@
import * as vite from 'vite' import * as vite from 'vite'
import { resolve } from 'upath' import { resolve } from 'pathe'
import { mkdirp, readJSON, writeFile } from 'fs-extra' import { mkdirp, readJSON, writeFile } from 'fs-extra'
import consola from 'consola' import consola from 'consola'
import vitePlugin from '@vitejs/plugin-vue' import vitePlugin from '@vitejs/plugin-vue'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import type { Plugin } from 'vite' import type { Plugin } from 'vite'
export function cacheDirPlugin (rootDir, name: string) { export function cacheDirPlugin (rootDir, name: string) {

View File

@ -1,4 +1,4 @@
import { dirname, isAbsolute, join, resolve } from 'upath' import { dirname, isAbsolute, join, resolve } from 'pathe'
import type { Plugin } from 'rollup' import type { Plugin } from 'rollup'
const PREFIX = '\0virtual:' const PREFIX = '\0virtual:'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import * as vite from 'vite' import * as vite from 'vite'
import vuePlugin from '@vitejs/plugin-vue' import vuePlugin from '@vitejs/plugin-vue'
import consola from 'consola' import consola from 'consola'

View File

@ -1,4 +1,4 @@
import { join } from 'upath' import { join } from 'pathe'
import fsExtra from 'fs-extra' import fsExtra from 'fs-extra'
export const wpfs = { export const wpfs = {

View File

@ -1,5 +1,5 @@
import * as vite from 'vite' import * as vite from 'vite'
import { resolve } from 'upath' import { resolve } from 'pathe'
import consola from 'consola' import consola from 'consola'
import type { Nuxt } from '@nuxt/kit' import type { Nuxt } from '@nuxt/kit'
import type { InlineConfig, SSROptions } from 'vite' import type { InlineConfig, SSROptions } from 'vite'

View File

@ -31,6 +31,7 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"memfs": "^3.3.0", "memfs": "^3.3.0",
"mini-css-extract-plugin": "^2.3.0", "mini-css-extract-plugin": "^2.3.0",
"pathe": "^0.2.0",
"pify": "^5.0.0", "pify": "^5.0.0",
"postcss": "^8.3.7", "postcss": "^8.3.7",
"postcss-import": "^14.0.2", "postcss-import": "^14.0.2",
@ -40,7 +41,6 @@
"style-resources-loader": "^1.4.1", "style-resources-loader": "^1.4.1",
"time-fix-plugin": "^2.0.7", "time-fix-plugin": "^2.0.7",
"ufo": "^0.7.9", "ufo": "^0.7.9",
"upath": "^2.0.1",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"vue": "3.2.16", "vue": "3.2.16",
"vue-loader": "^16.8.1", "vue-loader": "^16.8.1",

View File

@ -1,5 +1,5 @@
import querystring from 'querystring' import querystring from 'querystring'
import path from 'upath' import path from 'pathe'
import webpack from 'webpack' import webpack from 'webpack'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'

View File

@ -1,4 +1,4 @@
import { isAbsolute } from 'upath' import { isAbsolute } from 'pathe'
import { ProvidePlugin } from 'webpack' import { ProvidePlugin } from 'webpack'
import { WebpackConfigContext, applyPresets, getWebpackConfig } from '../utils/config' import { WebpackConfigContext, applyPresets, getWebpackConfig } from '../utils/config'
import { nuxt } from '../presets/nuxt' import { nuxt } from '../presets/nuxt'

View File

@ -1,4 +1,4 @@
import { normalize } from 'upath' import { normalize } from 'pathe'
import { getQuery } from 'ufo' import { getQuery } from 'ufo'
export default class NuxtSetupTransformerPlugin { export default class NuxtSetupTransformerPlugin {

View File

@ -3,7 +3,7 @@
* https://github.com/vuejs/vue/blob/dev/src/server/webpack-plugin/client.js * https://github.com/vuejs/vue/blob/dev/src/server/webpack-plugin/client.js
*/ */
import { dirname } from 'upath' import { dirname } from 'pathe'
import hash from 'hash-sum' import hash from 'hash-sum'
import { uniq } from 'lodash' import { uniq } from 'lodash'
import { writeFile, mkdirp } from 'fs-extra' import { writeFile, mkdirp } from 'fs-extra'

View File

@ -1,4 +1,4 @@
import { normalize } from 'upath' import { normalize } from 'pathe'
import TerserWebpackPlugin from 'terser-webpack-plugin' import TerserWebpackPlugin from 'terser-webpack-plugin'
import { reservedVueTags } from '../utils/reserved-tags' import { reservedVueTags } from '../utils/reserved-tags'
import { WebpackConfigContext } from '../utils/config' import { WebpackConfigContext } from '../utils/config'

View File

@ -1,4 +1,4 @@
import { resolve, normalize } from 'upath' import { resolve, normalize } from 'pathe'
import TimeFixPlugin from 'time-fix-plugin' import TimeFixPlugin from 'time-fix-plugin'
import WebpackBar from 'webpackbar' import WebpackBar from 'webpackbar'
import consola from 'consola' import consola from 'consola'

View File

@ -1,4 +1,4 @@
import path from 'upath' import path from 'pathe'
import MiniCssExtractPlugin from 'mini-css-extract-plugin' import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin' import CssMinimizerPlugin from 'css-minimizer-webpack-plugin'
import { fileName, WebpackConfigContext, applyPresets } from '../utils/config' import { fileName, WebpackConfigContext, applyPresets } from '../utils/config'

View File

@ -1,4 +1,4 @@
import { resolve } from 'upath' import { resolve } from 'pathe'
import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5' import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5'
import { DefinePlugin } from 'webpack' import { DefinePlugin } from 'webpack'
import NuxtSetupTransformerPlugin from '../plugins/transform-setup' import NuxtSetupTransformerPlugin from '../plugins/transform-setup'

View File

@ -49,7 +49,7 @@ function getPolyfills (targets, includes, { ignoreBrowserslistConfig, configPath
} }
function isPackageHoisted (packageName) { function isPackageHoisted (packageName) {
const path = require('upath') const path = require('pathe')
const installedPath = path.normalize(require.resolve(packageName)) const installedPath = path.normalize(require.resolve(packageName))
const relativePath = path.resolve(__dirname, '..', 'node_modules', packageName) const relativePath = path.resolve(__dirname, '..', 'node_modules', packageName)
return installedPath !== relativePath return installedPath !== relativePath

View File

@ -1,4 +1,4 @@
import path from 'upath' import path from 'pathe'
import pify from 'pify' import pify from 'pify'
import { Volume, createFsFromVolume } from 'memfs' import { Volume, createFsFromVolume } from 'memfs'

View File

@ -1,5 +1,5 @@
import fs from 'fs' import fs from 'fs'
import path from 'upath' import path from 'pathe'
import consola from 'consola' import consola from 'consola'
import { defaults, merge, cloneDeep } from 'lodash' import { defaults, merge, cloneDeep } from 'lodash'
import createResolver from 'postcss-import-resolver' import createResolver from 'postcss-import-resolver'

View File

@ -1,5 +1,5 @@
import type { IncomingMessage, ServerResponse } from 'http' import type { IncomingMessage, ServerResponse } from 'http'
import path from 'upath' import path from 'pathe'
import pify from 'pify' import pify from 'pify'
import webpack from 'webpack' import webpack from 'webpack'
import Glob from 'glob' import Glob from 'glob'

View File

@ -1,6 +1,6 @@
import { promises as fsp } from 'fs' import { promises as fsp } from 'fs'
import { execSync } from 'child_process' import { execSync } from 'child_process'
import { resolve } from 'upath' import { resolve } from 'pathe'
import globby from 'globby' import globby from 'globby'
async function loadPackage (dir: string) { async function loadPackage (dir: string) {

View File

@ -1,5 +1,5 @@
import { pathToFileURL } from 'url' import { pathToFileURL } from 'url'
import { resolve } from 'path' import { resolve } from 'pathe'
import destr from 'destr' import destr from 'destr'
import { listen } from 'listhen' import { listen } from 'listhen'
import { $fetch } from 'ohmyfetch' import { $fetch } from 'ohmyfetch'

View File

@ -1,4 +1,4 @@
import { resolve } from 'path' import { resolve } from 'pathe'
import { promises as fsp } from 'fs' import { promises as fsp } from 'fs'
import { TextEncoder, TextDecoder } from 'util' import { TextEncoder, TextDecoder } from 'util'
import { JSDOM } from 'jsdom' import { JSDOM } from 'jsdom'

View File

@ -1,4 +1,4 @@
import { resolve } from 'path' import { resolve } from 'pathe'
import { setupTest, testNitroBehavior, importModule } from './_tests.mjs' import { setupTest, testNitroBehavior, importModule } from './_tests.mjs'
describe('nitro:preset:lambda', () => { describe('nitro:preset:lambda', () => {

View File

@ -1,4 +1,4 @@
import { resolve } from 'path' import { resolve } from 'pathe'
import { startServer, setupTest, testNitroBehavior, importModule } from './_tests.mjs' import { startServer, setupTest, testNitroBehavior, importModule } from './_tests.mjs'
describe('nitro:preset:node', () => { describe('nitro:preset:node', () => {

View File

@ -1,4 +1,4 @@
import { resolve } from 'path' import { resolve } from 'pathe'
import { setupTest, startServer, testNitroBehavior, importModule } from './_tests.mjs' import { setupTest, startServer, testNitroBehavior, importModule } from './_tests.mjs'
describe('nitro:preset:vercel', () => { describe('nitro:preset:vercel', () => {

View File

@ -1,6 +1,6 @@
import { existsSync, readFileSync, writeFileSync, rmSync, mkdirSync } from 'fs' import { existsSync, readFileSync, writeFileSync, rmSync, mkdirSync } from 'fs'
import { execSync } from 'child_process' import { execSync } from 'child_process'
import { resolve, dirname } from 'path' import { resolve, dirname } from 'pathe'
import { fileURLToPath } from 'url' import { fileURLToPath } from 'url'
import defu from 'defu' import defu from 'defu'
import hash from 'object-hash' import hash from 'object-hash'

View File

@ -1421,9 +1421,9 @@ __metadata:
nuxi: ^0.10.0 nuxi: ^0.10.0
nuxt-swc: ^0.1.0 nuxt-swc: ^0.1.0
nuxt-vite: ^0.2.4 nuxt-vite: ^0.2.4
pathe: ^0.2.0
ufo: ^0.7.9 ufo: ^0.7.9
unbuild: latest unbuild: latest
upath: ^2.0.1
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@ -1467,6 +1467,7 @@ __metadata:
hash-sum: ^2.0.0 hash-sum: ^2.0.0
hookable: ^5.0.0 hookable: ^5.0.0
jiti: ^1.12.3 jiti: ^1.12.3
pathe: ^0.2.0
rc9: ^1.2.0 rc9: ^1.2.0
scule: ^0.2.1 scule: ^0.2.1
std-env: ^2.3.0 std-env: ^2.3.0
@ -1474,7 +1475,6 @@ __metadata:
unbuild: latest unbuild: latest
unctx: ^1.0.2 unctx: ^1.0.2
untyped: ^0.2.9 untyped: ^0.2.9
upath: ^2.0.1
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@ -1528,6 +1528,7 @@ __metadata:
node-fetch: ^3.0.0 node-fetch: ^3.0.0
ohmyfetch: ^0.3.1 ohmyfetch: ^0.3.1
ora: ^6.0.1 ora: ^6.0.1
pathe: ^0.2.0
pretty-bytes: ^5.6.0 pretty-bytes: ^5.6.0
rollup: ^2.57.0 rollup: ^2.57.0
rollup-plugin-analyzer: ^4.0.0 rollup-plugin-analyzer: ^4.0.0
@ -1576,9 +1577,9 @@ __metadata:
debounce: ^1.2.1 debounce: ^1.2.1
fs-extra: ^10.0.0 fs-extra: ^10.0.0
magic-string: ^0.25.7 magic-string: ^0.25.7
pathe: ^0.2.0
ufo: ^0.7.9 ufo: ^0.7.9
unbuild: latest unbuild: latest
upath: ^2.0.1
vite: ^2.5.10 vite: ^2.5.10
vue: 3.2.16 vue: 3.2.16
languageName: unknown languageName: unknown
@ -1613,6 +1614,7 @@ __metadata:
lodash: ^4.17.21 lodash: ^4.17.21
memfs: ^3.3.0 memfs: ^3.3.0
mini-css-extract-plugin: ^2.3.0 mini-css-extract-plugin: ^2.3.0
pathe: ^0.2.0
pify: ^5.0.0 pify: ^5.0.0
postcss: ^8.3.7 postcss: ^8.3.7
postcss-import: ^14.0.2 postcss-import: ^14.0.2
@ -1623,7 +1625,6 @@ __metadata:
time-fix-plugin: ^2.0.7 time-fix-plugin: ^2.0.7
ufo: ^0.7.9 ufo: ^0.7.9
unbuild: latest unbuild: latest
upath: ^2.0.1
url-loader: ^4.1.1 url-loader: ^4.1.1
vue: 3.2.16 vue: 3.2.16
vue-loader: ^16.8.1 vue-loader: ^16.8.1
@ -9886,9 +9887,9 @@ fsevents@~2.3.2:
jiti: ^1.12.3 jiti: ^1.12.3
listhen: ^0.2.4 listhen: ^0.2.4
mri: ^1.2.0 mri: ^1.2.0
pathe: ^0.2.0
scule: ^0.2.1 scule: ^0.2.1
unbuild: latest unbuild: latest
upath: ^2.0.1
v8-compile-cache: ^2.3.0 v8-compile-cache: ^2.3.0
dependenciesMeta: dependenciesMeta:
fsevents: fsevents:
@ -9922,9 +9923,9 @@ fsevents@~2.3.2:
lerna: ^4.0.0 lerna: ^4.0.0
mocha: ^9.1.1 mocha: ^9.1.1
object-hash: ^2.2.0 object-hash: ^2.2.0
pathe: ^0.2.0
typescript: ^4.4.3 typescript: ^4.4.3
unbuild: ^0.5.4 unbuild: ^0.5.4
upath: ^2.0.1
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@ -9993,11 +9994,11 @@ fsevents@~2.3.2:
lodash: ^4.17.21 lodash: ^4.17.21
nuxi: ^0.10.0 nuxi: ^0.10.0
ohmyfetch: ^0.3.1 ohmyfetch: ^0.3.1
pathe: ^0.2.0
scule: ^0.2.1 scule: ^0.2.1
ufo: ^0.7.9 ufo: ^0.7.9
unbuild: latest unbuild: latest
unplugin: ^0.2.13 unplugin: ^0.2.13
upath: ^2.0.1
vue: ^3.2.16 vue: ^3.2.16
vue-meta: next vue-meta: next
vue-router: ^4.0.11 vue-router: ^4.0.11
@ -10510,6 +10511,13 @@ fsevents@~2.3.2:
languageName: node languageName: node
linkType: hard linkType: hard
"pathe@npm:^0.2.0":
version: 0.2.0
resolution: "pathe@npm:0.2.0"
checksum: 9a8149ce152088f30d15b0b03a7c128ba21f16b4dc1f3f90fe38eee9f6d0f1d6da8e4e47bd2a4f9e14aaac7c30ed01cfc86216479011de2bdc598b65e6f19f41
languageName: node
linkType: hard
"pathval@npm:^1.1.1": "pathval@npm:^1.1.1":
version: 1.1.1 version: 1.1.1
resolution: "pathval@npm:1.1.1" resolution: "pathval@npm:1.1.1"