sv 0.8.2 → 0.8.4
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/bin.js +1697 -743
- package/dist/index.js +2 -2
- package/dist/{install-iBxCFLH9.js → install-CfRQUz9L.js} +18 -79
- package/dist/{package-manager-D3PRQ-L_.js → package-manager-CZaGcCtM.js} +2051 -1950
- package/dist/templates/demo/package.json +1 -1
- package/dist/templates/library/package.json +1 -1
- package/dist/templates/minimal/package.json +1 -1
- package/dist/testing.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,79 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E, __export, __toESM$1 as __toESM, be, detect, getUserAgent, parseJson$1, parseScript, parseScript$1, require_picocolors$1 as require_picocolors, resolveCommand, serializeScript, stripAst, up, walk } from "./package-manager-CZaGcCtM.js";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import process
|
|
4
|
+
import process from "node:process";
|
|
5
5
|
|
|
6
|
-
//#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
7
|
-
var require_picocolors = __commonJS({ "node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
|
|
8
|
-
let p = process || {}, argv = p.argv || [], env$1 = p.env || {};
|
|
9
|
-
let isColorSupported = !(!!env$1.NO_COLOR || argv.includes("--no-color")) && (!!env$1.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env$1.TERM !== "dumb" || !!env$1.CI);
|
|
10
|
-
let formatter = (open, close, replace = open) => (input) => {
|
|
11
|
-
let string = "" + input, index = string.indexOf(close, open.length);
|
|
12
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
13
|
-
};
|
|
14
|
-
let replaceClose = (string, close, replace, index) => {
|
|
15
|
-
let result = "", cursor = 0;
|
|
16
|
-
do {
|
|
17
|
-
result += string.substring(cursor, index) + replace;
|
|
18
|
-
cursor = index + close.length;
|
|
19
|
-
index = string.indexOf(close, cursor);
|
|
20
|
-
} while (~index);
|
|
21
|
-
return result + string.substring(cursor);
|
|
22
|
-
};
|
|
23
|
-
let createColors = (enabled = isColorSupported) => {
|
|
24
|
-
let f = enabled ? formatter : () => String;
|
|
25
|
-
return {
|
|
26
|
-
isColorSupported: enabled,
|
|
27
|
-
reset: f("\x1B[0m", "\x1B[0m"),
|
|
28
|
-
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
29
|
-
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
30
|
-
italic: f("\x1B[3m", "\x1B[23m"),
|
|
31
|
-
underline: f("\x1B[4m", "\x1B[24m"),
|
|
32
|
-
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
33
|
-
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
34
|
-
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
35
|
-
black: f("\x1B[30m", "\x1B[39m"),
|
|
36
|
-
red: f("\x1B[31m", "\x1B[39m"),
|
|
37
|
-
green: f("\x1B[32m", "\x1B[39m"),
|
|
38
|
-
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
39
|
-
blue: f("\x1B[34m", "\x1B[39m"),
|
|
40
|
-
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
41
|
-
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
42
|
-
white: f("\x1B[37m", "\x1B[39m"),
|
|
43
|
-
gray: f("\x1B[90m", "\x1B[39m"),
|
|
44
|
-
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
45
|
-
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
46
|
-
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
47
|
-
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
48
|
-
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
49
|
-
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
50
|
-
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
51
|
-
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
52
|
-
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
53
|
-
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
54
|
-
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
55
|
-
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
56
|
-
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
57
|
-
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
58
|
-
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
59
|
-
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
60
|
-
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
61
|
-
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
62
|
-
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
63
|
-
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
64
|
-
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
65
|
-
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
66
|
-
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
67
|
-
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
module.exports = createColors();
|
|
71
|
-
module.exports.createColors = createColors;
|
|
72
|
-
} });
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
6
|
//#region packages/cli/utils/env.ts
|
|
76
|
-
const TESTING = process
|
|
7
|
+
const TESTING = process.env.NODE_ENV?.toLowerCase() === "test";
|
|
77
8
|
|
|
78
9
|
//#endregion
|
|
79
10
|
//#region packages/core/dist/dedent-CElkE_9E.js
|
|
@@ -159,7 +90,7 @@ else mindent = Math.min(mindent, indent);
|
|
|
159
90
|
}
|
|
160
91
|
|
|
161
92
|
//#endregion
|
|
162
|
-
//#region packages/core/dist/common-
|
|
93
|
+
//#region packages/core/dist/common-DXNzjJGm.js
|
|
163
94
|
function decircular(object) {
|
|
164
95
|
const seenObjects = new WeakMap();
|
|
165
96
|
function internalDecircular(value, path$1 = []) {
|
|
@@ -280,6 +211,7 @@ function addFromString(ast, value) {
|
|
|
280
211
|
}
|
|
281
212
|
function expressionFromString(value) {
|
|
282
213
|
const program = parseScript(dedent_default(value));
|
|
214
|
+
stripAst(program, ["raw"]);
|
|
283
215
|
const statement = program.body[0];
|
|
284
216
|
if (statement.type !== "ExpressionStatement") throw new Error("value passed was not an expression");
|
|
285
217
|
return statement.expression;
|
|
@@ -1038,12 +970,17 @@ function setupAddons(addons, workspace) {
|
|
|
1038
970
|
for (const addon of addons) {
|
|
1039
971
|
const setupResult = {
|
|
1040
972
|
unsupported: [],
|
|
1041
|
-
dependsOn: []
|
|
973
|
+
dependsOn: [],
|
|
974
|
+
runsAfter: []
|
|
1042
975
|
};
|
|
1043
976
|
addon.setup?.({
|
|
1044
977
|
...workspace,
|
|
1045
|
-
dependsOn: (name) =>
|
|
1046
|
-
|
|
978
|
+
dependsOn: (name) => {
|
|
979
|
+
setupResult.dependsOn.push(name);
|
|
980
|
+
setupResult.runsAfter.push(name);
|
|
981
|
+
},
|
|
982
|
+
unsupported: (reason) => setupResult.unsupported.push(reason),
|
|
983
|
+
runsAfter: (name) => setupResult.runsAfter.push(name)
|
|
1047
984
|
});
|
|
1048
985
|
addonSetupResults[addon.id] = setupResult;
|
|
1049
986
|
}
|
|
@@ -1072,7 +1009,7 @@ async function runAddon({ addon, multiple, workspace }) {
|
|
|
1072
1009
|
const { command, args } = resolveCommand(workspace.packageManager, "execute", commandArgs);
|
|
1073
1010
|
const addonPrefix = multiple ? `${addon.id}: ` : "";
|
|
1074
1011
|
const executedCommand = `${command} ${args.join(" ")}`;
|
|
1075
|
-
if (!TESTING)
|
|
1012
|
+
if (!TESTING) E.step(`${addonPrefix}Running external command ${import_picocolors.default.gray(`(${executedCommand})`)}`);
|
|
1076
1013
|
if (workspace.packageManager === "npm") args.unshift("--yes");
|
|
1077
1014
|
try {
|
|
1078
1015
|
await be(command, args, {
|
|
@@ -1117,8 +1054,10 @@ async function runAddon({ addon, multiple, workspace }) {
|
|
|
1117
1054
|
};
|
|
1118
1055
|
}
|
|
1119
1056
|
function orderAddons(addons, setupResults) {
|
|
1120
|
-
return addons.sort((a, b) =>
|
|
1057
|
+
return addons.sort((a, b) => {
|
|
1058
|
+
return setupResults[a.id]?.runsAfter?.length - setupResults[b.id]?.runsAfter?.length;
|
|
1059
|
+
});
|
|
1121
1060
|
}
|
|
1122
1061
|
|
|
1123
1062
|
//#endregion
|
|
1124
|
-
export { addFromString, applyAddons, array_exports, common_exports, createWorkspace, dedent_default, exports_exports, formatFiles, function_exports, getHighlighter, imports_exports, installAddon, kit_exports, object_exports,
|
|
1063
|
+
export { addFromString, applyAddons, array_exports, common_exports, createWorkspace, dedent_default, exports_exports, formatFiles, function_exports, getHighlighter, imports_exports, installAddon, kit_exports, object_exports, setupAddons, variables_exports };
|