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
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ProcessOutput,
|
|
3
|
-
type BytesOutput,
|
|
4
|
-
type TextOutput,
|
|
5
|
-
} from "./processOutput";
|
|
6
|
-
export interface MultiProcessOutput<Metadata extends object = object> {
|
|
7
|
-
bytes(): BytesOutput<Metadata>;
|
|
8
|
-
text(): TextOutput<Metadata>;
|
|
9
|
-
}
|
|
10
|
-
export declare const createMultiProcessOutput: <
|
|
11
|
-
Metadata extends object = object,
|
|
12
|
-
>(
|
|
13
|
-
processes: ProcessOutput<Metadata>[],
|
|
14
|
-
) => MultiProcessOutput<Metadata>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type OutputStreamName = "stdout" | "stderr";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { type SimpleAsyncIterable } from "../../internal/core";
|
|
2
|
-
export type ByteStream = SimpleAsyncIterable<Uint8Array<ArrayBufferLike>>;
|
|
3
|
-
export type ProcessOutputChunk<
|
|
4
|
-
Chunk = unknown,
|
|
5
|
-
Metadata extends object = object,
|
|
6
|
-
> = {
|
|
7
|
-
/** The metadata for the script that produced the output chunk */
|
|
8
|
-
metadata: Metadata;
|
|
9
|
-
/** The output chunk */
|
|
10
|
-
chunk: Chunk;
|
|
11
|
-
};
|
|
12
|
-
export type ByteChunk<Metadata extends object = object> = ProcessOutputChunk<
|
|
13
|
-
Uint8Array<ArrayBufferLike>,
|
|
14
|
-
Metadata
|
|
15
|
-
>;
|
|
16
|
-
export type TextChunk<Metadata extends object = object> = ProcessOutputChunk<
|
|
17
|
-
string,
|
|
18
|
-
Metadata
|
|
19
|
-
>;
|
|
20
|
-
export type BytesOutput<Metadata extends object = object> = SimpleAsyncIterable<
|
|
21
|
-
ByteChunk<Metadata>
|
|
22
|
-
>;
|
|
23
|
-
export type TextOutput<Metadata extends object = object> = SimpleAsyncIterable<
|
|
24
|
-
TextChunk<Metadata>
|
|
25
|
-
>;
|
|
26
|
-
export interface ProcessOutput<Metadata extends object = object> {
|
|
27
|
-
bytes(): BytesOutput<Metadata>;
|
|
28
|
-
text(): TextOutput<Metadata>;
|
|
29
|
-
}
|
|
30
|
-
export declare const createProcessOutput: <Metadata extends object = object>(
|
|
31
|
-
stream: ByteStream,
|
|
32
|
-
metadata: Metadata,
|
|
33
|
-
) => ProcessOutput<Metadata>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare const PARALLEL_MAX_VALUES: readonly [
|
|
2
|
-
"auto",
|
|
3
|
-
"unbounded",
|
|
4
|
-
"default",
|
|
5
|
-
];
|
|
6
|
-
export type PercentageValue = `${number}%`;
|
|
7
|
-
/**
|
|
8
|
-
* The maximum number of scripts that can run in parallel.
|
|
9
|
-
*
|
|
10
|
-
* - `number`: The exact number of scripts that can run in parallel.
|
|
11
|
-
* - `"auto"`: The number of available logical CPU threads.
|
|
12
|
-
* - `"unbounded"`: No limit.
|
|
13
|
-
* - `"default"`: The default value, either "auto" or the value of the root config's "parallelMax" option.
|
|
14
|
-
* - `"${number}%"`: A percentage of the available logical CPU threads (e.g. "50%").
|
|
15
|
-
*/
|
|
16
|
-
export type ParallelMaxValue =
|
|
17
|
-
| number
|
|
18
|
-
| (typeof PARALLEL_MAX_VALUES)[number]
|
|
19
|
-
| PercentageValue;
|
|
20
|
-
/** Should always return at least 1 */
|
|
21
|
-
export declare const determineParallelMax: (
|
|
22
|
-
value: ParallelMaxValue,
|
|
23
|
-
errorMessageSuffix?: string,
|
|
24
|
-
) => number;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type MultiProcessOutput, type OutputStreamName } from "./output";
|
|
2
|
-
import type { ScriptCommand } from "./scriptCommand";
|
|
3
|
-
import type { ScriptShellOption } from "./scriptShellOption";
|
|
4
|
-
export type RunScriptExit<ScriptMetadata extends object = object> = {
|
|
5
|
-
exitCode: number;
|
|
6
|
-
signal: NodeJS.Signals | null;
|
|
7
|
-
success: boolean;
|
|
8
|
-
/** Whether the script was skipped due to a failed dependency */
|
|
9
|
-
skipped?: boolean;
|
|
10
|
-
startTimeISO: string;
|
|
11
|
-
endTimeISO: string;
|
|
12
|
-
durationMs: number;
|
|
13
|
-
metadata: ScriptMetadata;
|
|
14
|
-
};
|
|
15
|
-
export type RunScriptResult<ScriptMetadata extends object = object> = {
|
|
16
|
-
output: MultiProcessOutput<
|
|
17
|
-
ScriptMetadata & {
|
|
18
|
-
streamName: OutputStreamName;
|
|
19
|
-
}
|
|
20
|
-
>;
|
|
21
|
-
exit: Promise<RunScriptExit<ScriptMetadata>>;
|
|
22
|
-
metadata: ScriptMetadata;
|
|
23
|
-
kill: (exit?: number | NodeJS.Signals) => void;
|
|
24
|
-
};
|
|
25
|
-
export type RunScriptOptions<ScriptMetadata extends object = object> = {
|
|
26
|
-
scriptCommand: ScriptCommand;
|
|
27
|
-
metadata: ScriptMetadata;
|
|
28
|
-
env: Record<string, string>;
|
|
29
|
-
/** The shell to use to run the script. Defaults to "system". */
|
|
30
|
-
shell?: ScriptShellOption;
|
|
31
|
-
/** Set to `true` to ignore all output from the script. This saves memory when you don't need script output. */
|
|
32
|
-
ignoreOutput?: boolean;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Run some script and get an async output stream of
|
|
36
|
-
* stdout and stderr chunks and a result object
|
|
37
|
-
* containing exit details.
|
|
38
|
-
*/
|
|
39
|
-
export declare const runScript: <ScriptMetadata extends object = object>({
|
|
40
|
-
scriptCommand,
|
|
41
|
-
metadata,
|
|
42
|
-
env,
|
|
43
|
-
shell,
|
|
44
|
-
ignoreOutput,
|
|
45
|
-
}: RunScriptOptions<ScriptMetadata>) => RunScriptResult<ScriptMetadata>;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { type MultiProcessOutput, type OutputStreamName } from "./output";
|
|
2
|
-
import { type ParallelMaxValue } from "./parallel";
|
|
3
|
-
import { type RunScriptExit, type RunScriptResult } from "./runScript";
|
|
4
|
-
import { type ScriptCommand } from "./scriptCommand";
|
|
5
|
-
import { type ScriptShellOption } from "./scriptShellOption";
|
|
6
|
-
export type RunScriptsScript<ScriptMetadata extends object = object> = {
|
|
7
|
-
scriptCommand: ScriptCommand;
|
|
8
|
-
metadata: ScriptMetadata;
|
|
9
|
-
env: Record<string, string>;
|
|
10
|
-
/** The shell to use to run the script */
|
|
11
|
-
shell?: ScriptShellOption;
|
|
12
|
-
/** Indices of other scripts in the array that must complete before this one starts */
|
|
13
|
-
dependsOn?: number[];
|
|
14
|
-
/** Set to `true` to ignore all output from the script. This saves memory when you don't need script output. */
|
|
15
|
-
ignoreOutput?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type RunScriptsScriptResult<ScriptMetadata extends object = object> = {
|
|
18
|
-
/** The result of running the script */
|
|
19
|
-
result: RunScriptResult<ScriptMetadata>;
|
|
20
|
-
};
|
|
21
|
-
export type RunScriptsSummary<ScriptMetadata extends object = object> = {
|
|
22
|
-
totalCount: number;
|
|
23
|
-
successCount: number;
|
|
24
|
-
failureCount: number;
|
|
25
|
-
allSuccess: boolean;
|
|
26
|
-
startTimeISO: string;
|
|
27
|
-
endTimeISO: string;
|
|
28
|
-
durationMs: number;
|
|
29
|
-
scriptResults: RunScriptExit<ScriptMetadata>[];
|
|
30
|
-
};
|
|
31
|
-
export type ScriptEventName = "start" | "skip" | "exit";
|
|
32
|
-
export type RunScriptsResult<ScriptMetadata extends object = object> = {
|
|
33
|
-
output: MultiProcessOutput<
|
|
34
|
-
ScriptMetadata & {
|
|
35
|
-
streamName: OutputStreamName;
|
|
36
|
-
}
|
|
37
|
-
>;
|
|
38
|
-
/** Resolves with a results summary after all scripts have exited */
|
|
39
|
-
summary: Promise<RunScriptsSummary<ScriptMetadata>>;
|
|
40
|
-
};
|
|
41
|
-
export type RunScriptsParallelOptions = {
|
|
42
|
-
max: ParallelMaxValue;
|
|
43
|
-
};
|
|
44
|
-
export type RunScriptsOptions<ScriptMetadata extends object = object> = {
|
|
45
|
-
scripts: RunScriptsScript<ScriptMetadata>[];
|
|
46
|
-
parallel: boolean | RunScriptsParallelOptions;
|
|
47
|
-
/** When true, run scripts even if a dependency failed. Default: false (skip them). */
|
|
48
|
-
ignoreDependencyFailure?: boolean;
|
|
49
|
-
/** Set to `true` to ignore all output from the scripts. This saves memory when you don't need script output. */
|
|
50
|
-
ignoreOutput?: boolean;
|
|
51
|
-
/** Callback to invoke when a script event occurs */
|
|
52
|
-
onScriptEvent?: (
|
|
53
|
-
event: ScriptEventName,
|
|
54
|
-
scriptIndex: number,
|
|
55
|
-
result: RunScriptExit<ScriptMetadata> | null,
|
|
56
|
-
) => void;
|
|
57
|
-
};
|
|
58
|
-
/** Run a list of scripts */
|
|
59
|
-
export declare const runScripts: <ScriptMetadata extends object = object>({
|
|
60
|
-
scripts,
|
|
61
|
-
parallel,
|
|
62
|
-
ignoreDependencyFailure,
|
|
63
|
-
ignoreOutput,
|
|
64
|
-
onScriptEvent,
|
|
65
|
-
}: RunScriptsOptions<ScriptMetadata>) => RunScriptsResult<ScriptMetadata>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Workspace } from "../workspaces";
|
|
2
|
-
export declare const WORKSPACE_SCRIPT_COMMAND_METHODS: readonly [
|
|
3
|
-
"cd",
|
|
4
|
-
"filter",
|
|
5
|
-
];
|
|
6
|
-
export type WorkspaceScriptCommandMethod =
|
|
7
|
-
(typeof WORKSPACE_SCRIPT_COMMAND_METHODS)[number];
|
|
8
|
-
/** Basic metadata to run a script, the command string and the directory to run it in */
|
|
9
|
-
export interface ScriptCommand {
|
|
10
|
-
/** The command string to run */
|
|
11
|
-
command: string;
|
|
12
|
-
/** The directory to run the command in */
|
|
13
|
-
workingDirectory: string;
|
|
14
|
-
}
|
|
15
|
-
export interface CreateWorkspaceScriptCommandOptions {
|
|
16
|
-
/**
|
|
17
|
-
* The method to use to run the script.
|
|
18
|
-
* Either run in the workspace directory or use bun's --filter option.
|
|
19
|
-
* Defaults to "cd".
|
|
20
|
-
*/
|
|
21
|
-
method?: WorkspaceScriptCommandMethod;
|
|
22
|
-
/** The name of the script to run */
|
|
23
|
-
scriptName: string;
|
|
24
|
-
/** The arguments to append to the command */
|
|
25
|
-
args: string;
|
|
26
|
-
/** The workspace that the script belongs to */
|
|
27
|
-
workspace: Workspace;
|
|
28
|
-
/** The root directory of the project */
|
|
29
|
-
rootDirectory: string;
|
|
30
|
-
}
|
|
31
|
-
export declare const createWorkspaceScriptCommand: (
|
|
32
|
-
options: CreateWorkspaceScriptCommandOptions,
|
|
33
|
-
) => ScriptCommand;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { ScriptShellOption } from "./scriptShellOption";
|
|
2
|
-
export interface ScriptRuntimeMetadata {
|
|
3
|
-
projectPath: string;
|
|
4
|
-
projectName: string;
|
|
5
|
-
workspacePath: string;
|
|
6
|
-
workspaceRelativePath: string;
|
|
7
|
-
workspaceName: string;
|
|
8
|
-
scriptName: string;
|
|
9
|
-
}
|
|
10
|
-
declare const SCRIPT_RUNTIME_METADATA_CONFIG: {
|
|
11
|
-
readonly projectPath: {
|
|
12
|
-
readonly inlineName: "<projectPath>";
|
|
13
|
-
readonly envVarName: "BW_PROJECT_PATH";
|
|
14
|
-
};
|
|
15
|
-
readonly projectName: {
|
|
16
|
-
readonly inlineName: "<projectName>";
|
|
17
|
-
readonly envVarName: "BW_PROJECT_NAME";
|
|
18
|
-
};
|
|
19
|
-
readonly workspacePath: {
|
|
20
|
-
readonly inlineName: "<workspacePath>";
|
|
21
|
-
readonly envVarName: "BW_WORKSPACE_PATH";
|
|
22
|
-
};
|
|
23
|
-
readonly workspaceRelativePath: {
|
|
24
|
-
readonly inlineName: "<workspaceRelativePath>";
|
|
25
|
-
readonly envVarName: "BW_WORKSPACE_RELATIVE_PATH";
|
|
26
|
-
};
|
|
27
|
-
readonly scriptName: {
|
|
28
|
-
readonly inlineName: "<scriptName>";
|
|
29
|
-
readonly envVarName: "BW_SCRIPT_NAME";
|
|
30
|
-
};
|
|
31
|
-
readonly workspaceName: {
|
|
32
|
-
readonly inlineName: "<workspaceName>";
|
|
33
|
-
readonly envVarName: "BW_WORKSPACE_NAME";
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export type ScriptRuntimeMetadataKey =
|
|
37
|
-
keyof typeof SCRIPT_RUNTIME_METADATA_CONFIG;
|
|
38
|
-
export declare const getScriptRuntimeMetadataConfig: (
|
|
39
|
-
key: ScriptRuntimeMetadataKey,
|
|
40
|
-
) =>
|
|
41
|
-
| {
|
|
42
|
-
readonly inlineName: "<projectPath>";
|
|
43
|
-
readonly envVarName: "BW_PROJECT_PATH";
|
|
44
|
-
}
|
|
45
|
-
| {
|
|
46
|
-
readonly inlineName: "<projectName>";
|
|
47
|
-
readonly envVarName: "BW_PROJECT_NAME";
|
|
48
|
-
}
|
|
49
|
-
| {
|
|
50
|
-
readonly inlineName: "<workspacePath>";
|
|
51
|
-
readonly envVarName: "BW_WORKSPACE_PATH";
|
|
52
|
-
}
|
|
53
|
-
| {
|
|
54
|
-
readonly inlineName: "<workspaceRelativePath>";
|
|
55
|
-
readonly envVarName: "BW_WORKSPACE_RELATIVE_PATH";
|
|
56
|
-
}
|
|
57
|
-
| {
|
|
58
|
-
readonly inlineName: "<scriptName>";
|
|
59
|
-
readonly envVarName: "BW_SCRIPT_NAME";
|
|
60
|
-
}
|
|
61
|
-
| {
|
|
62
|
-
readonly inlineName: "<workspaceName>";
|
|
63
|
-
readonly envVarName: "BW_WORKSPACE_NAME";
|
|
64
|
-
};
|
|
65
|
-
export declare const createScriptRuntimeEnvVars: (
|
|
66
|
-
metadata: ScriptRuntimeMetadata,
|
|
67
|
-
) => Record<string, string>;
|
|
68
|
-
export declare const interpolateScriptRuntimeMetadata: (
|
|
69
|
-
text: string,
|
|
70
|
-
metadata: ScriptRuntimeMetadata,
|
|
71
|
-
shell: ScriptShellOption,
|
|
72
|
-
) => string;
|
|
73
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const SCRIPT_SHELL_OPTIONS: readonly ["bun", "system"];
|
|
2
|
-
export type ScriptShellOption = (typeof SCRIPT_SHELL_OPTIONS)[number];
|
|
3
|
-
export declare const validateScriptShellOption: (
|
|
4
|
-
shell: string,
|
|
5
|
-
fromEnvVar?: boolean,
|
|
6
|
-
) => ScriptShellOption;
|
|
7
|
-
export declare const getScriptShellDefault: () => "bun" | "system";
|
|
8
|
-
export declare const resolveScriptShell: (shell?: string) => ScriptShellOption;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**Essentially a wrapper around `Bun.spawn` that ensures all
|
|
2
|
-
* the subprocess is killed when the main process exits for any
|
|
3
|
-
* handle-able exit code or signal. */
|
|
4
|
-
export declare const createSubprocess: <
|
|
5
|
-
In extends Bun.SpawnOptions.Writable,
|
|
6
|
-
Out extends Bun.SpawnOptions.Readable,
|
|
7
|
-
Err extends Bun.SpawnOptions.Readable,
|
|
8
|
-
>(
|
|
9
|
-
argv: string[],
|
|
10
|
-
options: Bun.Spawn.SpawnOptions<In, Out, Err>,
|
|
11
|
-
) => Bun.Subprocess<In, Out, Err>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Workspace } from "../workspace";
|
|
2
|
-
export type DependencyCycleEdge = {
|
|
3
|
-
dependency: string;
|
|
4
|
-
dependent: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const preventDependencyCycles: (workspaces: Workspace[]) => {
|
|
7
|
-
workspaces: Workspace[];
|
|
8
|
-
cycles: DependencyCycleEdge[];
|
|
9
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ResolvedWorkspaceConfig } from "../../config";
|
|
2
|
-
import {
|
|
3
|
-
type BunCatalogSet,
|
|
4
|
-
type ResolvedPackageJsonContent,
|
|
5
|
-
} from "../packageJson";
|
|
6
|
-
import type { Workspace } from "../workspace";
|
|
7
|
-
export type WorkspaceMap = {
|
|
8
|
-
[workspaceName: string]: {
|
|
9
|
-
workspace: Workspace;
|
|
10
|
-
config: ResolvedWorkspaceConfig;
|
|
11
|
-
packageJson: ResolvedPackageJsonContent;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export declare const resolveWorkspaceDependencies: (
|
|
15
|
-
workspaceMap: WorkspaceMap,
|
|
16
|
-
includeRootWorkspace: boolean,
|
|
17
|
-
catalogs?: BunCatalogSet,
|
|
18
|
-
) => Workspace[];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceMap } from "./resolveDependencies";
|
|
2
|
-
export type ValidateWorkspaceDependencyRulesOptions = {
|
|
3
|
-
workspaceMap: WorkspaceMap;
|
|
4
|
-
};
|
|
5
|
-
export declare const validateWorkspaceDependencyRules: ({
|
|
6
|
-
workspaceMap,
|
|
7
|
-
}: ValidateWorkspaceDependencyRulesOptions) => void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const WORKSPACE_ERRORS: import("../internal/core").DefinedErrors<
|
|
2
|
-
| "PackageNotFound"
|
|
3
|
-
| "InvalidPackageJson"
|
|
4
|
-
| "DuplicateWorkspaceName"
|
|
5
|
-
| "InvalidWorkspaceName"
|
|
6
|
-
| "NoWorkspaceName"
|
|
7
|
-
| "InvalidScripts"
|
|
8
|
-
| "InvalidWorkspaces"
|
|
9
|
-
| "InvalidWorkspacePattern"
|
|
10
|
-
| "AliasConflict"
|
|
11
|
-
| "AliasedWorkspaceNotFound"
|
|
12
|
-
| "RootWorkspaceNotFound"
|
|
13
|
-
| "DependencyRuleViolation"
|
|
14
|
-
>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type WorkspaceMap } from "./dependencyGraph";
|
|
2
|
-
import type { Workspace } from "./workspace";
|
|
3
|
-
export interface FindWorkspacesOptions {
|
|
4
|
-
rootDirectory: string;
|
|
5
|
-
/** If provided, will override the workspaces found in the package.json. Mainly for testing purposes */
|
|
6
|
-
workspaceGlobs?: string[];
|
|
7
|
-
/** Whether to include the root workspace as a normal workspace.*/
|
|
8
|
-
includeRootWorkspace?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const sortWorkspaces: (workspaces: Workspace[]) => Workspace[];
|
|
11
|
-
export declare const findWorkspaces: ({
|
|
12
|
-
rootDirectory,
|
|
13
|
-
workspaceGlobs: _workspaceGlobs,
|
|
14
|
-
includeRootWorkspace,
|
|
15
|
-
}: FindWorkspacesOptions) => {
|
|
16
|
-
workspaces: Workspace[];
|
|
17
|
-
workspaceMap: WorkspaceMap;
|
|
18
|
-
rootWorkspace: Workspace;
|
|
19
|
-
};
|
|
20
|
-
export declare const validateWorkspaceAliases: (
|
|
21
|
-
workspaces: Workspace[],
|
|
22
|
-
workspaceAliases: Record<string, string>,
|
|
23
|
-
rootWorkspaceName: string,
|
|
24
|
-
) => void;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare const resolvePackageJsonPath: (directoryItem: string) => string;
|
|
2
|
-
export type BunCatalog = Record<string, string>;
|
|
3
|
-
export type BunCatalogSet = {
|
|
4
|
-
defaultCatalog: BunCatalog;
|
|
5
|
-
namedCatalogs: Record<string, BunCatalog>;
|
|
6
|
-
};
|
|
7
|
-
export type ResolvedPackageJsonContent = {
|
|
8
|
-
name: string;
|
|
9
|
-
workspaces: string[];
|
|
10
|
-
catalog: BunCatalog;
|
|
11
|
-
catalogs: Record<string, BunCatalog>;
|
|
12
|
-
scripts: Record<string, string>;
|
|
13
|
-
dependencies: Record<string, string>;
|
|
14
|
-
devDependencies: Record<string, string>;
|
|
15
|
-
peerDependencies: Record<string, string>;
|
|
16
|
-
optionalDependencies: Record<string, string>;
|
|
17
|
-
} & Record<string, unknown>;
|
|
18
|
-
/**
|
|
19
|
-
* Resolve a `catalog:` or `catalog:name` version reference for a given package name.
|
|
20
|
-
* Returns the resolved version string, or null if the catalog or package is not found.
|
|
21
|
-
*/
|
|
22
|
-
export declare const resolveCatalogDependencyVersion: (
|
|
23
|
-
packageName: string,
|
|
24
|
-
catalogRef: string,
|
|
25
|
-
catalogs: BunCatalogSet,
|
|
26
|
-
) => string | null;
|
|
27
|
-
export declare const resolvePackageJsonContent: (
|
|
28
|
-
packageJsonPath: string,
|
|
29
|
-
rootDirectory: string,
|
|
30
|
-
validations: ("workspaces" | "name" | "scripts")[],
|
|
31
|
-
) => ResolvedPackageJsonContent;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** Metadata about a nested package within a Bun monorepo */
|
|
2
|
-
export type Workspace = {
|
|
3
|
-
/** The name of the workspace from its `package.json` */
|
|
4
|
-
name: string;
|
|
5
|
-
/** Whether the workspace is the root workspace */
|
|
6
|
-
isRoot: boolean;
|
|
7
|
-
/** The relative path to the workspace from the root `package.json` */
|
|
8
|
-
path: string;
|
|
9
|
-
/** The pattern from `"workspaces"` in the root `package.json`that this workspace was matched from*/
|
|
10
|
-
matchPattern: string;
|
|
11
|
-
/** The scripts available in package.json */
|
|
12
|
-
scripts: string[];
|
|
13
|
-
/** Aliases assigned via the `"alias"` field in the workspace's config */
|
|
14
|
-
aliases: string[];
|
|
15
|
-
/** Tags assigned via the `"tags"` field in the workspace's config */
|
|
16
|
-
tags: string[];
|
|
17
|
-
/** Names of workspaces that this workspace depends on */
|
|
18
|
-
dependencies: string[];
|
|
19
|
-
/** Names of workspaces that depend on this workspace */
|
|
20
|
-
dependents: string[];
|
|
21
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Workspace } from "./workspace";
|
|
2
|
-
declare const TARGETS: readonly ["path", "alias", "name", "tag"];
|
|
3
|
-
export declare const WORKSPACE_PATTERN_ERRORS: import("../internal/core").DefinedErrors<"InvalidWorkspacePattern">;
|
|
4
|
-
export type WorkspacePatternTarget = (typeof TARGETS)[number];
|
|
5
|
-
export type WorkspacePattern = {
|
|
6
|
-
target: WorkspacePatternTarget | "default";
|
|
7
|
-
value: string;
|
|
8
|
-
isNegated: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare const WORKSPACE_PATTERN_NEGATION_PREFIX = "not:";
|
|
11
|
-
export declare const WORKSPACE_PATTERN_SEPARATOR = ":";
|
|
12
|
-
export declare const parseWorkspacePattern: (
|
|
13
|
-
pattern: string,
|
|
14
|
-
) => WorkspacePattern;
|
|
15
|
-
export declare const stringifyWorkspacePattern: (
|
|
16
|
-
pattern: WorkspacePattern,
|
|
17
|
-
) => string;
|
|
18
|
-
export declare const matchWorkspacesByPatterns: (
|
|
19
|
-
patterns: string[],
|
|
20
|
-
workspaces: Workspace[],
|
|
21
|
-
) => Workspace[];
|
|
22
|
-
export {};
|