Update package dependencies and remove unused files from node_modules

This commit is contained in:
becarta
2025-05-16 00:25:30 +02:00
parent 04584e9c98
commit 969d9c0af3
250 changed files with 47796 additions and 47121 deletions

22
node_modules/vitefu/src/index.js generated vendored
View File

@@ -1,6 +1,5 @@
import fs from 'node:fs/promises'
import fsSync from 'node:fs'
import { createRequire } from 'node:module'
import path from 'node:path'
import {
isDepIncluded,
@@ -13,20 +12,25 @@ import {
let pnp
if (process.versions.pnp) {
try {
const { createRequire } = (await import('module')).default
pnp = createRequire(import.meta.url)('pnpapi')
} catch {}
}
export { isDepIncluded, isDepExcluded, isDepNoExternaled, isDepExternaled }
/** @type {import('./index.d.ts').crawlFrameworkPkgs} */
/** @type {import('..').crawlFrameworkPkgs} */
export async function crawlFrameworkPkgs(options) {
const pkgJsonPath = await findClosestPkgJsonPath(options.root)
if (!pkgJsonPath) {
// don't throw as package.json is not required
return {
optimizeDeps: { include: [], exclude: [] },
ssr: { noExternal: [], external: [] }
// @ts-expect-error don't throw in deno as package.json is not required
if (typeof Deno !== 'undefined') {
return {
optimizeDeps: { include: [], exclude: [] },
ssr: { noExternal: [], external: [] }
}
} else {
throw new Error(`Cannot find package.json from ${options.root}`)
}
}
const pkgJson = await readJson(pkgJsonPath).catch((e) => {
@@ -189,7 +193,7 @@ export async function crawlFrameworkPkgs(options) {
}
}
/** @type {import('./index.d.ts').findDepPkgJsonPath} */
/** @type {import('..').findDepPkgJsonPath} */
export async function findDepPkgJsonPath(dep, parent) {
if (pnp) {
try {
@@ -217,7 +221,7 @@ export async function findDepPkgJsonPath(dep, parent) {
return undefined
}
/** @type {import('./index.d.ts').findClosestPkgJsonPath} */
/** @type {import('..').findClosestPkgJsonPath} */
export async function findClosestPkgJsonPath(dir, predicate = undefined) {
if (dir.endsWith('package.json')) {
dir = path.dirname(dir)
@@ -237,7 +241,7 @@ export async function findClosestPkgJsonPath(dir, predicate = undefined) {
return undefined
}
/** @type {import('./index.d.ts').pkgNeedsOptimization} */
/** @type {import('..').pkgNeedsOptimization} */
export async function pkgNeedsOptimization(pkgJson, pkgJsonPath) {
// only optimize if is cjs, using the below as heuristic
// see https://github.com/sveltejs/vite-plugin-svelte/issues/162