@depup/vite 7.3.1-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/LICENSE.md +2120 -0
  2. package/README.md +20 -0
  3. package/bin/openChrome.js +68 -0
  4. package/bin/vite.js +79 -0
  5. package/client.d.ts +279 -0
  6. package/dist/client/client.mjs +1106 -0
  7. package/dist/client/env.mjs +19 -0
  8. package/dist/node/chunks/build.js +4 -0
  9. package/dist/node/chunks/build2.js +5538 -0
  10. package/dist/node/chunks/chunk.js +48 -0
  11. package/dist/node/chunks/config.js +35978 -0
  12. package/dist/node/chunks/config2.js +4 -0
  13. package/dist/node/chunks/dist.js +6758 -0
  14. package/dist/node/chunks/lib.js +377 -0
  15. package/dist/node/chunks/logger.js +329 -0
  16. package/dist/node/chunks/moduleRunnerTransport.d.ts +96 -0
  17. package/dist/node/chunks/optimizer.js +4 -0
  18. package/dist/node/chunks/postcss-import.js +479 -0
  19. package/dist/node/chunks/preview.js +4 -0
  20. package/dist/node/chunks/server.js +4 -0
  21. package/dist/node/cli.js +698 -0
  22. package/dist/node/index.d.ts +3713 -0
  23. package/dist/node/index.js +30 -0
  24. package/dist/node/module-runner.d.ts +311 -0
  25. package/dist/node/module-runner.js +1160 -0
  26. package/misc/false.js +1 -0
  27. package/misc/true.js +1 -0
  28. package/package.json +199 -0
  29. package/types/customEvent.d.ts +50 -0
  30. package/types/hmrPayload.d.ts +74 -0
  31. package/types/hot.d.ts +39 -0
  32. package/types/import-meta.d.ts +5 -0
  33. package/types/importGlob.d.ts +89 -0
  34. package/types/importMeta.d.ts +30 -0
  35. package/types/internal/cssPreprocessorOptions.d.ts +44 -0
  36. package/types/internal/lightningcssOptions.d.ts +18 -0
  37. package/types/internal/terserOptions.d.ts +11 -0
  38. package/types/metadata.d.ts +33 -0
  39. package/types/package.json +4 -0
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # Vite ⚡
2
+
3
+ > Next Generation Frontend Tooling
4
+
5
+ - 💡 Instant Server Start
6
+ - ⚡️ Lightning Fast HMR
7
+ - 🛠️ Rich Features
8
+ - 📦 Optimized Build
9
+ - 🔩 Universal Plugin Interface
10
+ - 🔑 Fully Typed APIs
11
+
12
+ 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:
13
+
14
+ - 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).
15
+
16
+ - 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.
17
+
18
+ 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.
19
+
20
+ [Read the Docs to Learn More](https://vite.dev).
@@ -0,0 +1,68 @@
1
+ /*
2
+ Copyright (c) 2015-present, Facebook, Inc.
3
+
4
+ This source code is licensed under the MIT license found in the
5
+ LICENSE file at
6
+ https://github.com/facebook/create-react-app/blob/main/LICENSE
7
+ */
8
+
9
+ /* global Application */
10
+
11
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
12
+ function run(argv) {
13
+ const urlToOpen = argv[0]
14
+ // Allow requested program to be optional, default to Google Chrome
15
+ const programName = argv[1] ?? 'Google Chrome'
16
+
17
+ const app = Application(programName)
18
+
19
+ if (app.windows.length === 0) {
20
+ app.Window().make()
21
+ }
22
+
23
+ // 1: Looking for tab running debugger then,
24
+ // Reload debugging tab if found, then return
25
+ const found = lookupTabWithUrl(urlToOpen, app)
26
+ if (found) {
27
+ found.targetWindow.activeTabIndex = found.targetTabIndex
28
+ found.targetTab.reload()
29
+ found.targetWindow.index = 1
30
+ app.activate()
31
+ return
32
+ }
33
+
34
+ // 2: Looking for Empty tab
35
+ // In case debugging tab was not found
36
+ // We try to find an empty tab instead
37
+ const emptyTabFound = lookupTabWithUrl('chrome://newtab/', app)
38
+ if (emptyTabFound) {
39
+ emptyTabFound.targetWindow.activeTabIndex = emptyTabFound.targetTabIndex
40
+ emptyTabFound.targetTab.url = urlToOpen
41
+ app.activate()
42
+ return
43
+ }
44
+
45
+ // 3: Create new tab
46
+ // both debugging and empty tab were not found make a new tab with url
47
+ const firstWindow = app.windows[0]
48
+ firstWindow.tabs.push(app.Tab({ url: urlToOpen }))
49
+ app.activate()
50
+ }
51
+
52
+ /**
53
+ * Lookup tab with given url
54
+ */
55
+ function lookupTabWithUrl(lookupUrl, app) {
56
+ const windows = app.windows()
57
+ for (const window of windows) {
58
+ for (const [tabIndex, tab] of window.tabs().entries()) {
59
+ if (tab.url().includes(lookupUrl)) {
60
+ return {
61
+ targetTab: tab,
62
+ targetTabIndex: tabIndex + 1,
63
+ targetWindow: window,
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
package/bin/vite.js ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+ import { performance } from 'node:perf_hooks'
3
+ import module from 'node:module'
4
+
5
+ if (!import.meta.url.includes('node_modules')) {
6
+ if (!process.env.DEBUG_DISABLE_SOURCE_MAP) {
7
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins -- only used in dev
8
+ process.setSourceMapsEnabled(true)
9
+ }
10
+
11
+ process.on('unhandledRejection', (err) => {
12
+ throw new Error('UNHANDLED PROMISE REJECTION', { cause: err })
13
+ })
14
+ }
15
+
16
+ global.__vite_start_time = performance.now()
17
+
18
+ // check debug mode first before requiring the CLI.
19
+ const debugIndex = process.argv.findIndex((arg) => /^(?:-d|--debug)$/.test(arg))
20
+ const filterIndex = process.argv.findIndex((arg) =>
21
+ /^(?:-f|--filter)$/.test(arg),
22
+ )
23
+ const profileIndex = process.argv.indexOf('--profile')
24
+
25
+ if (debugIndex > 0) {
26
+ let value = process.argv[debugIndex + 1]
27
+ if (!value || value[0] === '-') {
28
+ value = 'vite:*'
29
+ } else {
30
+ // support debugging multiple flags with comma-separated list
31
+ value = value
32
+ .split(',')
33
+ .map((v) => `vite:${v}`)
34
+ .join(',')
35
+ }
36
+ process.env.DEBUG = `${
37
+ process.env.DEBUG ? process.env.DEBUG + ',' : ''
38
+ }${value}`
39
+
40
+ if (filterIndex > 0) {
41
+ const filter = process.argv[filterIndex + 1]
42
+ if (filter && filter[0] !== '-') {
43
+ process.env.VITE_DEBUG_FILTER = filter
44
+ }
45
+ }
46
+ }
47
+
48
+ function start() {
49
+ try {
50
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.8.0+ and only called if it exists
51
+ module.enableCompileCache?.()
52
+ // flush the cache after 10s because the cache is not flushed until process end
53
+ // for dev server, the cache is never flushed unless manually flushed because the process.exit is called
54
+ // also flushing the cache in SIGINT handler seems to cause the process to hang
55
+ setTimeout(() => {
56
+ try {
57
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins -- it is supported in Node 22.12.0+ and only called if it exists
58
+ module.flushCompileCache?.()
59
+ } catch {}
60
+ }, 10 * 1000).unref()
61
+ } catch {}
62
+ return import('../dist/node/cli.js')
63
+ }
64
+
65
+ if (profileIndex > 0) {
66
+ process.argv.splice(profileIndex, 1)
67
+ const next = process.argv[profileIndex]
68
+ if (next && next[0] !== '-') {
69
+ process.argv.splice(profileIndex, 1)
70
+ }
71
+ const inspector = await import('node:inspector').then((r) => r.default)
72
+ const session = (global.__vite_profile_session = new inspector.Session())
73
+ session.connect()
74
+ session.post('Profiler.enable', () => {
75
+ session.post('Profiler.start', start)
76
+ })
77
+ } else {
78
+ start()
79
+ }
package/client.d.ts ADDED
@@ -0,0 +1,279 @@
1
+ /// <reference path="./types/importMeta.d.ts" />
2
+
3
+ // CSS modules
4
+ type CSSModuleClasses = { readonly [key: string]: string }
5
+
6
+ declare module '*.module.css' {
7
+ const classes: CSSModuleClasses
8
+ export default classes
9
+ }
10
+ declare module '*.module.scss' {
11
+ const classes: CSSModuleClasses
12
+ export default classes
13
+ }
14
+ declare module '*.module.sass' {
15
+ const classes: CSSModuleClasses
16
+ export default classes
17
+ }
18
+ declare module '*.module.less' {
19
+ const classes: CSSModuleClasses
20
+ export default classes
21
+ }
22
+ declare module '*.module.styl' {
23
+ const classes: CSSModuleClasses
24
+ export default classes
25
+ }
26
+ declare module '*.module.stylus' {
27
+ const classes: CSSModuleClasses
28
+ export default classes
29
+ }
30
+ declare module '*.module.pcss' {
31
+ const classes: CSSModuleClasses
32
+ export default classes
33
+ }
34
+ declare module '*.module.sss' {
35
+ const classes: CSSModuleClasses
36
+ export default classes
37
+ }
38
+
39
+ // CSS
40
+ declare module '*.css' {}
41
+ declare module '*.scss' {}
42
+ declare module '*.sass' {}
43
+ declare module '*.less' {}
44
+ declare module '*.styl' {}
45
+ declare module '*.stylus' {}
46
+ declare module '*.pcss' {}
47
+ declare module '*.sss' {}
48
+
49
+ // Built-in asset types
50
+ // see `src/node/constants.ts`
51
+
52
+ // images
53
+ declare module '*.apng' {
54
+ const src: string
55
+ export default src
56
+ }
57
+ declare module '*.bmp' {
58
+ const src: string
59
+ export default src
60
+ }
61
+ declare module '*.png' {
62
+ const src: string
63
+ export default src
64
+ }
65
+ declare module '*.jpg' {
66
+ const src: string
67
+ export default src
68
+ }
69
+ declare module '*.jpeg' {
70
+ const src: string
71
+ export default src
72
+ }
73
+ declare module '*.jfif' {
74
+ const src: string
75
+ export default src
76
+ }
77
+ declare module '*.pjpeg' {
78
+ const src: string
79
+ export default src
80
+ }
81
+ declare module '*.pjp' {
82
+ const src: string
83
+ export default src
84
+ }
85
+ declare module '*.gif' {
86
+ const src: string
87
+ export default src
88
+ }
89
+ declare module '*.svg' {
90
+ const src: string
91
+ export default src
92
+ }
93
+ declare module '*.ico' {
94
+ const src: string
95
+ export default src
96
+ }
97
+ declare module '*.webp' {
98
+ const src: string
99
+ export default src
100
+ }
101
+ declare module '*.avif' {
102
+ const src: string
103
+ export default src
104
+ }
105
+ declare module '*.cur' {
106
+ const src: string
107
+ export default src
108
+ }
109
+ declare module '*.jxl' {
110
+ const src: string
111
+ export default src
112
+ }
113
+
114
+ // media
115
+ declare module '*.mp4' {
116
+ const src: string
117
+ export default src
118
+ }
119
+ declare module '*.webm' {
120
+ const src: string
121
+ export default src
122
+ }
123
+ declare module '*.ogg' {
124
+ const src: string
125
+ export default src
126
+ }
127
+ declare module '*.mp3' {
128
+ const src: string
129
+ export default src
130
+ }
131
+ declare module '*.wav' {
132
+ const src: string
133
+ export default src
134
+ }
135
+ declare module '*.flac' {
136
+ const src: string
137
+ export default src
138
+ }
139
+ declare module '*.aac' {
140
+ const src: string
141
+ export default src
142
+ }
143
+ declare module '*.opus' {
144
+ const src: string
145
+ export default src
146
+ }
147
+ declare module '*.mov' {
148
+ const src: string
149
+ export default src
150
+ }
151
+ declare module '*.m4a' {
152
+ const src: string
153
+ export default src
154
+ }
155
+ declare module '*.vtt' {
156
+ const src: string
157
+ export default src
158
+ }
159
+
160
+ // fonts
161
+ declare module '*.woff' {
162
+ const src: string
163
+ export default src
164
+ }
165
+ declare module '*.woff2' {
166
+ const src: string
167
+ export default src
168
+ }
169
+ declare module '*.eot' {
170
+ const src: string
171
+ export default src
172
+ }
173
+ declare module '*.ttf' {
174
+ const src: string
175
+ export default src
176
+ }
177
+ declare module '*.otf' {
178
+ const src: string
179
+ export default src
180
+ }
181
+
182
+ // other
183
+ declare module '*.webmanifest' {
184
+ const src: string
185
+ export default src
186
+ }
187
+ declare module '*.pdf' {
188
+ const src: string
189
+ export default src
190
+ }
191
+ declare module '*.txt' {
192
+ const src: string
193
+ export default src
194
+ }
195
+
196
+ // wasm?init
197
+ declare module '*.wasm?init' {
198
+ const initWasm: (
199
+ options?: WebAssembly.Imports,
200
+ ) => Promise<WebAssembly.Instance>
201
+ export default initWasm
202
+ }
203
+
204
+ // web worker
205
+ declare module '*?worker' {
206
+ const workerConstructor: {
207
+ new (options?: { name?: string }): Worker
208
+ }
209
+ export default workerConstructor
210
+ }
211
+
212
+ declare module '*?worker&inline' {
213
+ const workerConstructor: {
214
+ new (options?: { name?: string }): Worker
215
+ }
216
+ export default workerConstructor
217
+ }
218
+
219
+ declare module '*?worker&url' {
220
+ const src: string
221
+ export default src
222
+ }
223
+
224
+ declare module '*?sharedworker' {
225
+ const sharedWorkerConstructor: {
226
+ new (options?: { name?: string }): SharedWorker
227
+ }
228
+ export default sharedWorkerConstructor
229
+ }
230
+
231
+ declare module '*?sharedworker&inline' {
232
+ const sharedWorkerConstructor: {
233
+ new (options?: { name?: string }): SharedWorker
234
+ }
235
+ export default sharedWorkerConstructor
236
+ }
237
+
238
+ declare module '*?sharedworker&url' {
239
+ const src: string
240
+ export default src
241
+ }
242
+
243
+ declare module '*?raw' {
244
+ const src: string
245
+ export default src
246
+ }
247
+
248
+ declare module '*?url' {
249
+ const src: string
250
+ export default src
251
+ }
252
+
253
+ declare module '*?inline' {
254
+ const src: string
255
+ export default src
256
+ }
257
+
258
+ declare module '*?no-inline' {
259
+ const src: string
260
+ export default src
261
+ }
262
+
263
+ declare module '*?url&inline' {
264
+ const src: string
265
+ export default src
266
+ }
267
+
268
+ declare module '*?url&no-inline' {
269
+ const src: string
270
+ export default src
271
+ }
272
+
273
+ declare interface VitePreloadErrorEvent extends Event {
274
+ payload: Error
275
+ }
276
+
277
+ declare interface WindowEventMap {
278
+ 'vite:preloadError': VitePreloadErrorEvent
279
+ }