bun-workspaces 1.5.0 → 1.5.2
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/bin/cli.js +0 -0
- package/package.json +1 -5
- package/src/1108.mjs +30 -0
- package/src/{cli/commands/commandsConfig.mjs → 2392.mjs} +52 -11
- package/src/4427.mjs +9 -0
- package/src/5166.mjs +8 -0
- package/src/8126.mjs +4 -0
- package/src/8257.mjs +4 -0
- package/src/{config/util/configLocation.mjs → 8529.mjs} +11 -2
- package/src/ai/mcp/bwMcpServer.mjs +213 -9
- package/src/ai/mcp/core/index.mjs +3 -1
- package/src/ai/mcp/core/server.mjs +1 -3
- package/src/ai/mcp/core/transport.mjs +1 -2
- package/src/ai/mcp/core/types.mjs +0 -1
- package/src/ai/mcp/index.mjs +3 -1
- package/src/ai/mcp/resources.mjs +1 -2
- package/src/ai/mcp/tools.mjs +1 -5
- package/src/cli/commands/commandHandlerUtils.mjs +2 -6
- package/src/cli/commands/commands.mjs +1 -4
- package/src/cli/commands/handleSimpleCommands.mjs +4 -10
- package/src/cli/commands/index.mjs +11 -2
- package/src/cli/commands/mcp.mjs +1 -4
- package/src/cli/commands/runScript/handleRunScript.mjs +1 -9
- package/src/cli/commands/runScript/index.mjs +3 -1
- package/src/cli/commands/runScript/output/index.mjs +3 -1
- package/src/cli/commands/runScript/output/outputStyle.mjs +1 -3
- package/src/cli/commands/runScript/output/renderGroupedOutput.mjs +1 -6
- package/src/cli/commands/runScript/output/renderPlainOutput.mjs +1 -2
- package/src/cli/commands/runScript/output/sanitizeChunk.mjs +0 -1
- package/src/cli/createCli.mjs +2 -12
- package/src/cli/fatalErrorLogger.mjs +1 -2
- package/src/cli/globalOptions/globalOptions.mjs +2 -9
- package/src/cli/globalOptions/index.mjs +3 -2
- package/src/cli/index.d.ts +1025 -3
- package/src/cli/index.mjs +3 -1
- package/src/cli/middleware.mjs +1 -3
- package/src/config/index.mjs +3 -1
- package/src/config/public.d.ts +93 -10
- package/src/config/public.mjs +2 -6
- package/src/config/rootConfig/defineRootConfig.mjs +1 -2
- package/src/config/rootConfig/errors.mjs +1 -2
- package/src/config/rootConfig/index.mjs +2 -1
- package/src/config/rootConfig/loadRootConfig.mjs +1 -4
- package/src/config/rootConfig/rootConfig.mjs +1 -6
- package/src/config/rootConfig/rootConfigSchema.mjs +0 -1
- package/src/config/userEnvVars/index.mjs +3 -1
- package/src/config/userEnvVars/userEnvVars.mjs +3 -8
- package/src/config/util/ajvTypes.mjs +2 -1
- package/src/config/util/index.mjs +2 -1
- package/src/config/util/loadConfig.mjs +1 -6
- package/src/config/util/validateConfig.mjs +0 -1
- package/src/config/workspaceConfig/defineWorkspaceConfig.mjs +1 -2
- package/src/config/workspaceConfig/errors.mjs +1 -2
- package/src/config/workspaceConfig/index.mjs +2 -1
- package/src/config/workspaceConfig/loadWorkspaceConfig.mjs +2 -8
- package/src/config/workspaceConfig/workspaceConfig.mjs +1 -5
- package/src/config/workspaceConfig/workspaceConfigSchema.mjs +0 -1
- package/src/doctor/doctor.mjs +1 -5
- package/src/doctor/index.mjs +3 -1
- package/src/index.d.ts +458 -38
- package/src/index.mjs +4 -13
- package/src/internal/bun/bunLock.mjs +2 -4
- package/src/internal/bun/bunVersion.mjs +1 -3
- package/src/internal/bun/index.mjs +3 -1
- package/src/internal/bundledDeps/commander.mjs +3843 -0
- package/src/internal/bundledDeps/shellQuote.mjs +291 -0
- package/src/internal/core/error/error.mjs +0 -1
- package/src/internal/core/error/index.mjs +3 -1
- package/src/internal/core/index.mjs +3 -1
- package/src/internal/core/json/index.mjs +3 -1
- package/src/internal/core/json/json.mjs +3 -5
- package/src/internal/core/json/jsonc.mjs +0 -1
- package/src/internal/core/language/array/index.mjs +3 -1
- package/src/internal/core/language/array/optionalArray.mjs +0 -1
- package/src/internal/core/language/asyncIterable/asyncIterableQueue.mjs +0 -1
- package/src/internal/core/language/asyncIterable/index.mjs +3 -1
- package/src/internal/core/language/asyncIterable/mergeAsyncIterables.mjs +0 -1
- package/src/internal/core/language/events/typedEventTarget.mjs +0 -1
- package/src/internal/core/language/index.mjs +3 -1
- package/src/internal/core/language/regex/index.mjs +3 -1
- package/src/internal/core/language/regex/regex.mjs +0 -1
- package/src/internal/core/language/string/id.mjs +0 -1
- package/src/internal/core/language/string/index.mjs +3 -1
- package/src/internal/core/language/string/utf/eastAsianWidth.mjs +0 -1
- package/src/internal/core/language/string/utf/visibleLength.mjs +1 -2
- package/src/internal/core/language/types/index.mjs +3 -1
- package/src/internal/core/language/types/typeof.mjs +1 -3
- package/src/internal/core/language/types/types.mjs +3 -2
- package/src/internal/core/runtime/env.mjs +0 -1
- package/src/internal/core/runtime/index.mjs +3 -1
- package/src/internal/core/runtime/onExit.mjs +2 -3
- package/src/internal/core/runtime/os.mjs +1 -3
- package/src/internal/core/runtime/tempFile.mjs +1 -9
- package/src/internal/core/runtime/terminal.mjs +0 -1
- package/src/internal/generated/aiDocs/.gitkeep.mjs +1 -0
- package/src/internal/generated/aiDocs/docs.mjs +0 -1
- package/src/internal/logger/index.mjs +3 -1
- package/src/internal/logger/logger.mjs +4 -14
- package/src/internal/version.mjs +1 -2
- package/src/project/errors.mjs +1 -2
- package/src/project/implementations/fileSystemProject.mjs +3 -18
- package/src/project/implementations/memoryProject.mjs +1 -5
- package/src/project/implementations/projectBase.mjs +10 -19
- package/src/project/index.mjs +3 -1
- package/src/project/project.mjs +2 -1
- package/src/rslib-runtime.mjs +62 -0
- package/src/runScript/index.mjs +3 -1
- package/src/runScript/output/index.mjs +3 -1
- package/src/runScript/output/multiProcessOutput.mjs +1 -2
- package/src/runScript/output/outputStream.mjs +1 -1
- package/src/runScript/output/processOutput.mjs +1 -2
- package/src/runScript/parallel.mjs +4 -10
- package/src/runScript/recursion.mjs +1 -2
- package/src/runScript/runScript.mjs +1 -4
- package/src/runScript/runScripts.mjs +1 -6
- package/src/runScript/scriptCommand.mjs +1 -2
- package/src/runScript/scriptExecution.mjs +1 -3
- package/src/runScript/scriptRuntimeMetadata.mjs +38 -56
- package/src/runScript/scriptShellOption.mjs +5 -14
- package/src/runScript/subprocesses.mjs +4 -4
- package/src/workspaces/dependencyGraph/cycles.mjs +0 -1
- package/src/workspaces/dependencyGraph/index.mjs +3 -1
- package/src/workspaces/dependencyGraph/resolveDependencies.mjs +1 -2
- package/src/workspaces/dependencyGraph/validateDependencyRules.mjs +1 -3
- package/src/workspaces/errors.mjs +1 -2
- package/src/workspaces/findWorkspaces.mjs +1 -11
- package/src/workspaces/index.mjs +3 -1
- package/src/workspaces/packageJson.mjs +2 -7
- package/src/workspaces/workspace.mjs +2 -1
- package/src/workspaces/workspacePattern.mjs +4 -4
- package/src/ai/mcp/bwMcpServer.d.ts +0 -4
- package/src/ai/mcp/core/index.d.ts +0 -3
- package/src/ai/mcp/core/server.d.ts +0 -14
- package/src/ai/mcp/core/transport.d.ts +0 -12
- package/src/ai/mcp/core/types.d.ts +0 -104
- package/src/ai/mcp/index.d.ts +0 -2
- package/src/ai/mcp/resources.d.ts +0 -6
- package/src/ai/mcp/tools.d.ts +0 -6
- package/src/cli/commands/commandHandlerUtils.d.ts +0 -51
- package/src/cli/commands/commands.d.ts +0 -10
- package/src/cli/commands/commandsConfig.d.ts +0 -436
- package/src/cli/commands/handleSimpleCommands.d.ts +0 -21
- package/src/cli/commands/index.d.ts +0 -4
- package/src/cli/commands/mcp.d.ts +0 -3
- package/src/cli/commands/runScript/handleRunScript.d.ts +0 -3
- package/src/cli/commands/runScript/index.d.ts +0 -2
- package/src/cli/commands/runScript/output/index.d.ts +0 -1
- package/src/cli/commands/runScript/output/outputStyle.d.ts +0 -9
- package/src/cli/commands/runScript/output/renderGroupedOutput.d.ts +0 -75
- package/src/cli/commands/runScript/output/renderPlainOutput.d.ts +0 -24
- package/src/cli/commands/runScript/output/sanitizeChunk.d.ts +0 -4
- package/src/cli/createCli.d.ts +0 -26
- package/src/cli/fatalErrorLogger.d.ts +0 -1
- package/src/cli/globalOptions/globalOptions.d.ts +0 -43
- package/src/cli/globalOptions/globalOptionsConfig.d.ts +0 -52
- package/src/cli/globalOptions/globalOptionsConfig.mjs +0 -43
- package/src/cli/globalOptions/index.d.ts +0 -2
- package/src/cli/middleware.d.ts +0 -83
- package/src/config/index.d.ts +0 -3
- package/src/config/rootConfig/defineRootConfig.d.ts +0 -4
- package/src/config/rootConfig/errors.d.ts +0 -1
- package/src/config/rootConfig/index.d.ts +0 -5
- package/src/config/rootConfig/loadRootConfig.d.ts +0 -3
- package/src/config/rootConfig/rootConfig.d.ts +0 -25
- package/src/config/rootConfig/rootConfigLocation.d.ts +0 -2
- package/src/config/rootConfig/rootConfigLocation.mjs +0 -5
- package/src/config/rootConfig/rootConfigSchema.d.ts +0 -21
- package/src/config/userEnvVars/index.d.ts +0 -1
- package/src/config/userEnvVars/userEnvVars.d.ts +0 -13
- package/src/config/util/ajvTypes.d.ts +0 -10
- package/src/config/util/configLocation.d.ts +0 -18
- package/src/config/util/index.d.ts +0 -4
- package/src/config/util/loadConfig.d.ts +0 -18
- package/src/config/util/validateConfig.d.ts +0 -8
- package/src/config/workspaceConfig/defineWorkspaceConfig.d.ts +0 -7
- package/src/config/workspaceConfig/errors.d.ts +0 -1
- package/src/config/workspaceConfig/index.d.ts +0 -5
- package/src/config/workspaceConfig/loadWorkspaceConfig.d.ts +0 -3
- package/src/config/workspaceConfig/workspaceConfig.d.ts +0 -56
- package/src/config/workspaceConfig/workspaceConfigLocation.d.ts +0 -2
- package/src/config/workspaceConfig/workspaceConfigLocation.mjs +0 -5
- package/src/config/workspaceConfig/workspaceConfigSchema.d.ts +0 -56
- package/src/doctor/doctor.d.ts +0 -35
- package/src/doctor/index.d.ts +0 -1
- package/src/internal/bun/bunLock.d.ts +0 -20
- package/src/internal/bun/bunVersion.d.ts +0 -21
- package/src/internal/bun/index.d.ts +0 -2
- package/src/internal/core/error/error.d.ts +0 -13
- package/src/internal/core/error/index.d.ts +0 -1
- package/src/internal/core/index.d.ts +0 -4
- package/src/internal/core/json/index.d.ts +0 -2
- package/src/internal/core/json/json.d.ts +0 -49
- package/src/internal/core/json/jsonc.d.ts +0 -9
- package/src/internal/core/language/array/index.d.ts +0 -1
- package/src/internal/core/language/array/optionalArray.d.ts +0 -15
- package/src/internal/core/language/asyncIterable/asyncIterableQueue.d.ts +0 -16
- package/src/internal/core/language/asyncIterable/index.d.ts +0 -2
- package/src/internal/core/language/asyncIterable/mergeAsyncIterables.d.ts +0 -5
- package/src/internal/core/language/events/typedEventTarget.d.ts +0 -50
- package/src/internal/core/language/index.d.ts +0 -5
- package/src/internal/core/language/regex/index.d.ts +0 -1
- package/src/internal/core/language/regex/regex.d.ts +0 -3
- package/src/internal/core/language/string/id.d.ts +0 -1
- package/src/internal/core/language/string/index.d.ts +0 -1
- package/src/internal/core/language/string/utf/eastAsianWidth.d.ts +0 -16
- package/src/internal/core/language/string/utf/visibleLength.d.ts +0 -5
- package/src/internal/core/language/types/index.d.ts +0 -2
- package/src/internal/core/language/types/typeof.d.ts +0 -102
- package/src/internal/core/language/types/types.d.ts +0 -19
- package/src/internal/core/runtime/env.d.ts +0 -6
- package/src/internal/core/runtime/index.d.ts +0 -5
- package/src/internal/core/runtime/onExit.d.ts +0 -4
- package/src/internal/core/runtime/os.d.ts +0 -6
- package/src/internal/core/runtime/tempFile.d.ts +0 -20
- package/src/internal/core/runtime/terminal.d.ts +0 -1
- package/src/internal/docs/apiQuickstart.d.ts +0 -3
- package/src/internal/docs/apiQuickstart.mjs +0 -132
- package/src/internal/docs/cliQuickstart.d.ts +0 -2
- package/src/internal/docs/cliQuickstart.mjs +0 -86
- package/src/internal/docs/index.d.ts +0 -2
- package/src/internal/docs/index.mjs +0 -2
- package/src/internal/generated/aiDocs/docs.d.ts +0 -10
- package/src/internal/logger/index.d.ts +0 -1
- package/src/internal/logger/logger.d.ts +0 -45
- package/src/internal/version.d.ts +0 -1
- package/src/project/errors.d.ts +0 -5
- package/src/project/implementations/fileSystemProject.d.ts +0 -148
- package/src/project/implementations/memoryProject.d.ts +0 -41
- package/src/project/implementations/projectBase.d.ts +0 -37
- package/src/project/index.d.ts +0 -5
- package/src/project/project.d.ts +0 -79
- package/src/runScript/index.d.ts +0 -7
- package/src/runScript/output/index.d.ts +0 -3
- package/src/runScript/output/multiProcessOutput.d.ts +0 -14
- package/src/runScript/output/outputStream.d.ts +0 -1
- package/src/runScript/output/processOutput.d.ts +0 -33
- package/src/runScript/parallel.d.ts +0 -24
- package/src/runScript/recursion.d.ts +0 -4
- package/src/runScript/runScript.d.ts +0 -45
- package/src/runScript/runScripts.d.ts +0 -65
- package/src/runScript/scriptCommand.d.ts +0 -33
- package/src/runScript/scriptExecution.d.ts +0 -9
- package/src/runScript/scriptRuntimeMetadata.d.ts +0 -73
- package/src/runScript/scriptShellOption.d.ts +0 -8
- package/src/runScript/subprocesses.d.ts +0 -11
- package/src/workspaces/dependencyGraph/cycles.d.ts +0 -9
- package/src/workspaces/dependencyGraph/index.d.ts +0 -3
- package/src/workspaces/dependencyGraph/resolveDependencies.d.ts +0 -18
- package/src/workspaces/dependencyGraph/validateDependencyRules.d.ts +0 -7
- package/src/workspaces/errors.d.ts +0 -14
- package/src/workspaces/findWorkspaces.d.ts +0 -24
- package/src/workspaces/index.d.ts +0 -4
- package/src/workspaces/packageJson.d.ts +0 -31
- package/src/workspaces/workspace.d.ts +0 -21
- package/src/workspaces/workspacePattern.d.ts +0 -22
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { __webpack_require__ } from "../../rslib-runtime.mjs";
|
|
2
|
+
|
|
3
|
+
__webpack_require__.add({
|
|
4
|
+
"../../../node_modules/.bun/shell-quote@1.8.3/node_modules/shell-quote/index.js"(
|
|
5
|
+
__unused_rspack_module,
|
|
6
|
+
exports,
|
|
7
|
+
__webpack_require__,
|
|
8
|
+
) {
|
|
9
|
+
exports.h = __webpack_require__(
|
|
10
|
+
"../../../node_modules/.bun/shell-quote@1.8.3/node_modules/shell-quote/quote.js",
|
|
11
|
+
);
|
|
12
|
+
exports.q = __webpack_require__(
|
|
13
|
+
"../../../node_modules/.bun/shell-quote@1.8.3/node_modules/shell-quote/parse.js",
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
"../../../node_modules/.bun/shell-quote@1.8.3/node_modules/shell-quote/parse.js"(
|
|
17
|
+
module,
|
|
18
|
+
) {
|
|
19
|
+
// '<(' is process substitution operator and
|
|
20
|
+
// can be parsed the same as control operator
|
|
21
|
+
var CONTROL =
|
|
22
|
+
"(?:" +
|
|
23
|
+
[
|
|
24
|
+
"\\|\\|",
|
|
25
|
+
"\\&\\&",
|
|
26
|
+
";;",
|
|
27
|
+
"\\|\\&",
|
|
28
|
+
"\\<\\(",
|
|
29
|
+
"\\<\\<\\<",
|
|
30
|
+
">>",
|
|
31
|
+
">\\&",
|
|
32
|
+
"<\\&",
|
|
33
|
+
"[&;()|<>]",
|
|
34
|
+
].join("|") +
|
|
35
|
+
")";
|
|
36
|
+
var controlRE = new RegExp("^" + CONTROL + "$");
|
|
37
|
+
var META = "|&;()<> \\t";
|
|
38
|
+
var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
|
|
39
|
+
var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
|
|
40
|
+
var hash = /^#$/;
|
|
41
|
+
|
|
42
|
+
var SQ = "'";
|
|
43
|
+
var DQ = '"';
|
|
44
|
+
var DS = "$";
|
|
45
|
+
|
|
46
|
+
var TOKEN = "";
|
|
47
|
+
var mult = 0x100000000; // Math.pow(16, 8);
|
|
48
|
+
for (var i = 0; i < 4; i++) {
|
|
49
|
+
TOKEN += (mult * Math.random()).toString(16);
|
|
50
|
+
}
|
|
51
|
+
var startsWithToken = new RegExp("^" + TOKEN);
|
|
52
|
+
|
|
53
|
+
function matchAll(s, r) {
|
|
54
|
+
var origIndex = r.lastIndex;
|
|
55
|
+
|
|
56
|
+
var matches = [];
|
|
57
|
+
var matchObj;
|
|
58
|
+
|
|
59
|
+
while ((matchObj = r.exec(s))) {
|
|
60
|
+
matches.push(matchObj);
|
|
61
|
+
if (r.lastIndex === matchObj.index) {
|
|
62
|
+
r.lastIndex += 1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
r.lastIndex = origIndex;
|
|
67
|
+
|
|
68
|
+
return matches;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function getVar(env, pre, key) {
|
|
72
|
+
var r = typeof env === "function" ? env(key) : env[key];
|
|
73
|
+
if (typeof r === "undefined" && key != "") {
|
|
74
|
+
r = "";
|
|
75
|
+
} else if (typeof r === "undefined") {
|
|
76
|
+
r = "$";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (typeof r === "object") {
|
|
80
|
+
return pre + TOKEN + JSON.stringify(r) + TOKEN;
|
|
81
|
+
}
|
|
82
|
+
return pre + r;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function parseInternal(string, env, opts) {
|
|
86
|
+
if (!opts) {
|
|
87
|
+
opts = {};
|
|
88
|
+
}
|
|
89
|
+
var BS = opts.escape || "\\";
|
|
90
|
+
var BAREWORD = "(\\" + BS + "['\"" + META + "]|[^\\s'\"" + META + "])+";
|
|
91
|
+
|
|
92
|
+
var chunker = new RegExp(
|
|
93
|
+
[
|
|
94
|
+
"(" + CONTROL + ")", // control chars
|
|
95
|
+
"(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+",
|
|
96
|
+
].join("|"),
|
|
97
|
+
"g",
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
var matches = matchAll(string, chunker);
|
|
101
|
+
|
|
102
|
+
if (matches.length === 0) {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
if (!env) {
|
|
106
|
+
env = {};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
var commented = false;
|
|
110
|
+
|
|
111
|
+
return matches
|
|
112
|
+
.map(function (match) {
|
|
113
|
+
var s = match[0];
|
|
114
|
+
if (!s || commented) {
|
|
115
|
+
return void undefined;
|
|
116
|
+
}
|
|
117
|
+
if (controlRE.test(s)) {
|
|
118
|
+
return { op: s };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Hand-written scanner/parser for Bash quoting rules:
|
|
122
|
+
//
|
|
123
|
+
// 1. inside single quotes, all characters are printed literally.
|
|
124
|
+
// 2. inside double quotes, all characters are printed literally
|
|
125
|
+
// except variables prefixed by '$' and backslashes followed by
|
|
126
|
+
// either a double quote or another backslash.
|
|
127
|
+
// 3. outside of any quotes, backslashes are treated as escape
|
|
128
|
+
// characters and not printed (unless they are themselves escaped)
|
|
129
|
+
// 4. quote context can switch mid-token if there is no whitespace
|
|
130
|
+
// between the two quote contexts (e.g. all'one'"token" parses as
|
|
131
|
+
// "allonetoken")
|
|
132
|
+
var quote = false;
|
|
133
|
+
var esc = false;
|
|
134
|
+
var out = "";
|
|
135
|
+
var isGlob = false;
|
|
136
|
+
var i;
|
|
137
|
+
|
|
138
|
+
function parseEnvVar() {
|
|
139
|
+
i += 1;
|
|
140
|
+
var varend;
|
|
141
|
+
var varname;
|
|
142
|
+
var char = s.charAt(i);
|
|
143
|
+
|
|
144
|
+
if (char === "{") {
|
|
145
|
+
i += 1;
|
|
146
|
+
if (s.charAt(i) === "}") {
|
|
147
|
+
throw new Error("Bad substitution: " + s.slice(i - 2, i + 1));
|
|
148
|
+
}
|
|
149
|
+
varend = s.indexOf("}", i);
|
|
150
|
+
if (varend < 0) {
|
|
151
|
+
throw new Error("Bad substitution: " + s.slice(i));
|
|
152
|
+
}
|
|
153
|
+
varname = s.slice(i, varend);
|
|
154
|
+
i = varend;
|
|
155
|
+
} else if (/[*@#?$!_-]/.test(char)) {
|
|
156
|
+
varname = char;
|
|
157
|
+
i += 1;
|
|
158
|
+
} else {
|
|
159
|
+
var slicedFromI = s.slice(i);
|
|
160
|
+
varend = slicedFromI.match(/[^\w\d_]/);
|
|
161
|
+
if (!varend) {
|
|
162
|
+
varname = slicedFromI;
|
|
163
|
+
i = s.length;
|
|
164
|
+
} else {
|
|
165
|
+
varname = slicedFromI.slice(0, varend.index);
|
|
166
|
+
i += varend.index - 1;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return getVar(env, "", varname);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
for (i = 0; i < s.length; i++) {
|
|
173
|
+
var c = s.charAt(i);
|
|
174
|
+
isGlob = isGlob || (!quote && (c === "*" || c === "?"));
|
|
175
|
+
if (esc) {
|
|
176
|
+
out += c;
|
|
177
|
+
esc = false;
|
|
178
|
+
} else if (quote) {
|
|
179
|
+
if (c === quote) {
|
|
180
|
+
quote = false;
|
|
181
|
+
} else if (quote == SQ) {
|
|
182
|
+
out += c;
|
|
183
|
+
} else {
|
|
184
|
+
// Double quote
|
|
185
|
+
if (c === BS) {
|
|
186
|
+
i += 1;
|
|
187
|
+
c = s.charAt(i);
|
|
188
|
+
if (c === DQ || c === BS || c === DS) {
|
|
189
|
+
out += c;
|
|
190
|
+
} else {
|
|
191
|
+
out += BS + c;
|
|
192
|
+
}
|
|
193
|
+
} else if (c === DS) {
|
|
194
|
+
out += parseEnvVar();
|
|
195
|
+
} else {
|
|
196
|
+
out += c;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
} else if (c === DQ || c === SQ) {
|
|
200
|
+
quote = c;
|
|
201
|
+
} else if (controlRE.test(c)) {
|
|
202
|
+
return { op: s };
|
|
203
|
+
} else if (hash.test(c)) {
|
|
204
|
+
commented = true;
|
|
205
|
+
var commentObj = { comment: string.slice(match.index + i + 1) };
|
|
206
|
+
if (out.length) {
|
|
207
|
+
return [out, commentObj];
|
|
208
|
+
}
|
|
209
|
+
return [commentObj];
|
|
210
|
+
} else if (c === BS) {
|
|
211
|
+
esc = true;
|
|
212
|
+
} else if (c === DS) {
|
|
213
|
+
out += parseEnvVar();
|
|
214
|
+
} else {
|
|
215
|
+
out += c;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if (isGlob) {
|
|
220
|
+
return { op: "glob", pattern: out };
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return out;
|
|
224
|
+
})
|
|
225
|
+
.reduce(function (prev, arg) {
|
|
226
|
+
// finalize parsed arguments
|
|
227
|
+
// TODO: replace this whole reduce with a concat
|
|
228
|
+
return typeof arg === "undefined" ? prev : prev.concat(arg);
|
|
229
|
+
}, []);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
module.exports = function parse(s, env, opts) {
|
|
233
|
+
var mapped = parseInternal(s, env, opts);
|
|
234
|
+
if (typeof env !== "function") {
|
|
235
|
+
return mapped;
|
|
236
|
+
}
|
|
237
|
+
return mapped.reduce(function (acc, s) {
|
|
238
|
+
if (typeof s === "object") {
|
|
239
|
+
return acc.concat(s);
|
|
240
|
+
}
|
|
241
|
+
var xs = s.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
|
|
242
|
+
if (xs.length === 1) {
|
|
243
|
+
return acc.concat(xs[0]);
|
|
244
|
+
}
|
|
245
|
+
return acc.concat(
|
|
246
|
+
xs.filter(Boolean).map(function (x) {
|
|
247
|
+
if (startsWithToken.test(x)) {
|
|
248
|
+
return JSON.parse(x.split(TOKEN)[1]);
|
|
249
|
+
}
|
|
250
|
+
return x;
|
|
251
|
+
}),
|
|
252
|
+
);
|
|
253
|
+
}, []);
|
|
254
|
+
};
|
|
255
|
+
},
|
|
256
|
+
"../../../node_modules/.bun/shell-quote@1.8.3/node_modules/shell-quote/quote.js"(
|
|
257
|
+
module,
|
|
258
|
+
) {
|
|
259
|
+
module.exports = function quote(xs) {
|
|
260
|
+
return xs
|
|
261
|
+
.map(function (s) {
|
|
262
|
+
if (s === "") {
|
|
263
|
+
return "''";
|
|
264
|
+
}
|
|
265
|
+
if (s && typeof s === "object") {
|
|
266
|
+
return s.op.replace(/(.)/g, "\\$1");
|
|
267
|
+
}
|
|
268
|
+
if (/["\s\\]/.test(s) && !/'/.test(s)) {
|
|
269
|
+
return "'" + s.replace(/(['])/g, "\\$1") + "'";
|
|
270
|
+
}
|
|
271
|
+
if (/["'\s]/.test(s)) {
|
|
272
|
+
return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"';
|
|
273
|
+
}
|
|
274
|
+
return String(s).replace(
|
|
275
|
+
/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,
|
|
276
|
+
"$1\\$2",
|
|
277
|
+
);
|
|
278
|
+
})
|
|
279
|
+
.join(" ");
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
// This module is bundled with the build and is re-exported for organization, to provide clearer debugging paths
|
|
284
|
+
|
|
285
|
+
const shell_quote = __webpack_require__(
|
|
286
|
+
"../../../node_modules/.bun/shell-quote@1.8.3/node_modules/shell-quote/index.js",
|
|
287
|
+
);
|
|
288
|
+
var q = shell_quote.q;
|
|
289
|
+
var h = shell_quote.h;
|
|
290
|
+
|
|
291
|
+
export { h as quote, q as parse };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { isTypeof } from "../language/index.mjs";
|
|
2
|
-
|
|
1
|
+
import { isTypeof } from "../language/index.mjs";
|
|
2
|
+
import { isJSONObject } from "../../../8257.mjs";
|
|
3
3
|
|
|
4
4
|
const isJSONPrimitive = (value) =>
|
|
5
5
|
isTypeof(value, "string", "number", "boolean") || value === null;
|
|
6
6
|
const isJSONArray = (value) => Array.isArray(value) && value.every(isJSON);
|
|
7
|
-
const isJSONObject = (value) =>
|
|
8
|
-
typeof value === "object" && value !== null && value?.constructor === Object;
|
|
9
7
|
const isJSON = (value) =>
|
|
10
8
|
isJSONPrimitive(value) || isJSONArray(value) || isJSONObject(value);
|
|
11
9
|
|
|
12
|
-
export { isJSON, isJSONArray,
|
|
10
|
+
export { isJSON, isJSONArray, isJSONPrimitive };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// CONCATENATED MODULE: ./src/internal/core/language/asyncIterable/mergeAsyncIterables.ts
|
|
2
1
|
/** Run multiple async iterables in parallel and yield the results in the order they are completed. */ const mergeAsyncIterables =
|
|
3
2
|
(iterables) => ({
|
|
4
3
|
async *[Symbol.asyncIterator]() {
|
|
@@ -2,4 +2,6 @@ export * from "./asyncIterable/index.mjs";
|
|
|
2
2
|
export * from "./array/index.mjs";
|
|
3
3
|
export * from "./types/index.mjs";
|
|
4
4
|
export * from "./regex/index.mjs";
|
|
5
|
-
export * from "./string/index.mjs";
|
|
5
|
+
export * from "./string/index.mjs";
|
|
6
|
+
|
|
7
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { eaw } from "./eastAsianWidth.mjs";
|
|
2
|
-
// CONCATENATED MODULE: ./src/internal/core/language/string/utf/visibleLength.ts
|
|
1
|
+
import { eaw } from "./eastAsianWidth.mjs";
|
|
3
2
|
|
|
4
3
|
const getVisibleSliceIndex = (str, maxVisible) => {
|
|
5
4
|
let i = 0;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { defineErrors } from "../../error/index.mjs";
|
|
2
|
-
import { resolveOptionalArray } from "../array/optionalArray.mjs";
|
|
3
|
-
// CONCATENATED MODULE: external "../array/optionalArray.mjs"
|
|
4
|
-
// CONCATENATED MODULE: ./src/internal/core/language/types/typeof.ts
|
|
2
|
+
import { resolveOptionalArray } from "../array/optionalArray.mjs";
|
|
5
3
|
|
|
6
4
|
const InvalidJSTypeError = defineErrors("InvalidJSType").InvalidJSType;
|
|
7
5
|
const InvalidJSNumberError = defineErrors("InvalidJSNumber").InvalidJSNumber;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
1
|
+
/** Does not change an object type, but remaps it for cleaner Intellisense only */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
+
|
|
3
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { logger } from "../../logger/index.mjs";
|
|
2
|
-
// CONCATENATED MODULE: ./src/internal/core/runtime/onExit.ts
|
|
1
|
+
import { logger } from "../../logger/index.mjs";
|
|
3
2
|
|
|
4
3
|
let handlers = [];
|
|
5
4
|
let listenersRegistered = false;
|
|
@@ -34,7 +33,7 @@ const registerListeners = () => {
|
|
|
34
33
|
const handleSignal = () => {
|
|
35
34
|
runAllHandlers(signal);
|
|
36
35
|
process.off(signal, handleSignal);
|
|
37
|
-
process.kill(
|
|
36
|
+
process.kill(0, signal);
|
|
38
37
|
};
|
|
39
38
|
process.on(signal, handleSignal);
|
|
40
39
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import os from "os";
|
|
2
|
-
import path from "path";
|
|
3
|
-
// CONCATENATED MODULE: external "path"
|
|
4
|
-
// CONCATENATED MODULE: ./src/internal/core/runtime/os.ts
|
|
2
|
+
import path from "path";
|
|
5
3
|
|
|
6
4
|
const IS_WINDOWS = process.platform === "win32";
|
|
7
5
|
const IS_MACOS = process.platform === "darwin";
|
|
@@ -5,15 +5,7 @@ import { validateCurrentBunVersion } from "../../bun/bunVersion.mjs";
|
|
|
5
5
|
import { logger } from "../../logger/index.mjs";
|
|
6
6
|
import { BUN_WORKSPACES_VERSION } from "../../version.mjs";
|
|
7
7
|
import { createShortId } from "../language/string/id.mjs";
|
|
8
|
-
import { runOnExit } from "./onExit.mjs";
|
|
9
|
-
// CONCATENATED MODULE: external "os"
|
|
10
|
-
// CONCATENATED MODULE: external "path"
|
|
11
|
-
// CONCATENATED MODULE: external "../../bun/bunVersion.mjs"
|
|
12
|
-
// CONCATENATED MODULE: external "../../logger/index.mjs"
|
|
13
|
-
// CONCATENATED MODULE: external "../../version.mjs"
|
|
14
|
-
// CONCATENATED MODULE: external "../language/string/id.mjs"
|
|
15
|
-
// CONCATENATED MODULE: external "./onExit.mjs"
|
|
16
|
-
// CONCATENATED MODULE: ./src/internal/core/runtime/tempFile.ts
|
|
8
|
+
import { runOnExit } from "./onExit.mjs";
|
|
17
9
|
|
|
18
10
|
const getTempBasePackageDir = () => path.join(os.tmpdir(), "bun-workspaces");
|
|
19
11
|
const getTempParentDir = () =>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { defineErrors } from "../core/error/index.mjs";
|
|
2
|
-
import { IS_TEST } from "../core/runtime/env.mjs";
|
|
3
|
-
|
|
4
|
-
// CONCATENATED MODULE: ./src/internal/logger/logger.ts
|
|
2
|
+
import { IS_TEST } from "../core/runtime/env.mjs";
|
|
3
|
+
import { LOG_LEVELS, getLogLevelNumber } from "../../8126.mjs";
|
|
5
4
|
|
|
6
|
-
const LOG_LEVELS = ["debug", "info", "warn", "error"];
|
|
7
|
-
const getLevelNumber = (level) => LOG_LEVELS.indexOf(level);
|
|
8
5
|
const LOGGER_ERRORS = defineErrors("InvalidLogLevel");
|
|
9
6
|
const validateLogLevel = (level) => {
|
|
10
7
|
if (level === "silent") return;
|
|
@@ -106,7 +103,7 @@ class _Logger {
|
|
|
106
103
|
_printLevel = IS_TEST ? "error" : "info";
|
|
107
104
|
shouldPrint(level) {
|
|
108
105
|
if (this.printLevel === "silent") return false;
|
|
109
|
-
return
|
|
106
|
+
return getLogLevelNumber(level) >= getLogLevelNumber(this.printLevel);
|
|
110
107
|
}
|
|
111
108
|
_printStdout = (...args) => process.stdout.write(...args);
|
|
112
109
|
_printStderr = (...args) => process.stderr.write(...args);
|
|
@@ -123,11 +120,4 @@ const logger = createLogger("bun-workspaces");
|
|
|
123
120
|
logger.printLevel = level;
|
|
124
121
|
};
|
|
125
122
|
|
|
126
|
-
export {
|
|
127
|
-
LOGGER_ERRORS,
|
|
128
|
-
LOG_LEVELS,
|
|
129
|
-
createLogger,
|
|
130
|
-
logger,
|
|
131
|
-
setLogLevel,
|
|
132
|
-
validateLogLevel,
|
|
133
|
-
};
|
|
123
|
+
export { LOGGER_ERRORS, createLogger, logger, setLogLevel, validateLogLevel };
|
package/src/internal/version.mjs
CHANGED
package/src/project/errors.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { defineErrors } from "../internal/core/index.mjs";
|
|
2
|
-
// CONCATENATED MODULE: ./src/project/errors.ts
|
|
1
|
+
import { defineErrors } from "../internal/core/index.mjs";
|
|
3
2
|
|
|
4
3
|
const PROJECT_ERRORS = defineErrors(
|
|
5
4
|
"ProjectWorkspaceNotFound",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { parse, quote } from "shell-quote/";
|
|
4
3
|
import { loadRootConfig } from "../../config/index.mjs";
|
|
5
4
|
import { getUserEnvVar } from "../../config/userEnvVars/index.mjs";
|
|
5
|
+
import { parse, quote } from "../../internal/bundledDeps/shellQuote.mjs";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_TEMP_DIR,
|
|
8
8
|
IS_WINDOWS,
|
|
@@ -26,24 +26,9 @@ import { preventDependencyCycles } from "../../workspaces/dependencyGraph/index.
|
|
|
26
26
|
import { PROJECT_ERRORS } from "../errors.mjs";
|
|
27
27
|
import {
|
|
28
28
|
ProjectBase,
|
|
29
|
-
ROOT_WORKSPACE_SELECTOR,
|
|
30
29
|
resolveRootWorkspaceSelector,
|
|
31
30
|
resolveWorkspacePath,
|
|
32
|
-
} from "./projectBase.mjs";
|
|
33
|
-
// CONCATENATED MODULE: external "path"
|
|
34
|
-
// CONCATENATED MODULE: external "shell-quote/"
|
|
35
|
-
// CONCATENATED MODULE: external "../../config/index.mjs"
|
|
36
|
-
// CONCATENATED MODULE: external "../../config/userEnvVars/index.mjs"
|
|
37
|
-
// CONCATENATED MODULE: external "../../internal/core/index.mjs"
|
|
38
|
-
// CONCATENATED MODULE: external "../../internal/logger/index.mjs"
|
|
39
|
-
// CONCATENATED MODULE: external "../../runScript/index.mjs"
|
|
40
|
-
// CONCATENATED MODULE: external "../../runScript/recursion.mjs"
|
|
41
|
-
// CONCATENATED MODULE: external "../../runScript/scriptShellOption.mjs"
|
|
42
|
-
// CONCATENATED MODULE: external "../../workspaces/index.mjs"
|
|
43
|
-
// CONCATENATED MODULE: external "../../workspaces/dependencyGraph/index.mjs"
|
|
44
|
-
// CONCATENATED MODULE: external "../errors.mjs"
|
|
45
|
-
// CONCATENATED MODULE: external "./projectBase.mjs"
|
|
46
|
-
// CONCATENATED MODULE: ./src/project/implementations/fileSystemProject.ts
|
|
31
|
+
} from "./projectBase.mjs";
|
|
47
32
|
|
|
48
33
|
const quoteArg = (arg, shell) =>
|
|
49
34
|
IS_WINDOWS && shell === "system"
|
|
@@ -460,7 +445,7 @@ class _FileSystemProject extends ProjectBase {
|
|
|
460
445
|
: this.createScriptCommand({
|
|
461
446
|
workspaceNameOrAlias:
|
|
462
447
|
workspace.name === this.rootWorkspace.name
|
|
463
|
-
? ROOT_WORKSPACE_SELECTOR
|
|
448
|
+
? /* inlined export .ROOT_WORKSPACE_SELECTOR */ "@root"
|
|
464
449
|
: workspace.name,
|
|
465
450
|
scriptName: script,
|
|
466
451
|
args,
|
|
@@ -4,11 +4,7 @@ import {
|
|
|
4
4
|
WORKSPACE_ERRORS,
|
|
5
5
|
validateWorkspaceAliases,
|
|
6
6
|
} from "../../workspaces/index.mjs";
|
|
7
|
-
import { ProjectBase } from "./projectBase.mjs";
|
|
8
|
-
// CONCATENATED MODULE: external "../../internal/core/index.mjs"
|
|
9
|
-
// CONCATENATED MODULE: external "../../workspaces/index.mjs"
|
|
10
|
-
// CONCATENATED MODULE: external "./projectBase.mjs"
|
|
11
|
-
// CONCATENATED MODULE: ./src/project/implementations/memoryProject.ts
|
|
7
|
+
import { ProjectBase } from "./projectBase.mjs";
|
|
12
8
|
|
|
13
9
|
class _MemoryProject extends ProjectBase {
|
|
14
10
|
rootDirectory;
|