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,75 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type TypedEvent,
|
|
3
|
-
TypedEventTarget,
|
|
4
|
-
} from "../../../../internal/core/language/events/typedEventTarget";
|
|
5
|
-
import type {
|
|
6
|
-
RunScriptAcrossWorkspacesOutput,
|
|
7
|
-
RunWorkspaceScriptMetadata,
|
|
8
|
-
} from "../../../../project";
|
|
9
|
-
import type {
|
|
10
|
-
RunScriptExit,
|
|
11
|
-
RunScriptsSummary,
|
|
12
|
-
ScriptEventName,
|
|
13
|
-
} from "../../../../runScript";
|
|
14
|
-
import type { Workspace } from "../../../../workspaces";
|
|
15
|
-
import type { WriteOutputOptions } from "../../../createCli";
|
|
16
|
-
type ScriptEvent = TypedEvent<
|
|
17
|
-
ScriptEventName,
|
|
18
|
-
{
|
|
19
|
-
workspace: Workspace;
|
|
20
|
-
exitResult: RunScriptExit<RunWorkspaceScriptMetadata> | null;
|
|
21
|
-
}
|
|
22
|
-
>;
|
|
23
|
-
declare class ScriptEventTarget extends TypedEventTarget<{
|
|
24
|
-
[key in ScriptEvent["type"]]: ScriptEvent;
|
|
25
|
-
}> {}
|
|
26
|
-
export declare const createScriptEventTarget: () => ScriptEventTarget;
|
|
27
|
-
export declare const createScriptEvent: {
|
|
28
|
-
start: (
|
|
29
|
-
properties: Omit<
|
|
30
|
-
{
|
|
31
|
-
type: ScriptEventName;
|
|
32
|
-
} & {
|
|
33
|
-
workspace: Workspace;
|
|
34
|
-
exitResult: RunScriptExit<RunWorkspaceScriptMetadata> | null;
|
|
35
|
-
},
|
|
36
|
-
"type"
|
|
37
|
-
>,
|
|
38
|
-
options?: EventInit,
|
|
39
|
-
) => ScriptEvent;
|
|
40
|
-
skip: (
|
|
41
|
-
properties: Omit<
|
|
42
|
-
{
|
|
43
|
-
type: ScriptEventName;
|
|
44
|
-
} & {
|
|
45
|
-
workspace: Workspace;
|
|
46
|
-
exitResult: RunScriptExit<RunWorkspaceScriptMetadata> | null;
|
|
47
|
-
},
|
|
48
|
-
"type"
|
|
49
|
-
>,
|
|
50
|
-
options?: EventInit,
|
|
51
|
-
) => ScriptEvent;
|
|
52
|
-
exit: (
|
|
53
|
-
properties: Omit<
|
|
54
|
-
{
|
|
55
|
-
type: ScriptEventName;
|
|
56
|
-
} & {
|
|
57
|
-
workspace: Workspace;
|
|
58
|
-
exitResult: RunScriptExit<RunWorkspaceScriptMetadata> | null;
|
|
59
|
-
},
|
|
60
|
-
"type"
|
|
61
|
-
>,
|
|
62
|
-
options?: EventInit,
|
|
63
|
-
) => ScriptEvent;
|
|
64
|
-
};
|
|
65
|
-
export declare const renderGroupedOutput: (
|
|
66
|
-
workspaces: Workspace[],
|
|
67
|
-
output: RunScriptAcrossWorkspacesOutput,
|
|
68
|
-
summary: Promise<RunScriptsSummary<RunWorkspaceScriptMetadata>>,
|
|
69
|
-
scriptEventTarget: ScriptEventTarget,
|
|
70
|
-
activeScriptLines: number | "all" | "auto",
|
|
71
|
-
outputWriters: Required<WriteOutputOptions>,
|
|
72
|
-
terminalWidth: number,
|
|
73
|
-
terminalHeight: number,
|
|
74
|
-
) => Promise<void>;
|
|
75
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { RunScriptAcrossWorkspacesOutput } from "../../../../project";
|
|
2
|
-
import type { WriteOutputOptions } from "../../../createCli";
|
|
3
|
-
export type RenderPlainOutputOptions = {
|
|
4
|
-
stripDisruptiveControls?: boolean;
|
|
5
|
-
prefix?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function generatePlainOutputLines(
|
|
8
|
-
output: RunScriptAcrossWorkspacesOutput,
|
|
9
|
-
{ stripDisruptiveControls, prefix }: RenderPlainOutputOptions,
|
|
10
|
-
): AsyncGenerator<
|
|
11
|
-
{
|
|
12
|
-
line: string;
|
|
13
|
-
metadata: import("../../../..").RunWorkspaceScriptMetadata & {
|
|
14
|
-
streamName: import("../../../..").OutputStreamName;
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
void,
|
|
18
|
-
unknown
|
|
19
|
-
>;
|
|
20
|
-
export declare const renderPlainOutput: (
|
|
21
|
-
output: RunScriptAcrossWorkspacesOutput,
|
|
22
|
-
outputWriters: Required<WriteOutputOptions>,
|
|
23
|
-
{ stripDisruptiveControls, prefix }: RenderPlainOutputOptions,
|
|
24
|
-
) => Promise<void>;
|
package/src/cli/createCli.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type CliMiddlewareOptions } from "./middleware";
|
|
2
|
-
export interface WriteOutputOptions {
|
|
3
|
-
stdout?: (...args: Parameters<typeof process.stdout.write>) => void;
|
|
4
|
-
stderr?: (...args: Parameters<typeof process.stderr.write>) => void;
|
|
5
|
-
}
|
|
6
|
-
export interface RunCliOptions {
|
|
7
|
-
argv?: string[];
|
|
8
|
-
/** Should be `true` if args do not include the binary name (e.g. `bunx bun-workspaces`) */
|
|
9
|
-
programmatic?: true;
|
|
10
|
-
middleware?: CliMiddlewareOptions;
|
|
11
|
-
writeOutput?: WriteOutputOptions;
|
|
12
|
-
terminalWidth?: number;
|
|
13
|
-
terminalHeight?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface CLI {
|
|
16
|
-
run: (options?: RunCliOptions) => Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
export interface CreateCliOptions {
|
|
19
|
-
defaultCwd?: string;
|
|
20
|
-
/** Always handled when the result `.run()` is called */
|
|
21
|
-
defaultMiddleware?: CliMiddlewareOptions;
|
|
22
|
-
}
|
|
23
|
-
export declare const createCli: ({
|
|
24
|
-
defaultCwd,
|
|
25
|
-
defaultMiddleware,
|
|
26
|
-
}?: CreateCliOptions) => CLI;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const fatalErrorLogger: import("../internal/logger").Logger;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { type Command } from "commander";
|
|
2
|
-
import type { CliMiddleware } from "../middleware";
|
|
3
|
-
export declare const initializeWithGlobalOptions: (
|
|
4
|
-
program: Command,
|
|
5
|
-
args: string[],
|
|
6
|
-
middleware: CliMiddleware,
|
|
7
|
-
) => {
|
|
8
|
-
project: import("../../internal/core").Simplify<{
|
|
9
|
-
readonly rootDirectory: string;
|
|
10
|
-
readonly workspaces: import("../..").Workspace[];
|
|
11
|
-
readonly name: string;
|
|
12
|
-
readonly sourceType: "fileSystem";
|
|
13
|
-
readonly config: import("../../project").ProjectConfig;
|
|
14
|
-
readonly rootWorkspace: import("../..").Workspace;
|
|
15
|
-
runWorkspaceScript(
|
|
16
|
-
options: import("../..").RunWorkspaceScriptOptions,
|
|
17
|
-
): import("../..").RunWorkspaceScriptResult;
|
|
18
|
-
runScriptAcrossWorkspaces(
|
|
19
|
-
options: import("../..").RunScriptAcrossWorkspacesOptions,
|
|
20
|
-
): import("../..").RunScriptAcrossWorkspacesResult;
|
|
21
|
-
listWorkspacesWithScript(scriptName: string): import("../..").Workspace[];
|
|
22
|
-
mapScriptsToWorkspaces(): Record<
|
|
23
|
-
string,
|
|
24
|
-
import("../..").WorkspaceScriptMetadata
|
|
25
|
-
>;
|
|
26
|
-
mapTagsToWorkspaces(): Record<string, import("../..").Workspace[]>;
|
|
27
|
-
findWorkspaceByName(
|
|
28
|
-
workspaceName: string,
|
|
29
|
-
): import("../..").Workspace | null;
|
|
30
|
-
findWorkspaceByAlias(alias: string): import("../..").Workspace | null;
|
|
31
|
-
findWorkspaceByNameOrAlias(
|
|
32
|
-
nameOrAlias: string,
|
|
33
|
-
): import("../..").Workspace | null;
|
|
34
|
-
listWorkspacesWithTag(tag: string): import("../..").Workspace[];
|
|
35
|
-
findWorkspacesByPattern(
|
|
36
|
-
...workspacePatterns: string[]
|
|
37
|
-
): import("../..").Workspace[];
|
|
38
|
-
createScriptCommand(
|
|
39
|
-
options: import("../..").CreateProjectScriptCommandOptions,
|
|
40
|
-
): import("../..").CreateProjectScriptCommandResult;
|
|
41
|
-
}>;
|
|
42
|
-
projectError: Error | null;
|
|
43
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { type LogLevelSetting } from "../../internal/logger";
|
|
2
|
-
export interface CliGlobalOptions {
|
|
3
|
-
logLevel: LogLevelSetting;
|
|
4
|
-
cwd: string;
|
|
5
|
-
includeRoot: boolean;
|
|
6
|
-
workspaceRoot: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface CliGlobalOptionConfig {
|
|
9
|
-
mainOption: string;
|
|
10
|
-
shortOption: string;
|
|
11
|
-
description: string;
|
|
12
|
-
defaultValue: string;
|
|
13
|
-
values: string[] | null;
|
|
14
|
-
param: string;
|
|
15
|
-
}
|
|
16
|
-
export type CliGlobalOptionName = keyof CliGlobalOptions;
|
|
17
|
-
export declare const getCliGlobalOptionConfig: (
|
|
18
|
-
optionName: CliGlobalOptionName,
|
|
19
|
-
) =>
|
|
20
|
-
| {
|
|
21
|
-
readonly mainOption: "--log-level";
|
|
22
|
-
readonly shortOption: "-l";
|
|
23
|
-
readonly description: "Log levels";
|
|
24
|
-
readonly defaultValue: "info";
|
|
25
|
-
readonly values: ("debug" | "info" | "warn" | "error" | "silent")[];
|
|
26
|
-
readonly param: "level";
|
|
27
|
-
}
|
|
28
|
-
| {
|
|
29
|
-
readonly mainOption: "--cwd";
|
|
30
|
-
readonly shortOption: "-d";
|
|
31
|
-
readonly description: "Working directory";
|
|
32
|
-
readonly defaultValue: "";
|
|
33
|
-
readonly values: null;
|
|
34
|
-
readonly param: "path";
|
|
35
|
-
}
|
|
36
|
-
| {
|
|
37
|
-
readonly mainOption: "--include-root";
|
|
38
|
-
readonly shortOption: "-r";
|
|
39
|
-
readonly description: "Include the root workspace as a normal workspace";
|
|
40
|
-
readonly defaultValue: "";
|
|
41
|
-
readonly values: null;
|
|
42
|
-
readonly param: "";
|
|
43
|
-
}
|
|
44
|
-
| {
|
|
45
|
-
readonly mainOption: "--workspace-root";
|
|
46
|
-
readonly shortOption: "-w";
|
|
47
|
-
readonly description: "Run from the project root above the current working directory";
|
|
48
|
-
readonly defaultValue: "";
|
|
49
|
-
readonly values: null;
|
|
50
|
-
readonly param: "";
|
|
51
|
-
};
|
|
52
|
-
export declare const getCliGlobalOptionNames: () => CliGlobalOptionName[];
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { LOG_LEVELS } from "../../internal/logger/index.mjs"; // CONCATENATED MODULE: external "../../internal/logger/index.mjs"
|
|
2
|
-
// CONCATENATED MODULE: ./src/cli/globalOptions/globalOptionsConfig.ts
|
|
3
|
-
|
|
4
|
-
const CLI_GLOBAL_OPTIONS_CONFIG = {
|
|
5
|
-
logLevel: {
|
|
6
|
-
mainOption: "--log-level",
|
|
7
|
-
shortOption: "-l",
|
|
8
|
-
description: "Log levels",
|
|
9
|
-
defaultValue: "info",
|
|
10
|
-
values: [...LOG_LEVELS, "silent"],
|
|
11
|
-
param: "level",
|
|
12
|
-
},
|
|
13
|
-
cwd: {
|
|
14
|
-
mainOption: "--cwd",
|
|
15
|
-
shortOption: "-d",
|
|
16
|
-
description: "Working directory",
|
|
17
|
-
defaultValue: "",
|
|
18
|
-
values: null,
|
|
19
|
-
param: "path",
|
|
20
|
-
},
|
|
21
|
-
includeRoot: {
|
|
22
|
-
mainOption: "--include-root",
|
|
23
|
-
shortOption: "-r",
|
|
24
|
-
description: "Include the root workspace as a normal workspace",
|
|
25
|
-
defaultValue: "",
|
|
26
|
-
values: null,
|
|
27
|
-
param: "",
|
|
28
|
-
},
|
|
29
|
-
workspaceRoot: {
|
|
30
|
-
mainOption: "--workspace-root",
|
|
31
|
-
shortOption: "-w",
|
|
32
|
-
description:
|
|
33
|
-
"Run from the project root above the current working directory",
|
|
34
|
-
defaultValue: "",
|
|
35
|
-
values: null,
|
|
36
|
-
param: "",
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
const getCliGlobalOptionConfig = (optionName) =>
|
|
40
|
-
CLI_GLOBAL_OPTIONS_CONFIG[optionName];
|
|
41
|
-
const getCliGlobalOptionNames = () => Object.keys(CLI_GLOBAL_OPTIONS_CONFIG);
|
|
42
|
-
|
|
43
|
-
export { getCliGlobalOptionConfig, getCliGlobalOptionNames };
|
package/src/cli/middleware.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { Command as CommanderProgram } from "commander";
|
|
2
|
-
import type { FileSystemProject } from "../project";
|
|
3
|
-
import type { CliCommandName, CliGlobalCommandName } from "./commands";
|
|
4
|
-
import type {
|
|
5
|
-
GlobalCommandContext,
|
|
6
|
-
ProjectCommandContext,
|
|
7
|
-
} from "./commands/commandHandlerUtils";
|
|
8
|
-
export type InitProgramContext = {
|
|
9
|
-
commanderProgram: CommanderProgram;
|
|
10
|
-
argv: string[];
|
|
11
|
-
};
|
|
12
|
-
export type ProcessArgvContext = {
|
|
13
|
-
commanderProgram: CommanderProgram;
|
|
14
|
-
args: string[];
|
|
15
|
-
postTerminatorArgs: string[];
|
|
16
|
-
};
|
|
17
|
-
export type ProcessWorkingDirectoryContext = {
|
|
18
|
-
commanderProgram: CommanderProgram;
|
|
19
|
-
workingDirectory: string;
|
|
20
|
-
exists: boolean;
|
|
21
|
-
isDirectory: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type FindProjectContext = {
|
|
24
|
-
commanderProgram: CommanderProgram;
|
|
25
|
-
project: FileSystemProject;
|
|
26
|
-
projectError: Error | null;
|
|
27
|
-
};
|
|
28
|
-
export type PreParseContext = {
|
|
29
|
-
commanderProgram: CommanderProgram;
|
|
30
|
-
args: string[];
|
|
31
|
-
project: FileSystemProject;
|
|
32
|
-
projectError: Error | null;
|
|
33
|
-
};
|
|
34
|
-
export type PostParseContext = {
|
|
35
|
-
commanderProgram: CommanderProgram;
|
|
36
|
-
args: string[];
|
|
37
|
-
project: FileSystemProject;
|
|
38
|
-
projectError: Error | null;
|
|
39
|
-
};
|
|
40
|
-
export type CommandMiddlewareContext<C extends CliCommandName> = {
|
|
41
|
-
commanderProgram: CommanderProgram;
|
|
42
|
-
commandName: C;
|
|
43
|
-
commandContext: C extends CliGlobalCommandName
|
|
44
|
-
? GlobalCommandContext
|
|
45
|
-
: ProjectCommandContext;
|
|
46
|
-
commanderActionArgs: unknown[];
|
|
47
|
-
};
|
|
48
|
-
export type CommandMiddleware = <C extends CliCommandName>(
|
|
49
|
-
context: CommandMiddlewareContext<C>,
|
|
50
|
-
) => CommanderProgram;
|
|
51
|
-
export type PostCleanupContext = {
|
|
52
|
-
commanderProgram: CommanderProgram;
|
|
53
|
-
args: string[];
|
|
54
|
-
project: FileSystemProject;
|
|
55
|
-
projectError: Error | null;
|
|
56
|
-
};
|
|
57
|
-
export type CliMiddleware = {
|
|
58
|
-
/** The first callback when the Commander program is created */
|
|
59
|
-
initProgram: (context: InitProgramContext) => CommanderProgram;
|
|
60
|
-
/** Before the true parsing, just splitting the argv into args and post-terminator args */
|
|
61
|
-
processArgv: (context: ProcessArgvContext) => CommanderProgram;
|
|
62
|
-
/** Before the working directory is changed */
|
|
63
|
-
processWorkingDirectory: (
|
|
64
|
-
context: ProcessWorkingDirectoryContext,
|
|
65
|
-
) => CommanderProgram;
|
|
66
|
-
/** After the project has been initialized from global options */
|
|
67
|
-
findProject: (context: FindProjectContext) => CommanderProgram;
|
|
68
|
-
/** Before the Commander program parses the args */
|
|
69
|
-
preParse: (context: PreParseContext) => CommanderProgram;
|
|
70
|
-
/** After the Commander program has parsed the args (runs in finally block) */
|
|
71
|
-
postParse: (context: PostParseContext) => CommanderProgram;
|
|
72
|
-
/** Before a command is handled */
|
|
73
|
-
preHandleCommand: CommandMiddleware;
|
|
74
|
-
/** After a command is handled */
|
|
75
|
-
postHandleCommand: CommandMiddleware;
|
|
76
|
-
/** After the program has been parsed */
|
|
77
|
-
catchError: (error: Error) => unknown;
|
|
78
|
-
};
|
|
79
|
-
export type CliMiddlewareOptions = Partial<CliMiddleware>;
|
|
80
|
-
export declare const resolveMiddleware: (
|
|
81
|
-
defaultMiddleware: CliMiddlewareOptions,
|
|
82
|
-
runMiddleware: CliMiddlewareOptions,
|
|
83
|
-
) => CliMiddleware;
|
package/src/config/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ROOT_CONFIG_ERRORS: import("../../internal/core").DefinedErrors<"InvalidRootConfig">;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ShellOption } from "../../project";
|
|
2
|
-
import { type ParallelMaxValue, type ScriptShellOption } from "../../runScript";
|
|
3
|
-
export type RootConfig = {
|
|
4
|
-
defaults?: {
|
|
5
|
-
/** The maximum number of scripts that can run in parallel. (default: "auto") */
|
|
6
|
-
parallelMax?: ParallelMaxValue;
|
|
7
|
-
/** The shell to use for inline scripts. (default: "bun") */
|
|
8
|
-
shell?: ShellOption;
|
|
9
|
-
/** Whether to include the root workspace in the workspaces list by default. (default: false) */
|
|
10
|
-
includeRootWorkspace?: boolean;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export type ResolvedRootConfig = {
|
|
14
|
-
defaults: {
|
|
15
|
-
parallelMax: number;
|
|
16
|
-
shell: ScriptShellOption;
|
|
17
|
-
/** `undefined` means the value was not set in the input config */
|
|
18
|
-
includeRootWorkspace: boolean | undefined;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare const validateRootConfig: (config: RootConfig) => void;
|
|
22
|
-
export declare const createDefaultRootConfig: () => ResolvedRootConfig;
|
|
23
|
-
export declare const resolveRootConfig: (
|
|
24
|
-
config: RootConfig,
|
|
25
|
-
) => ResolvedRootConfig;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const ROOT_CONFIG_JSON_SCHEMA: {
|
|
2
|
-
readonly type: "object";
|
|
3
|
-
readonly additionalProperties: false;
|
|
4
|
-
readonly properties: {
|
|
5
|
-
readonly defaults: {
|
|
6
|
-
readonly type: "object";
|
|
7
|
-
readonly additionalProperties: false;
|
|
8
|
-
readonly properties: {
|
|
9
|
-
readonly parallelMax: {
|
|
10
|
-
readonly type: readonly ["number", "string"];
|
|
11
|
-
};
|
|
12
|
-
readonly shell: {
|
|
13
|
-
readonly type: "string";
|
|
14
|
-
};
|
|
15
|
-
readonly includeRootWorkspace: {
|
|
16
|
-
readonly type: "boolean";
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./userEnvVars";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const USER_ENV_VARS: {
|
|
2
|
-
readonly parallelMaxDefault: "BW_PARALLEL_MAX_DEFAULT";
|
|
3
|
-
readonly scriptShellDefault: "BW_SHELL_DEFAULT";
|
|
4
|
-
readonly includeRootWorkspaceDefault: "BW_INCLUDE_ROOT_WORKSPACE_DEFAULT";
|
|
5
|
-
};
|
|
6
|
-
export type UserEnvVarName = keyof typeof USER_ENV_VARS;
|
|
7
|
-
export declare const getUserEnvVar: (key: UserEnvVarName) => string | undefined;
|
|
8
|
-
export declare const getUserEnvVarName: (
|
|
9
|
-
key: UserEnvVarName,
|
|
10
|
-
) =>
|
|
11
|
-
| "BW_PARALLEL_MAX_DEFAULT"
|
|
12
|
-
| "BW_SHELL_DEFAULT"
|
|
13
|
-
| "BW_INCLUDE_ROOT_WORKSPACE_DEFAULT";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type AjvJsonSchemaErrorObject = {
|
|
2
|
-
instancePath?: string;
|
|
3
|
-
schemaPath?: string;
|
|
4
|
-
keyword?: string;
|
|
5
|
-
params?: Record<string, unknown>;
|
|
6
|
-
message?: string;
|
|
7
|
-
};
|
|
8
|
-
export type AjvSchemaValidator<T = unknown> = ((data: unknown) => data is T) & {
|
|
9
|
-
errors?: AjvJsonSchemaErrorObject[] | null;
|
|
10
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const CONFIG_LOCATION_TYPES: readonly [
|
|
2
|
-
"tsFile",
|
|
3
|
-
"jsFile",
|
|
4
|
-
"jsoncFile",
|
|
5
|
-
"jsonFile",
|
|
6
|
-
"packageJson",
|
|
7
|
-
];
|
|
8
|
-
export type ConfigLocationType = (typeof CONFIG_LOCATION_TYPES)[number];
|
|
9
|
-
export type ConfigLocation = {
|
|
10
|
-
type: ConfigLocationType;
|
|
11
|
-
content: unknown;
|
|
12
|
-
path: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const createConfigLocationPath: (
|
|
15
|
-
locationType: ConfigLocationType,
|
|
16
|
-
name: string,
|
|
17
|
-
packageJsonKey: string,
|
|
18
|
-
) => string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type AnyFunction } from "../../internal/core";
|
|
2
|
-
import { type ConfigLocation } from "./configLocation";
|
|
3
|
-
export declare const LOAD_CONFIG_ERRORS: import("../../internal/core").DefinedErrors<
|
|
4
|
-
"InvalidJSON" | "NoExportError" | "ModuleLoadFailure"
|
|
5
|
-
>;
|
|
6
|
-
export declare const getConfigLocation: (
|
|
7
|
-
name: string,
|
|
8
|
-
directory: string,
|
|
9
|
-
fileName: string,
|
|
10
|
-
packageJsonKey: string,
|
|
11
|
-
) => ConfigLocation | null;
|
|
12
|
-
export declare const loadConfig: <ProcessContent extends AnyFunction>(
|
|
13
|
-
name: string,
|
|
14
|
-
directory: string,
|
|
15
|
-
fileName: string,
|
|
16
|
-
packageJsonKey: string,
|
|
17
|
-
processContent: ProcessContent,
|
|
18
|
-
) => ReturnType<ProcessContent> | null;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { BunWorkspacesError } from "../../internal/core";
|
|
2
|
-
import type { AjvSchemaValidator } from "./ajvTypes";
|
|
3
|
-
export declare const executeValidator: <Config extends object>(
|
|
4
|
-
validator: AjvSchemaValidator<Config>,
|
|
5
|
-
name: string,
|
|
6
|
-
config: Config,
|
|
7
|
-
ErrorType: typeof BunWorkspacesError,
|
|
8
|
-
) => void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const WORKSPACE_CONFIG_ERRORS: import("../../internal/core").DefinedErrors<"InvalidWorkspaceConfig">;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export type WorkspaceDependenciesRule = {
|
|
2
|
-
allowPatterns?: string[];
|
|
3
|
-
denyPatterns?: string[];
|
|
4
|
-
};
|
|
5
|
-
export type WorkspaceRules = {
|
|
6
|
-
/** Allowed or denied workspace dependencies */
|
|
7
|
-
workspaceDependencies?: WorkspaceDependenciesRule;
|
|
8
|
-
};
|
|
9
|
-
/** Configuration that applies to a specific package.json script */
|
|
10
|
-
export type ScriptConfig = {
|
|
11
|
-
/**
|
|
12
|
-
* The order in which the script should be executed.
|
|
13
|
-
*
|
|
14
|
-
* This is used to sort the scripts in the workspace.
|
|
15
|
-
*
|
|
16
|
-
* Scripts with no `order` set will be executed in alphanumerical order
|
|
17
|
-
* of their relative path from the project root.
|
|
18
|
-
*/
|
|
19
|
-
order?: number;
|
|
20
|
-
};
|
|
21
|
-
/** Configuration that applies to a specific workspace */
|
|
22
|
-
export type WorkspaceConfig = {
|
|
23
|
-
/**
|
|
24
|
-
* An alias or list of aliases for the workspace.
|
|
25
|
-
*
|
|
26
|
-
* These must be unique to other workspaces' aliases
|
|
27
|
-
* and package.json names.
|
|
28
|
-
*/
|
|
29
|
-
alias?: string | string[];
|
|
30
|
-
/**
|
|
31
|
-
* Tags for the workspace.
|
|
32
|
-
*
|
|
33
|
-
* These can be used to group workspaces
|
|
34
|
-
* by a common tag.
|
|
35
|
-
*/
|
|
36
|
-
tags?: string[];
|
|
37
|
-
/**
|
|
38
|
-
* Configuration that maps to a script name in the workspace's package.json.
|
|
39
|
-
*/
|
|
40
|
-
scripts?: Record<string, ScriptConfig>;
|
|
41
|
-
/**
|
|
42
|
-
* Rules that validate the workspace.
|
|
43
|
-
*/
|
|
44
|
-
rules?: WorkspaceRules;
|
|
45
|
-
};
|
|
46
|
-
export type ResolvedWorkspaceConfig = {
|
|
47
|
-
aliases: string[];
|
|
48
|
-
tags: string[];
|
|
49
|
-
scripts: Record<string, ScriptConfig>;
|
|
50
|
-
rules: WorkspaceRules;
|
|
51
|
-
};
|
|
52
|
-
export declare const validateWorkspaceConfig: (config: WorkspaceConfig) => void;
|
|
53
|
-
export declare const resolveWorkspaceConfig: (
|
|
54
|
-
config: WorkspaceConfig,
|
|
55
|
-
) => ResolvedWorkspaceConfig;
|
|
56
|
-
export declare const createDefaultWorkspaceConfig: () => ResolvedWorkspaceConfig;
|