bun-workspaces 1.0.0-alpha.8 → 1.0.0
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/LICENSE.md +1 -1
- package/README.md +212 -19
- package/bin/cli.js +1 -1
- package/package.json +25 -9
- package/src/cli/commands/commandHandlerUtils.d.ts +45 -0
- package/src/cli/commands/commandHandlerUtils.mjs +81 -0
- package/src/cli/commands/commands.d.ts +10 -0
- package/src/cli/commands/commands.mjs +23 -0
- package/src/cli/commands/commandsConfig.d.ts +351 -0
- package/src/cli/commands/commandsConfig.mjs +183 -0
- package/src/cli/commands/handleSimpleCommands.d.ts +15 -0
- package/src/cli/commands/handleSimpleCommands.mjs +174 -0
- package/src/cli/commands/index.d.ts +3 -0
- package/src/cli/commands/index.mjs +3 -0
- package/src/cli/commands/runScript/handleRunScript.d.ts +3 -0
- package/src/cli/commands/runScript/handleRunScript.mjs +250 -0
- package/src/cli/commands/runScript/index.d.ts +2 -0
- package/src/cli/commands/runScript/index.mjs +2 -0
- package/src/cli/commands/runScript/output/index.d.ts +1 -0
- package/src/cli/commands/runScript/output/index.mjs +1 -0
- package/src/cli/commands/runScript/output/outputStyle.d.ts +8 -0
- package/src/cli/commands/runScript/output/outputStyle.mjs +17 -0
- package/src/cli/commands/runScript/output/renderGroupedOutput.d.ts +71 -0
- package/src/cli/commands/runScript/output/renderGroupedOutput.mjs +307 -0
- package/src/cli/commands/runScript/output/renderPlainOutput.d.ts +22 -0
- package/src/cli/commands/runScript/output/renderPlainOutput.mjs +43 -0
- package/src/cli/commands/runScript/output/sanitizeChunk.d.ts +4 -0
- package/src/cli/commands/runScript/output/sanitizeChunk.mjs +101 -0
- package/src/cli/createCli.d.ts +14 -8
- package/src/cli/createCli.mjs +94 -39
- package/src/cli/fatalErrorLogger.d.ts +1 -0
- package/src/cli/fatalErrorLogger.mjs +7 -0
- package/src/cli/globalOptions/globalOptions.d.ts +38 -2
- package/src/cli/globalOptions/globalOptions.mjs +96 -47
- package/src/cli/globalOptions/globalOptionsConfig.d.ts +37 -31
- package/src/cli/globalOptions/globalOptionsConfig.mjs +32 -30
- package/src/cli/globalOptions/index.mjs +1 -1
- package/src/cli/index.d.ts +3 -1
- package/src/cli/index.mjs +3 -2
- package/src/config/index.d.ts +3 -2
- package/src/config/index.mjs +3 -3
- package/src/config/rootConfig/errors.d.ts +1 -0
- package/src/config/rootConfig/errors.mjs +6 -0
- package/src/config/rootConfig/index.d.ts +5 -0
- package/src/config/rootConfig/index.mjs +5 -0
- package/src/config/rootConfig/loadRootConfig.d.ts +3 -0
- package/src/config/rootConfig/loadRootConfig.mjs +22 -0
- package/src/config/rootConfig/rootConfig.d.ts +17 -0
- package/src/config/rootConfig/rootConfig.mjs +43 -0
- package/src/config/rootConfig/rootConfigLocation.d.ts +2 -0
- package/src/config/rootConfig/rootConfigLocation.mjs +5 -0
- package/src/config/rootConfig/rootConfigSchema.d.ts +21 -0
- package/src/config/rootConfig/rootConfigSchema.mjs +24 -0
- package/src/config/userEnvVars/index.d.ts +1 -0
- package/src/config/userEnvVars/index.mjs +1 -0
- package/src/config/userEnvVars/userEnvVars.d.ts +13 -0
- package/src/config/userEnvVars/userEnvVars.mjs +10 -0
- package/src/config/util/ajvTypes.d.ts +10 -0
- package/src/config/util/ajvTypes.mjs +2 -0
- package/src/config/util/configLocation.d.ts +12 -0
- package/src/config/util/configLocation.mjs +11 -0
- package/src/config/util/index.d.ts +4 -0
- package/src/config/util/index.mjs +3 -0
- package/src/config/util/loadConfig.d.ts +16 -0
- package/src/config/util/loadConfig.mjs +118 -0
- package/src/config/util/validateConfig.d.ts +8 -0
- package/src/config/util/validateConfig.mjs +17 -0
- package/src/config/workspaceConfig/errors.d.ts +1 -0
- package/src/config/workspaceConfig/errors.mjs +6 -0
- package/src/config/workspaceConfig/index.d.ts +5 -0
- package/src/config/workspaceConfig/index.mjs +5 -0
- package/src/config/workspaceConfig/loadWorkspaceConfig.d.ts +3 -0
- package/src/config/workspaceConfig/loadWorkspaceConfig.mjs +25 -0
- package/src/config/workspaceConfig/workspaceConfig.d.ts +22 -0
- package/src/config/workspaceConfig/workspaceConfig.mjs +31 -0
- package/src/config/workspaceConfig/workspaceConfigLocation.d.ts +2 -0
- package/src/config/workspaceConfig/workspaceConfigLocation.mjs +5 -0
- package/src/config/workspaceConfig/workspaceConfigSchema.d.ts +25 -0
- package/src/config/workspaceConfig/workspaceConfigSchema.mjs +28 -0
- package/src/doctor/doctor.d.ts +35 -0
- package/src/doctor/doctor.mjs +52 -0
- package/src/doctor/index.d.ts +1 -0
- package/src/doctor/index.mjs +1 -0
- package/src/index.d.ts +37 -3
- package/src/index.mjs +16 -3
- package/src/internal/bun/bunLock.d.ts +20 -0
- package/src/internal/bun/bunLock.mjs +70 -0
- package/src/internal/bun/bunVersion.d.ts +21 -0
- package/src/internal/bun/bunVersion.mjs +43 -0
- package/src/internal/bun/index.d.ts +2 -0
- package/src/internal/bun/index.mjs +2 -0
- package/src/internal/core/error/error.d.ts +13 -0
- package/src/internal/core/error/error.mjs +36 -0
- package/src/internal/core/error/index.d.ts +1 -0
- package/src/internal/core/error/index.mjs +1 -0
- package/src/internal/core/index.d.ts +4 -0
- package/src/internal/core/index.mjs +4 -0
- package/src/internal/core/json/index.d.ts +2 -0
- package/src/internal/core/json/index.mjs +2 -0
- package/src/internal/core/json/json.d.ts +49 -0
- package/src/internal/core/json/json.mjs +12 -0
- package/src/internal/core/json/jsonc.d.ts +9 -0
- package/src/internal/core/json/jsonc.mjs +117 -0
- package/src/internal/core/language/array/index.d.ts +1 -0
- package/src/internal/core/language/array/index.mjs +1 -0
- package/src/internal/core/language/array/optionalArray.d.ts +15 -0
- package/src/internal/core/language/array/optionalArray.mjs +8 -0
- package/src/internal/core/language/asyncIterable/asyncIterableQueue.d.ts +16 -0
- package/src/internal/core/language/asyncIterable/asyncIterableQueue.mjs +81 -0
- package/src/internal/core/language/asyncIterable/index.d.ts +2 -0
- package/src/internal/core/language/asyncIterable/index.mjs +2 -0
- package/src/internal/core/language/asyncIterable/mergeAsyncIterables.d.ts +5 -0
- package/src/internal/core/language/asyncIterable/mergeAsyncIterables.mjs +27 -0
- package/src/internal/core/language/events/typedEventTarget.d.ts +50 -0
- package/src/internal/core/language/events/typedEventTarget.mjs +14 -0
- package/src/internal/core/language/index.d.ts +5 -0
- package/src/internal/core/language/index.mjs +5 -0
- package/src/internal/core/language/regex/index.d.ts +1 -0
- package/src/internal/core/language/regex/index.mjs +1 -0
- package/src/internal/{regex.d.ts → core/language/regex/regex.d.ts} +1 -0
- package/src/internal/core/language/regex/regex.mjs +10 -0
- package/src/internal/core/language/string/id.d.ts +1 -0
- package/src/internal/core/language/string/id.mjs +10 -0
- package/src/internal/core/language/string/index.d.ts +1 -0
- package/src/internal/core/language/string/index.mjs +1 -0
- package/src/internal/core/language/string/utf/eastAsianWidth.d.ts +16 -0
- package/src/internal/core/language/string/utf/eastAsianWidth.mjs +326 -0
- package/src/internal/core/language/string/utf/visibleLength.d.ts +5 -0
- package/src/internal/core/language/string/utf/visibleLength.mjs +29 -0
- package/src/internal/core/language/types/index.d.ts +2 -0
- package/src/internal/core/language/types/index.mjs +1 -0
- package/src/internal/core/language/types/typeof.d.ts +102 -0
- package/src/internal/core/language/types/typeof.mjs +123 -0
- package/src/internal/core/language/types/types.d.ts +14 -0
- package/src/internal/core/language/types/types.mjs +2 -0
- package/src/internal/{env.d.ts → core/runtime/env.d.ts} +1 -0
- package/src/internal/core/runtime/env.mjs +36 -0
- package/src/internal/core/runtime/index.d.ts +5 -0
- package/src/internal/core/runtime/index.mjs +5 -0
- package/src/internal/core/runtime/onExit.d.ts +4 -0
- package/src/internal/core/runtime/onExit.mjs +54 -0
- package/src/internal/core/runtime/os.d.ts +4 -0
- package/src/internal/core/runtime/os.mjs +7 -0
- package/src/internal/core/runtime/tempFile.d.ts +20 -0
- package/src/internal/core/runtime/tempFile.mjs +87 -0
- package/src/internal/core/runtime/terminal.d.ts +1 -0
- package/src/internal/core/runtime/terminal.mjs +4 -0
- package/src/internal/generated/ajv/validateRootConfig.mjs +1 -0
- package/src/internal/generated/ajv/validateWorkspaceConfig.mjs +1 -0
- package/src/internal/logger/index.d.ts +1 -0
- package/src/internal/logger/index.mjs +1 -0
- package/src/internal/logger/logger.d.ts +39 -0
- package/src/internal/logger/logger.mjs +116 -0
- package/src/internal/version.d.ts +1 -0
- package/src/internal/version.mjs +6 -0
- package/src/project/errors.d.ts +5 -1
- package/src/project/errors.mjs +10 -3
- package/src/project/implementations/fileSystemProject.d.ts +148 -0
- package/src/project/implementations/fileSystemProject.mjs +455 -0
- package/src/project/implementations/memoryProject.d.ts +41 -0
- package/src/project/implementations/memoryProject.mjs +148 -0
- package/src/project/implementations/projectBase.d.ts +35 -0
- package/src/project/implementations/projectBase.mjs +197 -0
- package/src/project/index.d.ts +5 -1
- package/src/project/index.mjs +4 -2
- package/src/project/project.d.ts +72 -28
- package/src/project/project.mjs +6 -72
- package/src/runScript/index.d.ts +7 -0
- package/src/runScript/index.mjs +7 -0
- package/src/runScript/output/index.d.ts +3 -0
- package/src/runScript/output/index.mjs +2 -0
- package/src/runScript/output/multiProcessOutput.d.ts +14 -0
- package/src/runScript/output/multiProcessOutput.mjs +21 -0
- package/src/runScript/output/outputStream.d.ts +1 -0
- package/src/runScript/output/outputStream.mjs +1 -0
- package/src/runScript/output/processOutput.d.ts +33 -0
- package/src/runScript/output/processOutput.mjs +124 -0
- package/src/runScript/parallel.d.ts +15 -0
- package/src/runScript/parallel.mjs +56 -0
- package/src/runScript/recursion.d.ts +4 -0
- package/src/runScript/recursion.mjs +17 -0
- package/src/runScript/runScript.d.ts +45 -0
- package/src/runScript/runScript.mjs +89 -0
- package/src/runScript/runScripts.d.ts +65 -0
- package/src/runScript/runScripts.mjs +263 -0
- package/src/runScript/scriptCommand.d.ts +33 -0
- package/src/runScript/scriptCommand.mjs +19 -0
- package/src/runScript/scriptExecution.d.ts +9 -0
- package/src/runScript/scriptExecution.mjs +50 -0
- package/src/runScript/scriptRuntimeMetadata.d.ts +73 -0
- package/src/runScript/scriptRuntimeMetadata.mjs +61 -0
- package/src/runScript/scriptShellOption.d.ts +8 -0
- package/src/runScript/scriptShellOption.mjs +39 -0
- package/src/runScript/subprocesses.d.ts +11 -0
- package/src/runScript/subprocesses.mjs +34 -0
- package/src/workspaces/dependencyGraph/cycles.d.ts +9 -0
- package/src/workspaces/dependencyGraph/cycles.mjs +91 -0
- package/src/workspaces/dependencyGraph/index.d.ts +2 -0
- package/src/workspaces/dependencyGraph/index.mjs +2 -0
- package/src/workspaces/dependencyGraph/resolveDependencies.d.ts +18 -0
- package/src/workspaces/dependencyGraph/resolveDependencies.mjs +52 -0
- package/src/workspaces/errors.d.ts +13 -1
- package/src/workspaces/errors.mjs +18 -3
- package/src/workspaces/findWorkspaces.d.ts +20 -13
- package/src/workspaces/findWorkspaces.mjs +208 -57
- package/src/workspaces/index.d.ts +4 -3
- package/src/workspaces/index.mjs +3 -2
- package/src/workspaces/packageJson.d.ts +28 -5
- package/src/workspaces/packageJson.mjs +177 -54
- package/src/workspaces/workspace.d.ts +19 -13
- package/src/workspaces/workspace.mjs +2 -0
- package/src/workspaces/workspacePattern.d.ts +21 -0
- package/src/workspaces/workspacePattern.mjs +104 -0
- package/src/cli/projectCommands/index.d.ts +0 -2
- package/src/cli/projectCommands/index.mjs +0 -2
- package/src/cli/projectCommands/projectCommandHandlers.d.ts +0 -8
- package/src/cli/projectCommands/projectCommandHandlers.mjs +0 -180
- package/src/cli/projectCommands/projectCommandsConfig.d.ts +0 -191
- package/src/cli/projectCommands/projectCommandsConfig.mjs +0 -100
- package/src/config/bunWorkspacesConfig.d.ts +0 -13
- package/src/config/bunWorkspacesConfig.mjs +0 -18
- package/src/config/configFile.d.ts +0 -3
- package/src/config/configFile.mjs +0 -21
- package/src/internal/bunVersion.d.ts +0 -14
- package/src/internal/bunVersion.mjs +0 -8
- package/src/internal/env.mjs +0 -15
- package/src/internal/error.d.ts +0 -7
- package/src/internal/error.mjs +0 -26
- package/src/internal/logger.d.ts +0 -21
- package/src/internal/logger.mjs +0 -85
- package/src/internal/regex.mjs +0 -3
- package/src/project/scriptCommand.d.ts +0 -15
- package/src/project/scriptCommand.mjs +0 -18
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
export interface CliCommandConfig {
|
|
2
|
+
command: string;
|
|
3
|
+
isGlobal: boolean;
|
|
4
|
+
aliases: string[] | readonly string[];
|
|
5
|
+
description: string;
|
|
6
|
+
options: Record<
|
|
7
|
+
string,
|
|
8
|
+
{
|
|
9
|
+
flags: string[] | readonly string[];
|
|
10
|
+
description: string;
|
|
11
|
+
values?: string[];
|
|
12
|
+
deprecated?: boolean;
|
|
13
|
+
}
|
|
14
|
+
>;
|
|
15
|
+
}
|
|
16
|
+
export type CliCommandName = keyof typeof CLI_COMMANDS_CONFIG;
|
|
17
|
+
export type CliGlobalCommandName = {
|
|
18
|
+
[K in CliCommandName]: (typeof CLI_COMMANDS_CONFIG)[K] extends {
|
|
19
|
+
isGlobal: true;
|
|
20
|
+
}
|
|
21
|
+
? K
|
|
22
|
+
: never;
|
|
23
|
+
}[CliCommandName];
|
|
24
|
+
export type CliProjectCommandName = Exclude<
|
|
25
|
+
CliCommandName,
|
|
26
|
+
CliGlobalCommandName
|
|
27
|
+
>;
|
|
28
|
+
export declare const JSON_FLAGS: readonly ["-j", "--json"];
|
|
29
|
+
export declare const DEFAULT_GROUPED_LINES = 20;
|
|
30
|
+
export declare const CLI_COMMANDS_CONFIG: {
|
|
31
|
+
readonly doctor: {
|
|
32
|
+
readonly command: "doctor";
|
|
33
|
+
readonly isGlobal: true;
|
|
34
|
+
readonly aliases: [];
|
|
35
|
+
readonly description: "Print diagnostic information";
|
|
36
|
+
readonly options: {
|
|
37
|
+
readonly json: {
|
|
38
|
+
readonly flags: readonly ["-j", "--json"];
|
|
39
|
+
readonly description: "Output as JSON";
|
|
40
|
+
};
|
|
41
|
+
readonly pretty: {
|
|
42
|
+
readonly flags: ["-p", "--pretty"];
|
|
43
|
+
readonly description: "Pretty print JSON";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readonly listWorkspaces: {
|
|
48
|
+
readonly command: "list-workspaces [workspacePatterns...]";
|
|
49
|
+
readonly isGlobal: false;
|
|
50
|
+
readonly aliases: ["ls", "list"];
|
|
51
|
+
readonly description: "List all workspaces";
|
|
52
|
+
readonly options: {
|
|
53
|
+
readonly workspacePatterns: {
|
|
54
|
+
readonly flags: ["-W", "--workspace-patterns <patterns>"];
|
|
55
|
+
readonly description: "Workspace patterns to match, separated by spaces";
|
|
56
|
+
};
|
|
57
|
+
readonly nameOnly: {
|
|
58
|
+
readonly flags: ["-n", "--name-only"];
|
|
59
|
+
readonly description: "Only show workspace names";
|
|
60
|
+
};
|
|
61
|
+
readonly json: {
|
|
62
|
+
readonly flags: readonly ["-j", "--json"];
|
|
63
|
+
readonly description: "Output as JSON";
|
|
64
|
+
};
|
|
65
|
+
readonly pretty: {
|
|
66
|
+
readonly flags: ["-p", "--pretty"];
|
|
67
|
+
readonly description: "Pretty print JSON";
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
readonly listScripts: {
|
|
72
|
+
readonly command: "list-scripts";
|
|
73
|
+
readonly isGlobal: false;
|
|
74
|
+
readonly aliases: ["ls-scripts"];
|
|
75
|
+
readonly description: "List all scripts available with their workspaces";
|
|
76
|
+
readonly options: {
|
|
77
|
+
readonly nameOnly: {
|
|
78
|
+
readonly flags: ["-n", "--name-only"];
|
|
79
|
+
readonly description: "Only show script names";
|
|
80
|
+
};
|
|
81
|
+
readonly json: {
|
|
82
|
+
readonly flags: readonly ["-j", "--json"];
|
|
83
|
+
readonly description: "Output as JSON";
|
|
84
|
+
};
|
|
85
|
+
readonly pretty: {
|
|
86
|
+
readonly flags: ["-p", "--pretty"];
|
|
87
|
+
readonly description: "Pretty print JSON";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
readonly workspaceInfo: {
|
|
92
|
+
readonly command: "workspace-info <workspaceName>";
|
|
93
|
+
readonly isGlobal: false;
|
|
94
|
+
readonly aliases: ["info"];
|
|
95
|
+
readonly description: "Show information about a workspace";
|
|
96
|
+
readonly options: {
|
|
97
|
+
readonly json: {
|
|
98
|
+
readonly flags: readonly ["-j", "--json"];
|
|
99
|
+
readonly description: "Output as JSON";
|
|
100
|
+
};
|
|
101
|
+
readonly pretty: {
|
|
102
|
+
readonly flags: ["-p", "--pretty"];
|
|
103
|
+
readonly description: "Pretty print JSON";
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
readonly scriptInfo: {
|
|
108
|
+
readonly command: "script-info <script>";
|
|
109
|
+
readonly isGlobal: false;
|
|
110
|
+
readonly aliases: [];
|
|
111
|
+
readonly description: "Show information about a script";
|
|
112
|
+
readonly options: {
|
|
113
|
+
readonly workspacesOnly: {
|
|
114
|
+
readonly flags: ["-w", "--workspaces-only"];
|
|
115
|
+
readonly description: "Only show script's workspace names";
|
|
116
|
+
};
|
|
117
|
+
readonly json: {
|
|
118
|
+
readonly flags: readonly ["-j", "--json"];
|
|
119
|
+
readonly description: "Output as JSON";
|
|
120
|
+
};
|
|
121
|
+
readonly pretty: {
|
|
122
|
+
readonly flags: ["-p", "--pretty"];
|
|
123
|
+
readonly description: "Pretty print JSON";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
readonly runScript: {
|
|
128
|
+
readonly command: "run-script [script] [workspacePatterns...]";
|
|
129
|
+
readonly isGlobal: false;
|
|
130
|
+
readonly aliases: ["run"];
|
|
131
|
+
readonly description: 'Run a script in all workspaces that have it in their "scripts" field in package.json';
|
|
132
|
+
readonly options: {
|
|
133
|
+
readonly script: {
|
|
134
|
+
readonly flags: ["-S", "--script <script>"];
|
|
135
|
+
readonly description: "The script to run.";
|
|
136
|
+
};
|
|
137
|
+
readonly workspacePatterns: {
|
|
138
|
+
readonly flags: ["-W", "--workspace-patterns <patterns>"];
|
|
139
|
+
readonly description: "Workspace patterns to match, separated by spaces.";
|
|
140
|
+
};
|
|
141
|
+
readonly parallel: {
|
|
142
|
+
readonly flags: ["-P", "--parallel [max]"];
|
|
143
|
+
readonly description: 'Run the scripts in parallel. Pass "false" for series, or a concurrency limit as a number, percentage ("50%"), "auto", "default", or"unbounded"';
|
|
144
|
+
};
|
|
145
|
+
readonly args: {
|
|
146
|
+
readonly flags: ["-a", "--args <args>"];
|
|
147
|
+
readonly description: "Args to append to the script command";
|
|
148
|
+
};
|
|
149
|
+
readonly outputStyle: {
|
|
150
|
+
readonly flags: ["-o", "--output-style <style>"];
|
|
151
|
+
readonly description: "The output style to use";
|
|
152
|
+
readonly values: ["grouped", "prefixed", "plain"];
|
|
153
|
+
};
|
|
154
|
+
readonly groupedLines: {
|
|
155
|
+
readonly flags: ["-L", "--grouped-lines <count>"];
|
|
156
|
+
readonly description: 'With "grouped" output, the max preview lines (number or "all", default 20)';
|
|
157
|
+
};
|
|
158
|
+
readonly noPrefix: {
|
|
159
|
+
readonly flags: ["-N", "--no-prefix"];
|
|
160
|
+
readonly description: "(DEPRECATED) Use --output-style=plain instead";
|
|
161
|
+
readonly deprecated: true;
|
|
162
|
+
};
|
|
163
|
+
readonly inline: {
|
|
164
|
+
readonly flags: ["-i", "--inline"];
|
|
165
|
+
readonly description: "Run the script as an inline command from the workspace directory";
|
|
166
|
+
};
|
|
167
|
+
readonly inlineName: {
|
|
168
|
+
readonly flags: ["-I", "--inline-name <name>"];
|
|
169
|
+
readonly description: "An optional name for the script when --inline is passed";
|
|
170
|
+
};
|
|
171
|
+
readonly shell: {
|
|
172
|
+
readonly flags: ["-s", "--shell <shell>"];
|
|
173
|
+
readonly values: ["bun", "system", "default"];
|
|
174
|
+
readonly description: "When using --inline, the shell to use to run the script";
|
|
175
|
+
};
|
|
176
|
+
readonly depOrder: {
|
|
177
|
+
readonly flags: ["-d", "--dep-order"];
|
|
178
|
+
readonly description: "Scripts for dependent workspaces run only after their dependencies";
|
|
179
|
+
};
|
|
180
|
+
readonly ignoreDepFailure: {
|
|
181
|
+
readonly flags: ["-f", "--ignore-dep-failure"];
|
|
182
|
+
readonly description: "In dependency order, continue running scripts even if a dependency fails";
|
|
183
|
+
};
|
|
184
|
+
readonly jsonOutfile: {
|
|
185
|
+
readonly flags: ["-j", "--json-outfile <file>"];
|
|
186
|
+
readonly description: "Output results in a JSON file";
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
export declare const getCliCommandConfig: (commandName: CliCommandName) =>
|
|
192
|
+
| {
|
|
193
|
+
readonly command: "doctor";
|
|
194
|
+
readonly isGlobal: true;
|
|
195
|
+
readonly aliases: [];
|
|
196
|
+
readonly description: "Print diagnostic information";
|
|
197
|
+
readonly options: {
|
|
198
|
+
readonly json: {
|
|
199
|
+
readonly flags: readonly ["-j", "--json"];
|
|
200
|
+
readonly description: "Output as JSON";
|
|
201
|
+
};
|
|
202
|
+
readonly pretty: {
|
|
203
|
+
readonly flags: ["-p", "--pretty"];
|
|
204
|
+
readonly description: "Pretty print JSON";
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
| {
|
|
209
|
+
readonly command: "list-workspaces [workspacePatterns...]";
|
|
210
|
+
readonly isGlobal: false;
|
|
211
|
+
readonly aliases: ["ls", "list"];
|
|
212
|
+
readonly description: "List all workspaces";
|
|
213
|
+
readonly options: {
|
|
214
|
+
readonly workspacePatterns: {
|
|
215
|
+
readonly flags: ["-W", "--workspace-patterns <patterns>"];
|
|
216
|
+
readonly description: "Workspace patterns to match, separated by spaces";
|
|
217
|
+
};
|
|
218
|
+
readonly nameOnly: {
|
|
219
|
+
readonly flags: ["-n", "--name-only"];
|
|
220
|
+
readonly description: "Only show workspace names";
|
|
221
|
+
};
|
|
222
|
+
readonly json: {
|
|
223
|
+
readonly flags: readonly ["-j", "--json"];
|
|
224
|
+
readonly description: "Output as JSON";
|
|
225
|
+
};
|
|
226
|
+
readonly pretty: {
|
|
227
|
+
readonly flags: ["-p", "--pretty"];
|
|
228
|
+
readonly description: "Pretty print JSON";
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
| {
|
|
233
|
+
readonly command: "list-scripts";
|
|
234
|
+
readonly isGlobal: false;
|
|
235
|
+
readonly aliases: ["ls-scripts"];
|
|
236
|
+
readonly description: "List all scripts available with their workspaces";
|
|
237
|
+
readonly options: {
|
|
238
|
+
readonly nameOnly: {
|
|
239
|
+
readonly flags: ["-n", "--name-only"];
|
|
240
|
+
readonly description: "Only show script names";
|
|
241
|
+
};
|
|
242
|
+
readonly json: {
|
|
243
|
+
readonly flags: readonly ["-j", "--json"];
|
|
244
|
+
readonly description: "Output as JSON";
|
|
245
|
+
};
|
|
246
|
+
readonly pretty: {
|
|
247
|
+
readonly flags: ["-p", "--pretty"];
|
|
248
|
+
readonly description: "Pretty print JSON";
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
| {
|
|
253
|
+
readonly command: "workspace-info <workspaceName>";
|
|
254
|
+
readonly isGlobal: false;
|
|
255
|
+
readonly aliases: ["info"];
|
|
256
|
+
readonly description: "Show information about a workspace";
|
|
257
|
+
readonly options: {
|
|
258
|
+
readonly json: {
|
|
259
|
+
readonly flags: readonly ["-j", "--json"];
|
|
260
|
+
readonly description: "Output as JSON";
|
|
261
|
+
};
|
|
262
|
+
readonly pretty: {
|
|
263
|
+
readonly flags: ["-p", "--pretty"];
|
|
264
|
+
readonly description: "Pretty print JSON";
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
| {
|
|
269
|
+
readonly command: "script-info <script>";
|
|
270
|
+
readonly isGlobal: false;
|
|
271
|
+
readonly aliases: [];
|
|
272
|
+
readonly description: "Show information about a script";
|
|
273
|
+
readonly options: {
|
|
274
|
+
readonly workspacesOnly: {
|
|
275
|
+
readonly flags: ["-w", "--workspaces-only"];
|
|
276
|
+
readonly description: "Only show script's workspace names";
|
|
277
|
+
};
|
|
278
|
+
readonly json: {
|
|
279
|
+
readonly flags: readonly ["-j", "--json"];
|
|
280
|
+
readonly description: "Output as JSON";
|
|
281
|
+
};
|
|
282
|
+
readonly pretty: {
|
|
283
|
+
readonly flags: ["-p", "--pretty"];
|
|
284
|
+
readonly description: "Pretty print JSON";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
| {
|
|
289
|
+
readonly command: "run-script [script] [workspacePatterns...]";
|
|
290
|
+
readonly isGlobal: false;
|
|
291
|
+
readonly aliases: ["run"];
|
|
292
|
+
readonly description: 'Run a script in all workspaces that have it in their "scripts" field in package.json';
|
|
293
|
+
readonly options: {
|
|
294
|
+
readonly script: {
|
|
295
|
+
readonly flags: ["-S", "--script <script>"];
|
|
296
|
+
readonly description: "The script to run.";
|
|
297
|
+
};
|
|
298
|
+
readonly workspacePatterns: {
|
|
299
|
+
readonly flags: ["-W", "--workspace-patterns <patterns>"];
|
|
300
|
+
readonly description: "Workspace patterns to match, separated by spaces.";
|
|
301
|
+
};
|
|
302
|
+
readonly parallel: {
|
|
303
|
+
readonly flags: ["-P", "--parallel [max]"];
|
|
304
|
+
readonly description: 'Run the scripts in parallel. Pass "false" for series, or a concurrency limit as a number, percentage ("50%"), "auto", "default", or"unbounded"';
|
|
305
|
+
};
|
|
306
|
+
readonly args: {
|
|
307
|
+
readonly flags: ["-a", "--args <args>"];
|
|
308
|
+
readonly description: "Args to append to the script command";
|
|
309
|
+
};
|
|
310
|
+
readonly outputStyle: {
|
|
311
|
+
readonly flags: ["-o", "--output-style <style>"];
|
|
312
|
+
readonly description: "The output style to use";
|
|
313
|
+
readonly values: ["grouped", "prefixed", "plain"];
|
|
314
|
+
};
|
|
315
|
+
readonly groupedLines: {
|
|
316
|
+
readonly flags: ["-L", "--grouped-lines <count>"];
|
|
317
|
+
readonly description: 'With "grouped" output, the max preview lines (number or "all", default 20)';
|
|
318
|
+
};
|
|
319
|
+
readonly noPrefix: {
|
|
320
|
+
readonly flags: ["-N", "--no-prefix"];
|
|
321
|
+
readonly description: "(DEPRECATED) Use --output-style=plain instead";
|
|
322
|
+
readonly deprecated: true;
|
|
323
|
+
};
|
|
324
|
+
readonly inline: {
|
|
325
|
+
readonly flags: ["-i", "--inline"];
|
|
326
|
+
readonly description: "Run the script as an inline command from the workspace directory";
|
|
327
|
+
};
|
|
328
|
+
readonly inlineName: {
|
|
329
|
+
readonly flags: ["-I", "--inline-name <name>"];
|
|
330
|
+
readonly description: "An optional name for the script when --inline is passed";
|
|
331
|
+
};
|
|
332
|
+
readonly shell: {
|
|
333
|
+
readonly flags: ["-s", "--shell <shell>"];
|
|
334
|
+
readonly values: ["bun", "system", "default"];
|
|
335
|
+
readonly description: "When using --inline, the shell to use to run the script";
|
|
336
|
+
};
|
|
337
|
+
readonly depOrder: {
|
|
338
|
+
readonly flags: ["-d", "--dep-order"];
|
|
339
|
+
readonly description: "Scripts for dependent workspaces run only after their dependencies";
|
|
340
|
+
};
|
|
341
|
+
readonly ignoreDepFailure: {
|
|
342
|
+
readonly flags: ["-f", "--ignore-dep-failure"];
|
|
343
|
+
readonly description: "In dependency order, continue running scripts even if a dependency fails";
|
|
344
|
+
};
|
|
345
|
+
readonly jsonOutfile: {
|
|
346
|
+
readonly flags: ["-j", "--json-outfile <file>"];
|
|
347
|
+
readonly description: "Output results in a JSON file";
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
export declare const getCliCommandNames: () => CliCommandName[];
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { SCRIPT_SHELL_OPTIONS } from "../../runScript/scriptShellOption.mjs";
|
|
2
|
+
import { OUTPUT_STYLE_VALUES } from "./runScript/output/outputStyle.mjs"; // CONCATENATED MODULE: external "../../runScript/scriptShellOption.mjs"
|
|
3
|
+
// CONCATENATED MODULE: external "./runScript/output/outputStyle.mjs"
|
|
4
|
+
// CONCATENATED MODULE: ./src/cli/commands/commandsConfig.ts
|
|
5
|
+
|
|
6
|
+
const JSON_FLAGS = ["-j", "--json"];
|
|
7
|
+
const DEFAULT_GROUPED_LINES = 20;
|
|
8
|
+
const CLI_COMMANDS_CONFIG = {
|
|
9
|
+
doctor: {
|
|
10
|
+
command: "doctor",
|
|
11
|
+
isGlobal: true,
|
|
12
|
+
aliases: [],
|
|
13
|
+
description: "Print diagnostic information",
|
|
14
|
+
options: {
|
|
15
|
+
json: {
|
|
16
|
+
flags: JSON_FLAGS,
|
|
17
|
+
description: "Output as JSON",
|
|
18
|
+
},
|
|
19
|
+
pretty: {
|
|
20
|
+
flags: ["-p", "--pretty"],
|
|
21
|
+
description: "Pretty print JSON",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
listWorkspaces: {
|
|
26
|
+
command: "list-workspaces [workspacePatterns...]",
|
|
27
|
+
isGlobal: false,
|
|
28
|
+
aliases: ["ls", "list"],
|
|
29
|
+
description: "List all workspaces",
|
|
30
|
+
options: {
|
|
31
|
+
workspacePatterns: {
|
|
32
|
+
flags: ["-W", "--workspace-patterns <patterns>"],
|
|
33
|
+
description: "Workspace patterns to match, separated by spaces",
|
|
34
|
+
},
|
|
35
|
+
nameOnly: {
|
|
36
|
+
flags: ["-n", "--name-only"],
|
|
37
|
+
description: "Only show workspace names",
|
|
38
|
+
},
|
|
39
|
+
json: {
|
|
40
|
+
flags: JSON_FLAGS,
|
|
41
|
+
description: "Output as JSON",
|
|
42
|
+
},
|
|
43
|
+
pretty: {
|
|
44
|
+
flags: ["-p", "--pretty"],
|
|
45
|
+
description: "Pretty print JSON",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
listScripts: {
|
|
50
|
+
command: "list-scripts",
|
|
51
|
+
isGlobal: false,
|
|
52
|
+
aliases: ["ls-scripts"],
|
|
53
|
+
description: "List all scripts available with their workspaces",
|
|
54
|
+
options: {
|
|
55
|
+
nameOnly: {
|
|
56
|
+
flags: ["-n", "--name-only"],
|
|
57
|
+
description: "Only show script names",
|
|
58
|
+
},
|
|
59
|
+
json: {
|
|
60
|
+
flags: JSON_FLAGS,
|
|
61
|
+
description: "Output as JSON",
|
|
62
|
+
},
|
|
63
|
+
pretty: {
|
|
64
|
+
flags: ["-p", "--pretty"],
|
|
65
|
+
description: "Pretty print JSON",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
workspaceInfo: {
|
|
70
|
+
command: "workspace-info <workspaceName>",
|
|
71
|
+
isGlobal: false,
|
|
72
|
+
aliases: ["info"],
|
|
73
|
+
description: "Show information about a workspace",
|
|
74
|
+
options: {
|
|
75
|
+
json: {
|
|
76
|
+
flags: JSON_FLAGS,
|
|
77
|
+
description: "Output as JSON",
|
|
78
|
+
},
|
|
79
|
+
pretty: {
|
|
80
|
+
flags: ["-p", "--pretty"],
|
|
81
|
+
description: "Pretty print JSON",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
scriptInfo: {
|
|
86
|
+
command: "script-info <script>",
|
|
87
|
+
isGlobal: false,
|
|
88
|
+
aliases: [],
|
|
89
|
+
description: "Show information about a script",
|
|
90
|
+
options: {
|
|
91
|
+
workspacesOnly: {
|
|
92
|
+
flags: ["-w", "--workspaces-only"],
|
|
93
|
+
description: "Only show script's workspace names",
|
|
94
|
+
},
|
|
95
|
+
json: {
|
|
96
|
+
flags: JSON_FLAGS,
|
|
97
|
+
description: "Output as JSON",
|
|
98
|
+
},
|
|
99
|
+
pretty: {
|
|
100
|
+
flags: ["-p", "--pretty"],
|
|
101
|
+
description: "Pretty print JSON",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
runScript: {
|
|
106
|
+
command: "run-script [script] [workspacePatterns...]",
|
|
107
|
+
isGlobal: false,
|
|
108
|
+
aliases: ["run"],
|
|
109
|
+
description:
|
|
110
|
+
'Run a script in all workspaces that have it in their "scripts" field in package.json',
|
|
111
|
+
options: {
|
|
112
|
+
script: {
|
|
113
|
+
flags: ["-S", "--script <script>"],
|
|
114
|
+
description: "The script to run.",
|
|
115
|
+
},
|
|
116
|
+
workspacePatterns: {
|
|
117
|
+
flags: ["-W", "--workspace-patterns <patterns>"],
|
|
118
|
+
description: "Workspace patterns to match, separated by spaces.",
|
|
119
|
+
},
|
|
120
|
+
parallel: {
|
|
121
|
+
flags: ["-P", "--parallel [max]"],
|
|
122
|
+
description:
|
|
123
|
+
'Run the scripts in parallel. Pass "false" for series, or a concurrency limit as a number, percentage ("50%"), "auto", "default", or"unbounded"',
|
|
124
|
+
},
|
|
125
|
+
args: {
|
|
126
|
+
flags: ["-a", "--args <args>"],
|
|
127
|
+
description: "Args to append to the script command",
|
|
128
|
+
},
|
|
129
|
+
outputStyle: {
|
|
130
|
+
flags: ["-o", "--output-style <style>"],
|
|
131
|
+
description: "The output style to use",
|
|
132
|
+
values: [...OUTPUT_STYLE_VALUES],
|
|
133
|
+
},
|
|
134
|
+
groupedLines: {
|
|
135
|
+
flags: ["-L", "--grouped-lines <count>"],
|
|
136
|
+
description: `With "grouped" output, the max preview lines (number or "all", default ${DEFAULT_GROUPED_LINES})`,
|
|
137
|
+
},
|
|
138
|
+
noPrefix: {
|
|
139
|
+
flags: ["-N", "--no-prefix"],
|
|
140
|
+
description: "(DEPRECATED) Use --output-style=plain instead",
|
|
141
|
+
deprecated: true,
|
|
142
|
+
},
|
|
143
|
+
inline: {
|
|
144
|
+
flags: ["-i", "--inline"],
|
|
145
|
+
description:
|
|
146
|
+
"Run the script as an inline command from the workspace directory",
|
|
147
|
+
},
|
|
148
|
+
inlineName: {
|
|
149
|
+
flags: ["-I", "--inline-name <name>"],
|
|
150
|
+
description: "An optional name for the script when --inline is passed",
|
|
151
|
+
},
|
|
152
|
+
shell: {
|
|
153
|
+
flags: ["-s", "--shell <shell>"],
|
|
154
|
+
values: [...SCRIPT_SHELL_OPTIONS, "default"],
|
|
155
|
+
description: `When using --inline, the shell to use to run the script`,
|
|
156
|
+
},
|
|
157
|
+
depOrder: {
|
|
158
|
+
flags: ["-d", "--dep-order"],
|
|
159
|
+
description:
|
|
160
|
+
"Scripts for dependent workspaces run only after their dependencies",
|
|
161
|
+
},
|
|
162
|
+
ignoreDepFailure: {
|
|
163
|
+
flags: ["-f", "--ignore-dep-failure"],
|
|
164
|
+
description:
|
|
165
|
+
"In dependency order, continue running scripts even if a dependency fails",
|
|
166
|
+
},
|
|
167
|
+
jsonOutfile: {
|
|
168
|
+
flags: ["-j", "--json-outfile <file>"],
|
|
169
|
+
description: "Output results in a JSON file",
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
const getCliCommandConfig = (commandName) => CLI_COMMANDS_CONFIG[commandName];
|
|
175
|
+
const getCliCommandNames = () => Object.keys(CLI_COMMANDS_CONFIG);
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
CLI_COMMANDS_CONFIG,
|
|
179
|
+
DEFAULT_GROUPED_LINES,
|
|
180
|
+
JSON_FLAGS,
|
|
181
|
+
getCliCommandConfig,
|
|
182
|
+
getCliCommandNames,
|
|
183
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const doctor: (
|
|
2
|
+
context: import("./commandHandlerUtils").GlobalCommandContext,
|
|
3
|
+
) => import("commander").Command;
|
|
4
|
+
export declare const listWorkspaces: (
|
|
5
|
+
context: import("./commandHandlerUtils").ProjectCommandContext,
|
|
6
|
+
) => import("commander").Command;
|
|
7
|
+
export declare const listScripts: (
|
|
8
|
+
context: import("./commandHandlerUtils").ProjectCommandContext,
|
|
9
|
+
) => import("commander").Command;
|
|
10
|
+
export declare const workspaceInfo: (
|
|
11
|
+
context: import("./commandHandlerUtils").ProjectCommandContext,
|
|
12
|
+
) => import("commander").Command;
|
|
13
|
+
export declare const scriptInfo: (
|
|
14
|
+
context: import("./commandHandlerUtils").ProjectCommandContext,
|
|
15
|
+
) => import("commander").Command;
|