Initial commit: MVP+ wish board with FastAPI + Tailwind

This commit is contained in:
Nikita committed 2026-08-05 17:06:36 +05:00
commit cd945a6128
2277 files changed
+843095

No files matched your search

+2322
View File
File diff suppressed because it is too large. Load diff
+20
View 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 "quick", pronounced [`/viːt/`](https://cdn.jsdelivr.net/gh/vitejs/vite@main/docs/public/vite.mp3), like "veet") is a build tool that aims to provide a faster and leaner development experience for modern web projects. It consists of two major parts:
- A dev server that provides [rich feature enhancements](https://vite.dev/guide/features) over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), for example extremely fast [Hot Module Replacement (HMR)](https://vite.dev/guide/features#hot-module-replacement).
- A build command that bundles your code with [Rolldown](https://rolldown.rs), 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).
+68
View File
@@ -0,0 +1,68 @@
/*
Copyright (c) 2015-present, Facebook, Inc.
This source code is licensed under the MIT license found in the
LICENSE file at
https://github.com/react/create-react-app/blob/main/LICENSE
*/
/* global Application */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function run(argv) {
const urlToOpen = argv[0]
// Allow requested program to be optional, default to Google Chrome
const programName = argv[1] ?? 'Google Chrome'
const app = Application(programName)
if (app.windows.length === 0) {
app.Window().make()
}
// 1: Looking for tab running debugger then,
// Reload debugging tab if found, then return
const found = lookupTabWithUrl(urlToOpen, app)
if (found) {
found.targetWindow.activeTabIndex = found.targetTabIndex
found.targetTab.reload()
found.targetWindow.index = 1
app.activate()
return
}
// 2: Looking for Empty tab
// In case debugging tab was not found
// We try to find an empty tab instead
const emptyTabFound = lookupTabWithUrl('chrome://newtab/', app)
if (emptyTabFound) {
emptyTabFound.targetWindow.activeTabIndex = emptyTabFound.targetTabIndex
emptyTabFound.targetTab.url = urlToOpen
app.activate()
return
}
// 3: Create new tab
// both debugging and empty tab were not found make a new tab with url
const firstWindow = app.windows[0]
firstWindow.tabs.push(app.Tab({ url: urlToOpen }))
app.activate()
}
/**
* Lookup tab with given url
*/
function lookupTabWithUrl(lookupUrl, app) {
const windows = app.windows()
for (const window of windows) {
for (const [tabIndex, tab] of window.tabs().entries()) {
if (tab.url().includes(lookupUrl)) {
return {
targetTab: tab,
targetTabIndex: tabIndex + 1,
targetWindow: window,
}
}
}
}
}
Generated Vendored Executable
+79
View 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')) {
if (!process.env.DEBUG_DISABLE_SOURCE_MAP) {
// eslint-disable-next-line n/no-unsupported-features/node-builtins -- only used in dev
process.setSourceMapsEnabled(true)
}
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[0] === '-') {
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[0] !== '-') {
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[0] !== '-') {
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()
}
+285
View File
@@ -0,0 +1,285 @@
/// <reference path="./types/importMeta.d.ts" />
// virtual modules
declare module 'vite/modulepreload-polyfill' {}
// 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
}
// wasm (ESM integration)
declare module '*.wasm' {}
// 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
}
+1
View File
@@ -0,0 +1 @@
export default false
+1
View File
@@ -0,0 +1 @@
export default true
+194
View File
@@ -0,0 +1,194 @@
{
"name": "vite",
"version": "8.2.0",
"description": "Native-ESM powered web dev build tool",
"keywords": [
"build-tool",
"dev-server",
"framework",
"frontend",
"hmr",
"vite"
],
"homepage": "https://vite.dev",
"bugs": {
"url": "https://github.com/vitejs/vite/issues"
},
"license": "MIT",
"author": "Evan You",
"repository": {
"type": "git",
"url": "git+https://github.com/vitejs/vite.git",
"directory": "packages/vite"
},
"funding": "https://github.com/vitejs/vite?sponsor=1",
"bin": {
"vite": "bin/vite.js"
},
"files": [
"bin",
"dist",
"misc/**/*.js",
"client.d.ts",
"types"
],
"type": "module",
"imports": {
"#module-sync-enabled": {
"module-sync": "./misc/true.js",
"default": "./misc/false.js"
},
"#types/*": "./types/*.d.ts",
"#dep-types/*": "./src/types/*.d.ts"
},
"exports": {
".": "./dist/node/index.js",
"./client": {
"types": "./client.d.ts"
},
"./module-runner": "./dist/node/module-runner.js",
"./internal": "./dist/node/internal.js",
"./dist/client/*": "./dist/client/*",
"./types/*": {
"types": "./types/*"
},
"./types/internal/*": null,
"./package.json": "./package.json"
},
"dependencies": {
"lightningcss": "^1.33.0",
"picomatch": "^4.0.5",
"postcss": "^8.5.23",
"rolldown": "~1.2.0",
"tinyglobby": "^0.2.17"
},
"devDependencies": {
"@babel/parser": "^7.29.7",
"@jridgewell/remapping": "^2.3.5",
"@jridgewell/trace-mapping": "^0.3.31",
"@polka/compression": "^1.0.0-next.25",
"@rollup/plugin-alias": "^6.0.0",
"@rollup/plugin-dynamic-import-vars": "2.1.4",
"@rollup/pluginutils": "^5.4.0",
"@types/escape-html": "^1.0.4",
"@types/pnpapi": "^0.0.5",
"@vercel/detect-agent": "^1.2.3",
"@vitejs/devtools": "^0.4.8",
"@vitest/utils": "4.1.10",
"@voidzero-dev/vite-task-client": "^0.2.0",
"artichokie": "^0.4.4",
"baseline-browser-mapping": "^2.11.3",
"cac": "^7.0.0",
"chokidar": "^3.6.0",
"connect": "^3.7.0",
"convert-source-map": "^2.0.0",
"cors": "^2.8.6",
"cross-spawn": "^7.0.6",
"dotenv-expand": "^13.0.0",
"es-module-lexer": "^2.3.1",
"esbuild": "^0.28.1",
"escape-html": "^1.0.3",
"estree-walker": "^3.0.3",
"etag": "^1.8.1",
"fresh-import": "^0.2.1",
"host-validation-middleware": "^0.1.4",
"http-proxy-3": "^1.23.3",
"launch-editor-middleware": "^2.14.1",
"magic-string": "^1.1.0",
"mlly": "^1.8.2",
"mrmime": "^2.0.1",
"nanoid": "^5.1.16",
"obug": "^1.0.2",
"open": "^10.2.0",
"parse5": "^8.0.1",
"pathe": "^2.0.3",
"periscopic": "^4.0.3",
"picocolors": "^1.1.1",
"postcss-import": "^16.1.1",
"postcss-load-config": "^6.0.1",
"postcss-modules": "^9.0.1",
"premove": "^4.0.0",
"resolve.exports": "^2.0.3",
"rolldown-plugin-dts": "^0.27.9",
"rollup": "^4.59.0",
"rollup-plugin-license": "^3.7.1",
"sass": "^1.102.0",
"sass-embedded": "^1.100.0",
"sirv": "^3.0.2",
"strip-literal": "^3.1.0",
"terser": "^5.49.0",
"ufo": "^1.6.4",
"ws": "^8.21.1"
},
"peerDependencies": {
"@types/node": "^20.19.0 || >=22.12.0",
"@vitejs/devtools": "^0.4.0",
"esbuild": "^0.27.0 || ^0.28.0",
"jiti": ">=1.21.0",
"less": "^4.0.0",
"sass": "^1.70.0",
"sass-embedded": "^1.70.0",
"stylus": ">=0.54.8",
"sugarss": "^5.0.0",
"terser": "^5.16.0",
"tsx": "^4.8.1",
"yaml": "^2.4.2"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"@vitejs/devtools": {
"optional": true
},
"esbuild": {
"optional": true
},
"jiti": {
"optional": true
},
"sass": {
"optional": true
},
"sass-embedded": {
"optional": true
},
"stylus": {
"optional": true
},
"less": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
},
"tsx": {
"optional": true
},
"yaml": {
"optional": true
}
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
},
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
"scripts": {
"dev": "premove dist && pnpm build-bundle -w",
"build": "premove dist && pnpm build-bundle && pnpm build-types",
"build-bundle": "rolldown --config rolldown.config.ts",
"build-types": "pnpm build-types-roll && pnpm build-types-check",
"build-types-roll": "rolldown --config rolldown.dts.config.ts",
"build-types-check": "tsc --project tsconfig.check.json",
"typecheck": "tsc && tsc -p src/node && tsc -p src/client && tsc -p src/module-runner && tsc -p src/shared && tsc -p src/node/__tests_dts__ && tsc -p src/module-runner/__tests_dts__",
"lint": "eslint --cache --ext .ts src/**",
"format": "oxfmt",
"generate-target": "tsx scripts/generateTarget.ts"
}
}
+81
View File
@@ -0,0 +1,81 @@
import type {
ErrorPayload,
FullReloadPayload,
PrunePayload,
UpdatePayload,
} from './hmrPayload.js'
export interface CustomEventMap {
// client events
'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
/** @internal */
'vite:forward-console': ForwardConsolePayload
/** @internal */
'vite:client-connected': { clientId: string }
/** @internal */
'vite:bundled-dev:reload-needed': { reason: string }
// server events
'vite:client:connect': undefined
'vite:client:disconnect': undefined
}
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
}
export type ForwardConsolePayload =
| {
type: 'error'
data: {
name: string
message: string
stack?: string
}
}
| {
type: 'unhandled-rejection'
data: {
name: string
message: string
stack?: string
}
}
| {
type: 'log'
data: {
level: string
message: 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 & {})
+94
View File
@@ -0,0 +1,94 @@
/** @deprecated use HotPayload */
export type HMRPayload = HotPayload
export type HotPayload =
| ConnectedPayload
| PingPayload
| UpdatePayload
| BundledDevUpdatePayload
| FullReloadPayload
| CustomPayload
| ErrorPayload
| PrunePayload
export interface ConnectedPayload {
type: 'connected'
}
export interface PingPayload {
type: 'ping'
}
export interface UpdatePayload {
type: 'update'
updates: Update[]
}
/**
* Full-bundle-mode update notification. The client computes the HMR boundaries
* itself from `changedIds`.
*/
export interface BundledDevUpdatePayload {
type: 'bundled-dev-update'
changedIds: string[]
/** URL of the per-client HMR patch chunk */
url: string
/** Per-client sequence number */
seq: number
}
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
/**
* When set, only the bundling-fallback page acts on the reload;
* other pages ignore the message.
* @internal
*/
ifFallback?: boolean
}
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
View File
@@ -0,0 +1,39 @@
import type { CustomEventName, InferCustomEventPayload } from './customEvent.js'
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
View 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.
+131
View File
@@ -0,0 +1,131 @@
// make input suggestions work
type StringQueryType = `?${keyof KnownAsTypeMap}` | (string & {})
type BaseQueryType = StringQueryType | Record<string, string | number | boolean>
export interface ImportGlobOptions<
Eager extends boolean,
AsType extends string,
QueryType extends BaseQueryType,
> {
/**
* 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?: QueryType
/**
* Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance.
*
* @default false
*/
exhaustive?: boolean
/**
* Base path to resolve relative paths.
*/
base?: string
/**
* Whether the glob pattern matching should be case-sensitive. Defaults to `true`.
*/
caseSensitive?: boolean
}
export type ImportGlobOptionsWithoutAs<
Eager extends boolean,
QueryType extends BaseQueryType,
> = Omit<ImportGlobOptions<Eager, string, QueryType>, 'as'> & {
as?: never
}
export type GeneralImportGlobOptions = ImportGlobOptions<
boolean,
string,
BaseQueryType
>
/**
* Declare Worker in case DOM is not added to the tsconfig lib causing
* Worker interface is not defined. For developers with DOM lib added,
* the Worker interface will be merged correctly.
*/
declare global {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface Worker {}
}
export interface KnownAsTypeMap {
raw: string
url: string
worker: Worker
}
type KnownQueryTypeMap = {
[K in keyof KnownAsTypeMap as `?${K}`]: KnownAsTypeMap[K]
}
export interface ImportGlobFunction {
/**
* Import a list of files with a glob pattern.
*
* Overload 1A: No generic provided, infer the type from `eager` and `query`
*/
<
Eager extends boolean,
Query extends BaseQueryType,
T = Query extends keyof KnownQueryTypeMap
? KnownQueryTypeMap[Query]
: unknown,
>(
glob: string | string[],
options?: ImportGlobOptionsWithoutAs<Eager, Query>,
): (Eager extends true ? true : false) extends true
? Record<string, T>
: Record<string, () => Promise<T>>
/**
* Import a list of files with a glob pattern.
*
* Overload 1B: No generic provided, infer the type from `eager` and `as`
* (deprecated, use `query` instead)
*/
<
Eager extends boolean,
As extends string,
T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown,
>(
glob: string | string[],
options?: ImportGlobOptions<Eager, As, BaseQueryType>,
): (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, BaseQueryType>,
): 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, BaseQueryType>,
): Record<string, M>
}
+30
View File
@@ -0,0 +1,30 @@
// 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 extends Record<ImportMetaEnvFallbackKey, any> {
BASE_URL: string
MODE: string
DEV: boolean
PROD: boolean
SSR: boolean
}
interface ImportMeta {
url: string
readonly hot?: import('./hot.js').ViteHotContext
readonly env: ImportMetaEnv
glob: import('./importGlob.js').ImportGlobFunction
}
+44
View File
@@ -0,0 +1,44 @@
/* 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 DartSassStringOptionsAsync = DartSass.StringOptions<'async'>
type SassEmbeddedStringOptionsAsync = SassEmbedded.StringOptions<'async'>
type SassStringOptionsAsync =
IsAny<SassEmbeddedStringOptionsAsync> extends false
? SassEmbeddedStringOptionsAsync
: DartSassStringOptionsAsync
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 {}
}
+28
View File
@@ -0,0 +1,28 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-ignore `esbuild` may not be installed
import type esbuild from 'esbuild'
/* eslint-enable @typescript-eslint/ban-ts-comment */
export type EsbuildTarget = string | string[]
export type EsbuildLoader = esbuild.Loader
export type EsbuildTransformOptions = esbuild.TransformOptions
export type EsbuildTransformResult = esbuild.TransformResult
export type EsbuildMessage = esbuild.Message
export type DepsOptimizerEsbuildOptions = Omit<
esbuild.BuildOptions,
| 'bundle'
| 'entryPoints'
| 'external'
| 'write'
| 'watch'
| 'outdir'
| 'outfile'
| 'outbase'
| 'outExtension'
| 'metafile'
>
+18
View 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'
>
+24
View File
@@ -0,0 +1,24 @@
import type * as Rolldown from 'rolldown'
export * from 'rolldown'
/** @deprecated use RolldownBuild instead */
export type RollupBuild = Rolldown.RolldownBuild
/** @deprecated use RolldownOptions instead */
export type RollupOptions = Rolldown.RolldownOptions
/** @deprecated use RolldownOutput instead */
export type RollupOutput = Rolldown.RolldownOutput
/** @deprecated use RolldownPlugin instead */
export type RollupPlugin = Rolldown.RolldownPlugin
/** @deprecated use RolldownPluginOption instead */
export type RollupPluginOption = Rolldown.RolldownPluginOption
/** @deprecated use RolldownWatcher instead */
export type RollupWatcher = Rolldown.RolldownWatcher
/** @deprecated use RollupWatcherEvent instead */
export type RollupWatcherEvent = Rolldown.RolldownWatcherEvent
+11
View File
@@ -0,0 +1,11 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-ignore `terser` may not be installed
export type * as Terser from 'terser'
// @ts-ignore `terser` may not be installed
import type * as Terser from 'terser'
/* eslint-enable @typescript-eslint/ban-ts-comment */
export type TerserMinifyOptions = Terser.MinifyOptions
export type TerserMinifyOutput = Terser.MinifyOutput
+47
View File
@@ -0,0 +1,47 @@
export interface AssetMetadata {
importedAssets: Set<string>
importedCss: Set<string>
}
export interface ChunkMetadata {
importedAssets: Set<string>
importedCss: Set<string>
/** @internal */
__modules: any
}
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']
* ```
*/
cssScopeTo?: readonly [importerId: string, exportName: string | undefined]
/** @deprecated no-op since Vite 6.1 */
lang?: string
}
declare module 'rolldown' {
export interface OutputAsset {
viteMetadata?: AssetMetadata
}
export interface RenderedChunk {
viteMetadata?: ChunkMetadata
}
export interface OutputChunk {
viteMetadata?: ChunkMetadata
}
export interface CustomPluginOptions {
vite?: CustomPluginOptionsVite
}
}