Update package dependencies and remove unused files from node_modules
This commit is contained in:
2
node_modules/vitefu/LICENSE
generated
vendored
2
node_modules/vitefu/LICENSE
generated
vendored
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Bjorn and Dominik
|
||||
Copyright (c) 2023 Bjorn and Dominik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
2
node_modules/vitefu/README.md
generated
vendored
2
node_modules/vitefu/README.md
generated
vendored
@@ -4,7 +4,7 @@ Utilities for building frameworks with Vite.
|
||||
|
||||
## Usage
|
||||
|
||||
See [src/index.d.ts](./src/index.d.ts).
|
||||
See [index.d.ts](./index.d.ts).
|
||||
|
||||
## License
|
||||
|
||||
|
0
node_modules/vitefu/src/index.d.ts → node_modules/vitefu/index.d.ts
generated
vendored
0
node_modules/vitefu/src/index.d.ts → node_modules/vitefu/index.d.ts
generated
vendored
22
node_modules/vitefu/package.json
generated
vendored
22
node_modules/vitefu/package.json
generated
vendored
@@ -1,22 +1,24 @@
|
||||
{
|
||||
"name": "vitefu",
|
||||
"description": "Utilities for building frameworks with Vite",
|
||||
"version": "1.0.6",
|
||||
"version": "0.2.5",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"types": "./src/index.d.ts",
|
||||
"types": "./index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.ts",
|
||||
"import": "./src/index.js",
|
||||
"require": "./src/index.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
"src",
|
||||
"index.d.ts"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/svitejs/vitefu.git"
|
||||
"url": "https://github.com/svitejs/vitefu.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/svitejs/vitefu/issues"
|
||||
@@ -30,7 +32,7 @@
|
||||
"test": "uvu tests \".*\\.test\\.js\""
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0"
|
||||
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"vite": {
|
||||
@@ -38,13 +40,7 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.18.63",
|
||||
"@types/pnpapi": "^0.0.5",
|
||||
"uvu": "^0.5.6",
|
||||
"vite": "^3.2.11"
|
||||
},
|
||||
"workspaces": [
|
||||
"tests/deps/*",
|
||||
"tests/projects/*"
|
||||
]
|
||||
"vite": "^3.2.3"
|
||||
}
|
||||
}
|
||||
|
58
node_modules/vitefu/src/index.d.cts
generated
vendored
58
node_modules/vitefu/src/index.d.cts
generated
vendored
@@ -1,58 +0,0 @@
|
||||
// CJS types like `index.d.ts` but dumbed down and doesn't import from `vite`. Thanks TypeScript.
|
||||
|
||||
export interface CrawlFrameworkPkgsOptions {
|
||||
root: string
|
||||
isBuild: boolean
|
||||
viteUserConfig?: any
|
||||
isFrameworkPkgByJson?: (pkgJson: Record<string, any>) => boolean
|
||||
isFrameworkPkgByName?: (pkgName: string) => boolean | undefined
|
||||
isSemiFrameworkPkgByJson?: (pkgJson: Record<string, any>) => boolean
|
||||
isSemiFrameworkPkgByName?: (pkgName: string) => boolean | undefined
|
||||
}
|
||||
|
||||
export interface CrawlFrameworkPkgsResult {
|
||||
optimizeDeps: {
|
||||
include: string[]
|
||||
exclude: string[]
|
||||
}
|
||||
ssr: {
|
||||
noExternal: string[]
|
||||
external: string[]
|
||||
}
|
||||
}
|
||||
|
||||
export declare function crawlFrameworkPkgs(
|
||||
options: CrawlFrameworkPkgsOptions
|
||||
): Promise<CrawlFrameworkPkgsResult>
|
||||
|
||||
export declare function findDepPkgJsonPath(
|
||||
dep: string,
|
||||
parent: string
|
||||
): Promise<string | undefined>
|
||||
|
||||
export declare function findClosestPkgJsonPath(
|
||||
dir: string,
|
||||
predicate?: (pkgJsonPath: string) => boolean | Promise<boolean>
|
||||
): Promise<string | undefined>
|
||||
|
||||
export declare function pkgNeedsOptimization(
|
||||
pkgJson: Record<string, any>,
|
||||
pkgJsonPath: string
|
||||
): Promise<boolean>
|
||||
|
||||
export declare function isDepExcluded(
|
||||
dep: string,
|
||||
optimizeDepsExclude: any
|
||||
): boolean
|
||||
|
||||
export declare function isDepIncluded(
|
||||
dep: string,
|
||||
optimizeDepsInclude: any
|
||||
): boolean
|
||||
|
||||
export declare function isDepNoExternaled(
|
||||
dep: string,
|
||||
ssrNoExternal: any
|
||||
): boolean
|
||||
|
||||
export declare function isDepExternaled(dep: string, ssrExternal: any): boolean
|
22
node_modules/vitefu/src/index.js
generated
vendored
22
node_modules/vitefu/src/index.js
generated
vendored
@@ -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
|
||||
|
19
node_modules/vitefu/src/sync.cjs
generated
vendored
19
node_modules/vitefu/src/sync.cjs
generated
vendored
@@ -1,11 +1,11 @@
|
||||
// contains synchronous API only so it can be exported as CJS and ESM
|
||||
|
||||
/** @type {import('./index.d.ts').isDepIncluded} */
|
||||
/** @type {import('..').isDepIncluded} */
|
||||
function isDepIncluded(dep, optimizeDepsInclude) {
|
||||
return optimizeDepsInclude.some((id) => parseIncludeStr(id) === dep)
|
||||
}
|
||||
|
||||
/** @type {import('./index.d.ts').isDepExcluded} */
|
||||
/** @type {import('..').isDepExcluded} */
|
||||
function isDepExcluded(dep, optimizeDepsExclude) {
|
||||
dep = parseIncludeStr(dep)
|
||||
return optimizeDepsExclude.some(
|
||||
@@ -13,7 +13,7 @@ function isDepExcluded(dep, optimizeDepsExclude) {
|
||||
)
|
||||
}
|
||||
|
||||
/** @type {import('./index.d.ts').isDepNoExternaled} */
|
||||
/** @type {import('..').isDepNoExternaled} */
|
||||
function isDepNoExternaled(dep, ssrNoExternal) {
|
||||
if (ssrNoExternal === true) {
|
||||
return true
|
||||
@@ -22,18 +22,9 @@ function isDepNoExternaled(dep, ssrNoExternal) {
|
||||
}
|
||||
}
|
||||
|
||||
/** @type {import('./index.d.ts').isDepExternaled} */
|
||||
/** @type {import('..').isDepExternaled} */
|
||||
function isDepExternaled(dep, ssrExternal) {
|
||||
// If `ssrExternal` is `true`, it just means that all linked
|
||||
// dependencies should also be externalized by default. It doesn't
|
||||
// mean that a dependency is being explicitly externalized. So we
|
||||
// return `false` in this case.
|
||||
// @ts-expect-error can be true in Vite 6
|
||||
if (ssrExternal === true) {
|
||||
return false
|
||||
} else {
|
||||
return ssrExternal.includes(dep)
|
||||
}
|
||||
return ssrExternal.includes(dep)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user