test commit-2
This commit is contained in:
2406
app/node_modules/vite/LICENSE.md
generated
vendored
Normal file
2406
app/node_modules/vite/LICENSE.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
20
app/node_modules/vite/README.md
generated
vendored
Normal file
20
app/node_modules/vite/README.md
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# vite ⚡
|
||||
|
||||
> Next Generation Frontend Tooling
|
||||
|
||||
- 💡 Instant Server Start
|
||||
- ⚡️ Lightning Fast HMR
|
||||
- 🛠️ Rich Features
|
||||
- 📦 Optimized Build
|
||||
- 🔩 Universal Plugin Interface
|
||||
- 🔑 Fully Typed APIs
|
||||
|
||||
Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:
|
||||
|
||||
- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vite.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vite.dev/guide/features.html#hot-module-replacement).
|
||||
|
||||
- A [build command](https://vite.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
|
||||
|
||||
In addition, Vite is highly extensible via its [Plugin API](https://vite.dev/guide/api-plugin.html) and [JavaScript API](https://vite.dev/guide/api-javascript.html) with full typing support.
|
||||
|
||||
[Read the Docs to Learn More](https://vite.dev).
|
||||
95
app/node_modules/vite/bin/openChrome.applescript
generated
vendored
Normal file
95
app/node_modules/vite/bin/openChrome.applescript
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
(*
|
||||
Copyright (c) 2015-present, Facebook, Inc.
|
||||
|
||||
This source code is licensed under the MIT license found in the
|
||||
LICENSE file at
|
||||
https://github.com/facebookincubator/create-react-app/blob/master/LICENSE
|
||||
*)
|
||||
|
||||
property targetTab: null
|
||||
property targetTabIndex: -1
|
||||
property targetWindow: null
|
||||
property theProgram: "Google Chrome"
|
||||
|
||||
on run argv
|
||||
set theURL to item 1 of argv
|
||||
|
||||
-- Allow requested program to be optional,
|
||||
-- default to Google Chrome
|
||||
if (count of argv) > 1 then
|
||||
set theProgram to item 2 of argv
|
||||
end if
|
||||
|
||||
using terms from application "Google Chrome"
|
||||
tell application theProgram
|
||||
|
||||
if (count every window) = 0 then
|
||||
make new window
|
||||
end if
|
||||
|
||||
-- 1: Looking for tab running debugger
|
||||
-- then, Reload debugging tab if found
|
||||
-- then return
|
||||
set found to my lookupTabWithUrl(theURL)
|
||||
if found then
|
||||
set targetWindow's active tab index to targetTabIndex
|
||||
tell targetTab to reload
|
||||
tell targetWindow to activate
|
||||
set index of targetWindow to 1
|
||||
return
|
||||
end if
|
||||
|
||||
-- 2: Looking for Empty tab
|
||||
-- In case debugging tab was not found
|
||||
-- We try to find an empty tab instead
|
||||
set found to my lookupTabWithUrl("chrome://newtab/")
|
||||
if found then
|
||||
set targetWindow's active tab index to targetTabIndex
|
||||
set URL of targetTab to theURL
|
||||
tell targetWindow to activate
|
||||
return
|
||||
end if
|
||||
|
||||
-- 3: Create new tab
|
||||
-- both debugging and empty tab were not found
|
||||
-- make a new tab with url
|
||||
tell window 1
|
||||
activate
|
||||
make new tab with properties {URL:theURL}
|
||||
end tell
|
||||
end tell
|
||||
end using terms from
|
||||
end run
|
||||
|
||||
-- Function:
|
||||
-- Lookup tab with given url
|
||||
-- if found, store tab, index, and window in properties
|
||||
-- (properties were declared on top of file)
|
||||
on lookupTabWithUrl(lookupUrl)
|
||||
using terms from application "Google Chrome"
|
||||
tell application theProgram
|
||||
-- Find a tab with the given url
|
||||
set found to false
|
||||
set theTabIndex to -1
|
||||
repeat with theWindow in every window
|
||||
set theTabIndex to 0
|
||||
repeat with theTab in every tab of theWindow
|
||||
set theTabIndex to theTabIndex + 1
|
||||
if (theTab's URL as string) contains lookupUrl then
|
||||
-- assign tab, tab index, and window to properties
|
||||
set targetTab to theTab
|
||||
set targetTabIndex to theTabIndex
|
||||
set targetWindow to theWindow
|
||||
set found to true
|
||||
exit repeat
|
||||
end if
|
||||
end repeat
|
||||
|
||||
if found then
|
||||
exit repeat
|
||||
end if
|
||||
end repeat
|
||||
end tell
|
||||
end using terms from
|
||||
return found
|
||||
end lookupTabWithUrl
|
||||
79
app/node_modules/vite/bin/vite.js
generated
vendored
Normal file
79
app/node_modules/vite/bin/vite.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env node
|
||||
import { performance } from 'node:perf_hooks'
|
||||
import module from 'node:module'
|
||||
|
||||
if (!import.meta.url.includes('node_modules')) {
|
||||
try {
|
||||
// only available as dev dependency
|
||||
await import('source-map-support').then((r) => r.default.install())
|
||||
} catch {}
|
||||
|
||||
process.on('unhandledRejection', (err) => {
|
||||
throw new Error('UNHANDLED PROMISE REJECTION', { cause: err })
|
||||
})
|
||||
}
|
||||
|
||||
global.__vite_start_time = performance.now()
|
||||
|
||||
// check debug mode first before requiring the CLI.
|
||||
const debugIndex = process.argv.findIndex((arg) => /^(?:-d|--debug)$/.test(arg))
|
||||
const filterIndex = process.argv.findIndex((arg) =>
|
||||
/^(?:-f|--filter)$/.test(arg),
|
||||
)
|
||||
const profileIndex = process.argv.indexOf('--profile')
|
||||
|
||||
if (debugIndex > 0) {
|
||||
let value = process.argv[debugIndex + 1]
|
||||
if (!value || value.startsWith('-')) {
|
||||
value = 'vite:*'
|
||||
} else {
|
||||
// support debugging multiple flags with comma-separated list
|
||||
value = value
|
||||
.split(',')
|
||||
.map((v) => `vite:${v}`)
|
||||
.join(',')
|
||||
}
|
||||
process.env.DEBUG = `${
|
||||
process.env.DEBUG ? process.env.DEBUG + ',' : ''
|
||||
}${value}`
|
||||
|
||||
if (filterIndex > 0) {
|
||||
const filter = process.argv[filterIndex + 1]
|
||||
if (filter && !filter.startsWith('-')) {
|
||||
process.env.VITE_DEBUG_FILTER = filter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function start() {
|
||||
try {
|
||||
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.8.0+ and only called if it exists
|
||||
module.enableCompileCache?.()
|
||||
// flush the cache after 10s because the cache is not flushed until process end
|
||||
// for dev server, the cache is never flushed unless manually flushed because the process.exit is called
|
||||
// also flushing the cache in SIGINT handler seems to cause the process to hang
|
||||
setTimeout(() => {
|
||||
try {
|
||||
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.12.0+ and only called if it exists
|
||||
module.flushCompileCache?.()
|
||||
} catch {}
|
||||
}, 10 * 1000).unref()
|
||||
} catch {}
|
||||
return import('../dist/node/cli.js')
|
||||
}
|
||||
|
||||
if (profileIndex > 0) {
|
||||
process.argv.splice(profileIndex, 1)
|
||||
const next = process.argv[profileIndex]
|
||||
if (next && !next.startsWith('-')) {
|
||||
process.argv.splice(profileIndex, 1)
|
||||
}
|
||||
const inspector = await import('node:inspector').then((r) => r.default)
|
||||
const session = (global.__vite_profile_session = new inspector.Session())
|
||||
session.connect()
|
||||
session.post('Profiler.enable', () => {
|
||||
session.post('Profiler.start', start)
|
||||
})
|
||||
} else {
|
||||
start()
|
||||
}
|
||||
279
app/node_modules/vite/client.d.ts
generated
vendored
Normal file
279
app/node_modules/vite/client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,279 @@
|
||||
/// <reference path="./types/importMeta.d.ts" />
|
||||
|
||||
// CSS modules
|
||||
type CSSModuleClasses = { readonly [key: string]: string }
|
||||
|
||||
declare module '*.module.css' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.scss' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.sass' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.less' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.styl' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.stylus' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.pcss' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
declare module '*.module.sss' {
|
||||
const classes: CSSModuleClasses
|
||||
export default classes
|
||||
}
|
||||
|
||||
// CSS
|
||||
declare module '*.css' {}
|
||||
declare module '*.scss' {}
|
||||
declare module '*.sass' {}
|
||||
declare module '*.less' {}
|
||||
declare module '*.styl' {}
|
||||
declare module '*.stylus' {}
|
||||
declare module '*.pcss' {}
|
||||
declare module '*.sss' {}
|
||||
|
||||
// Built-in asset types
|
||||
// see `src/node/constants.ts`
|
||||
|
||||
// images
|
||||
declare module '*.apng' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.bmp' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.png' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.jpg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.jpeg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.jfif' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.pjpeg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.pjp' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.gif' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.svg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.ico' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.webp' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.avif' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.cur' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.jxl' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// media
|
||||
declare module '*.mp4' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.webm' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.ogg' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.mp3' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.wav' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.flac' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.aac' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.opus' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.mov' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.m4a' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.vtt' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// fonts
|
||||
declare module '*.woff' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.woff2' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.eot' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.ttf' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.otf' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// other
|
||||
declare module '*.webmanifest' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.pdf' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
declare module '*.txt' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
// wasm?init
|
||||
declare module '*.wasm?init' {
|
||||
const initWasm: (
|
||||
options?: WebAssembly.Imports,
|
||||
) => Promise<WebAssembly.Instance>
|
||||
export default initWasm
|
||||
}
|
||||
|
||||
// web worker
|
||||
declare module '*?worker' {
|
||||
const workerConstructor: {
|
||||
new (options?: { name?: string }): Worker
|
||||
}
|
||||
export default workerConstructor
|
||||
}
|
||||
|
||||
declare module '*?worker&inline' {
|
||||
const workerConstructor: {
|
||||
new (options?: { name?: string }): Worker
|
||||
}
|
||||
export default workerConstructor
|
||||
}
|
||||
|
||||
declare module '*?worker&url' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?sharedworker' {
|
||||
const sharedWorkerConstructor: {
|
||||
new (options?: { name?: string }): SharedWorker
|
||||
}
|
||||
export default sharedWorkerConstructor
|
||||
}
|
||||
|
||||
declare module '*?sharedworker&inline' {
|
||||
const sharedWorkerConstructor: {
|
||||
new (options?: { name?: string }): SharedWorker
|
||||
}
|
||||
export default sharedWorkerConstructor
|
||||
}
|
||||
|
||||
declare module '*?sharedworker&url' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?raw' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?url' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?inline' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?no-inline' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?url&inline' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare module '*?url&no-inline' {
|
||||
const src: string
|
||||
export default src
|
||||
}
|
||||
|
||||
declare interface VitePreloadErrorEvent extends Event {
|
||||
payload: Error
|
||||
}
|
||||
|
||||
declare interface WindowEventMap {
|
||||
'vite:preloadError': VitePreloadErrorEvent
|
||||
}
|
||||
1134
app/node_modules/vite/dist/client/client.mjs
generated
vendored
Normal file
1134
app/node_modules/vite/dist/client/client.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
24
app/node_modules/vite/dist/client/env.mjs
generated
vendored
Normal file
24
app/node_modules/vite/dist/client/env.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const context = (() => {
|
||||
if (typeof globalThis !== "undefined") {
|
||||
return globalThis;
|
||||
} else if (typeof self !== "undefined") {
|
||||
return self;
|
||||
} else if (typeof window !== "undefined") {
|
||||
return window;
|
||||
} else {
|
||||
return Function("return this")();
|
||||
}
|
||||
})();
|
||||
const defines = __DEFINES__;
|
||||
Object.keys(defines).forEach((key) => {
|
||||
const segments = key.split(".");
|
||||
let target = context;
|
||||
for (let i = 0; i < segments.length; i++) {
|
||||
const segment = segments[i];
|
||||
if (i === segments.length - 1) {
|
||||
target[segment] = defines[key];
|
||||
} else {
|
||||
target = target[segment] || (target[segment] = {});
|
||||
}
|
||||
}
|
||||
});
|
||||
3986
app/node_modules/vite/dist/node-cjs/publicUtils.cjs
generated
vendored
Normal file
3986
app/node_modules/vite/dist/node-cjs/publicUtils.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
553
app/node_modules/vite/dist/node/chunks/dep-3RmXg9uo.js
generated
vendored
Normal file
553
app/node_modules/vite/dist/node/chunks/dep-3RmXg9uo.js
generated
vendored
Normal file
@@ -0,0 +1,553 @@
|
||||
var openParentheses = "(".charCodeAt(0);
|
||||
var closeParentheses = ")".charCodeAt(0);
|
||||
var singleQuote = "'".charCodeAt(0);
|
||||
var doubleQuote = '"'.charCodeAt(0);
|
||||
var backslash = "\\".charCodeAt(0);
|
||||
var slash = "/".charCodeAt(0);
|
||||
var comma = ",".charCodeAt(0);
|
||||
var colon = ":".charCodeAt(0);
|
||||
var star = "*".charCodeAt(0);
|
||||
var uLower = "u".charCodeAt(0);
|
||||
var uUpper = "U".charCodeAt(0);
|
||||
var plus = "+".charCodeAt(0);
|
||||
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
||||
|
||||
var parse$1 = function(input) {
|
||||
var tokens = [];
|
||||
var value = input;
|
||||
|
||||
var next,
|
||||
quote,
|
||||
prev,
|
||||
token,
|
||||
escape,
|
||||
escapePos,
|
||||
whitespacePos,
|
||||
parenthesesOpenPos;
|
||||
var pos = 0;
|
||||
var code = value.charCodeAt(pos);
|
||||
var max = value.length;
|
||||
var stack = [{ nodes: tokens }];
|
||||
var balanced = 0;
|
||||
var parent;
|
||||
|
||||
var name = "";
|
||||
var before = "";
|
||||
var after = "";
|
||||
|
||||
while (pos < max) {
|
||||
// Whitespaces
|
||||
if (code <= 32) {
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
prev = tokens[tokens.length - 1];
|
||||
if (code === closeParentheses && balanced) {
|
||||
after = token;
|
||||
} else if (prev && prev.type === "div") {
|
||||
prev.after = token;
|
||||
prev.sourceEndIndex += token.length;
|
||||
} else if (
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
(code === slash &&
|
||||
value.charCodeAt(next + 1) !== star &&
|
||||
(!parent ||
|
||||
(parent && parent.type === "function" && parent.value !== "calc")))
|
||||
) {
|
||||
before = token;
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "space",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
|
||||
// Quotes
|
||||
} else if (code === singleQuote || code === doubleQuote) {
|
||||
next = pos;
|
||||
quote = code === singleQuote ? "'" : '"';
|
||||
token = {
|
||||
type: "string",
|
||||
sourceIndex: pos,
|
||||
quote: quote
|
||||
};
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(quote, next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += quote;
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
token.value = value.slice(pos + 1, next);
|
||||
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
||||
tokens.push(token);
|
||||
pos = next + 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Comments
|
||||
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
||||
next = value.indexOf("*/", pos);
|
||||
|
||||
token = {
|
||||
type: "comment",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next + 2
|
||||
};
|
||||
|
||||
if (next === -1) {
|
||||
token.unclosed = true;
|
||||
next = value.length;
|
||||
token.sourceEndIndex = next;
|
||||
}
|
||||
|
||||
token.value = value.slice(pos + 2, next);
|
||||
tokens.push(token);
|
||||
|
||||
pos = next + 2;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Operation within calc
|
||||
} else if (
|
||||
(code === slash || code === star) &&
|
||||
parent &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc"
|
||||
) {
|
||||
token = value[pos];
|
||||
tokens.push({
|
||||
type: "word",
|
||||
sourceIndex: pos - before.length,
|
||||
sourceEndIndex: pos + token.length,
|
||||
value: token
|
||||
});
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Dividers
|
||||
} else if (code === slash || code === comma || code === colon) {
|
||||
token = value[pos];
|
||||
|
||||
tokens.push({
|
||||
type: "div",
|
||||
sourceIndex: pos - before.length,
|
||||
sourceEndIndex: pos + token.length,
|
||||
value: token,
|
||||
before: before,
|
||||
after: ""
|
||||
});
|
||||
before = "";
|
||||
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
// Open parentheses
|
||||
} else if (openParentheses === code) {
|
||||
// Whitespaces after open parentheses
|
||||
next = pos;
|
||||
do {
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (code <= 32);
|
||||
parenthesesOpenPos = pos;
|
||||
token = {
|
||||
type: "function",
|
||||
sourceIndex: pos - name.length,
|
||||
value: name,
|
||||
before: value.slice(parenthesesOpenPos + 1, next)
|
||||
};
|
||||
pos = next;
|
||||
|
||||
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
||||
next -= 1;
|
||||
do {
|
||||
escape = false;
|
||||
next = value.indexOf(")", next + 1);
|
||||
if (~next) {
|
||||
escapePos = next;
|
||||
while (value.charCodeAt(escapePos - 1) === backslash) {
|
||||
escapePos -= 1;
|
||||
escape = !escape;
|
||||
}
|
||||
} else {
|
||||
value += ")";
|
||||
next = value.length - 1;
|
||||
token.unclosed = true;
|
||||
}
|
||||
} while (escape);
|
||||
// Whitespaces before closed
|
||||
whitespacePos = next;
|
||||
do {
|
||||
whitespacePos -= 1;
|
||||
code = value.charCodeAt(whitespacePos);
|
||||
} while (code <= 32);
|
||||
if (parenthesesOpenPos < whitespacePos) {
|
||||
if (pos !== whitespacePos + 1) {
|
||||
token.nodes = [
|
||||
{
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: whitespacePos + 1,
|
||||
value: value.slice(pos, whitespacePos + 1)
|
||||
}
|
||||
];
|
||||
} else {
|
||||
token.nodes = [];
|
||||
}
|
||||
if (token.unclosed && whitespacePos + 1 !== next) {
|
||||
token.after = "";
|
||||
token.nodes.push({
|
||||
type: "space",
|
||||
sourceIndex: whitespacePos + 1,
|
||||
sourceEndIndex: next,
|
||||
value: value.slice(whitespacePos + 1, next)
|
||||
});
|
||||
} else {
|
||||
token.after = value.slice(whitespacePos + 1, next);
|
||||
token.sourceEndIndex = next;
|
||||
}
|
||||
} else {
|
||||
token.after = "";
|
||||
token.nodes = [];
|
||||
}
|
||||
pos = next + 1;
|
||||
token.sourceEndIndex = token.unclosed ? next : pos;
|
||||
code = value.charCodeAt(pos);
|
||||
tokens.push(token);
|
||||
} else {
|
||||
balanced += 1;
|
||||
token.after = "";
|
||||
token.sourceEndIndex = pos + 1;
|
||||
tokens.push(token);
|
||||
stack.push(token);
|
||||
tokens = token.nodes = [];
|
||||
parent = token;
|
||||
}
|
||||
name = "";
|
||||
|
||||
// Close parentheses
|
||||
} else if (closeParentheses === code && balanced) {
|
||||
pos += 1;
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
parent.after = after;
|
||||
parent.sourceEndIndex += after.length;
|
||||
after = "";
|
||||
balanced -= 1;
|
||||
stack[stack.length - 1].sourceEndIndex = pos;
|
||||
stack.pop();
|
||||
parent = stack[balanced];
|
||||
tokens = parent.nodes;
|
||||
|
||||
// Words
|
||||
} else {
|
||||
next = pos;
|
||||
do {
|
||||
if (code === backslash) {
|
||||
next += 1;
|
||||
}
|
||||
next += 1;
|
||||
code = value.charCodeAt(next);
|
||||
} while (
|
||||
next < max &&
|
||||
!(
|
||||
code <= 32 ||
|
||||
code === singleQuote ||
|
||||
code === doubleQuote ||
|
||||
code === comma ||
|
||||
code === colon ||
|
||||
code === slash ||
|
||||
code === openParentheses ||
|
||||
(code === star &&
|
||||
parent &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc") ||
|
||||
(code === slash &&
|
||||
parent.type === "function" &&
|
||||
parent.value === "calc") ||
|
||||
(code === closeParentheses && balanced)
|
||||
)
|
||||
);
|
||||
token = value.slice(pos, next);
|
||||
|
||||
if (openParentheses === code) {
|
||||
name = token;
|
||||
} else if (
|
||||
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
|
||||
plus === token.charCodeAt(1) &&
|
||||
isUnicodeRange.test(token.slice(2))
|
||||
) {
|
||||
tokens.push({
|
||||
type: "unicode-range",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next,
|
||||
value: token
|
||||
});
|
||||
} else {
|
||||
tokens.push({
|
||||
type: "word",
|
||||
sourceIndex: pos,
|
||||
sourceEndIndex: next,
|
||||
value: token
|
||||
});
|
||||
}
|
||||
|
||||
pos = next;
|
||||
}
|
||||
}
|
||||
|
||||
for (pos = stack.length - 1; pos; pos -= 1) {
|
||||
stack[pos].unclosed = true;
|
||||
stack[pos].sourceEndIndex = value.length;
|
||||
}
|
||||
|
||||
return stack[0].nodes;
|
||||
};
|
||||
|
||||
var walk$1 = function walk(nodes, cb, bubble) {
|
||||
var i, max, node, result;
|
||||
|
||||
for (i = 0, max = nodes.length; i < max; i += 1) {
|
||||
node = nodes[i];
|
||||
if (!bubble) {
|
||||
result = cb(node, i, nodes);
|
||||
}
|
||||
|
||||
if (
|
||||
result !== false &&
|
||||
node.type === "function" &&
|
||||
Array.isArray(node.nodes)
|
||||
) {
|
||||
walk(node.nodes, cb, bubble);
|
||||
}
|
||||
|
||||
if (bubble) {
|
||||
cb(node, i, nodes);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function stringifyNode(node, custom) {
|
||||
var type = node.type;
|
||||
var value = node.value;
|
||||
var buf;
|
||||
var customResult;
|
||||
|
||||
if (custom && (customResult = custom(node)) !== undefined) {
|
||||
return customResult;
|
||||
} else if (type === "word" || type === "space") {
|
||||
return value;
|
||||
} else if (type === "string") {
|
||||
buf = node.quote || "";
|
||||
return buf + value + (node.unclosed ? "" : buf);
|
||||
} else if (type === "comment") {
|
||||
return "/*" + value + (node.unclosed ? "" : "*/");
|
||||
} else if (type === "div") {
|
||||
return (node.before || "") + value + (node.after || "");
|
||||
} else if (Array.isArray(node.nodes)) {
|
||||
buf = stringify$1(node.nodes, custom);
|
||||
if (type !== "function") {
|
||||
return buf;
|
||||
}
|
||||
return (
|
||||
value +
|
||||
"(" +
|
||||
(node.before || "") +
|
||||
buf +
|
||||
(node.after || "") +
|
||||
(node.unclosed ? "" : ")")
|
||||
);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function stringify$1(nodes, custom) {
|
||||
var result, i;
|
||||
|
||||
if (Array.isArray(nodes)) {
|
||||
result = "";
|
||||
for (i = nodes.length - 1; ~i; i -= 1) {
|
||||
result = stringifyNode(nodes[i], custom) + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return stringifyNode(nodes, custom);
|
||||
}
|
||||
|
||||
var stringify_1 = stringify$1;
|
||||
|
||||
var unit;
|
||||
var hasRequiredUnit;
|
||||
|
||||
function requireUnit () {
|
||||
if (hasRequiredUnit) return unit;
|
||||
hasRequiredUnit = 1;
|
||||
var minus = "-".charCodeAt(0);
|
||||
var plus = "+".charCodeAt(0);
|
||||
var dot = ".".charCodeAt(0);
|
||||
var exp = "e".charCodeAt(0);
|
||||
var EXP = "E".charCodeAt(0);
|
||||
|
||||
// Check if three code points would start a number
|
||||
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
|
||||
function likeNumber(value) {
|
||||
var code = value.charCodeAt(0);
|
||||
var nextCode;
|
||||
|
||||
if (code === plus || code === minus) {
|
||||
nextCode = value.charCodeAt(1);
|
||||
|
||||
if (nextCode >= 48 && nextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var nextNextCode = value.charCodeAt(2);
|
||||
|
||||
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code === dot) {
|
||||
nextCode = value.charCodeAt(1);
|
||||
|
||||
if (nextCode >= 48 && nextCode <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code >= 48 && code <= 57) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Consume a number
|
||||
// https://www.w3.org/TR/css-syntax-3/#consume-number
|
||||
unit = function(value) {
|
||||
var pos = 0;
|
||||
var length = value.length;
|
||||
var code;
|
||||
var nextCode;
|
||||
var nextNextCode;
|
||||
|
||||
if (length === 0 || !likeNumber(value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code === plus || code === minus) {
|
||||
pos++;
|
||||
}
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
nextCode = value.charCodeAt(pos + 1);
|
||||
|
||||
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
||||
pos += 2;
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
code = value.charCodeAt(pos);
|
||||
nextCode = value.charCodeAt(pos + 1);
|
||||
nextNextCode = value.charCodeAt(pos + 2);
|
||||
|
||||
if (
|
||||
(code === exp || code === EXP) &&
|
||||
((nextCode >= 48 && nextCode <= 57) ||
|
||||
((nextCode === plus || nextCode === minus) &&
|
||||
nextNextCode >= 48 &&
|
||||
nextNextCode <= 57))
|
||||
) {
|
||||
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
||||
|
||||
while (pos < length) {
|
||||
code = value.charCodeAt(pos);
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
number: value.slice(0, pos),
|
||||
unit: value.slice(pos)
|
||||
};
|
||||
};
|
||||
return unit;
|
||||
}
|
||||
|
||||
var parse = parse$1;
|
||||
var walk = walk$1;
|
||||
var stringify = stringify_1;
|
||||
|
||||
function ValueParser(value) {
|
||||
if (this instanceof ValueParser) {
|
||||
this.nodes = parse(value);
|
||||
return this;
|
||||
}
|
||||
return new ValueParser(value);
|
||||
}
|
||||
|
||||
ValueParser.prototype.toString = function() {
|
||||
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
||||
};
|
||||
|
||||
ValueParser.prototype.walk = function(cb, bubble) {
|
||||
walk(this.nodes, cb, bubble);
|
||||
return this;
|
||||
};
|
||||
|
||||
ValueParser.unit = requireUnit();
|
||||
|
||||
ValueParser.walk = walk;
|
||||
|
||||
ValueParser.stringify = stringify;
|
||||
|
||||
var lib = ValueParser;
|
||||
|
||||
export { lib as l };
|
||||
822
app/node_modules/vite/dist/node/chunks/dep-AiMcmC_f.js
generated
vendored
Normal file
822
app/node_modules/vite/dist/node/chunks/dep-AiMcmC_f.js
generated
vendored
Normal file
@@ -0,0 +1,822 @@
|
||||
import { P as getDefaultExportFromCjs } from './dep-DBxKXgDP.js';
|
||||
import require$$0 from 'path';
|
||||
import { l as lib } from './dep-3RmXg9uo.js';
|
||||
|
||||
import { createRequire as __cjs_createRequire } from 'node:module';
|
||||
|
||||
const __require = __cjs_createRequire(import.meta.url);
|
||||
function _mergeNamespaces(n, m) {
|
||||
for (var i = 0; i < m.length; i++) {
|
||||
var e = m[i];
|
||||
if (typeof e !== 'string' && !Array.isArray(e)) { for (var k in e) {
|
||||
if (k !== 'default' && !(k in n)) {
|
||||
n[k] = e[k];
|
||||
}
|
||||
} }
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
var formatImportPrelude$2 = function formatImportPrelude(layer, media, supports) {
|
||||
const parts = [];
|
||||
|
||||
if (typeof layer !== "undefined") {
|
||||
let layerParams = "layer";
|
||||
if (layer) {
|
||||
layerParams = `layer(${layer})`;
|
||||
}
|
||||
|
||||
parts.push(layerParams);
|
||||
}
|
||||
|
||||
if (typeof supports !== "undefined") {
|
||||
parts.push(`supports(${supports})`);
|
||||
}
|
||||
|
||||
if (typeof media !== "undefined") {
|
||||
parts.push(media);
|
||||
}
|
||||
|
||||
return parts.join(" ")
|
||||
};
|
||||
|
||||
const formatImportPrelude$1 = formatImportPrelude$2;
|
||||
|
||||
// Base64 encode an import with conditions
|
||||
// The order of conditions is important and is interleaved with cascade layer declarations
|
||||
// Each group of conditions and cascade layers needs to be interpreted in order
|
||||
// To achieve this we create a list of base64 encoded imports, where each import contains a stylesheet with another import.
|
||||
// Each import can define a single group of conditions and a single cascade layer.
|
||||
var base64EncodedImport = function base64EncodedConditionalImport(prelude, conditions) {
|
||||
conditions.reverse();
|
||||
const first = conditions.pop();
|
||||
let params = `${prelude} ${formatImportPrelude$1(
|
||||
first.layer,
|
||||
first.media,
|
||||
first.supports,
|
||||
)}`;
|
||||
|
||||
for (const condition of conditions) {
|
||||
params = `'data:text/css;base64,${Buffer.from(`@import ${params}`).toString(
|
||||
"base64",
|
||||
)}' ${formatImportPrelude$1(
|
||||
condition.layer,
|
||||
condition.media,
|
||||
condition.supports,
|
||||
)}`;
|
||||
}
|
||||
|
||||
return params
|
||||
};
|
||||
|
||||
const base64EncodedConditionalImport = base64EncodedImport;
|
||||
|
||||
var applyConditions$1 = function applyConditions(bundle, atRule) {
|
||||
bundle.forEach(stmt => {
|
||||
if (
|
||||
stmt.type === "charset" ||
|
||||
stmt.type === "warning" ||
|
||||
!stmt.conditions?.length
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
if (stmt.type === "import") {
|
||||
stmt.node.params = base64EncodedConditionalImport(
|
||||
stmt.fullUri,
|
||||
stmt.conditions,
|
||||
);
|
||||
return
|
||||
}
|
||||
|
||||
const { nodes } = stmt;
|
||||
const { parent } = nodes[0];
|
||||
|
||||
const atRules = [];
|
||||
|
||||
// Convert conditions to at-rules
|
||||
for (const condition of stmt.conditions) {
|
||||
if (typeof condition.media !== "undefined") {
|
||||
const mediaNode = atRule({
|
||||
name: "media",
|
||||
params: condition.media,
|
||||
source: parent.source,
|
||||
});
|
||||
|
||||
atRules.push(mediaNode);
|
||||
}
|
||||
|
||||
if (typeof condition.supports !== "undefined") {
|
||||
const supportsNode = atRule({
|
||||
name: "supports",
|
||||
params: `(${condition.supports})`,
|
||||
source: parent.source,
|
||||
});
|
||||
|
||||
atRules.push(supportsNode);
|
||||
}
|
||||
|
||||
if (typeof condition.layer !== "undefined") {
|
||||
const layerNode = atRule({
|
||||
name: "layer",
|
||||
params: condition.layer,
|
||||
source: parent.source,
|
||||
});
|
||||
|
||||
atRules.push(layerNode);
|
||||
}
|
||||
}
|
||||
|
||||
// Add nodes to AST
|
||||
const outerAtRule = atRules.shift();
|
||||
const innerAtRule = atRules.reduce((previous, next) => {
|
||||
previous.append(next);
|
||||
return next
|
||||
}, outerAtRule);
|
||||
|
||||
parent.insertBefore(nodes[0], outerAtRule);
|
||||
|
||||
// remove nodes
|
||||
nodes.forEach(node => {
|
||||
node.parent = undefined;
|
||||
});
|
||||
|
||||
// better output
|
||||
nodes[0].raws.before = nodes[0].raws.before || "\n";
|
||||
|
||||
// wrap new rules with media query and/or layer at rule
|
||||
innerAtRule.append(nodes);
|
||||
|
||||
stmt.type = "nodes";
|
||||
stmt.nodes = [outerAtRule];
|
||||
delete stmt.node;
|
||||
});
|
||||
};
|
||||
|
||||
var applyRaws$1 = function applyRaws(bundle) {
|
||||
bundle.forEach((stmt, index) => {
|
||||
if (index === 0) return
|
||||
|
||||
if (stmt.parent) {
|
||||
const { before } = stmt.parent.node.raws;
|
||||
if (stmt.type === "nodes") stmt.nodes[0].raws.before = before;
|
||||
else stmt.node.raws.before = before;
|
||||
} else if (stmt.type === "nodes") {
|
||||
stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n";
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var applyStyles$1 = function applyStyles(bundle, styles) {
|
||||
styles.nodes = [];
|
||||
|
||||
// Strip additional statements.
|
||||
bundle.forEach(stmt => {
|
||||
if (["charset", "import"].includes(stmt.type)) {
|
||||
stmt.node.parent = undefined;
|
||||
styles.append(stmt.node);
|
||||
} else if (stmt.type === "nodes") {
|
||||
stmt.nodes.forEach(node => {
|
||||
node.parent = undefined;
|
||||
styles.append(node);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
|
||||
const base64DataURLRegexp = /^data:text\/css;base64,/i;
|
||||
const plainDataURLRegexp = /^data:text\/css;plain,/i;
|
||||
|
||||
function isValid(url) {
|
||||
return anyDataURLRegexp.test(url)
|
||||
}
|
||||
|
||||
function contents(url) {
|
||||
if (base64DataURLRegexp.test(url)) {
|
||||
// "data:text/css;base64,".length === 21
|
||||
return Buffer.from(url.slice(21), "base64").toString()
|
||||
}
|
||||
|
||||
if (plainDataURLRegexp.test(url)) {
|
||||
// "data:text/css;plain,".length === 20
|
||||
return decodeURIComponent(url.slice(20))
|
||||
}
|
||||
|
||||
// "data:text/css,".length === 14
|
||||
return decodeURIComponent(url.slice(14))
|
||||
}
|
||||
|
||||
var dataUrl = {
|
||||
isValid,
|
||||
contents,
|
||||
};
|
||||
|
||||
// external tooling
|
||||
const valueParser = lib;
|
||||
|
||||
// extended tooling
|
||||
const { stringify } = valueParser;
|
||||
|
||||
var parseStatements$1 = function parseStatements(result, styles, conditions, from) {
|
||||
const statements = [];
|
||||
let nodes = [];
|
||||
|
||||
styles.each(node => {
|
||||
let stmt;
|
||||
if (node.type === "atrule") {
|
||||
if (node.name === "import")
|
||||
stmt = parseImport(result, node, conditions, from);
|
||||
else if (node.name === "charset")
|
||||
stmt = parseCharset(result, node, conditions, from);
|
||||
}
|
||||
|
||||
if (stmt) {
|
||||
if (nodes.length) {
|
||||
statements.push({
|
||||
type: "nodes",
|
||||
nodes,
|
||||
conditions: [...conditions],
|
||||
from,
|
||||
});
|
||||
nodes = [];
|
||||
}
|
||||
statements.push(stmt);
|
||||
} else nodes.push(node);
|
||||
});
|
||||
|
||||
if (nodes.length) {
|
||||
statements.push({
|
||||
type: "nodes",
|
||||
nodes,
|
||||
conditions: [...conditions],
|
||||
from,
|
||||
});
|
||||
}
|
||||
|
||||
return statements
|
||||
};
|
||||
|
||||
function parseCharset(result, atRule, conditions, from) {
|
||||
if (atRule.prev()) {
|
||||
return result.warn("@charset must precede all other statements", {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
return {
|
||||
type: "charset",
|
||||
node: atRule,
|
||||
conditions: [...conditions],
|
||||
from,
|
||||
}
|
||||
}
|
||||
|
||||
function parseImport(result, atRule, conditions, from) {
|
||||
let prev = atRule.prev();
|
||||
|
||||
// `@import` statements may follow other `@import` statements.
|
||||
if (prev) {
|
||||
do {
|
||||
if (
|
||||
prev.type === "comment" ||
|
||||
(prev.type === "atrule" && prev.name === "import")
|
||||
) {
|
||||
prev = prev.prev();
|
||||
continue
|
||||
}
|
||||
|
||||
break
|
||||
} while (prev)
|
||||
}
|
||||
|
||||
// All `@import` statements may be preceded by `@charset` or `@layer` statements.
|
||||
// But the `@import` statements must be consecutive.
|
||||
if (prev) {
|
||||
do {
|
||||
if (
|
||||
prev.type === "comment" ||
|
||||
(prev.type === "atrule" &&
|
||||
(prev.name === "charset" || (prev.name === "layer" && !prev.nodes)))
|
||||
) {
|
||||
prev = prev.prev();
|
||||
continue
|
||||
}
|
||||
|
||||
return result.warn(
|
||||
"@import must precede all other statements (besides @charset or empty @layer)",
|
||||
{ node: atRule },
|
||||
)
|
||||
} while (prev)
|
||||
}
|
||||
|
||||
if (atRule.nodes) {
|
||||
return result.warn(
|
||||
"It looks like you didn't end your @import statement correctly. " +
|
||||
"Child nodes are attached to it.",
|
||||
{ node: atRule },
|
||||
)
|
||||
}
|
||||
|
||||
const params = valueParser(atRule.params).nodes;
|
||||
const stmt = {
|
||||
type: "import",
|
||||
uri: "",
|
||||
fullUri: "",
|
||||
node: atRule,
|
||||
conditions: [...conditions],
|
||||
from,
|
||||
};
|
||||
|
||||
let layer;
|
||||
let media;
|
||||
let supports;
|
||||
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
const node = params[i];
|
||||
|
||||
if (node.type === "space" || node.type === "comment") continue
|
||||
|
||||
if (node.type === "string") {
|
||||
if (stmt.uri) {
|
||||
return result.warn(`Multiple url's in '${atRule.toString()}'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
if (!node.value) {
|
||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
stmt.uri = node.value;
|
||||
stmt.fullUri = stringify(node);
|
||||
continue
|
||||
}
|
||||
|
||||
if (node.type === "function" && /^url$/i.test(node.value)) {
|
||||
if (stmt.uri) {
|
||||
return result.warn(`Multiple url's in '${atRule.toString()}'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
if (!node.nodes?.[0]?.value) {
|
||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
stmt.uri = node.nodes[0].value;
|
||||
stmt.fullUri = stringify(node);
|
||||
continue
|
||||
}
|
||||
|
||||
if (!stmt.uri) {
|
||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
if (
|
||||
(node.type === "word" || node.type === "function") &&
|
||||
/^layer$/i.test(node.value)
|
||||
) {
|
||||
if (typeof layer !== "undefined") {
|
||||
return result.warn(`Multiple layers in '${atRule.toString()}'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof supports !== "undefined") {
|
||||
return result.warn(
|
||||
`layers must be defined before support conditions in '${atRule.toString()}'`,
|
||||
{
|
||||
node: atRule,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if (node.nodes) {
|
||||
layer = stringify(node.nodes);
|
||||
} else {
|
||||
layer = "";
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
if (node.type === "function" && /^supports$/i.test(node.value)) {
|
||||
if (typeof supports !== "undefined") {
|
||||
return result.warn(
|
||||
`Multiple support conditions in '${atRule.toString()}'`,
|
||||
{
|
||||
node: atRule,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
supports = stringify(node.nodes);
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
media = stringify(params.slice(i));
|
||||
break
|
||||
}
|
||||
|
||||
if (!stmt.uri) {
|
||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
||||
node: atRule,
|
||||
})
|
||||
}
|
||||
|
||||
if (
|
||||
typeof media !== "undefined" ||
|
||||
typeof layer !== "undefined" ||
|
||||
typeof supports !== "undefined"
|
||||
) {
|
||||
stmt.conditions.push({
|
||||
layer,
|
||||
media,
|
||||
supports,
|
||||
});
|
||||
}
|
||||
|
||||
return stmt
|
||||
}
|
||||
|
||||
// builtin tooling
|
||||
const path$2 = require$$0;
|
||||
|
||||
// placeholder tooling
|
||||
let sugarss;
|
||||
|
||||
var processContent$1 = function processContent(
|
||||
result,
|
||||
content,
|
||||
filename,
|
||||
options,
|
||||
postcss,
|
||||
) {
|
||||
const { plugins } = options;
|
||||
const ext = path$2.extname(filename);
|
||||
|
||||
const parserList = [];
|
||||
|
||||
// SugarSS support:
|
||||
if (ext === ".sss") {
|
||||
if (!sugarss) {
|
||||
/* c8 ignore next 3 */
|
||||
try {
|
||||
sugarss = __require('sugarss');
|
||||
} catch {} // Ignore
|
||||
}
|
||||
if (sugarss)
|
||||
return runPostcss(postcss, content, filename, plugins, [sugarss])
|
||||
}
|
||||
|
||||
// Syntax support:
|
||||
if (result.opts.syntax?.parse) {
|
||||
parserList.push(result.opts.syntax.parse);
|
||||
}
|
||||
|
||||
// Parser support:
|
||||
if (result.opts.parser) parserList.push(result.opts.parser);
|
||||
// Try the default as a last resort:
|
||||
parserList.push(null);
|
||||
|
||||
return runPostcss(postcss, content, filename, plugins, parserList)
|
||||
};
|
||||
|
||||
function runPostcss(postcss, content, filename, plugins, parsers, index) {
|
||||
if (!index) index = 0;
|
||||
return postcss(plugins)
|
||||
.process(content, {
|
||||
from: filename,
|
||||
parser: parsers[index],
|
||||
})
|
||||
.catch(err => {
|
||||
// If there's an error, try the next parser
|
||||
index++;
|
||||
// If there are no parsers left, throw it
|
||||
if (index === parsers.length) throw err
|
||||
return runPostcss(postcss, content, filename, plugins, parsers, index)
|
||||
})
|
||||
}
|
||||
|
||||
const path$1 = require$$0;
|
||||
|
||||
const dataURL = dataUrl;
|
||||
const parseStatements = parseStatements$1;
|
||||
const processContent = processContent$1;
|
||||
const resolveId$1 = (id) => id;
|
||||
const formatImportPrelude = formatImportPrelude$2;
|
||||
|
||||
async function parseStyles$1(
|
||||
result,
|
||||
styles,
|
||||
options,
|
||||
state,
|
||||
conditions,
|
||||
from,
|
||||
postcss,
|
||||
) {
|
||||
const statements = parseStatements(result, styles, conditions, from);
|
||||
|
||||
for (const stmt of statements) {
|
||||
if (stmt.type !== "import" || !isProcessableURL(stmt.uri)) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (options.filter && !options.filter(stmt.uri)) {
|
||||
// rejected by filter
|
||||
continue
|
||||
}
|
||||
|
||||
await resolveImportId(result, stmt, options, state, postcss);
|
||||
}
|
||||
|
||||
let charset;
|
||||
const imports = [];
|
||||
const bundle = [];
|
||||
|
||||
function handleCharset(stmt) {
|
||||
if (!charset) charset = stmt;
|
||||
// charsets aren't case-sensitive, so convert to lower case to compare
|
||||
else if (
|
||||
stmt.node.params.toLowerCase() !== charset.node.params.toLowerCase()
|
||||
) {
|
||||
throw stmt.node.error(
|
||||
`Incompatible @charset statements:
|
||||
${stmt.node.params} specified in ${stmt.node.source.input.file}
|
||||
${charset.node.params} specified in ${charset.node.source.input.file}`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// squash statements and their children
|
||||
statements.forEach(stmt => {
|
||||
if (stmt.type === "charset") handleCharset(stmt);
|
||||
else if (stmt.type === "import") {
|
||||
if (stmt.children) {
|
||||
stmt.children.forEach((child, index) => {
|
||||
if (child.type === "import") imports.push(child);
|
||||
else if (child.type === "charset") handleCharset(child);
|
||||
else bundle.push(child);
|
||||
// For better output
|
||||
if (index === 0) child.parent = stmt;
|
||||
});
|
||||
} else imports.push(stmt);
|
||||
} else if (stmt.type === "nodes") {
|
||||
bundle.push(stmt);
|
||||
}
|
||||
});
|
||||
|
||||
return charset ? [charset, ...imports.concat(bundle)] : imports.concat(bundle)
|
||||
}
|
||||
|
||||
async function resolveImportId(result, stmt, options, state, postcss) {
|
||||
if (dataURL.isValid(stmt.uri)) {
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
stmt.children = await loadImportContent(
|
||||
result,
|
||||
stmt,
|
||||
stmt.uri,
|
||||
options,
|
||||
state,
|
||||
postcss,
|
||||
);
|
||||
|
||||
return
|
||||
} else if (dataURL.isValid(stmt.from.slice(-1))) {
|
||||
// Data urls can't be used as a base url to resolve imports.
|
||||
throw stmt.node.error(
|
||||
`Unable to import '${stmt.uri}' from a stylesheet that is embedded in a data url`,
|
||||
)
|
||||
}
|
||||
|
||||
const atRule = stmt.node;
|
||||
let sourceFile;
|
||||
if (atRule.source?.input?.file) {
|
||||
sourceFile = atRule.source.input.file;
|
||||
}
|
||||
const base = sourceFile
|
||||
? path$1.dirname(atRule.source.input.file)
|
||||
: options.root;
|
||||
|
||||
const paths = [await options.resolve(stmt.uri, base, options, atRule)].flat();
|
||||
|
||||
// Ensure that each path is absolute:
|
||||
const resolved = await Promise.all(
|
||||
paths.map(file => {
|
||||
return !path$1.isAbsolute(file)
|
||||
? resolveId$1(file)
|
||||
: file
|
||||
}),
|
||||
);
|
||||
|
||||
// Add dependency messages:
|
||||
resolved.forEach(file => {
|
||||
result.messages.push({
|
||||
type: "dependency",
|
||||
plugin: "postcss-import",
|
||||
file,
|
||||
parent: sourceFile,
|
||||
});
|
||||
});
|
||||
|
||||
const importedContent = await Promise.all(
|
||||
resolved.map(file => {
|
||||
return loadImportContent(result, stmt, file, options, state, postcss)
|
||||
}),
|
||||
);
|
||||
|
||||
// Merge loaded statements
|
||||
// eslint-disable-next-line require-atomic-updates
|
||||
stmt.children = importedContent.flat().filter(x => !!x);
|
||||
}
|
||||
|
||||
async function loadImportContent(
|
||||
result,
|
||||
stmt,
|
||||
filename,
|
||||
options,
|
||||
state,
|
||||
postcss,
|
||||
) {
|
||||
const atRule = stmt.node;
|
||||
const { conditions, from } = stmt;
|
||||
const stmtDuplicateCheckKey = conditions
|
||||
.map(condition =>
|
||||
formatImportPrelude(condition.layer, condition.media, condition.supports),
|
||||
)
|
||||
.join(":");
|
||||
|
||||
if (options.skipDuplicates) {
|
||||
// skip files already imported at the same scope
|
||||
if (state.importedFiles[filename]?.[stmtDuplicateCheckKey]) {
|
||||
return
|
||||
}
|
||||
|
||||
// save imported files to skip them next time
|
||||
if (!state.importedFiles[filename]) {
|
||||
state.importedFiles[filename] = {};
|
||||
}
|
||||
state.importedFiles[filename][stmtDuplicateCheckKey] = true;
|
||||
}
|
||||
|
||||
if (from.includes(filename)) {
|
||||
return
|
||||
}
|
||||
|
||||
const content = await options.load(filename, options);
|
||||
|
||||
if (content.trim() === "" && options.warnOnEmpty) {
|
||||
result.warn(`${filename} is empty`, { node: atRule });
|
||||
return
|
||||
}
|
||||
|
||||
// skip previous imported files not containing @import rules
|
||||
if (
|
||||
options.skipDuplicates &&
|
||||
state.hashFiles[content]?.[stmtDuplicateCheckKey]
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
const importedResult = await processContent(
|
||||
result,
|
||||
content,
|
||||
filename,
|
||||
options,
|
||||
postcss,
|
||||
);
|
||||
|
||||
const styles = importedResult.root;
|
||||
result.messages = result.messages.concat(importedResult.messages);
|
||||
|
||||
if (options.skipDuplicates) {
|
||||
const hasImport = styles.some(child => {
|
||||
return child.type === "atrule" && child.name === "import"
|
||||
});
|
||||
if (!hasImport) {
|
||||
// save hash files to skip them next time
|
||||
if (!state.hashFiles[content]) {
|
||||
state.hashFiles[content] = {};
|
||||
}
|
||||
|
||||
state.hashFiles[content][stmtDuplicateCheckKey] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// recursion: import @import from imported file
|
||||
return parseStyles$1(
|
||||
result,
|
||||
styles,
|
||||
options,
|
||||
state,
|
||||
conditions,
|
||||
[...from, filename],
|
||||
postcss,
|
||||
)
|
||||
}
|
||||
|
||||
function isProcessableURL(uri) {
|
||||
// skip protocol base uri (protocol://url) or protocol-relative
|
||||
if (/^(?:[a-z]+:)?\/\//i.test(uri)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// check for fragment or query
|
||||
try {
|
||||
// needs a base to parse properly
|
||||
const url = new URL(uri, "https://example.com");
|
||||
if (url.search) {
|
||||
return false
|
||||
}
|
||||
} catch {} // Ignore
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var parseStyles_1 = parseStyles$1;
|
||||
|
||||
// builtin tooling
|
||||
const path = require$$0;
|
||||
|
||||
// internal tooling
|
||||
const applyConditions = applyConditions$1;
|
||||
const applyRaws = applyRaws$1;
|
||||
const applyStyles = applyStyles$1;
|
||||
const loadContent = () => "";
|
||||
const parseStyles = parseStyles_1;
|
||||
const resolveId = (id) => id;
|
||||
|
||||
function AtImport(options) {
|
||||
options = {
|
||||
root: process.cwd(),
|
||||
path: [],
|
||||
skipDuplicates: true,
|
||||
resolve: resolveId,
|
||||
load: loadContent,
|
||||
plugins: [],
|
||||
addModulesDirectories: [],
|
||||
warnOnEmpty: true,
|
||||
...options,
|
||||
};
|
||||
|
||||
options.root = path.resolve(options.root);
|
||||
|
||||
// convert string to an array of a single element
|
||||
if (typeof options.path === "string") options.path = [options.path];
|
||||
|
||||
if (!Array.isArray(options.path)) options.path = [];
|
||||
|
||||
options.path = options.path.map(p => path.resolve(options.root, p));
|
||||
|
||||
return {
|
||||
postcssPlugin: "postcss-import",
|
||||
async Once(styles, { result, atRule, postcss }) {
|
||||
const state = {
|
||||
importedFiles: {},
|
||||
hashFiles: {},
|
||||
};
|
||||
|
||||
if (styles.source?.input?.file) {
|
||||
state.importedFiles[styles.source.input.file] = {};
|
||||
}
|
||||
|
||||
if (options.plugins && !Array.isArray(options.plugins)) {
|
||||
throw new Error("plugins option must be an array")
|
||||
}
|
||||
|
||||
const bundle = await parseStyles(
|
||||
result,
|
||||
styles,
|
||||
options,
|
||||
state,
|
||||
[],
|
||||
[],
|
||||
postcss,
|
||||
);
|
||||
|
||||
applyRaws(bundle);
|
||||
applyConditions(bundle, atRule);
|
||||
applyStyles(bundle, styles);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
AtImport.postcss = true;
|
||||
|
||||
var postcssImport = AtImport;
|
||||
|
||||
var index = /*@__PURE__*/getDefaultExportFromCjs(postcssImport);
|
||||
|
||||
var index$1 = /*#__PURE__*/_mergeNamespaces({
|
||||
__proto__: null,
|
||||
default: index
|
||||
}, [postcssImport]);
|
||||
|
||||
export { index$1 as i };
|
||||
8218
app/node_modules/vite/dist/node/chunks/dep-CvfTChi5.js
generated
vendored
Normal file
8218
app/node_modules/vite/dist/node/chunks/dep-CvfTChi5.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
49496
app/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js
generated
vendored
Normal file
49496
app/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7113
app/node_modules/vite/dist/node/chunks/dep-SgSik2vo.js
generated
vendored
Normal file
7113
app/node_modules/vite/dist/node/chunks/dep-SgSik2vo.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
949
app/node_modules/vite/dist/node/cli.js
generated
vendored
Normal file
949
app/node_modules/vite/dist/node/cli.js
generated
vendored
Normal file
@@ -0,0 +1,949 @@
|
||||
import path from 'node:path';
|
||||
import fs__default from 'node:fs';
|
||||
import { performance } from 'node:perf_hooks';
|
||||
import { EventEmitter } from 'events';
|
||||
import { O as colors, I as createLogger, r as resolveConfig } from './chunks/dep-DBxKXgDP.js';
|
||||
import { VERSION } from './constants.js';
|
||||
import 'node:fs/promises';
|
||||
import 'node:url';
|
||||
import 'node:util';
|
||||
import 'node:module';
|
||||
import 'node:crypto';
|
||||
import 'picomatch';
|
||||
import 'esbuild';
|
||||
import 'path';
|
||||
import 'fs';
|
||||
import 'fdir';
|
||||
import 'node:child_process';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'tty';
|
||||
import 'util';
|
||||
import 'net';
|
||||
import 'url';
|
||||
import 'http';
|
||||
import 'stream';
|
||||
import 'os';
|
||||
import 'child_process';
|
||||
import 'node:os';
|
||||
import 'node:net';
|
||||
import 'node:dns';
|
||||
import 'vite/module-runner';
|
||||
import 'rollup/parseAst';
|
||||
import 'node:buffer';
|
||||
import 'module';
|
||||
import 'node:readline';
|
||||
import 'node:process';
|
||||
import 'node:events';
|
||||
import 'tinyglobby';
|
||||
import 'crypto';
|
||||
import 'node:assert';
|
||||
import 'node:v8';
|
||||
import 'node:worker_threads';
|
||||
import 'https';
|
||||
import 'tls';
|
||||
import 'zlib';
|
||||
import 'buffer';
|
||||
import 'assert';
|
||||
import 'node:querystring';
|
||||
import 'node:zlib';
|
||||
|
||||
function toArr(any) {
|
||||
return any == null ? [] : Array.isArray(any) ? any : [any];
|
||||
}
|
||||
|
||||
function toVal(out, key, val, opts) {
|
||||
var x, old=out[key], nxt=(
|
||||
!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val))
|
||||
: typeof val === 'boolean' ? val
|
||||
: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val))
|
||||
: (x = +val,x * 0 === 0) ? x : val
|
||||
);
|
||||
out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);
|
||||
}
|
||||
|
||||
function mri2 (args, opts) {
|
||||
args = args || [];
|
||||
opts = opts || {};
|
||||
|
||||
var k, arr, arg, name, val, out={ _:[] };
|
||||
var i=0, j=0, idx=0, len=args.length;
|
||||
|
||||
const alibi = opts.alias !== void 0;
|
||||
const strict = opts.unknown !== void 0;
|
||||
const defaults = opts.default !== void 0;
|
||||
|
||||
opts.alias = opts.alias || {};
|
||||
opts.string = toArr(opts.string);
|
||||
opts.boolean = toArr(opts.boolean);
|
||||
|
||||
if (alibi) {
|
||||
for (k in opts.alias) {
|
||||
arr = opts.alias[k] = toArr(opts.alias[k]);
|
||||
for (i=0; i < arr.length; i++) {
|
||||
(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i=opts.boolean.length; i-- > 0;) {
|
||||
arr = opts.alias[opts.boolean[i]] || [];
|
||||
for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);
|
||||
}
|
||||
|
||||
for (i=opts.string.length; i-- > 0;) {
|
||||
arr = opts.alias[opts.string[i]] || [];
|
||||
for (j=arr.length; j-- > 0;) opts.string.push(arr[j]);
|
||||
}
|
||||
|
||||
if (defaults) {
|
||||
for (k in opts.default) {
|
||||
name = typeof opts.default[k];
|
||||
arr = opts.alias[k] = opts.alias[k] || [];
|
||||
if (opts[name] !== void 0) {
|
||||
opts[name].push(k);
|
||||
for (i=0; i < arr.length; i++) {
|
||||
opts[name].push(arr[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const keys = strict ? Object.keys(opts.alias) : [];
|
||||
|
||||
for (i=0; i < len; i++) {
|
||||
arg = args[i];
|
||||
|
||||
if (arg === '--') {
|
||||
out._ = out._.concat(args.slice(++i));
|
||||
break;
|
||||
}
|
||||
|
||||
for (j=0; j < arg.length; j++) {
|
||||
if (arg.charCodeAt(j) !== 45) break; // "-"
|
||||
}
|
||||
|
||||
if (j === 0) {
|
||||
out._.push(arg);
|
||||
} else if (arg.substring(j, j + 3) === 'no-') {
|
||||
name = arg.substring(j + 3);
|
||||
if (strict && !~keys.indexOf(name)) {
|
||||
return opts.unknown(arg);
|
||||
}
|
||||
out[name] = false;
|
||||
} else {
|
||||
for (idx=j+1; idx < arg.length; idx++) {
|
||||
if (arg.charCodeAt(idx) === 61) break; // "="
|
||||
}
|
||||
|
||||
name = arg.substring(j, idx);
|
||||
val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);
|
||||
arr = (j === 2 ? [name] : name);
|
||||
|
||||
for (idx=0; idx < arr.length; idx++) {
|
||||
name = arr[idx];
|
||||
if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);
|
||||
toVal(out, name, (idx + 1 < arr.length) || val, opts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defaults) {
|
||||
for (k in opts.default) {
|
||||
if (out[k] === void 0) {
|
||||
out[k] = opts.default[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (alibi) {
|
||||
for (k in out) {
|
||||
arr = opts.alias[k] || [];
|
||||
while (arr.length > 0) {
|
||||
out[arr.shift()] = out[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
const removeBrackets = (v) => v.replace(/[<[].+/, "").trim();
|
||||
const findAllBrackets = (v) => {
|
||||
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
|
||||
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
|
||||
const res = [];
|
||||
const parse = (match) => {
|
||||
let variadic = false;
|
||||
let value = match[1];
|
||||
if (value.startsWith("...")) {
|
||||
value = value.slice(3);
|
||||
variadic = true;
|
||||
}
|
||||
return {
|
||||
required: match[0].startsWith("<"),
|
||||
value,
|
||||
variadic
|
||||
};
|
||||
};
|
||||
let angledMatch;
|
||||
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) {
|
||||
res.push(parse(angledMatch));
|
||||
}
|
||||
let squareMatch;
|
||||
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) {
|
||||
res.push(parse(squareMatch));
|
||||
}
|
||||
return res;
|
||||
};
|
||||
const getMriOptions = (options) => {
|
||||
const result = {alias: {}, boolean: []};
|
||||
for (const [index, option] of options.entries()) {
|
||||
if (option.names.length > 1) {
|
||||
result.alias[option.names[0]] = option.names.slice(1);
|
||||
}
|
||||
if (option.isBoolean) {
|
||||
if (option.negated) {
|
||||
const hasStringTypeOption = options.some((o, i) => {
|
||||
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
||||
});
|
||||
if (!hasStringTypeOption) {
|
||||
result.boolean.push(option.names[0]);
|
||||
}
|
||||
} else {
|
||||
result.boolean.push(option.names[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const findLongest = (arr) => {
|
||||
return arr.sort((a, b) => {
|
||||
return a.length > b.length ? -1 : 1;
|
||||
})[0];
|
||||
};
|
||||
const padRight = (str, length) => {
|
||||
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
||||
};
|
||||
const camelcase = (input) => {
|
||||
return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
|
||||
return p1 + p2.toUpperCase();
|
||||
});
|
||||
};
|
||||
const setDotProp = (obj, keys, val) => {
|
||||
let i = 0;
|
||||
let length = keys.length;
|
||||
let t = obj;
|
||||
let x;
|
||||
for (; i < length; ++i) {
|
||||
x = t[keys[i]];
|
||||
t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
|
||||
}
|
||||
};
|
||||
const setByType = (obj, transforms) => {
|
||||
for (const key of Object.keys(transforms)) {
|
||||
const transform = transforms[key];
|
||||
if (transform.shouldTransform) {
|
||||
obj[key] = Array.prototype.concat.call([], obj[key]);
|
||||
if (typeof transform.transformFunction === "function") {
|
||||
obj[key] = obj[key].map(transform.transformFunction);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const getFileName = (input) => {
|
||||
const m = /([^\\\/]+)$/.exec(input);
|
||||
return m ? m[1] : "";
|
||||
};
|
||||
const camelcaseOptionName = (name) => {
|
||||
return name.split(".").map((v, i) => {
|
||||
return i === 0 ? camelcase(v) : v;
|
||||
}).join(".");
|
||||
};
|
||||
class CACError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = this.constructor.name;
|
||||
if (typeof Error.captureStackTrace === "function") {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
} else {
|
||||
this.stack = new Error(message).stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Option {
|
||||
constructor(rawName, description, config) {
|
||||
this.rawName = rawName;
|
||||
this.description = description;
|
||||
this.config = Object.assign({}, config);
|
||||
rawName = rawName.replace(/\.\*/g, "");
|
||||
this.negated = false;
|
||||
this.names = removeBrackets(rawName).split(",").map((v) => {
|
||||
let name = v.trim().replace(/^-{1,2}/, "");
|
||||
if (name.startsWith("no-")) {
|
||||
this.negated = true;
|
||||
name = name.replace(/^no-/, "");
|
||||
}
|
||||
return camelcaseOptionName(name);
|
||||
}).sort((a, b) => a.length > b.length ? 1 : -1);
|
||||
this.name = this.names[this.names.length - 1];
|
||||
if (this.negated && this.config.default == null) {
|
||||
this.config.default = true;
|
||||
}
|
||||
if (rawName.includes("<")) {
|
||||
this.required = true;
|
||||
} else if (rawName.includes("[")) {
|
||||
this.required = false;
|
||||
} else {
|
||||
this.isBoolean = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const processArgs = process.argv;
|
||||
const platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
|
||||
|
||||
class Command {
|
||||
constructor(rawName, description, config = {}, cli) {
|
||||
this.rawName = rawName;
|
||||
this.description = description;
|
||||
this.config = config;
|
||||
this.cli = cli;
|
||||
this.options = [];
|
||||
this.aliasNames = [];
|
||||
this.name = removeBrackets(rawName);
|
||||
this.args = findAllBrackets(rawName);
|
||||
this.examples = [];
|
||||
}
|
||||
usage(text) {
|
||||
this.usageText = text;
|
||||
return this;
|
||||
}
|
||||
allowUnknownOptions() {
|
||||
this.config.allowUnknownOptions = true;
|
||||
return this;
|
||||
}
|
||||
ignoreOptionDefaultValue() {
|
||||
this.config.ignoreOptionDefaultValue = true;
|
||||
return this;
|
||||
}
|
||||
version(version, customFlags = "-v, --version") {
|
||||
this.versionNumber = version;
|
||||
this.option(customFlags, "Display version number");
|
||||
return this;
|
||||
}
|
||||
example(example) {
|
||||
this.examples.push(example);
|
||||
return this;
|
||||
}
|
||||
option(rawName, description, config) {
|
||||
const option = new Option(rawName, description, config);
|
||||
this.options.push(option);
|
||||
return this;
|
||||
}
|
||||
alias(name) {
|
||||
this.aliasNames.push(name);
|
||||
return this;
|
||||
}
|
||||
action(callback) {
|
||||
this.commandAction = callback;
|
||||
return this;
|
||||
}
|
||||
isMatched(name) {
|
||||
return this.name === name || this.aliasNames.includes(name);
|
||||
}
|
||||
get isDefaultCommand() {
|
||||
return this.name === "" || this.aliasNames.includes("!");
|
||||
}
|
||||
get isGlobalCommand() {
|
||||
return this instanceof GlobalCommand;
|
||||
}
|
||||
hasOption(name) {
|
||||
name = name.split(".")[0];
|
||||
return this.options.find((option) => {
|
||||
return option.names.includes(name);
|
||||
});
|
||||
}
|
||||
outputHelp() {
|
||||
const {name, commands} = this.cli;
|
||||
const {
|
||||
versionNumber,
|
||||
options: globalOptions,
|
||||
helpCallback
|
||||
} = this.cli.globalCommand;
|
||||
let sections = [
|
||||
{
|
||||
body: `${name}${versionNumber ? `/${versionNumber}` : ""}`
|
||||
}
|
||||
];
|
||||
sections.push({
|
||||
title: "Usage",
|
||||
body: ` $ ${name} ${this.usageText || this.rawName}`
|
||||
});
|
||||
const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0;
|
||||
if (showCommands) {
|
||||
const longestCommandName = findLongest(commands.map((command) => command.rawName));
|
||||
sections.push({
|
||||
title: "Commands",
|
||||
body: commands.map((command) => {
|
||||
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
|
||||
}).join("\n")
|
||||
});
|
||||
sections.push({
|
||||
title: `For more info, run any command with the \`--help\` flag`,
|
||||
body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
|
||||
});
|
||||
}
|
||||
let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []];
|
||||
if (!this.isGlobalCommand && !this.isDefaultCommand) {
|
||||
options = options.filter((option) => option.name !== "version");
|
||||
}
|
||||
if (options.length > 0) {
|
||||
const longestOptionName = findLongest(options.map((option) => option.rawName));
|
||||
sections.push({
|
||||
title: "Options",
|
||||
body: options.map((option) => {
|
||||
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
|
||||
}).join("\n")
|
||||
});
|
||||
}
|
||||
if (this.examples.length > 0) {
|
||||
sections.push({
|
||||
title: "Examples",
|
||||
body: this.examples.map((example) => {
|
||||
if (typeof example === "function") {
|
||||
return example(name);
|
||||
}
|
||||
return example;
|
||||
}).join("\n")
|
||||
});
|
||||
}
|
||||
if (helpCallback) {
|
||||
sections = helpCallback(sections) || sections;
|
||||
}
|
||||
console.log(sections.map((section) => {
|
||||
return section.title ? `${section.title}:
|
||||
${section.body}` : section.body;
|
||||
}).join("\n\n"));
|
||||
}
|
||||
outputVersion() {
|
||||
const {name} = this.cli;
|
||||
const {versionNumber} = this.cli.globalCommand;
|
||||
if (versionNumber) {
|
||||
console.log(`${name}/${versionNumber} ${platformInfo}`);
|
||||
}
|
||||
}
|
||||
checkRequiredArgs() {
|
||||
const minimalArgsCount = this.args.filter((arg) => arg.required).length;
|
||||
if (this.cli.args.length < minimalArgsCount) {
|
||||
throw new CACError(`missing required args for command \`${this.rawName}\``);
|
||||
}
|
||||
}
|
||||
checkUnknownOptions() {
|
||||
const {options, globalCommand} = this.cli;
|
||||
if (!this.config.allowUnknownOptions) {
|
||||
for (const name of Object.keys(options)) {
|
||||
if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) {
|
||||
throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
checkOptionValue() {
|
||||
const {options: parsedOptions, globalCommand} = this.cli;
|
||||
const options = [...globalCommand.options, ...this.options];
|
||||
for (const option of options) {
|
||||
const value = parsedOptions[option.name.split(".")[0]];
|
||||
if (option.required) {
|
||||
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
|
||||
if (value === true || value === false && !hasNegated) {
|
||||
throw new CACError(`option \`${option.rawName}\` value is missing`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
class GlobalCommand extends Command {
|
||||
constructor(cli) {
|
||||
super("@@global@@", "", {}, cli);
|
||||
}
|
||||
}
|
||||
|
||||
var __assign = Object.assign;
|
||||
class CAC extends EventEmitter {
|
||||
constructor(name = "") {
|
||||
super();
|
||||
this.name = name;
|
||||
this.commands = [];
|
||||
this.rawArgs = [];
|
||||
this.args = [];
|
||||
this.options = {};
|
||||
this.globalCommand = new GlobalCommand(this);
|
||||
this.globalCommand.usage("<command> [options]");
|
||||
}
|
||||
usage(text) {
|
||||
this.globalCommand.usage(text);
|
||||
return this;
|
||||
}
|
||||
command(rawName, description, config) {
|
||||
const command = new Command(rawName, description || "", config, this);
|
||||
command.globalCommand = this.globalCommand;
|
||||
this.commands.push(command);
|
||||
return command;
|
||||
}
|
||||
option(rawName, description, config) {
|
||||
this.globalCommand.option(rawName, description, config);
|
||||
return this;
|
||||
}
|
||||
help(callback) {
|
||||
this.globalCommand.option("-h, --help", "Display this message");
|
||||
this.globalCommand.helpCallback = callback;
|
||||
this.showHelpOnExit = true;
|
||||
return this;
|
||||
}
|
||||
version(version, customFlags = "-v, --version") {
|
||||
this.globalCommand.version(version, customFlags);
|
||||
this.showVersionOnExit = true;
|
||||
return this;
|
||||
}
|
||||
example(example) {
|
||||
this.globalCommand.example(example);
|
||||
return this;
|
||||
}
|
||||
outputHelp() {
|
||||
if (this.matchedCommand) {
|
||||
this.matchedCommand.outputHelp();
|
||||
} else {
|
||||
this.globalCommand.outputHelp();
|
||||
}
|
||||
}
|
||||
outputVersion() {
|
||||
this.globalCommand.outputVersion();
|
||||
}
|
||||
setParsedInfo({args, options}, matchedCommand, matchedCommandName) {
|
||||
this.args = args;
|
||||
this.options = options;
|
||||
if (matchedCommand) {
|
||||
this.matchedCommand = matchedCommand;
|
||||
}
|
||||
if (matchedCommandName) {
|
||||
this.matchedCommandName = matchedCommandName;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
unsetMatchedCommand() {
|
||||
this.matchedCommand = void 0;
|
||||
this.matchedCommandName = void 0;
|
||||
}
|
||||
parse(argv = processArgs, {
|
||||
run = true
|
||||
} = {}) {
|
||||
this.rawArgs = argv;
|
||||
if (!this.name) {
|
||||
this.name = argv[1] ? getFileName(argv[1]) : "cli";
|
||||
}
|
||||
let shouldParse = true;
|
||||
for (const command of this.commands) {
|
||||
const parsed = this.mri(argv.slice(2), command);
|
||||
const commandName = parsed.args[0];
|
||||
if (command.isMatched(commandName)) {
|
||||
shouldParse = false;
|
||||
const parsedInfo = __assign(__assign({}, parsed), {
|
||||
args: parsed.args.slice(1)
|
||||
});
|
||||
this.setParsedInfo(parsedInfo, command, commandName);
|
||||
this.emit(`command:${commandName}`, command);
|
||||
}
|
||||
}
|
||||
if (shouldParse) {
|
||||
for (const command of this.commands) {
|
||||
if (command.name === "") {
|
||||
shouldParse = false;
|
||||
const parsed = this.mri(argv.slice(2), command);
|
||||
this.setParsedInfo(parsed, command);
|
||||
this.emit(`command:!`, command);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (shouldParse) {
|
||||
const parsed = this.mri(argv.slice(2));
|
||||
this.setParsedInfo(parsed);
|
||||
}
|
||||
if (this.options.help && this.showHelpOnExit) {
|
||||
this.outputHelp();
|
||||
run = false;
|
||||
this.unsetMatchedCommand();
|
||||
}
|
||||
if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) {
|
||||
this.outputVersion();
|
||||
run = false;
|
||||
this.unsetMatchedCommand();
|
||||
}
|
||||
const parsedArgv = {args: this.args, options: this.options};
|
||||
if (run) {
|
||||
this.runMatchedCommand();
|
||||
}
|
||||
if (!this.matchedCommand && this.args[0]) {
|
||||
this.emit("command:*");
|
||||
}
|
||||
return parsedArgv;
|
||||
}
|
||||
mri(argv, command) {
|
||||
const cliOptions = [
|
||||
...this.globalCommand.options,
|
||||
...command ? command.options : []
|
||||
];
|
||||
const mriOptions = getMriOptions(cliOptions);
|
||||
let argsAfterDoubleDashes = [];
|
||||
const doubleDashesIndex = argv.indexOf("--");
|
||||
if (doubleDashesIndex > -1) {
|
||||
argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
|
||||
argv = argv.slice(0, doubleDashesIndex);
|
||||
}
|
||||
let parsed = mri2(argv, mriOptions);
|
||||
parsed = Object.keys(parsed).reduce((res, name) => {
|
||||
return __assign(__assign({}, res), {
|
||||
[camelcaseOptionName(name)]: parsed[name]
|
||||
});
|
||||
}, {_: []});
|
||||
const args = parsed._;
|
||||
const options = {
|
||||
"--": argsAfterDoubleDashes
|
||||
};
|
||||
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
|
||||
let transforms = Object.create(null);
|
||||
for (const cliOption of cliOptions) {
|
||||
if (!ignoreDefault && cliOption.config.default !== void 0) {
|
||||
for (const name of cliOption.names) {
|
||||
options[name] = cliOption.config.default;
|
||||
}
|
||||
}
|
||||
if (Array.isArray(cliOption.config.type)) {
|
||||
if (transforms[cliOption.name] === void 0) {
|
||||
transforms[cliOption.name] = Object.create(null);
|
||||
transforms[cliOption.name]["shouldTransform"] = true;
|
||||
transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const key of Object.keys(parsed)) {
|
||||
if (key !== "_") {
|
||||
const keys = key.split(".");
|
||||
setDotProp(options, keys, parsed[key]);
|
||||
setByType(options, transforms);
|
||||
}
|
||||
}
|
||||
return {
|
||||
args,
|
||||
options
|
||||
};
|
||||
}
|
||||
runMatchedCommand() {
|
||||
const {args, options, matchedCommand: command} = this;
|
||||
if (!command || !command.commandAction)
|
||||
return;
|
||||
command.checkUnknownOptions();
|
||||
command.checkOptionValue();
|
||||
command.checkRequiredArgs();
|
||||
const actionArgs = [];
|
||||
command.args.forEach((arg, index) => {
|
||||
if (arg.variadic) {
|
||||
actionArgs.push(args.slice(index));
|
||||
} else {
|
||||
actionArgs.push(args[index]);
|
||||
}
|
||||
});
|
||||
actionArgs.push(options);
|
||||
return command.commandAction.apply(this, actionArgs);
|
||||
}
|
||||
}
|
||||
|
||||
const cac = (name = "") => new CAC(name);
|
||||
|
||||
const cli = cac("vite");
|
||||
let profileSession = global.__vite_profile_session;
|
||||
let profileCount = 0;
|
||||
const stopProfiler = (log) => {
|
||||
if (!profileSession) return;
|
||||
return new Promise((res, rej) => {
|
||||
profileSession.post("Profiler.stop", (err, { profile }) => {
|
||||
if (!err) {
|
||||
const outPath = path.resolve(
|
||||
`./vite-profile-${profileCount++}.cpuprofile`
|
||||
);
|
||||
fs__default.writeFileSync(outPath, JSON.stringify(profile));
|
||||
log(
|
||||
colors.yellow(
|
||||
`CPU profile written to ${colors.white(colors.dim(outPath))}`
|
||||
)
|
||||
);
|
||||
profileSession = void 0;
|
||||
res();
|
||||
} else {
|
||||
rej(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const filterDuplicateOptions = (options) => {
|
||||
for (const [key, value] of Object.entries(options)) {
|
||||
if (Array.isArray(value)) {
|
||||
options[key] = value[value.length - 1];
|
||||
}
|
||||
}
|
||||
};
|
||||
function cleanGlobalCLIOptions(options) {
|
||||
const ret = { ...options };
|
||||
delete ret["--"];
|
||||
delete ret.c;
|
||||
delete ret.config;
|
||||
delete ret.base;
|
||||
delete ret.l;
|
||||
delete ret.logLevel;
|
||||
delete ret.clearScreen;
|
||||
delete ret.configLoader;
|
||||
delete ret.d;
|
||||
delete ret.debug;
|
||||
delete ret.f;
|
||||
delete ret.filter;
|
||||
delete ret.m;
|
||||
delete ret.mode;
|
||||
delete ret.w;
|
||||
if ("sourcemap" in ret) {
|
||||
const sourcemap = ret.sourcemap;
|
||||
ret.sourcemap = sourcemap === "true" ? true : sourcemap === "false" ? false : ret.sourcemap;
|
||||
}
|
||||
if ("watch" in ret) {
|
||||
const watch = ret.watch;
|
||||
ret.watch = watch ? {} : void 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
function cleanBuilderCLIOptions(options) {
|
||||
const ret = { ...options };
|
||||
delete ret.app;
|
||||
return ret;
|
||||
}
|
||||
const convertHost = (v) => {
|
||||
if (typeof v === "number") {
|
||||
return String(v);
|
||||
}
|
||||
return v;
|
||||
};
|
||||
const convertBase = (v) => {
|
||||
if (v === 0) {
|
||||
return "";
|
||||
}
|
||||
return v;
|
||||
};
|
||||
cli.option("-c, --config <file>", `[string] use specified config file`).option("--base <path>", `[string] public base path (default: /)`, {
|
||||
type: [convertBase]
|
||||
}).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option(
|
||||
"--configLoader <loader>",
|
||||
`[string] use 'bundle' to bundle the config with esbuild, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)`
|
||||
).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
||||
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--open [path]", `[boolean | string] open browser on startup`).option("--cors", `[boolean] enable CORS`).option("--strictPort", `[boolean] exit if specified port is already in use`).option(
|
||||
"--force",
|
||||
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
||||
).action(async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { createServer } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.S; });
|
||||
try {
|
||||
const server = await createServer({
|
||||
root,
|
||||
base: options.base,
|
||||
mode: options.mode,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
clearScreen: options.clearScreen,
|
||||
server: cleanGlobalCLIOptions(options),
|
||||
forceOptimizeDeps: options.force
|
||||
});
|
||||
if (!server.httpServer) {
|
||||
throw new Error("HTTP server not available");
|
||||
}
|
||||
await server.listen();
|
||||
const info = server.config.logger.info;
|
||||
const modeString = options.mode && options.mode !== "development" ? ` ${colors.bgGreen(` ${colors.bold(options.mode)} `)}` : "";
|
||||
const viteStartTime = global.__vite_start_time ?? false;
|
||||
const startupDurationString = viteStartTime ? colors.dim(
|
||||
`ready in ${colors.reset(
|
||||
colors.bold(Math.ceil(performance.now() - viteStartTime))
|
||||
)} ms`
|
||||
) : "";
|
||||
const hasExistingLogs = process.stdout.bytesWritten > 0 || process.stderr.bytesWritten > 0;
|
||||
info(
|
||||
`
|
||||
${colors.green(
|
||||
`${colors.bold("VITE")} v${VERSION}`
|
||||
)}${modeString} ${startupDurationString}
|
||||
`,
|
||||
{
|
||||
clear: !hasExistingLogs
|
||||
}
|
||||
);
|
||||
server.printUrls();
|
||||
const customShortcuts = [];
|
||||
if (profileSession) {
|
||||
customShortcuts.push({
|
||||
key: "p",
|
||||
description: "start/stop the profiler",
|
||||
async action(server2) {
|
||||
if (profileSession) {
|
||||
await stopProfiler(server2.config.logger.info);
|
||||
} else {
|
||||
const inspector = await import('node:inspector').then(
|
||||
(r) => r.default
|
||||
);
|
||||
await new Promise((res) => {
|
||||
profileSession = new inspector.Session();
|
||||
profileSession.connect();
|
||||
profileSession.post("Profiler.enable", () => {
|
||||
profileSession.post("Profiler.start", () => {
|
||||
server2.config.logger.info("Profiler started");
|
||||
res();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
server.bindCLIShortcuts({ print: true, customShortcuts });
|
||||
} catch (e) {
|
||||
const logger = createLogger(options.logLevel);
|
||||
logger.error(colors.red(`error when starting dev server:
|
||||
${e.stack}`), {
|
||||
error: e
|
||||
});
|
||||
stopProfiler(logger.info);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'modules')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option(
|
||||
"--assetsDir <dir>",
|
||||
`[string] directory under outDir to place assets in (default: assets)`
|
||||
).option(
|
||||
"--assetsInlineLimit <number>",
|
||||
`[number] static asset base64 inline threshold in bytes (default: 4096)`
|
||||
).option(
|
||||
"--ssr [entry]",
|
||||
`[string] build specified entry for server-side rendering`
|
||||
).option(
|
||||
"--sourcemap [output]",
|
||||
`[boolean | "inline" | "hidden"] output source maps for build (default: false)`
|
||||
).option(
|
||||
"--minify [minifier]",
|
||||
`[boolean | "terser" | "esbuild"] enable/disable minification, or specify minifier to use (default: esbuild)`
|
||||
).option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option(
|
||||
"--emptyOutDir",
|
||||
`[boolean] force empty outDir when it's outside of root`
|
||||
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
||||
async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { createBuilder } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.T; });
|
||||
const buildOptions = cleanGlobalCLIOptions(
|
||||
cleanBuilderCLIOptions(options)
|
||||
);
|
||||
try {
|
||||
const inlineConfig = {
|
||||
root,
|
||||
base: options.base,
|
||||
mode: options.mode,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
clearScreen: options.clearScreen,
|
||||
build: buildOptions,
|
||||
...options.app ? { builder: {} } : {}
|
||||
};
|
||||
const builder = await createBuilder(inlineConfig, null);
|
||||
await builder.buildApp();
|
||||
} catch (e) {
|
||||
createLogger(options.logLevel).error(
|
||||
colors.red(`error during build:
|
||||
${e.stack}`),
|
||||
{ error: e }
|
||||
);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
||||
}
|
||||
}
|
||||
);
|
||||
cli.command(
|
||||
"optimize [root]",
|
||||
"pre-bundle dependencies (deprecated, the pre-bundle process runs automatically and does not need to be called)"
|
||||
).option(
|
||||
"--force",
|
||||
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
||||
).action(
|
||||
async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { optimizeDeps } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.R; });
|
||||
try {
|
||||
const config = await resolveConfig(
|
||||
{
|
||||
root,
|
||||
base: options.base,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
mode: options.mode
|
||||
},
|
||||
"serve"
|
||||
);
|
||||
await optimizeDeps(config, options.force, true);
|
||||
} catch (e) {
|
||||
createLogger(options.logLevel).error(
|
||||
colors.red(`error when optimizing deps:
|
||||
${e.stack}`),
|
||||
{ error: e }
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
);
|
||||
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
|
||||
async (root, options) => {
|
||||
filterDuplicateOptions(options);
|
||||
const { preview } = await import('./chunks/dep-DBxKXgDP.js').then(function (n) { return n.U; });
|
||||
try {
|
||||
const server = await preview({
|
||||
root,
|
||||
base: options.base,
|
||||
configFile: options.config,
|
||||
configLoader: options.configLoader,
|
||||
logLevel: options.logLevel,
|
||||
mode: options.mode,
|
||||
build: {
|
||||
outDir: options.outDir
|
||||
},
|
||||
preview: {
|
||||
port: options.port,
|
||||
strictPort: options.strictPort,
|
||||
host: options.host,
|
||||
open: options.open
|
||||
}
|
||||
});
|
||||
server.printUrls();
|
||||
server.bindCLIShortcuts({ print: true });
|
||||
} catch (e) {
|
||||
createLogger(options.logLevel).error(
|
||||
colors.red(`error when starting preview server:
|
||||
${e.stack}`),
|
||||
{ error: e }
|
||||
);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
||||
}
|
||||
}
|
||||
);
|
||||
cli.help();
|
||||
cli.version(VERSION);
|
||||
cli.parse();
|
||||
|
||||
export { stopProfiler };
|
||||
149
app/node_modules/vite/dist/node/constants.js
generated
vendored
Normal file
149
app/node_modules/vite/dist/node/constants.js
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
import path, { resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
const { version } = JSON.parse(
|
||||
readFileSync(new URL("../../package.json", import.meta.url)).toString()
|
||||
);
|
||||
const ROLLUP_HOOKS = [
|
||||
"options",
|
||||
"buildStart",
|
||||
"buildEnd",
|
||||
"renderStart",
|
||||
"renderError",
|
||||
"renderChunk",
|
||||
"writeBundle",
|
||||
"generateBundle",
|
||||
"banner",
|
||||
"footer",
|
||||
"augmentChunkHash",
|
||||
"outputOptions",
|
||||
"renderDynamicImport",
|
||||
"resolveFileUrl",
|
||||
"resolveImportMeta",
|
||||
"intro",
|
||||
"outro",
|
||||
"closeBundle",
|
||||
"closeWatcher",
|
||||
"load",
|
||||
"moduleParsed",
|
||||
"watchChange",
|
||||
"resolveDynamicImport",
|
||||
"resolveId",
|
||||
"shouldTransformCachedModule",
|
||||
"transform",
|
||||
"onLog"
|
||||
];
|
||||
const VERSION = version;
|
||||
const DEFAULT_MAIN_FIELDS = [
|
||||
"browser",
|
||||
"module",
|
||||
"jsnext:main",
|
||||
// moment still uses this...
|
||||
"jsnext"
|
||||
];
|
||||
const DEFAULT_CLIENT_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS);
|
||||
const DEFAULT_SERVER_MAIN_FIELDS = Object.freeze(
|
||||
DEFAULT_MAIN_FIELDS.filter((f) => f !== "browser")
|
||||
);
|
||||
const DEV_PROD_CONDITION = `development|production`;
|
||||
const DEFAULT_CONDITIONS = ["module", "browser", "node", DEV_PROD_CONDITION];
|
||||
const DEFAULT_CLIENT_CONDITIONS = Object.freeze(
|
||||
DEFAULT_CONDITIONS.filter((c) => c !== "node")
|
||||
);
|
||||
const DEFAULT_SERVER_CONDITIONS = Object.freeze(
|
||||
DEFAULT_CONDITIONS.filter((c) => c !== "browser")
|
||||
);
|
||||
const ESBUILD_MODULES_TARGET = [
|
||||
"es2020",
|
||||
"edge88",
|
||||
"firefox78",
|
||||
"chrome87",
|
||||
"safari14"
|
||||
];
|
||||
const DEFAULT_CONFIG_FILES = [
|
||||
"vite.config.js",
|
||||
"vite.config.mjs",
|
||||
"vite.config.ts",
|
||||
"vite.config.cjs",
|
||||
"vite.config.mts",
|
||||
"vite.config.cts"
|
||||
];
|
||||
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
|
||||
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
|
||||
const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
|
||||
const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
|
||||
const FS_PREFIX = `/@fs/`;
|
||||
const CLIENT_PUBLIC_PATH = `/@vite/client`;
|
||||
const ENV_PUBLIC_PATH = `/@vite/env`;
|
||||
const VITE_PACKAGE_DIR = resolve(
|
||||
// import.meta.url is `dist/node/constants.js` after bundle
|
||||
fileURLToPath(import.meta.url),
|
||||
"../../.."
|
||||
);
|
||||
const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs");
|
||||
const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs");
|
||||
const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
|
||||
const KNOWN_ASSET_TYPES = [
|
||||
// images
|
||||
"apng",
|
||||
"bmp",
|
||||
"png",
|
||||
"jpe?g",
|
||||
"jfif",
|
||||
"pjpeg",
|
||||
"pjp",
|
||||
"gif",
|
||||
"svg",
|
||||
"ico",
|
||||
"webp",
|
||||
"avif",
|
||||
"cur",
|
||||
"jxl",
|
||||
// media
|
||||
"mp4",
|
||||
"webm",
|
||||
"ogg",
|
||||
"mp3",
|
||||
"wav",
|
||||
"flac",
|
||||
"aac",
|
||||
"opus",
|
||||
"mov",
|
||||
"m4a",
|
||||
"vtt",
|
||||
// fonts
|
||||
"woff2?",
|
||||
"eot",
|
||||
"ttf",
|
||||
"otf",
|
||||
// other
|
||||
"webmanifest",
|
||||
"pdf",
|
||||
"txt"
|
||||
];
|
||||
const DEFAULT_ASSETS_RE = new RegExp(
|
||||
`\\.(` + KNOWN_ASSET_TYPES.join("|") + `)(\\?.*)?$`,
|
||||
"i"
|
||||
);
|
||||
const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
|
||||
const loopbackHosts = /* @__PURE__ */ new Set([
|
||||
"localhost",
|
||||
"127.0.0.1",
|
||||
"::1",
|
||||
"0000:0000:0000:0000:0000:0000:0000:0001"
|
||||
]);
|
||||
const wildcardHosts = /* @__PURE__ */ new Set([
|
||||
"0.0.0.0",
|
||||
"::",
|
||||
"0000:0000:0000:0000:0000:0000:0000:0000"
|
||||
]);
|
||||
const DEFAULT_DEV_PORT = 5173;
|
||||
const DEFAULT_PREVIEW_PORT = 4173;
|
||||
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
|
||||
const defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/;
|
||||
const METADATA_FILENAME = "_metadata.json";
|
||||
const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = "ERR_OPTIMIZE_DEPS_PROCESSING_ERROR";
|
||||
const ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR = "ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR";
|
||||
|
||||
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, DEP_VERSION_RE, DEV_PROD_CONDITION, ENV_ENTRY, ENV_PUBLIC_PATH, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, ROLLUP_HOOKS, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, defaultAllowedOrigins, loopbackHosts, wildcardHosts };
|
||||
4222
app/node_modules/vite/dist/node/index.d.ts
generated
vendored
Normal file
4222
app/node_modules/vite/dist/node/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
194
app/node_modules/vite/dist/node/index.js
generated
vendored
Normal file
194
app/node_modules/vite/dist/node/index.js
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
||||
import { a as arraify, i as isInNodeModules, D as DevEnvironment } from './chunks/dep-DBxKXgDP.js';
|
||||
export { B as BuildEnvironment, f as build, m as buildErrorMessage, g as createBuilder, F as createFilter, h as createIdResolver, I as createLogger, n as createRunnableDevEnvironment, c as createServer, y as createServerHotChannel, w as createServerModuleRunner, x as createServerModuleRunnerTransport, d as defineConfig, v as fetchModule, j as formatPostcssSourceMap, L as isFileLoadingAllowed, K as isFileServingAllowed, q as isRunnableDevEnvironment, l as loadConfigFromFile, M as loadEnv, E as mergeAlias, C as mergeConfig, z as moduleRunnerTransform, A as normalizePath, o as optimizeDeps, p as perEnvironmentPlugin, b as perEnvironmentState, k as preprocessCSS, e as preview, r as resolveConfig, N as resolveEnvPrefix, G as rollupVersion, u as runnerImport, J as searchForWorkspaceRoot, H as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-DBxKXgDP.js';
|
||||
export { defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, VERSION as version } from './constants.js';
|
||||
export { version as esbuildVersion } from 'esbuild';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:fs/promises';
|
||||
import 'node:url';
|
||||
import 'node:util';
|
||||
import 'node:perf_hooks';
|
||||
import 'node:module';
|
||||
import 'node:crypto';
|
||||
import 'picomatch';
|
||||
import 'path';
|
||||
import 'fs';
|
||||
import 'fdir';
|
||||
import 'node:child_process';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'tty';
|
||||
import 'util';
|
||||
import 'net';
|
||||
import 'events';
|
||||
import 'url';
|
||||
import 'http';
|
||||
import 'stream';
|
||||
import 'os';
|
||||
import 'child_process';
|
||||
import 'node:os';
|
||||
import 'node:net';
|
||||
import 'node:dns';
|
||||
import 'vite/module-runner';
|
||||
import 'node:buffer';
|
||||
import 'module';
|
||||
import 'node:readline';
|
||||
import 'node:process';
|
||||
import 'node:events';
|
||||
import 'tinyglobby';
|
||||
import 'crypto';
|
||||
import 'node:assert';
|
||||
import 'node:v8';
|
||||
import 'node:worker_threads';
|
||||
import 'https';
|
||||
import 'tls';
|
||||
import 'zlib';
|
||||
import 'buffer';
|
||||
import 'assert';
|
||||
import 'node:querystring';
|
||||
import 'node:zlib';
|
||||
|
||||
const CSS_LANGS_RE = (
|
||||
// eslint-disable-next-line regexp/no-unused-capturing-group
|
||||
/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/
|
||||
);
|
||||
const isCSSRequest = (request) => CSS_LANGS_RE.test(request);
|
||||
class SplitVendorChunkCache {
|
||||
cache;
|
||||
constructor() {
|
||||
this.cache = /* @__PURE__ */ new Map();
|
||||
}
|
||||
reset() {
|
||||
this.cache = /* @__PURE__ */ new Map();
|
||||
}
|
||||
}
|
||||
function splitVendorChunk(options = {}) {
|
||||
const cache = options.cache ?? new SplitVendorChunkCache();
|
||||
return (id, { getModuleInfo }) => {
|
||||
if (isInNodeModules(id) && !isCSSRequest(id) && staticImportedByEntry(id, getModuleInfo, cache.cache)) {
|
||||
return "vendor";
|
||||
}
|
||||
};
|
||||
}
|
||||
function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) {
|
||||
if (cache.has(id)) {
|
||||
return cache.get(id);
|
||||
}
|
||||
if (importStack.includes(id)) {
|
||||
cache.set(id, false);
|
||||
return false;
|
||||
}
|
||||
const mod = getModuleInfo(id);
|
||||
if (!mod) {
|
||||
cache.set(id, false);
|
||||
return false;
|
||||
}
|
||||
if (mod.isEntry) {
|
||||
cache.set(id, true);
|
||||
return true;
|
||||
}
|
||||
const someImporterIs = mod.importers.some(
|
||||
(importer) => staticImportedByEntry(
|
||||
importer,
|
||||
getModuleInfo,
|
||||
cache,
|
||||
importStack.concat(id)
|
||||
)
|
||||
);
|
||||
cache.set(id, someImporterIs);
|
||||
return someImporterIs;
|
||||
}
|
||||
function splitVendorChunkPlugin() {
|
||||
const caches = [];
|
||||
function createSplitVendorChunk(output, config) {
|
||||
const cache = new SplitVendorChunkCache();
|
||||
caches.push(cache);
|
||||
const build = config.build ?? {};
|
||||
const format = output.format;
|
||||
if (!build.ssr && !build.lib && format !== "umd" && format !== "iife") {
|
||||
return splitVendorChunk({ cache });
|
||||
}
|
||||
}
|
||||
return {
|
||||
name: "vite:split-vendor-chunk",
|
||||
config(config) {
|
||||
let outputs = config.build?.rollupOptions?.output;
|
||||
if (outputs) {
|
||||
outputs = arraify(outputs);
|
||||
for (const output of outputs) {
|
||||
const viteManualChunks = createSplitVendorChunk(output, config);
|
||||
if (viteManualChunks) {
|
||||
if (output.manualChunks) {
|
||||
if (typeof output.manualChunks === "function") {
|
||||
const userManualChunks = output.manualChunks;
|
||||
output.manualChunks = (id, api) => {
|
||||
return userManualChunks(id, api) ?? viteManualChunks(id, api);
|
||||
};
|
||||
} else {
|
||||
console.warn(
|
||||
"(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead."
|
||||
);
|
||||
}
|
||||
} else {
|
||||
output.manualChunks = viteManualChunks;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: createSplitVendorChunk({}, config)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
buildStart() {
|
||||
caches.forEach((cache) => cache.reset());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function createFetchableDevEnvironment(name, config, context) {
|
||||
if (typeof Request === "undefined" || typeof Response === "undefined") {
|
||||
throw new TypeError(
|
||||
"FetchableDevEnvironment requires a global `Request` and `Response` object."
|
||||
);
|
||||
}
|
||||
if (!context.handleRequest) {
|
||||
throw new TypeError(
|
||||
"FetchableDevEnvironment requires a `handleRequest` method during initialisation."
|
||||
);
|
||||
}
|
||||
return new FetchableDevEnvironment(name, config, context);
|
||||
}
|
||||
function isFetchableDevEnvironment(environment) {
|
||||
return environment instanceof FetchableDevEnvironment;
|
||||
}
|
||||
class FetchableDevEnvironment extends DevEnvironment {
|
||||
_handleRequest;
|
||||
constructor(name, config, context) {
|
||||
super(name, config, context);
|
||||
this._handleRequest = context.handleRequest;
|
||||
}
|
||||
async dispatchFetch(request) {
|
||||
if (!(request instanceof Request)) {
|
||||
throw new TypeError(
|
||||
"FetchableDevEnvironment `dispatchFetch` must receive a `Request` object."
|
||||
);
|
||||
}
|
||||
const response = await this._handleRequest(request);
|
||||
if (!(response instanceof Response)) {
|
||||
throw new TypeError(
|
||||
"FetchableDevEnvironment `context.handleRequest` must return a `Response` object."
|
||||
);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
export { DevEnvironment, createFetchableDevEnvironment, isCSSRequest, isFetchableDevEnvironment, splitVendorChunk, splitVendorChunkPlugin };
|
||||
290
app/node_modules/vite/dist/node/module-runner.d.ts
generated
vendored
Normal file
290
app/node_modules/vite/dist/node/module-runner.d.ts
generated
vendored
Normal file
@@ -0,0 +1,290 @@
|
||||
import { ModuleNamespace, ViteHotContext } from '../../types/hot.js';
|
||||
import { Update, HotPayload } from '../../types/hmrPayload.js';
|
||||
import { InferCustomEventPayload } from '../../types/customEvent.js';
|
||||
import { N as NormalizedModuleRunnerTransport, E as ExternalFetchResult, V as ViteFetchResult, M as ModuleRunnerTransport, F as FetchFunctionOptions, a as FetchResult } from './moduleRunnerTransport.d-DJ_mE5sf.js';
|
||||
export { b as ModuleRunnerTransportHandlers, c as createWebSocketModuleRunnerTransport } from './moduleRunnerTransport.d-DJ_mE5sf.js';
|
||||
|
||||
interface SourceMapLike {
|
||||
version: number;
|
||||
mappings?: string;
|
||||
names?: string[];
|
||||
sources?: string[];
|
||||
sourcesContent?: string[];
|
||||
}
|
||||
declare class DecodedMap {
|
||||
map: SourceMapLike;
|
||||
_encoded: string;
|
||||
_decoded: undefined | number[][][];
|
||||
_decodedMemo: Stats;
|
||||
url: string;
|
||||
version: number;
|
||||
names: string[];
|
||||
resolvedSources: string[];
|
||||
constructor(map: SourceMapLike, from: string);
|
||||
}
|
||||
interface Stats {
|
||||
lastKey: number;
|
||||
lastNeedle: number;
|
||||
lastIndex: number;
|
||||
}
|
||||
|
||||
type CustomListenersMap = Map<string, ((data: any) => void)[]>;
|
||||
interface HotModule {
|
||||
id: string;
|
||||
callbacks: HotCallback[];
|
||||
}
|
||||
interface HotCallback {
|
||||
deps: string[];
|
||||
fn: (modules: Array<ModuleNamespace | undefined>) => void;
|
||||
}
|
||||
interface HMRLogger {
|
||||
error(msg: string | Error): void;
|
||||
debug(...msg: unknown[]): void;
|
||||
}
|
||||
declare class HMRClient {
|
||||
logger: HMRLogger;
|
||||
private transport;
|
||||
private importUpdatedModule;
|
||||
hotModulesMap: Map<string, HotModule>;
|
||||
disposeMap: Map<string, (data: any) => void | Promise<void>>;
|
||||
pruneMap: Map<string, (data: any) => void | Promise<void>>;
|
||||
dataMap: Map<string, any>;
|
||||
customListenersMap: CustomListenersMap;
|
||||
ctxToListenersMap: Map<string, CustomListenersMap>;
|
||||
currentFirstInvalidatedBy: string | undefined;
|
||||
constructor(logger: HMRLogger, transport: NormalizedModuleRunnerTransport, importUpdatedModule: (update: Update) => Promise<ModuleNamespace>);
|
||||
notifyListeners<T extends string>(event: T, data: InferCustomEventPayload<T>): Promise<void>;
|
||||
send(payload: HotPayload): void;
|
||||
clear(): void;
|
||||
prunePaths(paths: string[]): Promise<void>;
|
||||
protected warnFailedUpdate(err: Error, path: string | string[]): void;
|
||||
private updateQueue;
|
||||
private pendingUpdateQueue;
|
||||
/**
|
||||
* buffer multiple hot updates triggered by the same src change
|
||||
* so that they are invoked in the same order they were sent.
|
||||
* (otherwise the order may be inconsistent because of the http request round trip)
|
||||
*/
|
||||
queueUpdate(payload: Update): Promise<void>;
|
||||
private fetchUpdate;
|
||||
}
|
||||
|
||||
interface DefineImportMetadata {
|
||||
/**
|
||||
* Imported names before being transformed to `ssrImportKey`
|
||||
*
|
||||
* import foo, { bar as baz, qux } from 'hello'
|
||||
* => ['default', 'bar', 'qux']
|
||||
*
|
||||
* import * as namespace from 'world
|
||||
* => undefined
|
||||
*/
|
||||
importedNames?: string[];
|
||||
}
|
||||
interface SSRImportMetadata extends DefineImportMetadata {
|
||||
isDynamicImport?: boolean;
|
||||
}
|
||||
|
||||
declare const ssrModuleExportsKey = "__vite_ssr_exports__";
|
||||
declare const ssrImportKey = "__vite_ssr_import__";
|
||||
declare const ssrDynamicImportKey = "__vite_ssr_dynamic_import__";
|
||||
declare const ssrExportAllKey = "__vite_ssr_exportAll__";
|
||||
declare const ssrImportMetaKey = "__vite_ssr_import_meta__";
|
||||
|
||||
interface ModuleRunnerDebugger {
|
||||
(formatter: unknown, ...args: unknown[]): void;
|
||||
}
|
||||
declare class ModuleRunner {
|
||||
options: ModuleRunnerOptions;
|
||||
evaluator: ModuleEvaluator;
|
||||
private debug?;
|
||||
evaluatedModules: EvaluatedModules;
|
||||
hmrClient?: HMRClient;
|
||||
private readonly envProxy;
|
||||
private readonly transport;
|
||||
private readonly resetSourceMapSupport?;
|
||||
private readonly concurrentModuleNodePromises;
|
||||
private closed;
|
||||
constructor(options: ModuleRunnerOptions, evaluator?: ModuleEvaluator, debug?: ModuleRunnerDebugger | undefined);
|
||||
/**
|
||||
* URL to execute. Accepts file path, server path or id relative to the root.
|
||||
*/
|
||||
import<T = any>(url: string): Promise<T>;
|
||||
/**
|
||||
* Clear all caches including HMR listeners.
|
||||
*/
|
||||
clearCache(): void;
|
||||
/**
|
||||
* Clears all caches, removes all HMR listeners, and resets source map support.
|
||||
* This method doesn't stop the HMR connection.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
/**
|
||||
* Returns `true` if the runtime has been closed by calling `close()` method.
|
||||
*/
|
||||
isClosed(): boolean;
|
||||
private processImport;
|
||||
private isCircularModule;
|
||||
private isCircularImport;
|
||||
private cachedRequest;
|
||||
private cachedModule;
|
||||
private getModuleInformation;
|
||||
protected directRequest(url: string, mod: EvaluatedModuleNode, _callstack: string[]): Promise<any>;
|
||||
}
|
||||
|
||||
interface RetrieveFileHandler {
|
||||
(path: string): string | null | undefined | false;
|
||||
}
|
||||
interface RetrieveSourceMapHandler {
|
||||
(path: string): null | {
|
||||
url: string;
|
||||
map: any;
|
||||
};
|
||||
}
|
||||
interface InterceptorOptions {
|
||||
retrieveFile?: RetrieveFileHandler;
|
||||
retrieveSourceMap?: RetrieveSourceMapHandler;
|
||||
}
|
||||
|
||||
interface ModuleRunnerImportMeta extends ImportMeta {
|
||||
url: string;
|
||||
env: ImportMetaEnv;
|
||||
hot?: ViteHotContext;
|
||||
[key: string]: any;
|
||||
}
|
||||
interface ModuleRunnerContext {
|
||||
[ssrModuleExportsKey]: Record<string, any>;
|
||||
[ssrImportKey]: (id: string, metadata?: DefineImportMetadata) => Promise<any>;
|
||||
[ssrDynamicImportKey]: (id: string, options?: ImportCallOptions) => Promise<any>;
|
||||
[ssrExportAllKey]: (obj: any) => void;
|
||||
[ssrImportMetaKey]: ModuleRunnerImportMeta;
|
||||
}
|
||||
interface ModuleEvaluator {
|
||||
/**
|
||||
* Number of prefixed lines in the transformed code.
|
||||
*/
|
||||
startOffset?: number;
|
||||
/**
|
||||
* Run code that was transformed by Vite.
|
||||
* @param context Function context
|
||||
* @param code Transformed code
|
||||
* @param module The module node
|
||||
*/
|
||||
runInlinedModule(context: ModuleRunnerContext, code: string, module: Readonly<EvaluatedModuleNode>): Promise<any>;
|
||||
/**
|
||||
* Run externalized module.
|
||||
* @param file File URL to the external module
|
||||
*/
|
||||
runExternalModule(file: string): Promise<any>;
|
||||
}
|
||||
type ResolvedResult = (ExternalFetchResult | ViteFetchResult) & {
|
||||
url: string;
|
||||
id: string;
|
||||
};
|
||||
type FetchFunction = (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
|
||||
interface ModuleRunnerHmr {
|
||||
/**
|
||||
* Configure HMR logger.
|
||||
*/
|
||||
logger?: false | HMRLogger;
|
||||
}
|
||||
interface ModuleRunnerOptions {
|
||||
/**
|
||||
* Root of the project
|
||||
* @deprecated not used and to be removed
|
||||
*/
|
||||
root?: string;
|
||||
/**
|
||||
* A set of methods to communicate with the server.
|
||||
*/
|
||||
transport: ModuleRunnerTransport;
|
||||
/**
|
||||
* Configure how source maps are resolved. Prefers `node` if `process.setSourceMapsEnabled` is available.
|
||||
* Otherwise it will use `prepareStackTrace` by default which overrides `Error.prepareStackTrace` method.
|
||||
* You can provide an object to configure how file contents and source maps are resolved for files that were not processed by Vite.
|
||||
*/
|
||||
sourcemapInterceptor?: false | 'node' | 'prepareStackTrace' | InterceptorOptions;
|
||||
/**
|
||||
* Disable HMR or configure HMR options.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
hmr?: boolean | ModuleRunnerHmr;
|
||||
/**
|
||||
* Custom module cache. If not provided, creates a separate module cache for each ModuleRunner instance.
|
||||
*/
|
||||
evaluatedModules?: EvaluatedModules;
|
||||
}
|
||||
interface ImportMetaEnv {
|
||||
[key: string]: any;
|
||||
BASE_URL: string;
|
||||
MODE: string;
|
||||
DEV: boolean;
|
||||
PROD: boolean;
|
||||
SSR: boolean;
|
||||
}
|
||||
|
||||
declare class EvaluatedModuleNode {
|
||||
id: string;
|
||||
url: string;
|
||||
importers: Set<string>;
|
||||
imports: Set<string>;
|
||||
evaluated: boolean;
|
||||
meta: ResolvedResult | undefined;
|
||||
promise: Promise<any> | undefined;
|
||||
exports: any | undefined;
|
||||
file: string;
|
||||
map: DecodedMap | undefined;
|
||||
constructor(id: string, url: string);
|
||||
}
|
||||
declare class EvaluatedModules {
|
||||
readonly idToModuleMap: Map<string, EvaluatedModuleNode>;
|
||||
readonly fileToModulesMap: Map<string, Set<EvaluatedModuleNode>>;
|
||||
readonly urlToIdModuleMap: Map<string, EvaluatedModuleNode>;
|
||||
/**
|
||||
* Returns the module node by the resolved module ID. Usually, module ID is
|
||||
* the file system path with query and/or hash. It can also be a virtual module.
|
||||
*
|
||||
* Module runner graph will have 1 to 1 mapping with the server module graph.
|
||||
* @param id Resolved module ID
|
||||
*/
|
||||
getModuleById(id: string): EvaluatedModuleNode | undefined;
|
||||
/**
|
||||
* Returns all modules related to the file system path. Different modules
|
||||
* might have different query parameters or hash, so it's possible to have
|
||||
* multiple modules for the same file.
|
||||
* @param file The file system path of the module
|
||||
*/
|
||||
getModulesByFile(file: string): Set<EvaluatedModuleNode> | undefined;
|
||||
/**
|
||||
* Returns the module node by the URL that was used in the import statement.
|
||||
* Unlike module graph on the server, the URL is not resolved and is used as is.
|
||||
* @param url Server URL that was used in the import statement
|
||||
*/
|
||||
getModuleByUrl(url: string): EvaluatedModuleNode | undefined;
|
||||
/**
|
||||
* Ensure that module is in the graph. If the module is already in the graph,
|
||||
* it will return the existing module node. Otherwise, it will create a new
|
||||
* module node and add it to the graph.
|
||||
* @param id Resolved module ID
|
||||
* @param url URL that was used in the import statement
|
||||
*/
|
||||
ensureModule(id: string, url: string): EvaluatedModuleNode;
|
||||
invalidateModule(node: EvaluatedModuleNode): void;
|
||||
/**
|
||||
* Extracts the inlined source map from the module code and returns the decoded
|
||||
* source map. If the source map is not inlined, it will return null.
|
||||
* @param id Resolved module ID
|
||||
*/
|
||||
getModuleSourceMapById(id: string): DecodedMap | null;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
declare class ESModulesEvaluator implements ModuleEvaluator {
|
||||
readonly startOffset: number;
|
||||
runInlinedModule(context: ModuleRunnerContext, code: string): Promise<any>;
|
||||
runExternalModule(filepath: string): Promise<any>;
|
||||
}
|
||||
|
||||
export { ESModulesEvaluator, EvaluatedModuleNode, EvaluatedModules, FetchFunctionOptions, FetchResult, ModuleRunner, ModuleRunnerTransport, ssrDynamicImportKey, ssrExportAllKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };
|
||||
export type { FetchFunction, HMRLogger, InterceptorOptions, ModuleEvaluator, ModuleRunnerContext, ModuleRunnerHmr, ModuleRunnerImportMeta, ModuleRunnerOptions, ResolvedResult, SSRImportMetadata };
|
||||
1311
app/node_modules/vite/dist/node/module-runner.js
generated
vendored
Normal file
1311
app/node_modules/vite/dist/node/module-runner.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
87
app/node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts
generated
vendored
Normal file
87
app/node_modules/vite/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
import { HotPayload } from '../../types/hmrPayload.js';
|
||||
|
||||
interface FetchFunctionOptions {
|
||||
cached?: boolean;
|
||||
startOffset?: number;
|
||||
}
|
||||
type FetchResult = CachedFetchResult | ExternalFetchResult | ViteFetchResult;
|
||||
interface CachedFetchResult {
|
||||
/**
|
||||
* If module cached in the runner, we can just confirm
|
||||
* it wasn't invalidated on the server side.
|
||||
*/
|
||||
cache: true;
|
||||
}
|
||||
interface ExternalFetchResult {
|
||||
/**
|
||||
* The path to the externalized module starting with file://,
|
||||
* by default this will be imported via a dynamic "import"
|
||||
* instead of being transformed by vite and loaded with vite runner
|
||||
*/
|
||||
externalize: string;
|
||||
/**
|
||||
* Type of the module. Will be used to determine if import statement is correct.
|
||||
* For example, if Vite needs to throw an error if variable is not actually exported
|
||||
*/
|
||||
type: 'module' | 'commonjs' | 'builtin' | 'network';
|
||||
}
|
||||
interface ViteFetchResult {
|
||||
/**
|
||||
* Code that will be evaluated by vite runner
|
||||
* by default this will be wrapped in an async function
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* File path of the module on disk.
|
||||
* This will be resolved as import.meta.url/filename
|
||||
* Will be equal to `null` for virtual modules
|
||||
*/
|
||||
file: string | null;
|
||||
/**
|
||||
* Module ID in the server module graph.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Module URL used in the import.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Invalidate module on the client side.
|
||||
*/
|
||||
invalidate: boolean;
|
||||
}
|
||||
type InvokeMethods = {
|
||||
fetchModule: (id: string, importer?: string, options?: FetchFunctionOptions) => Promise<FetchResult>;
|
||||
};
|
||||
|
||||
type ModuleRunnerTransportHandlers = {
|
||||
onMessage: (data: HotPayload) => void;
|
||||
onDisconnection: () => void;
|
||||
};
|
||||
/**
|
||||
* "send and connect" or "invoke" must be implemented
|
||||
*/
|
||||
interface ModuleRunnerTransport {
|
||||
connect?(handlers: ModuleRunnerTransportHandlers): Promise<void> | void;
|
||||
disconnect?(): Promise<void> | void;
|
||||
send?(data: HotPayload): Promise<void> | void;
|
||||
invoke?(data: HotPayload): Promise<{
|
||||
result: any;
|
||||
} | {
|
||||
error: any;
|
||||
}>;
|
||||
timeout?: number;
|
||||
}
|
||||
interface NormalizedModuleRunnerTransport {
|
||||
connect?(onMessage?: (data: HotPayload) => void): Promise<void> | void;
|
||||
disconnect?(): Promise<void> | void;
|
||||
send(data: HotPayload): Promise<void>;
|
||||
invoke<T extends keyof InvokeMethods>(name: T, data: Parameters<InvokeMethods[T]>): Promise<ReturnType<Awaited<InvokeMethods[T]>>>;
|
||||
}
|
||||
declare const createWebSocketModuleRunnerTransport: (options: {
|
||||
createConnection: () => WebSocket;
|
||||
pingInterval?: number;
|
||||
}) => Required<Pick<ModuleRunnerTransport, "connect" | "disconnect" | "send">>;
|
||||
|
||||
export { createWebSocketModuleRunnerTransport as c };
|
||||
export type { ExternalFetchResult as E, FetchFunctionOptions as F, ModuleRunnerTransport as M, NormalizedModuleRunnerTransport as N, ViteFetchResult as V, FetchResult as a, ModuleRunnerTransportHandlers as b };
|
||||
96
app/node_modules/vite/index.cjs
generated
vendored
Normal file
96
app/node_modules/vite/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
const description =
|
||||
' See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.'
|
||||
|
||||
warnCjsUsage()
|
||||
|
||||
// type utils
|
||||
module.exports.defineConfig = (config) => config
|
||||
|
||||
// proxy cjs utils (sync functions)
|
||||
Object.assign(module.exports, require('./dist/node-cjs/publicUtils.cjs'))
|
||||
|
||||
// async functions, can be redirect from ESM build
|
||||
const asyncFunctions = [
|
||||
'build',
|
||||
'createServer',
|
||||
'preview',
|
||||
'transformWithEsbuild',
|
||||
'resolveConfig',
|
||||
'optimizeDeps',
|
||||
'formatPostcssSourceMap',
|
||||
'loadConfigFromFile',
|
||||
'preprocessCSS',
|
||||
'createBuilder',
|
||||
'runnerImport',
|
||||
]
|
||||
asyncFunctions.forEach((name) => {
|
||||
module.exports[name] = (...args) =>
|
||||
import('./dist/node/index.js').then((i) => i[name](...args))
|
||||
})
|
||||
|
||||
// variables and sync functions that cannot be used from cjs build
|
||||
const disallowedVariables = [
|
||||
// was not exposed in cjs from the beginning
|
||||
'parseAst',
|
||||
'parseAstAsync',
|
||||
'buildErrorMessage',
|
||||
'sortUserPlugins',
|
||||
// Environment API related variables that are too big to include in the cjs build
|
||||
'DevEnvironment',
|
||||
'BuildEnvironment',
|
||||
'createIdResolver',
|
||||
'createRunnableDevEnvironment',
|
||||
// can be redirected from ESM, but doesn't make sense as it's Environment API related
|
||||
'fetchModule',
|
||||
'moduleRunnerTransform',
|
||||
// can be exposed, but doesn't make sense as it's Environment API related
|
||||
'createServerHotChannel',
|
||||
'createServerModuleRunner',
|
||||
'createServerModuleRunnerTransport',
|
||||
'isRunnableDevEnvironment',
|
||||
'createFetchableDevEnvironment',
|
||||
'isFetchableDevEnvironment',
|
||||
]
|
||||
disallowedVariables.forEach((name) => {
|
||||
Object.defineProperty(module.exports, name, {
|
||||
get() {
|
||||
throw new Error(
|
||||
`${name} is not available in the CJS build of Vite.` + description,
|
||||
)
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
function warnCjsUsage() {
|
||||
if (process.env.VITE_CJS_IGNORE_WARNING) return
|
||||
const logLevelIndex = process.argv.findIndex((arg) =>
|
||||
/^(?:-l|--logLevel)/.test(arg),
|
||||
)
|
||||
if (logLevelIndex > 0) {
|
||||
const logLevelValue = process.argv[logLevelIndex + 1]
|
||||
if (logLevelValue === 'silent' || logLevelValue === 'error') {
|
||||
return
|
||||
}
|
||||
if (/silent|error/.test(process.argv[logLevelIndex])) {
|
||||
return
|
||||
}
|
||||
}
|
||||
const yellow = (str) => `\u001b[33m${str}\u001b[39m`
|
||||
console.warn(
|
||||
yellow("The CJS build of Vite's Node API is deprecated." + description),
|
||||
)
|
||||
if (process.env.VITE_CJS_TRACE) {
|
||||
const e = {}
|
||||
const stackTraceLimit = Error.stackTraceLimit
|
||||
Error.stackTraceLimit = 100
|
||||
Error.captureStackTrace(e)
|
||||
Error.stackTraceLimit = stackTraceLimit
|
||||
console.log(
|
||||
e.stack
|
||||
.split('\n')
|
||||
.slice(1)
|
||||
.filter((line) => !line.includes('(node:'))
|
||||
.join('\n'),
|
||||
)
|
||||
}
|
||||
}
|
||||
6
app/node_modules/vite/index.d.cts
generated
vendored
Normal file
6
app/node_modules/vite/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* @deprecated The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
|
||||
*/
|
||||
declare const module: any
|
||||
|
||||
export = module
|
||||
1
app/node_modules/vite/misc/false.js
generated
vendored
Normal file
1
app/node_modules/vite/misc/false.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default false
|
||||
1
app/node_modules/vite/misc/true.js
generated
vendored
Normal file
1
app/node_modules/vite/misc/true.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default true
|
||||
204
app/node_modules/vite/package.json
generated
vendored
Normal file
204
app/node_modules/vite/package.json
generated
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
{
|
||||
"name": "vite",
|
||||
"version": "6.3.5",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
"description": "Native-ESM powered web dev build tool",
|
||||
"bin": {
|
||||
"vite": "bin/vite.js"
|
||||
},
|
||||
"keywords": [
|
||||
"frontend",
|
||||
"framework",
|
||||
"hmr",
|
||||
"dev-server",
|
||||
"build-tool",
|
||||
"vite"
|
||||
],
|
||||
"main": "./dist/node/index.js",
|
||||
"types": "./dist/node/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"module-sync": "./dist/node/index.js",
|
||||
"import": "./dist/node/index.js",
|
||||
"require": "./index.cjs"
|
||||
},
|
||||
"./client": {
|
||||
"types": "./client.d.ts"
|
||||
},
|
||||
"./module-runner": "./dist/node/module-runner.js",
|
||||
"./dist/client/*": "./dist/client/*",
|
||||
"./types/*": {
|
||||
"types": "./types/*"
|
||||
},
|
||||
"./types/internal/*": null,
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"module-runner": [
|
||||
"dist/node/module-runner.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"imports": {
|
||||
"#module-sync-enabled": {
|
||||
"module-sync": "./misc/true.js",
|
||||
"default": "./misc/false.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"dist",
|
||||
"misc/**/*.js",
|
||||
"client.d.ts",
|
||||
"index.cjs",
|
||||
"index.d.cts",
|
||||
"types"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^18.0.0 || ^20.0.0 || >=22.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vitejs/vite.git",
|
||||
"directory": "packages/vite"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/vitejs/vite/issues"
|
||||
},
|
||||
"homepage": "https://vite.dev",
|
||||
"funding": "https://github.com/vitejs/vite?sponsor=1",
|
||||
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
||||
"dependencies": {
|
||||
"esbuild": "^0.25.0",
|
||||
"fdir": "^6.4.4",
|
||||
"picomatch": "^4.0.2",
|
||||
"postcss": "^8.5.3",
|
||||
"rollup": "^4.34.9",
|
||||
"tinyglobby": "^0.2.13"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ampproject/remapping": "^2.3.0",
|
||||
"@babel/parser": "^7.27.0",
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"@polka/compression": "^1.0.0-next.25",
|
||||
"@rollup/plugin-alias": "^5.1.1",
|
||||
"@rollup/plugin-commonjs": "^28.0.3",
|
||||
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
"@rollup/plugin-node-resolve": "16.0.1",
|
||||
"@rollup/pluginutils": "^5.1.4",
|
||||
"@types/escape-html": "^1.0.4",
|
||||
"@types/pnpapi": "^0.0.5",
|
||||
"artichokie": "^0.3.1",
|
||||
"cac": "^6.7.14",
|
||||
"chokidar": "^3.6.0",
|
||||
"connect": "^3.7.0",
|
||||
"convert-source-map": "^2.0.0",
|
||||
"cors": "^2.8.5",
|
||||
"cross-spawn": "^7.0.6",
|
||||
"debug": "^4.4.0",
|
||||
"dep-types": "link:./src/types",
|
||||
"dotenv": "^16.5.0",
|
||||
"dotenv-expand": "^12.0.2",
|
||||
"es-module-lexer": "^1.6.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"estree-walker": "^3.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"http-proxy": "^1.18.1",
|
||||
"launch-editor-middleware": "^2.10.0",
|
||||
"lightningcss": "^1.29.3",
|
||||
"magic-string": "^0.30.17",
|
||||
"mlly": "^1.7.4",
|
||||
"mrmime": "^2.0.1",
|
||||
"nanoid": "^5.1.5",
|
||||
"open": "^10.1.1",
|
||||
"parse5": "^7.2.1",
|
||||
"pathe": "^2.0.3",
|
||||
"periscopic": "^4.0.2",
|
||||
"picocolors": "^1.1.1",
|
||||
"postcss-import": "^16.1.0",
|
||||
"postcss-load-config": "^6.0.1",
|
||||
"postcss-modules": "^6.0.1",
|
||||
"resolve.exports": "^2.0.3",
|
||||
"rollup-plugin-dts": "^6.2.1",
|
||||
"rollup-plugin-esbuild": "^6.2.1",
|
||||
"rollup-plugin-license": "^3.6.0",
|
||||
"sass": "^1.86.3",
|
||||
"sass-embedded": "^1.86.3",
|
||||
"sirv": "^3.0.1",
|
||||
"source-map-support": "^0.5.21",
|
||||
"strip-literal": "^3.0.0",
|
||||
"terser": "^5.39.0",
|
||||
"tsconfck": "^3.1.5",
|
||||
"tslib": "^2.8.1",
|
||||
"types": "link:./types",
|
||||
"ufo": "^1.6.1",
|
||||
"ws": "^8.18.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
|
||||
"jiti": ">=1.21.0",
|
||||
"less": "*",
|
||||
"lightningcss": "^1.21.0",
|
||||
"sass": "*",
|
||||
"sass-embedded": "*",
|
||||
"stylus": "*",
|
||||
"sugarss": "*",
|
||||
"terser": "^5.16.0",
|
||||
"tsx": "^4.8.1",
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
},
|
||||
"jiti": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
},
|
||||
"sass-embedded": {
|
||||
"optional": true
|
||||
},
|
||||
"stylus": {
|
||||
"optional": true
|
||||
},
|
||||
"less": {
|
||||
"optional": true
|
||||
},
|
||||
"sugarss": {
|
||||
"optional": true
|
||||
},
|
||||
"lightningcss": {
|
||||
"optional": true
|
||||
},
|
||||
"terser": {
|
||||
"optional": true
|
||||
},
|
||||
"tsx": {
|
||||
"optional": true
|
||||
},
|
||||
"yaml": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "tsx scripts/dev.ts",
|
||||
"build": "premove dist && pnpm build-bundle && pnpm build-types",
|
||||
"build-bundle": "rollup --config rollup.config.ts --configPlugin esbuild",
|
||||
"build-types": "pnpm build-types-temp && pnpm build-types-roll && pnpm build-types-check",
|
||||
"build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node/tsconfig.build.json",
|
||||
"build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin esbuild && premove temp",
|
||||
"build-types-check": "tsc --project tsconfig.check.json",
|
||||
"typecheck": "tsc --noEmit && tsc --noEmit -p src/node",
|
||||
"lint": "eslint --cache --ext .ts src/**",
|
||||
"format": "prettier --write --cache --parser typescript \"src/**/*.ts\""
|
||||
}
|
||||
}
|
||||
45
app/node_modules/vite/types/customEvent.d.ts
generated
vendored
Normal file
45
app/node_modules/vite/types/customEvent.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import type {
|
||||
ErrorPayload,
|
||||
FullReloadPayload,
|
||||
PrunePayload,
|
||||
UpdatePayload,
|
||||
} from './hmrPayload'
|
||||
|
||||
export interface CustomEventMap {
|
||||
'vite:beforeUpdate': UpdatePayload
|
||||
'vite:afterUpdate': UpdatePayload
|
||||
'vite:beforePrune': PrunePayload
|
||||
'vite:beforeFullReload': FullReloadPayload
|
||||
'vite:error': ErrorPayload
|
||||
'vite:invalidate': InvalidatePayload
|
||||
'vite:ws:connect': WebSocketConnectionPayload
|
||||
'vite:ws:disconnect': WebSocketConnectionPayload
|
||||
}
|
||||
|
||||
export interface WebSocketConnectionPayload {
|
||||
/**
|
||||
* @experimental
|
||||
* We expose this instance experimentally to see potential usage.
|
||||
* This might be removed in the future if we didn't find reasonable use cases.
|
||||
* If you find this useful, please open an issue with details so we can discuss and make it stable API.
|
||||
*/
|
||||
// eslint-disable-next-line n/no-unsupported-features/node-builtins
|
||||
webSocket: WebSocket
|
||||
}
|
||||
|
||||
export interface InvalidatePayload {
|
||||
path: string
|
||||
message: string | undefined
|
||||
firstInvalidatedBy: string
|
||||
}
|
||||
|
||||
/**
|
||||
* provides types for payloads of built-in Vite events
|
||||
*/
|
||||
export type InferCustomEventPayload<T extends string> =
|
||||
T extends keyof CustomEventMap ? CustomEventMap[T] : any
|
||||
|
||||
/**
|
||||
* provides types for names of built-in Vite events
|
||||
*/
|
||||
export type CustomEventName = keyof CustomEventMap | (string & {})
|
||||
74
app/node_modules/vite/types/hmrPayload.d.ts
generated
vendored
Normal file
74
app/node_modules/vite/types/hmrPayload.d.ts
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
/** @deprecated use HotPayload */
|
||||
export type HMRPayload = HotPayload
|
||||
export type HotPayload =
|
||||
| ConnectedPayload
|
||||
| PingPayload
|
||||
| UpdatePayload
|
||||
| FullReloadPayload
|
||||
| CustomPayload
|
||||
| ErrorPayload
|
||||
| PrunePayload
|
||||
|
||||
export interface ConnectedPayload {
|
||||
type: 'connected'
|
||||
}
|
||||
|
||||
export interface PingPayload {
|
||||
type: 'ping'
|
||||
}
|
||||
|
||||
export interface UpdatePayload {
|
||||
type: 'update'
|
||||
updates: Update[]
|
||||
}
|
||||
|
||||
export interface Update {
|
||||
type: 'js-update' | 'css-update'
|
||||
path: string
|
||||
acceptedPath: string
|
||||
timestamp: number
|
||||
/** @internal */
|
||||
explicitImportRequired?: boolean
|
||||
/** @internal */
|
||||
isWithinCircularImport?: boolean
|
||||
/** @internal */
|
||||
firstInvalidatedBy?: string
|
||||
/** @internal */
|
||||
invalidates?: string[]
|
||||
}
|
||||
|
||||
export interface PrunePayload {
|
||||
type: 'prune'
|
||||
paths: string[]
|
||||
}
|
||||
|
||||
export interface FullReloadPayload {
|
||||
type: 'full-reload'
|
||||
path?: string
|
||||
/** @internal */
|
||||
triggeredBy?: string
|
||||
}
|
||||
|
||||
export interface CustomPayload {
|
||||
type: 'custom'
|
||||
event: string
|
||||
data?: any
|
||||
}
|
||||
|
||||
export interface ErrorPayload {
|
||||
type: 'error'
|
||||
err: {
|
||||
[name: string]: any
|
||||
message: string
|
||||
stack: string
|
||||
id?: string
|
||||
frame?: string
|
||||
plugin?: string
|
||||
pluginCode?: string
|
||||
loc?: {
|
||||
file?: string
|
||||
line: number
|
||||
column: number
|
||||
}
|
||||
}
|
||||
}
|
||||
39
app/node_modules/vite/types/hot.d.ts
generated
vendored
Normal file
39
app/node_modules/vite/types/hot.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { CustomEventName, InferCustomEventPayload } from './customEvent'
|
||||
|
||||
export type ModuleNamespace = Record<string, any> & {
|
||||
[Symbol.toStringTag]: 'Module'
|
||||
}
|
||||
|
||||
export interface ViteHotContext {
|
||||
readonly data: any
|
||||
|
||||
accept(): void
|
||||
accept(cb: (mod: ModuleNamespace | undefined) => void): void
|
||||
accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void
|
||||
accept(
|
||||
deps: readonly string[],
|
||||
cb: (mods: Array<ModuleNamespace | undefined>) => void,
|
||||
): void
|
||||
|
||||
acceptExports(
|
||||
exportNames: string | readonly string[],
|
||||
cb?: (mod: ModuleNamespace | undefined) => void,
|
||||
): void
|
||||
|
||||
dispose(cb: (data: any) => void): void
|
||||
prune(cb: (data: any) => void): void
|
||||
invalidate(message?: string): void
|
||||
|
||||
on<T extends CustomEventName>(
|
||||
event: T,
|
||||
cb: (payload: InferCustomEventPayload<T>) => void,
|
||||
): void
|
||||
off<T extends CustomEventName>(
|
||||
event: T,
|
||||
cb: (payload: InferCustomEventPayload<T>) => void,
|
||||
): void
|
||||
send<T extends CustomEventName>(
|
||||
event: T,
|
||||
data?: InferCustomEventPayload<T>,
|
||||
): void
|
||||
}
|
||||
5
app/node_modules/vite/types/import-meta.d.ts
generated
vendored
Normal file
5
app/node_modules/vite/types/import-meta.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/// <reference path="./importMeta.d.ts" />
|
||||
|
||||
// https://github.com/microsoft/TypeScript/issues/45096
|
||||
// TypeScript has a bug that makes <reference types="vite/types/importMeta" />
|
||||
// not possible in userland. This file provides a workaround for now.
|
||||
75
app/node_modules/vite/types/importGlob.d.ts
generated
vendored
Normal file
75
app/node_modules/vite/types/importGlob.d.ts
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
export interface ImportGlobOptions<
|
||||
Eager extends boolean,
|
||||
AsType extends string,
|
||||
> {
|
||||
/**
|
||||
* Import type for the import url.
|
||||
*
|
||||
* @deprecated Use `query` instead, e.g. `as: 'url'` -> `query: '?url', import: 'default'`
|
||||
*/
|
||||
as?: AsType
|
||||
/**
|
||||
* Import as static or dynamic
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
eager?: Eager
|
||||
/**
|
||||
* Import only the specific named export. Set to `default` to import the default export.
|
||||
*/
|
||||
import?: string
|
||||
/**
|
||||
* Custom queries
|
||||
*/
|
||||
query?: string | Record<string, string | number | boolean>
|
||||
/**
|
||||
* Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
exhaustive?: boolean
|
||||
}
|
||||
|
||||
export type GeneralImportGlobOptions = ImportGlobOptions<boolean, string>
|
||||
|
||||
export interface KnownAsTypeMap {
|
||||
raw: string
|
||||
url: string
|
||||
worker: Worker
|
||||
}
|
||||
|
||||
export interface ImportGlobFunction {
|
||||
/**
|
||||
* Import a list of files with a glob pattern.
|
||||
*
|
||||
* Overload 1: No generic provided, infer the type from `eager` and `as`
|
||||
*/
|
||||
<
|
||||
Eager extends boolean,
|
||||
As extends string,
|
||||
T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown,
|
||||
>(
|
||||
glob: string | string[],
|
||||
options?: ImportGlobOptions<Eager, As>,
|
||||
): (Eager extends true ? true : false) extends true
|
||||
? Record<string, T>
|
||||
: Record<string, () => Promise<T>>
|
||||
/**
|
||||
* Import a list of files with a glob pattern.
|
||||
*
|
||||
* Overload 2: Module generic provided, infer the type from `eager: false`
|
||||
*/
|
||||
<M>(
|
||||
glob: string | string[],
|
||||
options?: ImportGlobOptions<false, string>,
|
||||
): Record<string, () => Promise<M>>
|
||||
/**
|
||||
* Import a list of files with a glob pattern.
|
||||
*
|
||||
* Overload 3: Module generic provided, infer the type from `eager: true`
|
||||
*/
|
||||
<M>(
|
||||
glob: string | string[],
|
||||
options: ImportGlobOptions<true, string>,
|
||||
): Record<string, M>
|
||||
}
|
||||
31
app/node_modules/vite/types/importMeta.d.ts
generated
vendored
Normal file
31
app/node_modules/vite/types/importMeta.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// This file is an augmentation to the built-in ImportMeta interface
|
||||
// Thus cannot contain any top-level imports
|
||||
// <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation>
|
||||
|
||||
// This is tested in `packages/vite/src/node/__tests_dts__/typeOptions.ts`
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- to allow extending by users
|
||||
interface ViteTypeOptions {
|
||||
// strictImportMetaEnv: unknown
|
||||
}
|
||||
|
||||
type ImportMetaEnvFallbackKey =
|
||||
'strictImportMetaEnv' extends keyof ViteTypeOptions ? never : string
|
||||
|
||||
interface ImportMetaEnv {
|
||||
[key: ImportMetaEnvFallbackKey]: any
|
||||
BASE_URL: string
|
||||
MODE: string
|
||||
DEV: boolean
|
||||
PROD: boolean
|
||||
SSR: boolean
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
url: string
|
||||
|
||||
readonly hot?: import('./hot').ViteHotContext
|
||||
|
||||
readonly env: ImportMetaEnv
|
||||
|
||||
glob: import('./importGlob').ImportGlobFunction
|
||||
}
|
||||
63
app/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts
generated
vendored
Normal file
63
app/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
// @ts-ignore `sass` may not be installed
|
||||
import type DartSass from 'sass'
|
||||
// @ts-ignore `sass-embedded` may not be installed
|
||||
import type SassEmbedded from 'sass-embedded'
|
||||
// @ts-ignore `less` may not be installed
|
||||
import type Less from 'less'
|
||||
// @ts-ignore `stylus` may not be installed
|
||||
import type Stylus from 'stylus'
|
||||
|
||||
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
// https://github.com/type-challenges/type-challenges/issues/29285
|
||||
type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false
|
||||
|
||||
type DartSassLegacyStringOptionsAsync = DartSass.LegacyStringOptions<'async'>
|
||||
type SassEmbeddedLegacyStringOptionsAsync =
|
||||
SassEmbedded.LegacyStringOptions<'async'>
|
||||
type SassLegacyStringOptionsAsync =
|
||||
IsAny<DartSassLegacyStringOptionsAsync> extends false
|
||||
? DartSassLegacyStringOptionsAsync
|
||||
: SassEmbeddedLegacyStringOptionsAsync
|
||||
|
||||
export type SassLegacyPreprocessBaseOptions = Omit<
|
||||
SassLegacyStringOptionsAsync,
|
||||
| 'data'
|
||||
| 'file'
|
||||
| 'outFile'
|
||||
| 'sourceMap'
|
||||
| 'omitSourceMapUrl'
|
||||
| 'sourceMapEmbed'
|
||||
| 'sourceMapRoot'
|
||||
>
|
||||
|
||||
type DartSassStringOptionsAsync = DartSass.StringOptions<'async'>
|
||||
type SassEmbeddedStringOptionsAsync = SassEmbedded.StringOptions<'async'>
|
||||
type SassStringOptionsAsync =
|
||||
IsAny<DartSassStringOptionsAsync> extends false
|
||||
? DartSassStringOptionsAsync
|
||||
: SassEmbeddedStringOptionsAsync
|
||||
|
||||
export type SassModernPreprocessBaseOptions = Omit<
|
||||
SassStringOptionsAsync,
|
||||
'url' | 'sourceMap'
|
||||
>
|
||||
|
||||
export type LessPreprocessorBaseOptions = Omit<
|
||||
Less.Options,
|
||||
'sourceMap' | 'filename'
|
||||
>
|
||||
|
||||
export type StylusPreprocessorBaseOptions = Omit<
|
||||
Stylus.RenderOptions,
|
||||
'filename'
|
||||
> & { define?: Record<string, any> }
|
||||
|
||||
declare global {
|
||||
// LESS' types somewhat references this which doesn't make sense in Node,
|
||||
// so we have to shim it
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface HTMLLinkElement {}
|
||||
}
|
||||
18
app/node_modules/vite/types/internal/lightningcssOptions.d.ts
generated
vendored
Normal file
18
app/node_modules/vite/types/internal/lightningcssOptions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
// @ts-ignore `lightningcss` may not be installed
|
||||
import type Lightningcss from 'lightningcss'
|
||||
|
||||
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
export type LightningCSSOptions = Omit<
|
||||
Lightningcss.BundleAsyncOptions<Lightningcss.CustomAtRules>,
|
||||
| 'filename'
|
||||
| 'resolver'
|
||||
| 'minify'
|
||||
| 'sourceMap'
|
||||
| 'analyzeDependencies'
|
||||
// properties not overridden by Vite, but does not make sense to set by end users
|
||||
| 'inputSourceMap'
|
||||
| 'projectRoot'
|
||||
>
|
||||
35
app/node_modules/vite/types/metadata.d.ts
generated
vendored
Normal file
35
app/node_modules/vite/types/metadata.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
export interface ChunkMetadata {
|
||||
importedAssets: Set<string>
|
||||
importedCss: Set<string>
|
||||
}
|
||||
|
||||
export interface CustomPluginOptionsVite {
|
||||
/**
|
||||
* If this is a CSS Rollup module, you can scope to its importer's exports
|
||||
* so that if those exports are treeshaken away, the CSS module will also
|
||||
* be treeshaken.
|
||||
*
|
||||
* The "importerId" must import the CSS Rollup module statically.
|
||||
*
|
||||
* Example config if the CSS id is `/src/App.vue?vue&type=style&lang.css`:
|
||||
* ```js
|
||||
* cssScopeTo: ['/src/App.vue', 'default']
|
||||
* ```
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
cssScopeTo?: readonly [importerId: string, exportName: string | undefined]
|
||||
|
||||
/** @deprecated no-op since Vite 6.1 */
|
||||
lang?: string
|
||||
}
|
||||
|
||||
declare module 'rollup' {
|
||||
export interface RenderedChunk {
|
||||
viteMetadata?: ChunkMetadata
|
||||
}
|
||||
|
||||
export interface CustomPluginOptions {
|
||||
vite?: CustomPluginOptionsVite
|
||||
}
|
||||
}
|
||||
4
app/node_modules/vite/types/package.json
generated
vendored
Normal file
4
app/node_modules/vite/types/package.json
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"//": "this file is here to make typescript happy when moduleResolution=node16+",
|
||||
"version": "0.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user