vite 6.3.5 → 7.1.5
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.
- package/LICENSE.md +81 -314
- package/bin/openChrome.js +68 -0
- package/bin/vite.js +7 -7
- package/dist/client/client.mjs +886 -922
- package/dist/client/env.mjs +14 -19
- package/dist/node/chunks/dep-BuoK8Wda.js +377 -0
- package/dist/node/chunks/dep-BvyJBvVx.js +4 -0
- package/dist/node/chunks/dep-Cs9lwdKu.js +4 -0
- package/dist/node/chunks/dep-DCVhRpiz.js +5595 -0
- package/dist/node/chunks/dep-DDbTn5rw.js +482 -0
- package/dist/node/chunks/dep-D_YDhiNx.js +4 -0
- package/dist/node/chunks/dep-M_KD0XSK.js +36707 -0
- package/dist/node/chunks/dep-SmwnYDP9.js +320 -0
- package/dist/node/chunks/dep-cWFO4sv4.js +4 -0
- package/dist/node/chunks/dep-lCKrEJQm.js +31 -0
- package/dist/node/chunks/dep-sDKrrA4S.js +6814 -0
- package/dist/node/chunks/dep-yxQqhtZq.js +4 -0
- package/dist/node/cli.js +624 -865
- package/dist/node/index.d.ts +2723 -3277
- package/dist/node/index.js +24 -188
- package/dist/node/module-runner.d.ts +256 -234
- package/dist/node/module-runner.js +1000 -1178
- package/dist/node/moduleRunnerTransport-BWUZBVLX.d.ts +88 -0
- package/package.json +52 -55
- package/types/importGlob.d.ts +14 -0
- package/types/internal/cssPreprocessorOptions.d.ts +3 -22
- package/types/internal/terserOptions.d.ts +11 -0
- package/types/metadata.d.ts +0 -2
- package/bin/openChrome.applescript +0 -95
- package/dist/node/chunks/dep-3RmXg9uo.js +0 -553
- package/dist/node/chunks/dep-AiMcmC_f.js +0 -822
- package/dist/node/chunks/dep-CvfTChi5.js +0 -8218
- package/dist/node/chunks/dep-DBxKXgDP.js +0 -49496
- package/dist/node/chunks/dep-SgSik2vo.js +0 -7113
- package/dist/node/constants.js +0 -149
- package/dist/node/moduleRunnerTransport.d-DJ_mE5sf.d.ts +0 -87
- package/dist/node-cjs/publicUtils.cjs +0 -3986
- package/index.cjs +0 -96
- package/index.d.cts +0 -6
package/dist/client/env.mjs
CHANGED
@@ -1,24 +1,19 @@
|
|
1
|
+
//#region src/client/env.ts
|
1
2
|
const context = (() => {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
} else if (typeof window !== "undefined") {
|
7
|
-
return window;
|
8
|
-
} else {
|
9
|
-
return Function("return this")();
|
10
|
-
}
|
3
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
4
|
+
else if (typeof self !== "undefined") return self;
|
5
|
+
else if (typeof window !== "undefined") return window;
|
6
|
+
else return Function("return this")();
|
11
7
|
})();
|
12
8
|
const defines = __DEFINES__;
|
13
9
|
Object.keys(defines).forEach((key) => {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
target = target[segment] || (target[segment] = {});
|
22
|
-
}
|
23
|
-
}
|
10
|
+
const segments = key.split(".");
|
11
|
+
let target = context;
|
12
|
+
for (let i = 0; i < segments.length; i++) {
|
13
|
+
const segment = segments[i];
|
14
|
+
if (i === segments.length - 1) target[segment] = defines[key];
|
15
|
+
else target = target[segment] || (target[segment] = {});
|
16
|
+
}
|
24
17
|
});
|
18
|
+
|
19
|
+
//#endregion
|
@@ -0,0 +1,377 @@
|
|
1
|
+
import { __commonJS } from "./dep-lCKrEJQm.js";
|
2
|
+
|
3
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js
|
4
|
+
var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/parse.js": ((exports, module) => {
|
5
|
+
var openParentheses = "(".charCodeAt(0);
|
6
|
+
var closeParentheses = ")".charCodeAt(0);
|
7
|
+
var singleQuote = "'".charCodeAt(0);
|
8
|
+
var doubleQuote = "\"".charCodeAt(0);
|
9
|
+
var backslash = "\\".charCodeAt(0);
|
10
|
+
var slash = "/".charCodeAt(0);
|
11
|
+
var comma = ",".charCodeAt(0);
|
12
|
+
var colon = ":".charCodeAt(0);
|
13
|
+
var star = "*".charCodeAt(0);
|
14
|
+
var uLower = "u".charCodeAt(0);
|
15
|
+
var uUpper = "U".charCodeAt(0);
|
16
|
+
var plus$1 = "+".charCodeAt(0);
|
17
|
+
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
18
|
+
module.exports = function(input) {
|
19
|
+
var tokens = [];
|
20
|
+
var value = input;
|
21
|
+
var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
|
22
|
+
var pos = 0;
|
23
|
+
var code = value.charCodeAt(pos);
|
24
|
+
var max = value.length;
|
25
|
+
var stack = [{ nodes: tokens }];
|
26
|
+
var balanced = 0;
|
27
|
+
var parent;
|
28
|
+
var name = "";
|
29
|
+
var before = "";
|
30
|
+
var after = "";
|
31
|
+
while (pos < max) if (code <= 32) {
|
32
|
+
next = pos;
|
33
|
+
do {
|
34
|
+
next += 1;
|
35
|
+
code = value.charCodeAt(next);
|
36
|
+
} while (code <= 32);
|
37
|
+
token = value.slice(pos, next);
|
38
|
+
prev = tokens[tokens.length - 1];
|
39
|
+
if (code === closeParentheses && balanced) after = token;
|
40
|
+
else if (prev && prev.type === "div") {
|
41
|
+
prev.after = token;
|
42
|
+
prev.sourceEndIndex += token.length;
|
43
|
+
} else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) before = token;
|
44
|
+
else tokens.push({
|
45
|
+
type: "space",
|
46
|
+
sourceIndex: pos,
|
47
|
+
sourceEndIndex: next,
|
48
|
+
value: token
|
49
|
+
});
|
50
|
+
pos = next;
|
51
|
+
} else if (code === singleQuote || code === doubleQuote) {
|
52
|
+
next = pos;
|
53
|
+
quote = code === singleQuote ? "'" : "\"";
|
54
|
+
token = {
|
55
|
+
type: "string",
|
56
|
+
sourceIndex: pos,
|
57
|
+
quote
|
58
|
+
};
|
59
|
+
do {
|
60
|
+
escape = false;
|
61
|
+
next = value.indexOf(quote, next + 1);
|
62
|
+
if (~next) {
|
63
|
+
escapePos = next;
|
64
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
65
|
+
escapePos -= 1;
|
66
|
+
escape = !escape;
|
67
|
+
}
|
68
|
+
} else {
|
69
|
+
value += quote;
|
70
|
+
next = value.length - 1;
|
71
|
+
token.unclosed = true;
|
72
|
+
}
|
73
|
+
} while (escape);
|
74
|
+
token.value = value.slice(pos + 1, next);
|
75
|
+
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
76
|
+
tokens.push(token);
|
77
|
+
pos = next + 1;
|
78
|
+
code = value.charCodeAt(pos);
|
79
|
+
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
80
|
+
next = value.indexOf("*/", pos);
|
81
|
+
token = {
|
82
|
+
type: "comment",
|
83
|
+
sourceIndex: pos,
|
84
|
+
sourceEndIndex: next + 2
|
85
|
+
};
|
86
|
+
if (next === -1) {
|
87
|
+
token.unclosed = true;
|
88
|
+
next = value.length;
|
89
|
+
token.sourceEndIndex = next;
|
90
|
+
}
|
91
|
+
token.value = value.slice(pos + 2, next);
|
92
|
+
tokens.push(token);
|
93
|
+
pos = next + 2;
|
94
|
+
code = value.charCodeAt(pos);
|
95
|
+
} else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
|
96
|
+
token = value[pos];
|
97
|
+
tokens.push({
|
98
|
+
type: "word",
|
99
|
+
sourceIndex: pos - before.length,
|
100
|
+
sourceEndIndex: pos + token.length,
|
101
|
+
value: token
|
102
|
+
});
|
103
|
+
pos += 1;
|
104
|
+
code = value.charCodeAt(pos);
|
105
|
+
} else if (code === slash || code === comma || code === colon) {
|
106
|
+
token = value[pos];
|
107
|
+
tokens.push({
|
108
|
+
type: "div",
|
109
|
+
sourceIndex: pos - before.length,
|
110
|
+
sourceEndIndex: pos + token.length,
|
111
|
+
value: token,
|
112
|
+
before,
|
113
|
+
after: ""
|
114
|
+
});
|
115
|
+
before = "";
|
116
|
+
pos += 1;
|
117
|
+
code = value.charCodeAt(pos);
|
118
|
+
} else if (openParentheses === code) {
|
119
|
+
next = pos;
|
120
|
+
do {
|
121
|
+
next += 1;
|
122
|
+
code = value.charCodeAt(next);
|
123
|
+
} while (code <= 32);
|
124
|
+
parenthesesOpenPos = pos;
|
125
|
+
token = {
|
126
|
+
type: "function",
|
127
|
+
sourceIndex: pos - name.length,
|
128
|
+
value: name,
|
129
|
+
before: value.slice(parenthesesOpenPos + 1, next)
|
130
|
+
};
|
131
|
+
pos = next;
|
132
|
+
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
133
|
+
next -= 1;
|
134
|
+
do {
|
135
|
+
escape = false;
|
136
|
+
next = value.indexOf(")", next + 1);
|
137
|
+
if (~next) {
|
138
|
+
escapePos = next;
|
139
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
140
|
+
escapePos -= 1;
|
141
|
+
escape = !escape;
|
142
|
+
}
|
143
|
+
} else {
|
144
|
+
value += ")";
|
145
|
+
next = value.length - 1;
|
146
|
+
token.unclosed = true;
|
147
|
+
}
|
148
|
+
} while (escape);
|
149
|
+
whitespacePos = next;
|
150
|
+
do {
|
151
|
+
whitespacePos -= 1;
|
152
|
+
code = value.charCodeAt(whitespacePos);
|
153
|
+
} while (code <= 32);
|
154
|
+
if (parenthesesOpenPos < whitespacePos) {
|
155
|
+
if (pos !== whitespacePos + 1) token.nodes = [{
|
156
|
+
type: "word",
|
157
|
+
sourceIndex: pos,
|
158
|
+
sourceEndIndex: whitespacePos + 1,
|
159
|
+
value: value.slice(pos, whitespacePos + 1)
|
160
|
+
}];
|
161
|
+
else token.nodes = [];
|
162
|
+
if (token.unclosed && whitespacePos + 1 !== next) {
|
163
|
+
token.after = "";
|
164
|
+
token.nodes.push({
|
165
|
+
type: "space",
|
166
|
+
sourceIndex: whitespacePos + 1,
|
167
|
+
sourceEndIndex: next,
|
168
|
+
value: value.slice(whitespacePos + 1, next)
|
169
|
+
});
|
170
|
+
} else {
|
171
|
+
token.after = value.slice(whitespacePos + 1, next);
|
172
|
+
token.sourceEndIndex = next;
|
173
|
+
}
|
174
|
+
} else {
|
175
|
+
token.after = "";
|
176
|
+
token.nodes = [];
|
177
|
+
}
|
178
|
+
pos = next + 1;
|
179
|
+
token.sourceEndIndex = token.unclosed ? next : pos;
|
180
|
+
code = value.charCodeAt(pos);
|
181
|
+
tokens.push(token);
|
182
|
+
} else {
|
183
|
+
balanced += 1;
|
184
|
+
token.after = "";
|
185
|
+
token.sourceEndIndex = pos + 1;
|
186
|
+
tokens.push(token);
|
187
|
+
stack.push(token);
|
188
|
+
tokens = token.nodes = [];
|
189
|
+
parent = token;
|
190
|
+
}
|
191
|
+
name = "";
|
192
|
+
} else if (closeParentheses === code && balanced) {
|
193
|
+
pos += 1;
|
194
|
+
code = value.charCodeAt(pos);
|
195
|
+
parent.after = after;
|
196
|
+
parent.sourceEndIndex += after.length;
|
197
|
+
after = "";
|
198
|
+
balanced -= 1;
|
199
|
+
stack[stack.length - 1].sourceEndIndex = pos;
|
200
|
+
stack.pop();
|
201
|
+
parent = stack[balanced];
|
202
|
+
tokens = parent.nodes;
|
203
|
+
} else {
|
204
|
+
next = pos;
|
205
|
+
do {
|
206
|
+
if (code === backslash) next += 1;
|
207
|
+
next += 1;
|
208
|
+
code = value.charCodeAt(next);
|
209
|
+
} 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));
|
210
|
+
token = value.slice(pos, next);
|
211
|
+
if (openParentheses === code) name = token;
|
212
|
+
else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus$1 === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) tokens.push({
|
213
|
+
type: "unicode-range",
|
214
|
+
sourceIndex: pos,
|
215
|
+
sourceEndIndex: next,
|
216
|
+
value: token
|
217
|
+
});
|
218
|
+
else tokens.push({
|
219
|
+
type: "word",
|
220
|
+
sourceIndex: pos,
|
221
|
+
sourceEndIndex: next,
|
222
|
+
value: token
|
223
|
+
});
|
224
|
+
pos = next;
|
225
|
+
}
|
226
|
+
for (pos = stack.length - 1; pos; pos -= 1) {
|
227
|
+
stack[pos].unclosed = true;
|
228
|
+
stack[pos].sourceEndIndex = value.length;
|
229
|
+
}
|
230
|
+
return stack[0].nodes;
|
231
|
+
};
|
232
|
+
}) });
|
233
|
+
|
234
|
+
//#endregion
|
235
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/walk.js
|
236
|
+
var require_walk = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/walk.js": ((exports, module) => {
|
237
|
+
module.exports = function walk$1(nodes, cb, bubble) {
|
238
|
+
var i, max, node, result;
|
239
|
+
for (i = 0, max = nodes.length; i < max; i += 1) {
|
240
|
+
node = nodes[i];
|
241
|
+
if (!bubble) result = cb(node, i, nodes);
|
242
|
+
if (result !== false && node.type === "function" && Array.isArray(node.nodes)) walk$1(node.nodes, cb, bubble);
|
243
|
+
if (bubble) cb(node, i, nodes);
|
244
|
+
}
|
245
|
+
};
|
246
|
+
}) });
|
247
|
+
|
248
|
+
//#endregion
|
249
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/stringify.js
|
250
|
+
var require_stringify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/stringify.js": ((exports, module) => {
|
251
|
+
function stringifyNode(node, custom) {
|
252
|
+
var type = node.type;
|
253
|
+
var value = node.value;
|
254
|
+
var buf;
|
255
|
+
var customResult;
|
256
|
+
if (custom && (customResult = custom(node)) !== void 0) return customResult;
|
257
|
+
else if (type === "word" || type === "space") return value;
|
258
|
+
else if (type === "string") {
|
259
|
+
buf = node.quote || "";
|
260
|
+
return buf + value + (node.unclosed ? "" : buf);
|
261
|
+
} else if (type === "comment") return "/*" + value + (node.unclosed ? "" : "*/");
|
262
|
+
else if (type === "div") return (node.before || "") + value + (node.after || "");
|
263
|
+
else if (Array.isArray(node.nodes)) {
|
264
|
+
buf = stringify$1(node.nodes, custom);
|
265
|
+
if (type !== "function") return buf;
|
266
|
+
return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
|
267
|
+
}
|
268
|
+
return value;
|
269
|
+
}
|
270
|
+
function stringify$1(nodes, custom) {
|
271
|
+
var result, i;
|
272
|
+
if (Array.isArray(nodes)) {
|
273
|
+
result = "";
|
274
|
+
for (i = nodes.length - 1; ~i; i -= 1) result = stringifyNode(nodes[i], custom) + result;
|
275
|
+
return result;
|
276
|
+
}
|
277
|
+
return stringifyNode(nodes, custom);
|
278
|
+
}
|
279
|
+
module.exports = stringify$1;
|
280
|
+
}) });
|
281
|
+
|
282
|
+
//#endregion
|
283
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/unit.js
|
284
|
+
var require_unit = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/unit.js": ((exports, module) => {
|
285
|
+
var minus = "-".charCodeAt(0);
|
286
|
+
var plus = "+".charCodeAt(0);
|
287
|
+
var dot = ".".charCodeAt(0);
|
288
|
+
var exp = "e".charCodeAt(0);
|
289
|
+
var EXP = "E".charCodeAt(0);
|
290
|
+
function likeNumber(value) {
|
291
|
+
var code = value.charCodeAt(0);
|
292
|
+
var nextCode;
|
293
|
+
if (code === plus || code === minus) {
|
294
|
+
nextCode = value.charCodeAt(1);
|
295
|
+
if (nextCode >= 48 && nextCode <= 57) return true;
|
296
|
+
var nextNextCode = value.charCodeAt(2);
|
297
|
+
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) return true;
|
298
|
+
return false;
|
299
|
+
}
|
300
|
+
if (code === dot) {
|
301
|
+
nextCode = value.charCodeAt(1);
|
302
|
+
if (nextCode >= 48 && nextCode <= 57) return true;
|
303
|
+
return false;
|
304
|
+
}
|
305
|
+
if (code >= 48 && code <= 57) return true;
|
306
|
+
return false;
|
307
|
+
}
|
308
|
+
module.exports = function(value) {
|
309
|
+
var pos = 0;
|
310
|
+
var length = value.length;
|
311
|
+
var code;
|
312
|
+
var nextCode;
|
313
|
+
var nextNextCode;
|
314
|
+
if (length === 0 || !likeNumber(value)) return false;
|
315
|
+
code = value.charCodeAt(pos);
|
316
|
+
if (code === plus || code === minus) pos++;
|
317
|
+
while (pos < length) {
|
318
|
+
code = value.charCodeAt(pos);
|
319
|
+
if (code < 48 || code > 57) break;
|
320
|
+
pos += 1;
|
321
|
+
}
|
322
|
+
code = value.charCodeAt(pos);
|
323
|
+
nextCode = value.charCodeAt(pos + 1);
|
324
|
+
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
325
|
+
pos += 2;
|
326
|
+
while (pos < length) {
|
327
|
+
code = value.charCodeAt(pos);
|
328
|
+
if (code < 48 || code > 57) break;
|
329
|
+
pos += 1;
|
330
|
+
}
|
331
|
+
}
|
332
|
+
code = value.charCodeAt(pos);
|
333
|
+
nextCode = value.charCodeAt(pos + 1);
|
334
|
+
nextNextCode = value.charCodeAt(pos + 2);
|
335
|
+
if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
|
336
|
+
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
337
|
+
while (pos < length) {
|
338
|
+
code = value.charCodeAt(pos);
|
339
|
+
if (code < 48 || code > 57) break;
|
340
|
+
pos += 1;
|
341
|
+
}
|
342
|
+
}
|
343
|
+
return {
|
344
|
+
number: value.slice(0, pos),
|
345
|
+
unit: value.slice(pos)
|
346
|
+
};
|
347
|
+
};
|
348
|
+
}) });
|
349
|
+
|
350
|
+
//#endregion
|
351
|
+
//#region ../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/index.js
|
352
|
+
var require_lib = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postcss-value-parser@4.2.0/node_modules/postcss-value-parser/lib/index.js": ((exports, module) => {
|
353
|
+
var parse = require_parse();
|
354
|
+
var walk = require_walk();
|
355
|
+
var stringify = require_stringify();
|
356
|
+
function ValueParser(value) {
|
357
|
+
if (this instanceof ValueParser) {
|
358
|
+
this.nodes = parse(value);
|
359
|
+
return this;
|
360
|
+
}
|
361
|
+
return new ValueParser(value);
|
362
|
+
}
|
363
|
+
ValueParser.prototype.toString = function() {
|
364
|
+
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
365
|
+
};
|
366
|
+
ValueParser.prototype.walk = function(cb, bubble) {
|
367
|
+
walk(this.nodes, cb, bubble);
|
368
|
+
return this;
|
369
|
+
};
|
370
|
+
ValueParser.unit = require_unit();
|
371
|
+
ValueParser.walk = walk;
|
372
|
+
ValueParser.stringify = stringify;
|
373
|
+
module.exports = ValueParser;
|
374
|
+
}) });
|
375
|
+
|
376
|
+
//#endregion
|
377
|
+
export { require_lib };
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import "./dep-SmwnYDP9.js";
|
2
|
+
import { BuildEnvironment, build, buildEnvironmentOptionsDefaults, builderOptionsDefaults, createBuilder, createToImportMetaURLBasedRelativeRuntime, injectEnvironmentToHooks, onRollupLog, resolveBuildEnvironmentOptions, resolveBuildOutputs, resolveBuildPlugins, resolveBuilderOptions, resolveLibFilename, resolveUserExternal, toOutputFilePathInCss, toOutputFilePathInHtml, toOutputFilePathInJS, toOutputFilePathWithoutRuntime } from "./dep-M_KD0XSK.js";
|
3
|
+
|
4
|
+
export { createBuilder, resolveBuildPlugins };
|