vite-plus 0.1.8 → 0.1.10
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/dist/config/agent.d.ts +2 -2
- package/dist/config/agent.js +14 -47
- package/dist/global/{agent-CA64n2mH.js → agent-BinmPKap.js} +43 -37
- package/dist/global/config.js +10 -39
- package/dist/global/create.js +2 -2
- package/dist/global/migrate.js +2 -2
- package/dist/global/src-B-pcmd0F.js +250 -0
- package/dist/global/staged.js +1 -1
- package/dist/global/{workspace-CpFQmwjZ.js → workspace-rbERvHOo.js} +1 -1
- package/dist/pack-bin.js +1 -0
- package/dist/run-config.d.ts +11 -0
- package/dist/test/plugins/mocker-transforms.js +1 -0
- package/dist/test/plugins/utils-source-map-node.js +1 -0
- package/dist/test/runtime.d.ts +2 -0
- package/dist/test/runtime.js +1 -0
- package/dist/utils/agent.d.ts +1 -0
- package/dist/utils/agent.js +13 -0
- package/package.json +21 -19
- package/dist/global/src-DwSJ0s0I.js +0 -249
- package/dist/test/internal/module-runner.d.ts +0 -2
- package/dist/test/internal/module-runner.js +0 -1
- package/dist/test/mocker.d.ts +0 -2
- package/dist/test/mocker.js +0 -1
package/dist/config/agent.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type AgentConfig } from '../utils/agent.js';
|
|
1
|
+
import { hasExistingAgentInstructions, type AgentConfig } from '../utils/agent.js';
|
|
2
2
|
export interface AgentSetupSelection {
|
|
3
3
|
instructionFilePath: 'CLAUDE.md' | 'AGENTS.md';
|
|
4
4
|
agents: AgentConfig[];
|
|
5
5
|
}
|
|
6
6
|
export declare function resolveAgentSetup(root: string, interactive: boolean): Promise<AgentSetupSelection>;
|
|
7
|
-
export
|
|
7
|
+
export { hasExistingAgentInstructions };
|
|
8
8
|
export declare function injectAgentBlock(root: string, filePath: string): void;
|
|
9
9
|
export declare function setupMcpConfig(root: string, selectedAgents: AgentConfig[]): void;
|
package/dist/config/agent.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import * as prompts from '@voidzero-dev/vite-plus-prompts';
|
|
4
|
-
import { detectAgents, getAgentById, } from '../utils/agent.js';
|
|
4
|
+
import { detectAgents, getAgentById, hasExistingAgentInstructions, replaceMarkedAgentInstructionsSection, } from '../utils/agent.js';
|
|
5
5
|
import { writeJsonFile, readJsonFile } from '../utils/json.js';
|
|
6
6
|
import { pkgRoot } from '../utils/path.js';
|
|
7
7
|
function detectInstructionFilePath(root, agentConfigs) {
|
|
@@ -56,69 +56,36 @@ export async function resolveAgentSetup(root, interactive) {
|
|
|
56
56
|
}
|
|
57
57
|
return pickAgentWhenUndetected();
|
|
58
58
|
}
|
|
59
|
-
// ---
|
|
60
|
-
function getOwnVersion() {
|
|
61
|
-
const pkg = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf-8'));
|
|
62
|
-
if (typeof pkg.version !== 'string') {
|
|
63
|
-
throw new Error('vite-plus package.json is missing a "version" field');
|
|
64
|
-
}
|
|
65
|
-
return pkg.version;
|
|
66
|
-
}
|
|
59
|
+
// --- Template reading ---
|
|
67
60
|
function readAgentPrompt() {
|
|
68
61
|
return readFileSync(join(pkgRoot, 'AGENTS.md'), 'utf-8');
|
|
69
62
|
}
|
|
70
|
-
// ---
|
|
71
|
-
|
|
72
|
-
const MARKER_CLOSE = '<!--/injected-by-vite-plus-->';
|
|
73
|
-
const MARKER_BLOCK_RE = /<!--injected-by-vite-plus-v[\w.+-]+-->\n[\s\S]*?<!--\/injected-by-vite-plus-->/;
|
|
74
|
-
export function hasExistingAgentInstructions(root) {
|
|
75
|
-
for (const file of ['AGENTS.md', 'CLAUDE.md']) {
|
|
76
|
-
const fullPath = join(root, file);
|
|
77
|
-
if (existsSync(fullPath)) {
|
|
78
|
-
const content = readFileSync(fullPath, 'utf-8');
|
|
79
|
-
if (MARKER_OPEN_RE.test(content)) {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
63
|
+
// --- Agent instructions injection ---
|
|
64
|
+
export { hasExistingAgentInstructions };
|
|
86
65
|
export function injectAgentBlock(root, filePath) {
|
|
87
66
|
const fullPath = join(root, filePath);
|
|
88
|
-
const
|
|
89
|
-
const promptContent = readAgentPrompt();
|
|
90
|
-
const openMarker = `<!--injected-by-vite-plus-v${version}-->`;
|
|
91
|
-
const block = `${openMarker}\n${promptContent}\n${MARKER_CLOSE}`;
|
|
67
|
+
const template = readAgentPrompt();
|
|
92
68
|
if (existsSync(fullPath)) {
|
|
93
69
|
const existing = readFileSync(fullPath, 'utf-8');
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
// Replace existing block with updated version
|
|
101
|
-
const updated = existing.replace(MARKER_BLOCK_RE, block);
|
|
102
|
-
if (updated === existing) {
|
|
103
|
-
// Closing marker is missing or malformed — append fresh block
|
|
104
|
-
const separator = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
105
|
-
writeFileSync(fullPath, existing + separator + block + '\n');
|
|
106
|
-
prompts.log.warn(`Existing Vite+ block in ${filePath} was malformed; appended fresh block`);
|
|
70
|
+
const updated = replaceMarkedAgentInstructionsSection(existing, template);
|
|
71
|
+
if (updated !== undefined) {
|
|
72
|
+
if (updated !== existing) {
|
|
73
|
+
writeFileSync(fullPath, updated);
|
|
74
|
+
prompts.log.success(`Updated Vite+ instructions in ${filePath}`);
|
|
107
75
|
}
|
|
108
76
|
else {
|
|
109
|
-
|
|
110
|
-
prompts.log.success(`Updated Vite+ instructions in ${filePath} (v${match[1]} → v${version})`);
|
|
77
|
+
prompts.log.info(`${filePath} already has up-to-date Vite+ instructions`);
|
|
111
78
|
}
|
|
112
79
|
}
|
|
113
80
|
else {
|
|
114
|
-
//
|
|
81
|
+
// No markers found — append template
|
|
115
82
|
const separator = existing.endsWith('\n') ? '\n' : '\n\n';
|
|
116
|
-
writeFileSync(fullPath, existing + separator +
|
|
83
|
+
writeFileSync(fullPath, existing + separator + template);
|
|
117
84
|
prompts.log.success(`Added Vite+ instructions to ${filePath}`);
|
|
118
85
|
}
|
|
119
86
|
}
|
|
120
87
|
else {
|
|
121
|
-
writeFileSync(fullPath,
|
|
88
|
+
writeFileSync(fullPath, template);
|
|
122
89
|
prompts.log.success(`Created ${filePath} with Vite+ instructions`);
|
|
123
90
|
}
|
|
124
91
|
}
|
|
@@ -2,18 +2,18 @@ import { t as __commonJSMin } from "./chunk-CgnkrU7a.js";
|
|
|
2
2
|
import { o as DEFAULT_ENVS, u as resolve$1 } from "./json-BRdVJ52a.js";
|
|
3
3
|
import { n as accent } from "./help-CbTzUdXc.js";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { stripVTControlCharacters } from "node:util";
|
|
6
|
-
import color from "picocolors";
|
|
5
|
+
import { stripVTControlCharacters, styleText } from "node:util";
|
|
7
6
|
import process$1, { stdin, stdout } from "node:process";
|
|
8
7
|
import * as k from "node:readline";
|
|
9
8
|
import ot from "node:readline";
|
|
10
9
|
import { ReadStream } from "node:tty";
|
|
10
|
+
import color from "picocolors";
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import { downloadPackageManager } from "../../binding/index.js";
|
|
13
13
|
import spawn from "cross-spawn";
|
|
14
14
|
import fsPromises from "node:fs/promises";
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../../node_modules/.pnpm/@clack+core@1.0
|
|
16
|
+
//#region ../../node_modules/.pnpm/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
|
|
17
17
|
var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
18
18
|
const ESC = "\x1B";
|
|
19
19
|
const CSI = `${ESC}[`;
|
|
@@ -66,10 +66,10 @@ var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
66
66
|
beep
|
|
67
67
|
};
|
|
68
68
|
})))();
|
|
69
|
-
function
|
|
69
|
+
function x(t, e, s) {
|
|
70
70
|
if (!s.some((u) => !u.disabled)) return t;
|
|
71
71
|
const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
|
|
72
|
-
return s[n].disabled ?
|
|
72
|
+
return s[n].disabled ? x(n, e < 0 ? -1 : 1, s) : n;
|
|
73
73
|
}
|
|
74
74
|
const at = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170 || t === 173 || t === 174 || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || t === 198 || t === 208 || t === 215 || t === 216 || t >= 222 && t <= 225 || t === 230 || t >= 232 && t <= 234 || t === 236 || t === 237 || t === 240 || t === 242 || t === 243 || t >= 247 && t <= 250 || t === 252 || t === 254 || t === 257 || t === 273 || t === 275 || t === 283 || t === 294 || t === 295 || t === 299 || t >= 305 && t <= 307 || t === 312 || t >= 319 && t <= 322 || t === 324 || t >= 328 && t <= 331 || t === 333 || t === 338 || t === 339 || t === 358 || t === 359 || t === 363 || t === 462 || t === 464 || t === 466 || t === 468 || t === 470 || t === 472 || t === 474 || t === 476 || t === 593 || t === 609 || t === 708 || t === 711 || t >= 713 && t <= 715 || t === 717 || t === 720 || t >= 728 && t <= 731 || t === 733 || t === 735 || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || t === 1025 || t >= 1040 && t <= 1103 || t === 1105 || t === 8208 || t >= 8211 && t <= 8214 || t === 8216 || t === 8217 || t === 8220 || t === 8221 || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || t === 8240 || t === 8242 || t === 8243 || t === 8245 || t === 8251 || t === 8254 || t === 8308 || t === 8319 || t >= 8321 && t <= 8324 || t === 8364 || t === 8451 || t === 8453 || t === 8457 || t === 8467 || t === 8470 || t === 8481 || t === 8482 || t === 8486 || t === 8491 || t === 8531 || t === 8532 || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || t === 8585 || t >= 8592 && t <= 8601 || t === 8632 || t === 8633 || t === 8658 || t === 8660 || t === 8679 || t === 8704 || t === 8706 || t === 8707 || t === 8711 || t === 8712 || t === 8715 || t === 8719 || t === 8721 || t === 8725 || t === 8730 || t >= 8733 && t <= 8736 || t === 8739 || t === 8741 || t >= 8743 && t <= 8748 || t === 8750 || t >= 8756 && t <= 8759 || t === 8764 || t === 8765 || t === 8776 || t === 8780 || t === 8786 || t === 8800 || t === 8801 || t >= 8804 && t <= 8807 || t === 8810 || t === 8811 || t === 8814 || t === 8815 || t === 8834 || t === 8835 || t === 8838 || t === 8839 || t === 8853 || t === 8857 || t === 8869 || t === 8895 || t === 8978 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || t === 9632 || t === 9633 || t >= 9635 && t <= 9641 || t === 9650 || t === 9651 || t === 9654 || t === 9655 || t === 9660 || t === 9661 || t === 9664 || t === 9665 || t >= 9670 && t <= 9672 || t === 9675 || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || t === 9711 || t === 9733 || t === 9734 || t === 9737 || t === 9742 || t === 9743 || t === 9756 || t === 9758 || t === 9792 || t === 9794 || t === 9824 || t === 9825 || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || t === 9836 || t === 9837 || t === 9839 || t === 9886 || t === 9887 || t === 9919 || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || t === 9955 || t === 9960 || t === 9961 || t >= 9963 && t <= 9969 || t === 9972 || t >= 9974 && t <= 9977 || t === 9979 || t === 9980 || t === 9982 || t === 9983 || t === 10045 || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || t === 65533 || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || t === 127375 || t === 127376 || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109, lt = (t) => t === 12288 || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510, ht = (t) => t >= 4352 && t <= 4447 || t === 8986 || t === 8987 || t === 9001 || t === 9002 || t >= 9193 && t <= 9196 || t === 9200 || t === 9203 || t === 9725 || t === 9726 || t === 9748 || t === 9749 || t >= 9800 && t <= 9811 || t === 9855 || t === 9875 || t === 9889 || t === 9898 || t === 9899 || t === 9917 || t === 9918 || t === 9924 || t === 9925 || t === 9934 || t === 9940 || t === 9962 || t === 9970 || t === 9971 || t === 9973 || t === 9978 || t === 9981 || t === 9989 || t === 9994 || t === 9995 || t === 10024 || t === 10060 || t === 10062 || t >= 10067 && t <= 10069 || t === 10071 || t >= 10133 && t <= 10135 || t === 10160 || t === 10175 || t === 11035 || t === 11036 || t === 11088 || t === 11093 || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || t === 94192 || t === 94193 || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || t === 110589 || t === 110590 || t >= 110592 && t <= 110882 || t === 110898 || t >= 110928 && t <= 110930 || t === 110933 || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || t === 126980 || t === 127183 || t === 127374 || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || t === 127568 || t === 127569 || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || t === 127988 || t >= 127992 && t <= 128062 || t === 128064 || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || t === 128378 || t === 128405 || t === 128406 || t === 128420 || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || t === 128716 || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || t === 128747 || t === 128748 || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || t === 129008 || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141, O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, L = /\t{1,1000}/y, P = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy, M = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, ct = /\p{M}+/gu, ft = {
|
|
75
75
|
limit: Infinity,
|
|
@@ -144,7 +144,7 @@ const at = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170
|
|
|
144
144
|
limit: Infinity,
|
|
145
145
|
ellipsis: "",
|
|
146
146
|
ellipsisWidth: 0
|
|
147
|
-
}, S = (t, e = {}) => X(t, pt, e).width,
|
|
147
|
+
}, S = (t, e = {}) => X(t, pt, e).width, T = "\x1B", Z = "", Ft = 39, j = "\x07", Q = "[", dt = "]", tt = "m", U = `${dt}8;;`, et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${U}(?<uri>.*)${j})`, "y"), mt = (t) => {
|
|
148
148
|
if (t >= 30 && t <= 37 || t >= 90 && t <= 97) return 39;
|
|
149
149
|
if (t >= 40 && t <= 47 || t >= 100 && t <= 107) return 49;
|
|
150
150
|
if (t === 1 || t === 2) return 22;
|
|
@@ -154,12 +154,12 @@ const at = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170
|
|
|
154
154
|
if (t === 8) return 28;
|
|
155
155
|
if (t === 9) return 29;
|
|
156
156
|
if (t === 0) return 0;
|
|
157
|
-
}, st = (t) => `${
|
|
157
|
+
}, st = (t) => `${T}${Q}${t}${tt}`, it = (t) => `${T}${U}${t}${j}`, gt = (t) => t.map((e) => S(e)), G = (t, e, s) => {
|
|
158
158
|
const i = e[Symbol.iterator]();
|
|
159
159
|
let r = !1, n = !1, u = t.at(-1), a = u === void 0 ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
|
|
160
160
|
for (; !l.done;) {
|
|
161
161
|
const m = l.value, A = S(m);
|
|
162
|
-
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m ===
|
|
162
|
+
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === T || m === Z) && (r = !0, n = e.startsWith(U, g + 1)), r ? n ? m === j && (r = !1, n = !1) : m === tt && (r = !1) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
|
|
163
163
|
}
|
|
164
164
|
u = t.at(-1), !a && u !== void 0 && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
165
165
|
}, vt = (t) => {
|
|
@@ -199,7 +199,7 @@ const at = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170
|
|
|
199
199
|
let m = g.next(), A = g.next(), V = 0;
|
|
200
200
|
for (; !m.done;) {
|
|
201
201
|
const h = m.value, o = A.value;
|
|
202
|
-
if (i += h, h ===
|
|
202
|
+
if (i += h, h === T || h === Z) {
|
|
203
203
|
et.lastIndex = V + 1;
|
|
204
204
|
const F = et.exec(E)?.groups;
|
|
205
205
|
if (F?.code !== void 0) {
|
|
@@ -267,11 +267,11 @@ const bt = globalThis.process.platform.startsWith("win"), z = Symbol("clack:canc
|
|
|
267
267
|
function Ct(t) {
|
|
268
268
|
return t === z;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function W(t, e) {
|
|
271
271
|
const s = t;
|
|
272
272
|
s.isTTY && s.setRawMode(e);
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function xt({ input: t = stdin, output: e = stdout, overwrite: s = !0, hideCursor: i = !0 } = {}) {
|
|
275
275
|
const r = k.createInterface({
|
|
276
276
|
input: t,
|
|
277
277
|
output: e,
|
|
@@ -301,7 +301,7 @@ function Bt({ input: t = stdin, output: e = stdout, overwrite: s = !0, hideCurso
|
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
const rt = (t) => "columns" in t && typeof t.columns == "number" ? t.columns : 80, nt = (t) => "rows" in t && typeof t.rows == "number" ? t.rows : 20;
|
|
304
|
-
function
|
|
304
|
+
function Bt(t, e, s, i = s) {
|
|
305
305
|
return K(e, rt(t ?? stdout) - s.length, {
|
|
306
306
|
hard: !0,
|
|
307
307
|
trim: !1
|
|
@@ -309,7 +309,7 @@ function xt(t, e, s, i = s) {
|
|
|
309
309
|
`).map((n, u) => `${u === 0 ? i : s}${n}`).join(`
|
|
310
310
|
`);
|
|
311
311
|
}
|
|
312
|
-
var
|
|
312
|
+
var B = class {
|
|
313
313
|
input;
|
|
314
314
|
output;
|
|
315
315
|
_abortSignal;
|
|
@@ -363,10 +363,10 @@ var x = class {
|
|
|
363
363
|
prompt: "",
|
|
364
364
|
escapeCodeTimeout: 50,
|
|
365
365
|
terminal: !0
|
|
366
|
-
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress),
|
|
367
|
-
this.output.write(import_src.cursor.show), this.output.off("resize", this.render),
|
|
366
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), W(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
367
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), W(this.input, !1), e(this.value);
|
|
368
368
|
}), this.once("cancel", () => {
|
|
369
|
-
this.output.write(import_src.cursor.show), this.output.off("resize", this.render),
|
|
369
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), W(this.input, !1), e(z);
|
|
370
370
|
});
|
|
371
371
|
});
|
|
372
372
|
}
|
|
@@ -404,7 +404,7 @@ var x = class {
|
|
|
404
404
|
}
|
|
405
405
|
close() {
|
|
406
406
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
407
|
-
`),
|
|
407
|
+
`), W(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
408
408
|
}
|
|
409
409
|
restoreCursor() {
|
|
410
410
|
const e = K(this._prevFrame, process.stdout.columns, {
|
|
@@ -456,7 +456,7 @@ var x = class {
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
var kt = class extends
|
|
459
|
+
var kt = class extends B {
|
|
460
460
|
get cursor() {
|
|
461
461
|
return this.value ? 0 : 1;
|
|
462
462
|
}
|
|
@@ -473,7 +473,7 @@ var kt = class extends x {
|
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
|
-
|
|
476
|
+
let Lt = class extends B {
|
|
477
477
|
options;
|
|
478
478
|
cursor = 0;
|
|
479
479
|
get _value() {
|
|
@@ -498,17 +498,17 @@ var Lt = class extends x {
|
|
|
498
498
|
constructor(e) {
|
|
499
499
|
super(e, !1), this.options = e.options, this.value = [...e.initialValues ?? []];
|
|
500
500
|
const s = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), 0);
|
|
501
|
-
this.cursor = this.options[s].disabled ?
|
|
501
|
+
this.cursor = this.options[s].disabled ? x(s, 1, this.options) : s, this.on("key", (i) => {
|
|
502
502
|
i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
|
|
503
503
|
}), this.on("cursor", (i) => {
|
|
504
504
|
switch (i) {
|
|
505
505
|
case "left":
|
|
506
506
|
case "up":
|
|
507
|
-
this.cursor =
|
|
507
|
+
this.cursor = x(this.cursor, -1, this.options);
|
|
508
508
|
break;
|
|
509
509
|
case "down":
|
|
510
510
|
case "right":
|
|
511
|
-
this.cursor =
|
|
511
|
+
this.cursor = x(this.cursor, 1, this.options);
|
|
512
512
|
break;
|
|
513
513
|
case "space":
|
|
514
514
|
this.toggleValue();
|
|
@@ -517,7 +517,7 @@ var Lt = class extends x {
|
|
|
517
517
|
});
|
|
518
518
|
}
|
|
519
519
|
};
|
|
520
|
-
var
|
|
520
|
+
var Tt = class extends B {
|
|
521
521
|
options;
|
|
522
522
|
cursor = 0;
|
|
523
523
|
get _selectedValue() {
|
|
@@ -529,28 +529,28 @@ var Wt = class extends x {
|
|
|
529
529
|
constructor(e) {
|
|
530
530
|
super(e, !1), this.options = e.options;
|
|
531
531
|
const s = this.options.findIndex(({ value: r }) => r === e.initialValue), i = s === -1 ? 0 : s;
|
|
532
|
-
this.cursor = this.options[i].disabled ?
|
|
532
|
+
this.cursor = this.options[i].disabled ? x(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
|
|
533
533
|
switch (r) {
|
|
534
534
|
case "left":
|
|
535
535
|
case "up":
|
|
536
|
-
this.cursor =
|
|
536
|
+
this.cursor = x(this.cursor, -1, this.options);
|
|
537
537
|
break;
|
|
538
538
|
case "down":
|
|
539
539
|
case "right":
|
|
540
|
-
this.cursor =
|
|
540
|
+
this.cursor = x(this.cursor, 1, this.options);
|
|
541
541
|
break;
|
|
542
542
|
}
|
|
543
543
|
this.changeValue();
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
|
-
var $t = class extends
|
|
547
|
+
var $t = class extends B {
|
|
548
548
|
get userInputWithCursor() {
|
|
549
549
|
if (this.state === "submit") return this.userInput;
|
|
550
550
|
const e = this.userInput;
|
|
551
551
|
if (this.cursor >= e.length) return `${this.userInput}\u2588`;
|
|
552
552
|
const s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
|
|
553
|
-
return `${s}${
|
|
553
|
+
return `${s}${styleText("inverse", i)}${r.join("")}`;
|
|
554
554
|
}
|
|
555
555
|
get cursor() {
|
|
556
556
|
return this._cursor;
|
|
@@ -1131,7 +1131,7 @@ const multiselect = (opts) => {
|
|
|
1131
1131
|
const formatMessageLines = (message) => {
|
|
1132
1132
|
return message.split("\n").map((line, index) => `${index === 0 ? `${symbol(this.state)} ` : nestedPrefix}${line}`).join("\n");
|
|
1133
1133
|
};
|
|
1134
|
-
const wrappedMessage = hasGuide ?
|
|
1134
|
+
const wrappedMessage = hasGuide ? Bt(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
|
|
1135
1135
|
const title = `${hasGuide ? `${color.gray(S_BAR)}\n` : ""}${wrappedMessage}\n`;
|
|
1136
1136
|
const value = this.value ?? [];
|
|
1137
1137
|
const styleOption = (option, active) => {
|
|
@@ -1145,13 +1145,13 @@ const multiselect = (opts) => {
|
|
|
1145
1145
|
case "submit": {
|
|
1146
1146
|
const submitText = this.options.filter(({ value: optionValue }) => value.includes(optionValue)).map((option) => opt(option, "submitted")).join(color.dim(", ")) || color.dim("none");
|
|
1147
1147
|
const submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : nestedPrefix;
|
|
1148
|
-
return `${title}${
|
|
1148
|
+
return `${title}${Bt(opts.output, submitText, submitPrefix)}\n`;
|
|
1149
1149
|
}
|
|
1150
1150
|
case "cancel": {
|
|
1151
1151
|
const label = this.options.filter(({ value: optionValue }) => value.includes(optionValue)).map((option) => opt(option, "cancelled")).join(color.dim(", "));
|
|
1152
1152
|
if (label.trim() === "") return hasGuide ? `${title}${color.gray(S_BAR)}\n` : `${title.trimEnd()}\n`;
|
|
1153
1153
|
const cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : nestedPrefix;
|
|
1154
|
-
const wrappedLabel =
|
|
1154
|
+
const wrappedLabel = Bt(opts.output, label, cancelPrefix);
|
|
1155
1155
|
return hasGuide ? `${title}${wrappedLabel}\n${color.gray(S_BAR)}\n` : `${title}${wrappedLabel}\n`;
|
|
1156
1156
|
}
|
|
1157
1157
|
case "error": {
|
|
@@ -1293,7 +1293,7 @@ const spinner = ({ indicator = "dots", onCancel, output = process.stdout, cancel
|
|
|
1293
1293
|
const hasGuide = opts.withGuide ?? false;
|
|
1294
1294
|
const startLoop = () => {
|
|
1295
1295
|
isSpinnerActive = true;
|
|
1296
|
-
unblock =
|
|
1296
|
+
unblock = xt({ output });
|
|
1297
1297
|
_origin = performance.now();
|
|
1298
1298
|
_prevMessage = void 0;
|
|
1299
1299
|
if (hasGuide) output.write(`${color.gray(S_BAR)}\n`);
|
|
@@ -1395,7 +1395,7 @@ const select = (opts) => {
|
|
|
1395
1395
|
default: return withMarker(color.dim(" "), label, (text) => text, hint);
|
|
1396
1396
|
}
|
|
1397
1397
|
};
|
|
1398
|
-
return new
|
|
1398
|
+
return new Tt({
|
|
1399
1399
|
options: opts.options,
|
|
1400
1400
|
signal: opts.signal,
|
|
1401
1401
|
input: opts.input,
|
|
@@ -1408,16 +1408,16 @@ const select = (opts) => {
|
|
|
1408
1408
|
return message.split("\n").map((line, index) => `${index === 0 ? `${symbol(this.state)} ` : nestedPrefix}${line}`).join("\n");
|
|
1409
1409
|
};
|
|
1410
1410
|
const hasMessage = opts.message.trim().length > 0;
|
|
1411
|
-
const messageLines = !hasMessage ? "" : hasGuide ?
|
|
1411
|
+
const messageLines = !hasMessage ? "" : hasGuide ? Bt(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
|
|
1412
1412
|
const title = hasMessage ? `${hasGuide ? `${color.gray(S_BAR)}\n` : ""}${messageLines}\n` : "";
|
|
1413
1413
|
switch (this.state) {
|
|
1414
1414
|
case "submit": {
|
|
1415
1415
|
const submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : nestedPrefix;
|
|
1416
|
-
return `${title}${
|
|
1416
|
+
return `${title}${Bt(opts.output, opt(this.options[this.cursor], "selected"), submitPrefix)}\n`;
|
|
1417
1417
|
}
|
|
1418
1418
|
case "cancel": {
|
|
1419
1419
|
const cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : nestedPrefix;
|
|
1420
|
-
return `${title}${
|
|
1420
|
+
return `${title}${Bt(opts.output, opt(this.options[this.cursor], "cancelled"), cancelPrefix)}${hasGuide ? `\n${color.gray(S_BAR)}` : ""}\n`;
|
|
1421
1421
|
}
|
|
1422
1422
|
default: {
|
|
1423
1423
|
const prefix = hasGuide ? `${color.blue(S_BAR)} ` : nestedPrefix;
|
|
@@ -1986,6 +1986,12 @@ function detectExistingAgentTargetPaths(projectRoot) {
|
|
|
1986
1986
|
}
|
|
1987
1987
|
return detectedPaths.length > 0 ? detectedPaths : void 0;
|
|
1988
1988
|
}
|
|
1989
|
+
function hasExistingAgentInstructions(projectRoot) {
|
|
1990
|
+
const targetPaths = detectExistingAgentTargetPaths(projectRoot);
|
|
1991
|
+
if (!targetPaths) return false;
|
|
1992
|
+
for (const targetPath of targetPaths) if (fs.readFileSync(path.join(projectRoot, targetPath), "utf-8").includes(AGENT_INSTRUCTIONS_START_MARKER)) return true;
|
|
1993
|
+
return false;
|
|
1994
|
+
}
|
|
1989
1995
|
function resolveAgentTargetPaths(agent) {
|
|
1990
1996
|
const agentNames = parseAgentNames(agent);
|
|
1991
1997
|
const resolvedAgentNames = agentNames.length > 0 ? agentNames : ["other"];
|
|
@@ -2165,4 +2171,4 @@ function getMarkedRange(content, startMarker, endMarker) {
|
|
|
2165
2171
|
};
|
|
2166
2172
|
}
|
|
2167
2173
|
//#endregion
|
|
2168
|
-
export {
|
|
2174
|
+
export { note as A, DependencyType as C, intro as D, confirm as E, Ct as F, select as M, spinner as N, log as O, text as P, runCommandSilently as S, cancel as T, upgradeYarn as _, hasExistingAgentInstructions as a, rulesDir as b, writeAgentInstructions as c, downloadPackageManager$1 as d, getSpinner as f, selectPackageManager as g, runViteInstall as h, getAgentById as i, outro as j, multiselect as k, cancelAndExit as l, runViteFmt as m, detectAgents as n, replaceMarkedAgentInstructionsSection as o, promptGitHooks as p, detectExistingAgentTargetPaths as r, selectAgentTargetPaths as s, detectAgentConflicts as t, defaultInteractive as u, displayRelative as v, PackageManager as w, templatesDir as x, pkgRoot as y };
|
package/dist/global/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as note, F as Ct, M as select, O as log, T as cancel, a as hasExistingAgentInstructions, i as getAgentById, n as detectAgents, o as replaceMarkedAgentInstructionsSection, p as promptGitHooks, u as defaultInteractive, y as pkgRoot } from "./agent-BinmPKap.js";
|
|
2
2
|
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
3
3
|
import { i as writeJsonFile, r as readJsonFile, s as VITE_PLUS_NAME } from "./json-BRdVJ52a.js";
|
|
4
4
|
import { i as log$1, t as renderCliDoc } from "./help-CbTzUdXc.js";
|
|
@@ -151,54 +151,25 @@ async function resolveAgentSetup(root, interactive) {
|
|
|
151
151
|
};
|
|
152
152
|
return pickAgentWhenUndetected();
|
|
153
153
|
}
|
|
154
|
-
function getOwnVersion() {
|
|
155
|
-
const pkg = JSON.parse(readFileSync(join(pkgRoot, "package.json"), "utf-8"));
|
|
156
|
-
if (typeof pkg.version !== "string") throw new Error("vite-plus package.json is missing a \"version\" field");
|
|
157
|
-
return pkg.version;
|
|
158
|
-
}
|
|
159
154
|
function readAgentPrompt() {
|
|
160
155
|
return readFileSync(join(pkgRoot, "AGENTS.md"), "utf-8");
|
|
161
156
|
}
|
|
162
|
-
const MARKER_OPEN_RE = /<!--injected-by-vite-plus-v([\w.+-]+)-->/;
|
|
163
|
-
const MARKER_CLOSE = "<!--/injected-by-vite-plus-->";
|
|
164
|
-
const MARKER_BLOCK_RE = /<!--injected-by-vite-plus-v[\w.+-]+-->\n[\s\S]*?<!--\/injected-by-vite-plus-->/;
|
|
165
|
-
function hasExistingAgentInstructions(root) {
|
|
166
|
-
for (const file of ["AGENTS.md", "CLAUDE.md"]) {
|
|
167
|
-
const fullPath = join(root, file);
|
|
168
|
-
if (existsSync(fullPath)) {
|
|
169
|
-
const content = readFileSync(fullPath, "utf-8");
|
|
170
|
-
if (MARKER_OPEN_RE.test(content)) return true;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
157
|
function injectAgentBlock(root, filePath) {
|
|
176
158
|
const fullPath = join(root, filePath);
|
|
177
|
-
const
|
|
178
|
-
const promptContent = readAgentPrompt();
|
|
179
|
-
const block = `${`<!--injected-by-vite-plus-v${version}-->`}\n${promptContent}\n${MARKER_CLOSE}`;
|
|
159
|
+
const template = readAgentPrompt();
|
|
180
160
|
if (existsSync(fullPath)) {
|
|
181
161
|
const existing = readFileSync(fullPath, "utf-8");
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (updated === existing) {
|
|
190
|
-
writeFileSync(fullPath, existing + (existing.endsWith("\n") ? "\n" : "\n\n") + block + "\n");
|
|
191
|
-
log.warn(`Existing Vite+ block in ${filePath} was malformed; appended fresh block`);
|
|
192
|
-
} else {
|
|
193
|
-
writeFileSync(fullPath, updated);
|
|
194
|
-
log.success(`Updated Vite+ instructions in ${filePath} (v${match[1]} → v${version})`);
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
writeFileSync(fullPath, existing + (existing.endsWith("\n") ? "\n" : "\n\n") + block + "\n");
|
|
162
|
+
const updated = replaceMarkedAgentInstructionsSection(existing, template);
|
|
163
|
+
if (updated !== void 0) if (updated !== existing) {
|
|
164
|
+
writeFileSync(fullPath, updated);
|
|
165
|
+
log.success(`Updated Vite+ instructions in ${filePath}`);
|
|
166
|
+
} else log.info(`${filePath} already has up-to-date Vite+ instructions`);
|
|
167
|
+
else {
|
|
168
|
+
writeFileSync(fullPath, existing + (existing.endsWith("\n") ? "\n" : "\n\n") + template);
|
|
198
169
|
log.success(`Added Vite+ instructions to ${filePath}`);
|
|
199
170
|
}
|
|
200
171
|
} else {
|
|
201
|
-
writeFileSync(fullPath,
|
|
172
|
+
writeFileSync(fullPath, template);
|
|
202
173
|
log.success(`Created ${filePath} with Vite+ instructions`);
|
|
203
174
|
}
|
|
204
175
|
}
|
package/dist/global/create.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, t as __commonJSMin } from "./chunk-CgnkrU7a.js";
|
|
2
|
-
import {
|
|
2
|
+
import { C as DependencyType, D as intro, E as confirm, F as Ct, M as select, N as spinner, O as log, P as text, T as cancel, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, k as multiselect, m as runViteFmt, p as promptGitHooks, r as detectExistingAgentTargetPaths, s as selectAgentTargetPaths, u as defaultInteractive, v as displayRelative, w as PackageManager, x as templatesDir } from "./agent-BinmPKap.js";
|
|
3
3
|
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
4
|
-
import { _ as rewriteMonorepo, a as detectExistingEditor, f as installGitHooks, n as updatePackageJsonWithDeps, o as selectEditor, r as updateWorkspaceConfig, s as writeEditorConfigs, t as detectWorkspace$1, v as rewriteMonorepoProject, y as rewriteStandaloneProject } from "./workspace-
|
|
4
|
+
import { _ as rewriteMonorepo, a as detectExistingEditor, f as installGitHooks, n as updatePackageJsonWithDeps, o as selectEditor, r as updateWorkspaceConfig, s as writeEditorConfigs, t as detectWorkspace$1, v as rewriteMonorepoProject, y as rewriteStandaloneProject } from "./workspace-rbERvHOo.js";
|
|
5
5
|
import "./browser-CBapUTD0.js";
|
|
6
6
|
import { r as readJsonFile, t as editJsonFile } from "./json-BRdVJ52a.js";
|
|
7
7
|
import "./package-YAMvX5PJ.js";
|
package/dist/global/migrate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM } from "./chunk-CgnkrU7a.js";
|
|
2
|
-
import {
|
|
2
|
+
import { E as confirm, F as Ct, M as select, N as spinner, O as log, _ as upgradeYarn, c as writeAgentInstructions, d as downloadPackageManager$1, g as selectPackageManager, h as runViteInstall, j as outro, l as cancelAndExit, p as promptGitHooks, s as selectAgentTargetPaths, t as detectAgentConflicts, u as defaultInteractive, v as displayRelative, w as PackageManager } from "./agent-BinmPKap.js";
|
|
3
3
|
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
4
|
-
import { _ as rewriteMonorepo, b as createMigrationReport, c as checkViteVersion, d as detectPrettierProject, f as installGitHooks, g as preflightGitHooksSetup, h as migratePrettierToOxfmt, i as detectEditorConflicts, l as checkVitestVersion, m as migrateEslintToOxlint, o as selectEditor, p as mergeViteConfigFiles, s as writeEditorConfigs, t as detectWorkspace$1, u as detectEslintProject, x as require_semver, y as rewriteStandaloneProject } from "./workspace-
|
|
4
|
+
import { _ as rewriteMonorepo, b as createMigrationReport, c as checkViteVersion, d as detectPrettierProject, f as installGitHooks, g as preflightGitHooksSetup, h as migratePrettierToOxfmt, i as detectEditorConflicts, l as checkVitestVersion, m as migrateEslintToOxlint, o as selectEditor, p as mergeViteConfigFiles, s as writeEditorConfigs, t as detectWorkspace$1, u as detectEslintProject, x as require_semver, y as rewriteStandaloneProject } from "./workspace-rbERvHOo.js";
|
|
5
5
|
import "./browser-CBapUTD0.js";
|
|
6
6
|
import "./json-BRdVJ52a.js";
|
|
7
7
|
import { i as readNearestPackageJson, r as hasVitePlusDependency } from "./package-YAMvX5PJ.js";
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import nodeos__default from "node:os";
|
|
2
|
+
import "@voidzero-dev/vite-plus-core";
|
|
3
|
+
export * from "@voidzero-dev/vite-plus-core";
|
|
4
|
+
//#region ../test/dist/vendor/std-env.mjs
|
|
5
|
+
const e = globalThis.process?.env || Object.create(null), t = globalThis.process || { env: e }, n = t !== void 0 && t.env && t.env.NODE_ENV || void 0, r = [
|
|
6
|
+
[`claude`, [`CLAUDECODE`, `CLAUDE_CODE`]],
|
|
7
|
+
[`replit`, [`REPL_ID`]],
|
|
8
|
+
[`gemini`, [`GEMINI_CLI`]],
|
|
9
|
+
[`codex`, [`CODEX_SANDBOX`, `CODEX_THREAD_ID`]],
|
|
10
|
+
[`opencode`, [`OPENCODE`]],
|
|
11
|
+
[`pi`, [i(`PATH`, /\.pi[\\/]agent/)]],
|
|
12
|
+
[`auggie`, [`AUGMENT_AGENT`]],
|
|
13
|
+
[`goose`, [`GOOSE_PROVIDER`]],
|
|
14
|
+
[`devin`, [i(`EDITOR`, /devin/)]],
|
|
15
|
+
[`cursor`, [`CURSOR_AGENT`]],
|
|
16
|
+
[`kiro`, [i(`TERM_PROGRAM`, /kiro/)]]
|
|
17
|
+
];
|
|
18
|
+
function i(t, n) {
|
|
19
|
+
return () => {
|
|
20
|
+
let r = e[t];
|
|
21
|
+
return r ? n.test(r) : !1;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function a() {
|
|
25
|
+
let t = e.AI_AGENT;
|
|
26
|
+
if (t) return { name: t.toLowerCase() };
|
|
27
|
+
for (let [t, n] of r) for (let r of n) if (typeof r == `string` ? e[r] : r()) return { name: t };
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
const o = a();
|
|
31
|
+
o.name;
|
|
32
|
+
const c = !!o.name, l = [
|
|
33
|
+
[`APPVEYOR`],
|
|
34
|
+
[
|
|
35
|
+
`AWS_AMPLIFY`,
|
|
36
|
+
`AWS_APP_ID`,
|
|
37
|
+
{ ci: !0 }
|
|
38
|
+
],
|
|
39
|
+
[`AZURE_PIPELINES`, `SYSTEM_TEAMFOUNDATIONCOLLECTIONURI`],
|
|
40
|
+
[`AZURE_STATIC`, `INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN`],
|
|
41
|
+
[`APPCIRCLE`, `AC_APPCIRCLE`],
|
|
42
|
+
[`BAMBOO`, `bamboo_planKey`],
|
|
43
|
+
[`BITBUCKET`, `BITBUCKET_COMMIT`],
|
|
44
|
+
[`BITRISE`, `BITRISE_IO`],
|
|
45
|
+
[`BUDDY`, `BUDDY_WORKSPACE_ID`],
|
|
46
|
+
[`BUILDKITE`],
|
|
47
|
+
[`CIRCLE`, `CIRCLECI`],
|
|
48
|
+
[`CIRRUS`, `CIRRUS_CI`],
|
|
49
|
+
[
|
|
50
|
+
`CLOUDFLARE_PAGES`,
|
|
51
|
+
`CF_PAGES`,
|
|
52
|
+
{ ci: !0 }
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
`CLOUDFLARE_WORKERS`,
|
|
56
|
+
`WORKERS_CI`,
|
|
57
|
+
{ ci: !0 }
|
|
58
|
+
],
|
|
59
|
+
[`GOOGLE_CLOUDRUN`, `K_SERVICE`],
|
|
60
|
+
[`GOOGLE_CLOUDRUN_JOB`, `CLOUD_RUN_JOB`],
|
|
61
|
+
[`CODEBUILD`, `CODEBUILD_BUILD_ARN`],
|
|
62
|
+
[`CODEFRESH`, `CF_BUILD_ID`],
|
|
63
|
+
[`DRONE`],
|
|
64
|
+
[`DRONE`, `DRONE_BUILD_EVENT`],
|
|
65
|
+
[`DSARI`],
|
|
66
|
+
[`GITHUB_ACTIONS`],
|
|
67
|
+
[`GITLAB`, `GITLAB_CI`],
|
|
68
|
+
[`GITLAB`, `CI_MERGE_REQUEST_ID`],
|
|
69
|
+
[`GOCD`, `GO_PIPELINE_LABEL`],
|
|
70
|
+
[`LAYERCI`],
|
|
71
|
+
[`JENKINS`, `JENKINS_URL`],
|
|
72
|
+
[`HUDSON`, `HUDSON_URL`],
|
|
73
|
+
[`MAGNUM`],
|
|
74
|
+
[`NETLIFY`],
|
|
75
|
+
[
|
|
76
|
+
`NETLIFY`,
|
|
77
|
+
`NETLIFY_LOCAL`,
|
|
78
|
+
{ ci: !1 }
|
|
79
|
+
],
|
|
80
|
+
[`NEVERCODE`],
|
|
81
|
+
[`RENDER`],
|
|
82
|
+
[`SAIL`, `SAILCI`],
|
|
83
|
+
[`SEMAPHORE`],
|
|
84
|
+
[`SCREWDRIVER`],
|
|
85
|
+
[`SHIPPABLE`],
|
|
86
|
+
[`SOLANO`, `TDDIUM`],
|
|
87
|
+
[`STRIDER`],
|
|
88
|
+
[`TEAMCITY`, `TEAMCITY_VERSION`],
|
|
89
|
+
[`TRAVIS`],
|
|
90
|
+
[`VERCEL`, `NOW_BUILDER`],
|
|
91
|
+
[
|
|
92
|
+
`VERCEL`,
|
|
93
|
+
`VERCEL`,
|
|
94
|
+
{ ci: !1 }
|
|
95
|
+
],
|
|
96
|
+
[
|
|
97
|
+
`VERCEL`,
|
|
98
|
+
`VERCEL_ENV`,
|
|
99
|
+
{ ci: !1 }
|
|
100
|
+
],
|
|
101
|
+
[`APPCENTER`, `APPCENTER_BUILD_ID`],
|
|
102
|
+
[
|
|
103
|
+
`CODESANDBOX`,
|
|
104
|
+
`CODESANDBOX_SSE`,
|
|
105
|
+
{ ci: !1 }
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
`CODESANDBOX`,
|
|
109
|
+
`CODESANDBOX_HOST`,
|
|
110
|
+
{ ci: !1 }
|
|
111
|
+
],
|
|
112
|
+
[`STACKBLITZ`],
|
|
113
|
+
[`STORMKIT`],
|
|
114
|
+
[`CLEAVR`],
|
|
115
|
+
[`ZEABUR`],
|
|
116
|
+
[
|
|
117
|
+
`CODESPHERE`,
|
|
118
|
+
`CODESPHERE_APP_ID`,
|
|
119
|
+
{ ci: !0 }
|
|
120
|
+
],
|
|
121
|
+
[`RAILWAY`, `RAILWAY_PROJECT_ID`],
|
|
122
|
+
[`RAILWAY`, `RAILWAY_SERVICE_ID`],
|
|
123
|
+
[`DENO-DEPLOY`, `DENO_DEPLOY`],
|
|
124
|
+
[`DENO-DEPLOY`, `DENO_DEPLOYMENT_ID`],
|
|
125
|
+
[
|
|
126
|
+
`FIREBASE_APP_HOSTING`,
|
|
127
|
+
`FIREBASE_APP_HOSTING`,
|
|
128
|
+
{ ci: !0 }
|
|
129
|
+
]
|
|
130
|
+
];
|
|
131
|
+
function u() {
|
|
132
|
+
for (let t of l) if (e[t[1] || t[0]]) return {
|
|
133
|
+
name: t[0].toLowerCase(),
|
|
134
|
+
...t[2]
|
|
135
|
+
};
|
|
136
|
+
return e.SHELL === `/bin/jsh` && t.versions?.webcontainer ? {
|
|
137
|
+
name: `stackblitz`,
|
|
138
|
+
ci: !1
|
|
139
|
+
} : {
|
|
140
|
+
name: ``,
|
|
141
|
+
ci: !1
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const d = u();
|
|
145
|
+
d.name;
|
|
146
|
+
const p = t.platform || ``, m = !!e.CI || d.ci !== !1, h = !!t.stdout?.isTTY;
|
|
147
|
+
e.DEBUG;
|
|
148
|
+
n === `test` || e.TEST;
|
|
149
|
+
n === `production` || e.MODE;
|
|
150
|
+
n === `dev` || n === `development` || e.MODE;
|
|
151
|
+
e.MINIMAL;
|
|
152
|
+
const S = /^win/i.test(p);
|
|
153
|
+
/^linux/i.test(p);
|
|
154
|
+
/^darwin/i.test(p);
|
|
155
|
+
!e.NO_COLOR && (e.FORCE_COLOR || (h || S) && e.TERM);
|
|
156
|
+
const E = (t.versions?.node || ``).replace(/^v/, ``) || null;
|
|
157
|
+
Number(E?.split(`.`)[0]);
|
|
158
|
+
const O = !!t?.versions?.node, k = `Bun` in globalThis, A = `Deno` in globalThis, j = `fastly` in globalThis, M = `Netlify` in globalThis, N = `EdgeRuntime` in globalThis, P = globalThis.navigator?.userAgent === `Cloudflare-Workers`, F = [
|
|
159
|
+
[M, `netlify`],
|
|
160
|
+
[N, `edge-light`],
|
|
161
|
+
[P, `workerd`],
|
|
162
|
+
[j, `fastly`],
|
|
163
|
+
[A, `deno`],
|
|
164
|
+
[k, `bun`],
|
|
165
|
+
[O, `node`]
|
|
166
|
+
];
|
|
167
|
+
function I() {
|
|
168
|
+
let e = F.find((e) => e[0]);
|
|
169
|
+
if (e) return { name: e[1] };
|
|
170
|
+
}
|
|
171
|
+
I()?.name;
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region ../test/dist/chunks/env.D4Lgay0q.js
|
|
174
|
+
const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
|
|
175
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== void 0;
|
|
176
|
+
(isNode || isDeno) && process.platform;
|
|
177
|
+
(isNode || isDeno) && process.stdout?.isTTY;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region ../test/dist/chunks/defaults.CdU2lD-q.js
|
|
180
|
+
const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
|
|
181
|
+
const defaultExclude = ["**/node_modules/**", "**/.git/**"];
|
|
182
|
+
const coverageConfigDefaults = {
|
|
183
|
+
provider: "v8",
|
|
184
|
+
enabled: false,
|
|
185
|
+
clean: true,
|
|
186
|
+
cleanOnRerun: true,
|
|
187
|
+
reportsDirectory: "./coverage",
|
|
188
|
+
exclude: [],
|
|
189
|
+
reportOnFailure: false,
|
|
190
|
+
reporter: [
|
|
191
|
+
["text", {}],
|
|
192
|
+
["html", {}],
|
|
193
|
+
["clover", {}],
|
|
194
|
+
["json", {}]
|
|
195
|
+
],
|
|
196
|
+
allowExternal: false,
|
|
197
|
+
excludeAfterRemap: false,
|
|
198
|
+
processingConcurrency: Math.min(20, nodeos__default.availableParallelism?.() ?? nodeos__default.cpus().length)
|
|
199
|
+
};
|
|
200
|
+
Object.freeze({
|
|
201
|
+
allowOnly: !m,
|
|
202
|
+
isolate: true,
|
|
203
|
+
watch: !m && process.stdin.isTTY && !c,
|
|
204
|
+
globals: false,
|
|
205
|
+
environment: "node",
|
|
206
|
+
clearMocks: false,
|
|
207
|
+
restoreMocks: false,
|
|
208
|
+
mockReset: false,
|
|
209
|
+
unstubGlobals: false,
|
|
210
|
+
unstubEnvs: false,
|
|
211
|
+
include: defaultInclude,
|
|
212
|
+
exclude: defaultExclude,
|
|
213
|
+
teardownTimeout: 1e4,
|
|
214
|
+
forceRerunTriggers: ["**/package.json/**", "**/{vitest,vite}.config.*/**"],
|
|
215
|
+
update: false,
|
|
216
|
+
reporters: [],
|
|
217
|
+
silent: false,
|
|
218
|
+
hideSkippedTests: false,
|
|
219
|
+
api: false,
|
|
220
|
+
ui: false,
|
|
221
|
+
uiBase: "/__vitest__/",
|
|
222
|
+
open: !m,
|
|
223
|
+
css: { include: [] },
|
|
224
|
+
coverage: coverageConfigDefaults,
|
|
225
|
+
fakeTimers: {
|
|
226
|
+
loopLimit: 1e4,
|
|
227
|
+
shouldClearNativeTimers: true
|
|
228
|
+
},
|
|
229
|
+
maxConcurrency: 5,
|
|
230
|
+
dangerouslyIgnoreUnhandledErrors: false,
|
|
231
|
+
typecheck: {
|
|
232
|
+
checker: "tsc",
|
|
233
|
+
include: ["**/*.{test,spec}-d.?(c|m)[jt]s?(x)"],
|
|
234
|
+
exclude: defaultExclude
|
|
235
|
+
},
|
|
236
|
+
slowTestThreshold: 300,
|
|
237
|
+
disableConsoleIntercept: false,
|
|
238
|
+
detectAsyncLeaks: false
|
|
239
|
+
});
|
|
240
|
+
const CONFIG_NAMES = ["vitest.config", "vite.config"];
|
|
241
|
+
const CONFIG_EXTENSIONS = [
|
|
242
|
+
".ts",
|
|
243
|
+
".mts",
|
|
244
|
+
".cts",
|
|
245
|
+
".js",
|
|
246
|
+
".mjs",
|
|
247
|
+
".cjs"
|
|
248
|
+
];
|
|
249
|
+
CONFIG_NAMES.flatMap((name) => CONFIG_EXTENSIONS.map((ext) => name + ext));
|
|
250
|
+
//#endregion
|
package/dist/global/staged.js
CHANGED
|
@@ -8118,7 +8118,7 @@ const lintStaged = async ({ allowEmpty = false, color = SUPPORTS_COLOR, concurre
|
|
|
8118
8118
|
* Resolve vite.config.ts and return the config object.
|
|
8119
8119
|
*/
|
|
8120
8120
|
async function resolveViteConfig(cwd) {
|
|
8121
|
-
const { resolveConfig } = await import("./src-
|
|
8121
|
+
const { resolveConfig } = await import("./src-B-pcmd0F.js");
|
|
8122
8122
|
return resolveConfig({ root: cwd }, "build");
|
|
8123
8123
|
}
|
|
8124
8124
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM, t as __commonJSMin } from "./chunk-CgnkrU7a.js";
|
|
2
|
-
import {
|
|
2
|
+
import { F as Ct, M as select, O as log, S as runCommandSilently, b as rulesDir, f as getSpinner, v as displayRelative, w as PackageManager } from "./agent-BinmPKap.js";
|
|
3
3
|
import { _ as YAMLMap, g as YAMLSeq, i as parseDocument, n as parse, y as Scalar } from "./browser-CBapUTD0.js";
|
|
4
4
|
import { a as BASEURL_TSCONFIG_WARNING, c as VITE_PLUS_OVERRIDE_PACKAGES, i as writeJsonFile, l as VITE_PLUS_VERSION, n as isJsonFile, r as readJsonFile, s as VITE_PLUS_NAME, t as editJsonFile } from "./json-BRdVJ52a.js";
|
|
5
5
|
import { n as getScopeFromPackageName, t as detectPackageMetadata } from "./package-YAMvX5PJ.js";
|
package/dist/pack-bin.js
CHANGED
|
@@ -57,6 +57,7 @@ cli
|
|
|
57
57
|
.option('--public-dir <dir>', 'Alias for --copy, deprecated')
|
|
58
58
|
.option('--tsconfig <tsconfig>', 'Set tsconfig path')
|
|
59
59
|
.option('--unbundle', 'Unbundle mode')
|
|
60
|
+
.option('--root <dir>', 'Root directory of input files')
|
|
60
61
|
.option('--exe', 'Bundle as executable')
|
|
61
62
|
.option('-W, --workspace [dir]', 'Enable workspace mode')
|
|
62
63
|
.option('-F, --filter <pattern>', 'Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name')
|
package/dist/run-config.d.ts
CHANGED
|
@@ -82,4 +82,15 @@ export type RunConfig = {
|
|
|
82
82
|
tasks?: {
|
|
83
83
|
[key in string]?: Task;
|
|
84
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* Whether to automatically run `preX`/`postX` package.json scripts as
|
|
87
|
+
* lifecycle hooks when script `X` is executed.
|
|
88
|
+
*
|
|
89
|
+
* When `true` (the default), running script `test` will automatically
|
|
90
|
+
* run `pretest` before and `posttest` after, if they exist.
|
|
91
|
+
*
|
|
92
|
+
* This option can only be set in the workspace root's config file.
|
|
93
|
+
* Setting it in a package's config will result in an error.
|
|
94
|
+
*/
|
|
95
|
+
enablePrePostScripts?: boolean;
|
|
85
96
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@voidzero-dev/vite-plus-test/plugins/mocker-transforms';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@voidzero-dev/vite-plus-test/plugins/utils-source-map-node';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@voidzero-dev/vite-plus-test/runtime';
|
package/dist/utils/agent.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare function selectAgentTargetPath({ interactive, agent, onCancel, }:
|
|
|
63
63
|
}): Promise<string | undefined>;
|
|
64
64
|
export declare function detectExistingAgentTargetPaths(projectRoot: string): string[] | undefined;
|
|
65
65
|
export declare function detectExistingAgentTargetPath(projectRoot: string): string | undefined;
|
|
66
|
+
export declare function hasExistingAgentInstructions(projectRoot: string): boolean;
|
|
66
67
|
export declare function resolveAgentTargetPaths(agent?: string | string[]): string[];
|
|
67
68
|
export declare function resolveAgentTargetPath(agent?: string): string;
|
|
68
69
|
export interface AgentConflictInfo {
|
package/dist/utils/agent.js
CHANGED
|
@@ -203,6 +203,19 @@ export function detectExistingAgentTargetPaths(projectRoot) {
|
|
|
203
203
|
export function detectExistingAgentTargetPath(projectRoot) {
|
|
204
204
|
return detectExistingAgentTargetPaths(projectRoot)?.[0];
|
|
205
205
|
}
|
|
206
|
+
export function hasExistingAgentInstructions(projectRoot) {
|
|
207
|
+
const targetPaths = detectExistingAgentTargetPaths(projectRoot);
|
|
208
|
+
if (!targetPaths) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
for (const targetPath of targetPaths) {
|
|
212
|
+
const content = fs.readFileSync(path.join(projectRoot, targetPath), 'utf-8');
|
|
213
|
+
if (content.includes(AGENT_INSTRUCTIONS_START_MARKER)) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
206
219
|
export function resolveAgentTargetPaths(agent) {
|
|
207
220
|
const agentNames = parseAgentNames(agent);
|
|
208
221
|
const resolvedAgentNames = agentNames.length > 0 ? agentNames : ['other'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"oxfmt": "./bin/oxfmt",
|
|
@@ -102,10 +102,6 @@
|
|
|
102
102
|
"types": "./dist/test/internal/browser.d.ts",
|
|
103
103
|
"default": "./dist/test/internal/browser.js"
|
|
104
104
|
},
|
|
105
|
-
"./test/internal/module-runner": {
|
|
106
|
-
"types": "./dist/test/internal/module-runner.d.ts",
|
|
107
|
-
"default": "./dist/test/internal/module-runner.js"
|
|
108
|
-
},
|
|
109
105
|
"./test/runners": {
|
|
110
106
|
"types": "./dist/test/runners.d.ts",
|
|
111
107
|
"default": "./dist/test/runners.js"
|
|
@@ -135,9 +131,9 @@
|
|
|
135
131
|
"types": "./dist/test/snapshot.d.ts",
|
|
136
132
|
"default": "./dist/test/snapshot.js"
|
|
137
133
|
},
|
|
138
|
-
"./test/
|
|
139
|
-
"types": "./dist/test/
|
|
140
|
-
"default": "./dist/test/
|
|
134
|
+
"./test/runtime": {
|
|
135
|
+
"types": "./dist/test/runtime.d.ts",
|
|
136
|
+
"default": "./dist/test/runtime.js"
|
|
141
137
|
},
|
|
142
138
|
"./test/worker": {
|
|
143
139
|
"types": "./dist/test/worker.d.ts",
|
|
@@ -205,6 +201,9 @@
|
|
|
205
201
|
"./test/plugins/utils-source-map": {
|
|
206
202
|
"default": "./dist/test/plugins/utils-source-map.js"
|
|
207
203
|
},
|
|
204
|
+
"./test/plugins/utils-source-map-node": {
|
|
205
|
+
"default": "./dist/test/plugins/utils-source-map-node.js"
|
|
206
|
+
},
|
|
208
207
|
"./test/plugins/utils-error": {
|
|
209
208
|
"default": "./dist/test/plugins/utils-error.js"
|
|
210
209
|
},
|
|
@@ -262,6 +261,9 @@
|
|
|
262
261
|
"./test/plugins/mocker-redirect": {
|
|
263
262
|
"default": "./dist/test/plugins/mocker-redirect.js"
|
|
264
263
|
},
|
|
264
|
+
"./test/plugins/mocker-transforms": {
|
|
265
|
+
"default": "./dist/test/plugins/mocker-transforms.js"
|
|
266
|
+
},
|
|
265
267
|
"./test/plugins/mocker-automock": {
|
|
266
268
|
"default": "./dist/test/plugins/mocker-automock.js"
|
|
267
269
|
},
|
|
@@ -297,12 +299,12 @@
|
|
|
297
299
|
"@oxc-project/types": "=0.115.0",
|
|
298
300
|
"cac": "^6.7.14",
|
|
299
301
|
"cross-spawn": "^7.0.5",
|
|
300
|
-
"oxfmt": "=0.
|
|
301
|
-
"oxlint": "=1.
|
|
302
|
+
"oxfmt": "=0.40.0",
|
|
303
|
+
"oxlint": "=1.55.0",
|
|
302
304
|
"oxlint-tsgolint": "=0.16.0",
|
|
303
305
|
"picocolors": "^1.1.1",
|
|
304
|
-
"@voidzero-dev/vite-plus-core": "0.1.
|
|
305
|
-
"@voidzero-dev/vite-plus-test": "0.1.
|
|
306
|
+
"@voidzero-dev/vite-plus-core": "0.1.10",
|
|
307
|
+
"@voidzero-dev/vite-plus-test": "0.1.10"
|
|
306
308
|
},
|
|
307
309
|
"devDependencies": {
|
|
308
310
|
"@napi-rs/cli": "^3.4.1",
|
|
@@ -325,7 +327,7 @@
|
|
|
325
327
|
"yaml": "^2.8.1",
|
|
326
328
|
"@voidzero-dev/vite-plus-prompts": "0.0.0",
|
|
327
329
|
"rolldown": "1.0.0-rc.9",
|
|
328
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.
|
|
330
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.10"
|
|
329
331
|
},
|
|
330
332
|
"napi": {
|
|
331
333
|
"binaryName": "vite-plus",
|
|
@@ -343,12 +345,12 @@
|
|
|
343
345
|
"node": "^20.19.0 || >=22.12.0"
|
|
344
346
|
},
|
|
345
347
|
"optionalDependencies": {
|
|
346
|
-
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.
|
|
347
|
-
"@voidzero-dev/vite-plus-darwin-x64": "0.1.
|
|
348
|
-
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.
|
|
349
|
-
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.
|
|
350
|
-
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.
|
|
351
|
-
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.
|
|
348
|
+
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.10",
|
|
349
|
+
"@voidzero-dev/vite-plus-darwin-x64": "0.1.10",
|
|
350
|
+
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.10",
|
|
351
|
+
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.10",
|
|
352
|
+
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.10",
|
|
353
|
+
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.10"
|
|
352
354
|
},
|
|
353
355
|
"scripts": {
|
|
354
356
|
"build": "oxnode -C dev ./build.ts",
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import nodeos__default from "node:os";
|
|
2
|
-
import "@voidzero-dev/vite-plus-core";
|
|
3
|
-
export * from "@voidzero-dev/vite-plus-core";
|
|
4
|
-
//#region ../test/dist/vendor/std-env.mjs
|
|
5
|
-
const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis), o = new Proxy(r, {
|
|
6
|
-
get(e, s) {
|
|
7
|
-
return i()[s] ?? r[s];
|
|
8
|
-
},
|
|
9
|
-
has(e, s) {
|
|
10
|
-
return s in i() || s in r;
|
|
11
|
-
},
|
|
12
|
-
set(e, s, E) {
|
|
13
|
-
const B = i(!0);
|
|
14
|
-
return B[s] = E, !0;
|
|
15
|
-
},
|
|
16
|
-
deleteProperty(e, s) {
|
|
17
|
-
if (!s) return !1;
|
|
18
|
-
const E = i(!0);
|
|
19
|
-
return delete E[s], !0;
|
|
20
|
-
},
|
|
21
|
-
ownKeys() {
|
|
22
|
-
const e = i(!0);
|
|
23
|
-
return Object.keys(e);
|
|
24
|
-
}
|
|
25
|
-
}), t = typeof process < "u" && process.env && "production" || "", f = [
|
|
26
|
-
["APPVEYOR"],
|
|
27
|
-
[
|
|
28
|
-
"AWS_AMPLIFY",
|
|
29
|
-
"AWS_APP_ID",
|
|
30
|
-
{ ci: !0 }
|
|
31
|
-
],
|
|
32
|
-
["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
|
|
33
|
-
["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
|
|
34
|
-
["APPCIRCLE", "AC_APPCIRCLE"],
|
|
35
|
-
["BAMBOO", "bamboo_planKey"],
|
|
36
|
-
["BITBUCKET", "BITBUCKET_COMMIT"],
|
|
37
|
-
["BITRISE", "BITRISE_IO"],
|
|
38
|
-
["BUDDY", "BUDDY_WORKSPACE_ID"],
|
|
39
|
-
["BUILDKITE"],
|
|
40
|
-
["CIRCLE", "CIRCLECI"],
|
|
41
|
-
["CIRRUS", "CIRRUS_CI"],
|
|
42
|
-
[
|
|
43
|
-
"CLOUDFLARE_PAGES",
|
|
44
|
-
"CF_PAGES",
|
|
45
|
-
{ ci: !0 }
|
|
46
|
-
],
|
|
47
|
-
[
|
|
48
|
-
"CLOUDFLARE_WORKERS",
|
|
49
|
-
"WORKERS_CI",
|
|
50
|
-
{ ci: !0 }
|
|
51
|
-
],
|
|
52
|
-
["CODEBUILD", "CODEBUILD_BUILD_ARN"],
|
|
53
|
-
["CODEFRESH", "CF_BUILD_ID"],
|
|
54
|
-
["DRONE"],
|
|
55
|
-
["DRONE", "DRONE_BUILD_EVENT"],
|
|
56
|
-
["DSARI"],
|
|
57
|
-
["GITHUB_ACTIONS"],
|
|
58
|
-
["GITLAB", "GITLAB_CI"],
|
|
59
|
-
["GITLAB", "CI_MERGE_REQUEST_ID"],
|
|
60
|
-
["GOCD", "GO_PIPELINE_LABEL"],
|
|
61
|
-
["LAYERCI"],
|
|
62
|
-
["HUDSON", "HUDSON_URL"],
|
|
63
|
-
["JENKINS", "JENKINS_URL"],
|
|
64
|
-
["MAGNUM"],
|
|
65
|
-
["NETLIFY"],
|
|
66
|
-
[
|
|
67
|
-
"NETLIFY",
|
|
68
|
-
"NETLIFY_LOCAL",
|
|
69
|
-
{ ci: !1 }
|
|
70
|
-
],
|
|
71
|
-
["NEVERCODE"],
|
|
72
|
-
["RENDER"],
|
|
73
|
-
["SAIL", "SAILCI"],
|
|
74
|
-
["SEMAPHORE"],
|
|
75
|
-
["SCREWDRIVER"],
|
|
76
|
-
["SHIPPABLE"],
|
|
77
|
-
["SOLANO", "TDDIUM"],
|
|
78
|
-
["STRIDER"],
|
|
79
|
-
["TEAMCITY", "TEAMCITY_VERSION"],
|
|
80
|
-
["TRAVIS"],
|
|
81
|
-
["VERCEL", "NOW_BUILDER"],
|
|
82
|
-
[
|
|
83
|
-
"VERCEL",
|
|
84
|
-
"VERCEL",
|
|
85
|
-
{ ci: !1 }
|
|
86
|
-
],
|
|
87
|
-
[
|
|
88
|
-
"VERCEL",
|
|
89
|
-
"VERCEL_ENV",
|
|
90
|
-
{ ci: !1 }
|
|
91
|
-
],
|
|
92
|
-
["APPCENTER", "APPCENTER_BUILD_ID"],
|
|
93
|
-
[
|
|
94
|
-
"CODESANDBOX",
|
|
95
|
-
"CODESANDBOX_SSE",
|
|
96
|
-
{ ci: !1 }
|
|
97
|
-
],
|
|
98
|
-
[
|
|
99
|
-
"CODESANDBOX",
|
|
100
|
-
"CODESANDBOX_HOST",
|
|
101
|
-
{ ci: !1 }
|
|
102
|
-
],
|
|
103
|
-
["STACKBLITZ"],
|
|
104
|
-
["STORMKIT"],
|
|
105
|
-
["CLEAVR"],
|
|
106
|
-
["ZEABUR"],
|
|
107
|
-
[
|
|
108
|
-
"CODESPHERE",
|
|
109
|
-
"CODESPHERE_APP_ID",
|
|
110
|
-
{ ci: !0 }
|
|
111
|
-
],
|
|
112
|
-
["RAILWAY", "RAILWAY_PROJECT_ID"],
|
|
113
|
-
["RAILWAY", "RAILWAY_SERVICE_ID"],
|
|
114
|
-
["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
|
|
115
|
-
[
|
|
116
|
-
"FIREBASE_APP_HOSTING",
|
|
117
|
-
"FIREBASE_APP_HOSTING",
|
|
118
|
-
{ ci: !0 }
|
|
119
|
-
]
|
|
120
|
-
];
|
|
121
|
-
function b() {
|
|
122
|
-
if (globalThis.process?.env) for (const e of f) {
|
|
123
|
-
const s = e[1] || e[0];
|
|
124
|
-
if (globalThis.process?.env[s]) return {
|
|
125
|
-
name: e[0].toLowerCase(),
|
|
126
|
-
...e[2]
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
|
|
130
|
-
name: "stackblitz",
|
|
131
|
-
ci: !1
|
|
132
|
-
} : {
|
|
133
|
-
name: "",
|
|
134
|
-
ci: !1
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
const l = b();
|
|
138
|
-
l.name;
|
|
139
|
-
function n(e) {
|
|
140
|
-
return e ? e !== "false" : !1;
|
|
141
|
-
}
|
|
142
|
-
const I = globalThis.process?.platform || "", T = n(o.CI) || l.ci !== !1, R = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
|
|
143
|
-
n(o.DEBUG);
|
|
144
|
-
t === "test" || n(o.TEST);
|
|
145
|
-
n(o.MINIMAL);
|
|
146
|
-
const A = /^win/i.test(I);
|
|
147
|
-
/^linux/i.test(I);
|
|
148
|
-
/^darwin/i.test(I);
|
|
149
|
-
!n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (R || A) && o.TERM);
|
|
150
|
-
const C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
|
|
151
|
-
Number(C?.split(".")[0]);
|
|
152
|
-
const W = globalThis.process || Object.create(null), _ = { versions: {} };
|
|
153
|
-
new Proxy(W, { get(e, s) {
|
|
154
|
-
if (s === "env") return o;
|
|
155
|
-
if (s in e) return e[s];
|
|
156
|
-
if (s in _) return _[s];
|
|
157
|
-
} });
|
|
158
|
-
const O = globalThis.process?.release?.name === "node", c = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D = !!globalThis.Deno, L = !!globalThis.fastly, S = !!globalThis.Netlify, u = !!globalThis.EdgeRuntime, N = globalThis.navigator?.userAgent === "Cloudflare-Workers", F = [
|
|
159
|
-
[S, "netlify"],
|
|
160
|
-
[u, "edge-light"],
|
|
161
|
-
[N, "workerd"],
|
|
162
|
-
[L, "fastly"],
|
|
163
|
-
[D, "deno"],
|
|
164
|
-
[c, "bun"],
|
|
165
|
-
[O, "node"]
|
|
166
|
-
];
|
|
167
|
-
function G() {
|
|
168
|
-
const e = F.find((s) => s[0]);
|
|
169
|
-
if (e) return { name: e[1] };
|
|
170
|
-
}
|
|
171
|
-
G()?.name;
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region ../test/dist/chunks/env.D4Lgay0q.js
|
|
174
|
-
const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
|
|
175
|
-
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== void 0;
|
|
176
|
-
(isNode || isDeno) && process.platform;
|
|
177
|
-
(isNode || isDeno) && process.stdout?.isTTY;
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region ../test/dist/chunks/defaults.BOqNVLsY.js
|
|
180
|
-
const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
|
|
181
|
-
const defaultExclude = ["**/node_modules/**", "**/.git/**"];
|
|
182
|
-
const coverageConfigDefaults = {
|
|
183
|
-
provider: "v8",
|
|
184
|
-
enabled: false,
|
|
185
|
-
clean: true,
|
|
186
|
-
cleanOnRerun: true,
|
|
187
|
-
reportsDirectory: "./coverage",
|
|
188
|
-
exclude: [],
|
|
189
|
-
reportOnFailure: false,
|
|
190
|
-
reporter: [
|
|
191
|
-
["text", {}],
|
|
192
|
-
["html", {}],
|
|
193
|
-
["clover", {}],
|
|
194
|
-
["json", {}]
|
|
195
|
-
],
|
|
196
|
-
allowExternal: false,
|
|
197
|
-
excludeAfterRemap: false,
|
|
198
|
-
processingConcurrency: Math.min(20, nodeos__default.availableParallelism?.() ?? nodeos__default.cpus().length)
|
|
199
|
-
};
|
|
200
|
-
Object.freeze({
|
|
201
|
-
allowOnly: !T,
|
|
202
|
-
isolate: true,
|
|
203
|
-
watch: !T && process.stdin.isTTY,
|
|
204
|
-
globals: false,
|
|
205
|
-
environment: "node",
|
|
206
|
-
clearMocks: false,
|
|
207
|
-
restoreMocks: false,
|
|
208
|
-
mockReset: false,
|
|
209
|
-
unstubGlobals: false,
|
|
210
|
-
unstubEnvs: false,
|
|
211
|
-
include: defaultInclude,
|
|
212
|
-
exclude: defaultExclude,
|
|
213
|
-
teardownTimeout: 1e4,
|
|
214
|
-
forceRerunTriggers: ["**/package.json/**", "**/{vitest,vite}.config.*/**"],
|
|
215
|
-
update: false,
|
|
216
|
-
reporters: [],
|
|
217
|
-
silent: false,
|
|
218
|
-
hideSkippedTests: false,
|
|
219
|
-
api: false,
|
|
220
|
-
ui: false,
|
|
221
|
-
uiBase: "/__vitest__/",
|
|
222
|
-
open: !T,
|
|
223
|
-
css: { include: [] },
|
|
224
|
-
coverage: coverageConfigDefaults,
|
|
225
|
-
fakeTimers: {
|
|
226
|
-
loopLimit: 1e4,
|
|
227
|
-
shouldClearNativeTimers: true
|
|
228
|
-
},
|
|
229
|
-
maxConcurrency: 5,
|
|
230
|
-
dangerouslyIgnoreUnhandledErrors: false,
|
|
231
|
-
typecheck: {
|
|
232
|
-
checker: "tsc",
|
|
233
|
-
include: ["**/*.{test,spec}-d.?(c|m)[jt]s?(x)"],
|
|
234
|
-
exclude: defaultExclude
|
|
235
|
-
},
|
|
236
|
-
slowTestThreshold: 300,
|
|
237
|
-
disableConsoleIntercept: false
|
|
238
|
-
});
|
|
239
|
-
const CONFIG_NAMES = ["vitest.config", "vite.config"];
|
|
240
|
-
const CONFIG_EXTENSIONS = [
|
|
241
|
-
".ts",
|
|
242
|
-
".mts",
|
|
243
|
-
".cts",
|
|
244
|
-
".js",
|
|
245
|
-
".mjs",
|
|
246
|
-
".cjs"
|
|
247
|
-
];
|
|
248
|
-
CONFIG_NAMES.flatMap((name) => CONFIG_EXTENSIONS.map((ext) => name + ext));
|
|
249
|
-
//#endregion
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@voidzero-dev/vite-plus-test/internal/module-runner';
|
package/dist/test/mocker.d.ts
DELETED
package/dist/test/mocker.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@voidzero-dev/vite-plus-test/mocker';
|