bun-workspaces 1.0.1-alpha → 1.0.1
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 +189 -70
- package/bin/cli.js +1 -2
- package/package.json +27 -30
- package/src/cli/commands/commandHandlerUtils.d.ts +49 -0
- package/src/cli/commands/commandHandlerUtils.mjs +91 -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 +249 -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 +73 -0
- package/src/cli/commands/runScript/output/renderGroupedOutput.mjs +308 -0
- package/src/cli/commands/runScript/output/renderPlainOutput.d.ts +24 -0
- package/src/cli/commands/runScript/output/renderPlainOutput.mjs +44 -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 +25 -0
- package/src/cli/createCli.mjs +154 -0
- package/src/cli/fatalErrorLogger.d.ts +1 -0
- package/src/cli/fatalErrorLogger.mjs +7 -0
- package/src/cli/globalOptions/globalOptions.d.ts +40 -0
- package/src/cli/globalOptions/globalOptions.mjs +105 -0
- package/src/cli/globalOptions/globalOptionsConfig.d.ts +43 -0
- package/src/cli/globalOptions/globalOptionsConfig.mjs +34 -0
- package/src/cli/globalOptions/index.d.ts +2 -0
- package/src/cli/globalOptions/index.mjs +2 -0
- package/src/cli/index.d.ts +3 -0
- package/src/cli/index.mjs +3 -0
- package/src/cli/middleware.d.ts +72 -0
- package/src/cli/middleware.mjs +38 -0
- package/src/config/index.d.ts +3 -0
- package/src/config/index.mjs +3 -0
- 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 -0
- package/src/index.mjs +16 -0
- 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/{error.ts → core/error/error.mjs} +16 -18
- 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/core/language/regex/regex.d.ts +3 -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/core/runtime/env.d.ts +6 -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 +45 -0
- package/src/internal/logger/logger.mjs +133 -0
- package/src/internal/version.d.ts +1 -0
- package/src/internal/version.mjs +6 -0
- package/src/project/errors.d.ts +5 -0
- package/src/project/errors.mjs +10 -0
- 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 -0
- package/src/project/index.mjs +4 -0
- package/src/project/project.d.ts +75 -0
- package/src/project/project.mjs +6 -0
- 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 -0
- package/src/workspaces/errors.mjs +18 -0
- package/src/workspaces/findWorkspaces.d.ts +24 -0
- package/src/workspaces/findWorkspaces.mjs +217 -0
- package/src/workspaces/index.d.ts +4 -0
- package/src/workspaces/index.mjs +3 -0
- package/src/workspaces/packageJson.d.ts +31 -0
- package/src/workspaces/packageJson.mjs +188 -0
- package/src/workspaces/{workspace.ts → workspace.d.ts} +11 -6
- package/src/workspaces/workspace.mjs +2 -0
- package/src/workspaces/workspacePattern.d.ts +21 -0
- package/src/workspaces/workspacePattern.mjs +104 -0
- package/bun.lock +0 -576
- package/src/cli/cli.ts +0 -87
- package/src/cli/globalOptions.ts +0 -122
- package/src/cli/index.ts +0 -1
- package/src/cli/projectCommands.ts +0 -396
- package/src/config/bunWorkspacesConfig.ts +0 -62
- package/src/config/configFile.ts +0 -33
- package/src/config/index.ts +0 -7
- package/src/index.ts +0 -3
- package/src/internal/bunVersion.ts +0 -26
- package/src/internal/env.ts +0 -25
- package/src/internal/logger.ts +0 -145
- package/src/internal/regex.ts +0 -5
- package/src/project/errors.ts +0 -6
- package/src/project/index.ts +0 -6
- package/src/project/project.ts +0 -155
- package/src/project/scriptCommand.ts +0 -40
- package/src/workspaces/errors.ts +0 -14
- package/src/workspaces/findWorkspaces.ts +0 -137
- package/src/workspaces/index.ts +0 -7
- package/src/workspaces/packageJson.ts +0 -166
- package/tsconfig.json +0 -28
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { loadRootConfig } from "../../config/index.mjs";
|
|
4
|
+
import { getUserEnvVar } from "../../config/userEnvVars/index.mjs";
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_TEMP_DIR,
|
|
7
|
+
isPlainObject,
|
|
8
|
+
validateJSTypes,
|
|
9
|
+
} from "../../internal/core/index.mjs";
|
|
10
|
+
import { logger } from "../../internal/logger/index.mjs";
|
|
11
|
+
import {
|
|
12
|
+
createScriptRuntimeEnvVars,
|
|
13
|
+
interpolateScriptRuntimeMetadata,
|
|
14
|
+
runScript,
|
|
15
|
+
runScripts,
|
|
16
|
+
} from "../../runScript/index.mjs";
|
|
17
|
+
import { checkIsRecursiveScript } from "../../runScript/recursion.mjs";
|
|
18
|
+
import { resolveScriptShell } from "../../runScript/scriptShellOption.mjs";
|
|
19
|
+
import { findWorkspaces, sortWorkspaces } from "../../workspaces/index.mjs";
|
|
20
|
+
import { preventDependencyCycles } from "../../workspaces/dependencyGraph/index.mjs";
|
|
21
|
+
import { PROJECT_ERRORS } from "../errors.mjs";
|
|
22
|
+
import {
|
|
23
|
+
ProjectBase,
|
|
24
|
+
ROOT_WORKSPACE_SELECTOR,
|
|
25
|
+
resolveRootWorkspaceSelector,
|
|
26
|
+
resolveWorkspacePath,
|
|
27
|
+
} from "./projectBase.mjs"; // CONCATENATED MODULE: external "fs"
|
|
28
|
+
// CONCATENATED MODULE: external "path"
|
|
29
|
+
// CONCATENATED MODULE: external "../../config/index.mjs"
|
|
30
|
+
// CONCATENATED MODULE: external "../../config/userEnvVars/index.mjs"
|
|
31
|
+
// CONCATENATED MODULE: external "../../internal/core/index.mjs"
|
|
32
|
+
// CONCATENATED MODULE: external "../../internal/logger/index.mjs"
|
|
33
|
+
// CONCATENATED MODULE: external "../../runScript/index.mjs"
|
|
34
|
+
// CONCATENATED MODULE: external "../../runScript/recursion.mjs"
|
|
35
|
+
// CONCATENATED MODULE: external "../../runScript/scriptShellOption.mjs"
|
|
36
|
+
// CONCATENATED MODULE: external "../../workspaces/index.mjs"
|
|
37
|
+
// CONCATENATED MODULE: external "../../workspaces/dependencyGraph/index.mjs"
|
|
38
|
+
// CONCATENATED MODULE: external "../errors.mjs"
|
|
39
|
+
// CONCATENATED MODULE: external "./projectBase.mjs"
|
|
40
|
+
// CONCATENATED MODULE: ./src/project/implementations/fileSystemProject.ts
|
|
41
|
+
|
|
42
|
+
class _FileSystemProject extends ProjectBase {
|
|
43
|
+
rootDirectory;
|
|
44
|
+
workspaces;
|
|
45
|
+
name;
|
|
46
|
+
sourceType = "fileSystem";
|
|
47
|
+
config;
|
|
48
|
+
rootWorkspace;
|
|
49
|
+
constructor(options) {
|
|
50
|
+
super();
|
|
51
|
+
validateJSTypes(
|
|
52
|
+
{
|
|
53
|
+
"rootDirectory option": {
|
|
54
|
+
value: options.rootDirectory,
|
|
55
|
+
typeofName: "string",
|
|
56
|
+
optional: true,
|
|
57
|
+
},
|
|
58
|
+
"name option": {
|
|
59
|
+
value: options.name,
|
|
60
|
+
typeofName: "string",
|
|
61
|
+
optional: true,
|
|
62
|
+
},
|
|
63
|
+
"includeRootWorkspace option": {
|
|
64
|
+
value: options.includeRootWorkspace,
|
|
65
|
+
typeofName: "boolean",
|
|
66
|
+
optional: true,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
throw: true,
|
|
71
|
+
},
|
|
72
|
+
);
|
|
73
|
+
if (!_FileSystemProject.#initialized) {
|
|
74
|
+
DEFAULT_TEMP_DIR.initialize(true);
|
|
75
|
+
_FileSystemProject.#initialized = true;
|
|
76
|
+
}
|
|
77
|
+
this.rootDirectory = path.resolve(
|
|
78
|
+
process.cwd(),
|
|
79
|
+
options.rootDirectory ?? "",
|
|
80
|
+
);
|
|
81
|
+
const rootConfig = loadRootConfig(this.rootDirectory);
|
|
82
|
+
const { workspaces, workspaceMap, rootWorkspace } = findWorkspaces({
|
|
83
|
+
rootDirectory: this.rootDirectory,
|
|
84
|
+
includeRootWorkspace:
|
|
85
|
+
options.includeRootWorkspace ??
|
|
86
|
+
rootConfig.defaults.includeRootWorkspace ??
|
|
87
|
+
getUserEnvVar("includeRootWorkspaceDefault") === "true",
|
|
88
|
+
});
|
|
89
|
+
this.rootWorkspace = rootWorkspace;
|
|
90
|
+
this.workspaces = workspaces;
|
|
91
|
+
this.config = {
|
|
92
|
+
root: rootConfig,
|
|
93
|
+
workspaces: Object.fromEntries(
|
|
94
|
+
Object.entries(workspaceMap)
|
|
95
|
+
.map(([name, { config }]) => [name, config])
|
|
96
|
+
.filter(([_, config]) => config !== undefined),
|
|
97
|
+
),
|
|
98
|
+
};
|
|
99
|
+
if (!options.name) {
|
|
100
|
+
const packageJson = JSON.parse(
|
|
101
|
+
fs.readFileSync(path.join(this.rootDirectory, "package.json"), "utf8"),
|
|
102
|
+
);
|
|
103
|
+
this.name = packageJson.name ?? "";
|
|
104
|
+
} else {
|
|
105
|
+
this.name = "";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
runWorkspaceScript(options) {
|
|
109
|
+
validateJSTypes(
|
|
110
|
+
{
|
|
111
|
+
"workspaceNameOrAlias option": {
|
|
112
|
+
value: options.workspaceNameOrAlias,
|
|
113
|
+
typeofName: "string",
|
|
114
|
+
},
|
|
115
|
+
"script option": {
|
|
116
|
+
value: options.script,
|
|
117
|
+
typeofName: "string",
|
|
118
|
+
},
|
|
119
|
+
"inline option": {
|
|
120
|
+
value: options.inline,
|
|
121
|
+
typeofName: ["boolean", "object"],
|
|
122
|
+
optional: true,
|
|
123
|
+
},
|
|
124
|
+
"args option": {
|
|
125
|
+
value: options.args,
|
|
126
|
+
typeofName: "string",
|
|
127
|
+
optional: true,
|
|
128
|
+
},
|
|
129
|
+
"ignoreOutput option": {
|
|
130
|
+
value: options.ignoreOutput,
|
|
131
|
+
typeofName: "boolean",
|
|
132
|
+
optional: true,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
throw: true,
|
|
137
|
+
},
|
|
138
|
+
);
|
|
139
|
+
if (isPlainObject(options.inline)) {
|
|
140
|
+
validateJSTypes(
|
|
141
|
+
{
|
|
142
|
+
"inline.scriptName option": {
|
|
143
|
+
value: options.inline.scriptName,
|
|
144
|
+
typeofName: "string",
|
|
145
|
+
optional: true,
|
|
146
|
+
},
|
|
147
|
+
"inline.shell option": {
|
|
148
|
+
value: options.inline.shell,
|
|
149
|
+
typeofName: "string",
|
|
150
|
+
optional: true,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
throw: true,
|
|
155
|
+
},
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
const workspace = resolveRootWorkspaceSelector(
|
|
159
|
+
options.workspaceNameOrAlias,
|
|
160
|
+
this,
|
|
161
|
+
);
|
|
162
|
+
if (!workspace) {
|
|
163
|
+
throw new PROJECT_ERRORS.ProjectWorkspaceNotFound(
|
|
164
|
+
`Workspace not found: ${JSON.stringify(options.workspaceNameOrAlias)}`,
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
const shell = resolveScriptShell(
|
|
168
|
+
options.inline && typeof options.inline === "object"
|
|
169
|
+
? options.inline.shell
|
|
170
|
+
: this.config.root.defaults.shell,
|
|
171
|
+
);
|
|
172
|
+
logger.debug(
|
|
173
|
+
`Running script ${options.inline ? "inline command" : options.script} in workspace ${workspace.name}${options.inline ? ` using the ${shell} shell` : ""}`,
|
|
174
|
+
);
|
|
175
|
+
const inlineScriptName =
|
|
176
|
+
typeof options.inline === "object"
|
|
177
|
+
? (options.inline?.scriptName ?? "")
|
|
178
|
+
: "";
|
|
179
|
+
const scriptRuntimeMetadata = {
|
|
180
|
+
projectPath: this.rootDirectory,
|
|
181
|
+
projectName: this.name,
|
|
182
|
+
workspacePath: resolveWorkspacePath(this, workspace),
|
|
183
|
+
workspaceRelativePath: workspace.path,
|
|
184
|
+
workspaceName: workspace.name,
|
|
185
|
+
scriptName: options.inline ? inlineScriptName : options.script,
|
|
186
|
+
};
|
|
187
|
+
const args = interpolateScriptRuntimeMetadata(
|
|
188
|
+
options.args ?? "",
|
|
189
|
+
scriptRuntimeMetadata,
|
|
190
|
+
shell,
|
|
191
|
+
);
|
|
192
|
+
const script = options.inline
|
|
193
|
+
? interpolateScriptRuntimeMetadata(
|
|
194
|
+
options.script,
|
|
195
|
+
scriptRuntimeMetadata,
|
|
196
|
+
shell,
|
|
197
|
+
) + (args ? " " + args : "")
|
|
198
|
+
: options.script;
|
|
199
|
+
if (!options.inline && checkIsRecursiveScript(workspace.name, script)) {
|
|
200
|
+
throw new PROJECT_ERRORS.RecursiveWorkspaceScript(
|
|
201
|
+
`Script "${script}" recursively calls itself in workspace "${workspace.name}"`,
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
const scriptCommand = options.inline
|
|
205
|
+
? {
|
|
206
|
+
command: script,
|
|
207
|
+
workingDirectory: resolveWorkspacePath(this, workspace),
|
|
208
|
+
}
|
|
209
|
+
: this.createScriptCommand({
|
|
210
|
+
workspaceNameOrAlias: options.workspaceNameOrAlias,
|
|
211
|
+
scriptName: script,
|
|
212
|
+
args,
|
|
213
|
+
}).commandDetails;
|
|
214
|
+
const result = runScript({
|
|
215
|
+
scriptCommand,
|
|
216
|
+
metadata: {
|
|
217
|
+
workspace,
|
|
218
|
+
},
|
|
219
|
+
env: createScriptRuntimeEnvVars(scriptRuntimeMetadata),
|
|
220
|
+
shell,
|
|
221
|
+
ignoreOutput: options.ignoreOutput ?? false,
|
|
222
|
+
});
|
|
223
|
+
return result;
|
|
224
|
+
}
|
|
225
|
+
runScriptAcrossWorkspaces(options) {
|
|
226
|
+
validateJSTypes(
|
|
227
|
+
{
|
|
228
|
+
"script option": {
|
|
229
|
+
value: options.script,
|
|
230
|
+
typeofName: "string",
|
|
231
|
+
},
|
|
232
|
+
"workspacePatterns option": {
|
|
233
|
+
value: options.workspacePatterns,
|
|
234
|
+
optional: true,
|
|
235
|
+
itemOptions: {
|
|
236
|
+
typeofName: "string",
|
|
237
|
+
},
|
|
238
|
+
array: true,
|
|
239
|
+
},
|
|
240
|
+
"inline option": {
|
|
241
|
+
value: options.inline,
|
|
242
|
+
typeofName: ["boolean", "object"],
|
|
243
|
+
optional: true,
|
|
244
|
+
},
|
|
245
|
+
"args option": {
|
|
246
|
+
value: options.args,
|
|
247
|
+
typeofName: "string",
|
|
248
|
+
optional: true,
|
|
249
|
+
},
|
|
250
|
+
"parallel option": {
|
|
251
|
+
value: options.parallel,
|
|
252
|
+
typeofName: ["boolean", "object"],
|
|
253
|
+
optional: true,
|
|
254
|
+
},
|
|
255
|
+
"dependencyOrder option": {
|
|
256
|
+
value: options.dependencyOrder,
|
|
257
|
+
typeofName: "boolean",
|
|
258
|
+
optional: true,
|
|
259
|
+
},
|
|
260
|
+
"ignoreDependencyFailure option": {
|
|
261
|
+
value: options.ignoreDependencyFailure,
|
|
262
|
+
typeofName: "boolean",
|
|
263
|
+
optional: true,
|
|
264
|
+
},
|
|
265
|
+
"ignoreOutput option": {
|
|
266
|
+
value: options.ignoreOutput,
|
|
267
|
+
typeofName: "boolean",
|
|
268
|
+
optional: true,
|
|
269
|
+
},
|
|
270
|
+
"onScriptEvent option": {
|
|
271
|
+
value: options.onScriptEvent,
|
|
272
|
+
typeofName: "function",
|
|
273
|
+
optional: true,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
throw: true,
|
|
278
|
+
},
|
|
279
|
+
);
|
|
280
|
+
if (isPlainObject(options.inline)) {
|
|
281
|
+
validateJSTypes(
|
|
282
|
+
{
|
|
283
|
+
"inline.scriptName option": {
|
|
284
|
+
value: options.inline.scriptName,
|
|
285
|
+
typeofName: "string",
|
|
286
|
+
optional: true,
|
|
287
|
+
},
|
|
288
|
+
"inline.shell option": {
|
|
289
|
+
value: options.inline.shell,
|
|
290
|
+
typeofName: "string",
|
|
291
|
+
optional: true,
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
throw: true,
|
|
296
|
+
},
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
if (isPlainObject(options.parallel)) {
|
|
300
|
+
validateJSTypes(
|
|
301
|
+
{
|
|
302
|
+
"parallel.max option": {
|
|
303
|
+
value: options.parallel.max,
|
|
304
|
+
typeofName: ["number", "string"],
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
throw: true,
|
|
309
|
+
},
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
const matchedWorkspaces = sortWorkspaces(
|
|
313
|
+
(
|
|
314
|
+
options.workspacePatterns ??
|
|
315
|
+
this.workspaces.map((workspace) => workspace.name)
|
|
316
|
+
).flatMap((pattern) => this.findWorkspacesByPattern(pattern)),
|
|
317
|
+
);
|
|
318
|
+
let workspaces = matchedWorkspaces
|
|
319
|
+
.filter(
|
|
320
|
+
(workspace) =>
|
|
321
|
+
options.inline || workspace.scripts.includes(options.script),
|
|
322
|
+
)
|
|
323
|
+
.sort((a, b) => {
|
|
324
|
+
const aScriptConfig =
|
|
325
|
+
this.config.workspaces[a.name]?.scripts[options.script];
|
|
326
|
+
const bScriptConfig =
|
|
327
|
+
this.config.workspaces[b.name]?.scripts[options.script];
|
|
328
|
+
if (!aScriptConfig) {
|
|
329
|
+
return bScriptConfig ? 1 : 0;
|
|
330
|
+
}
|
|
331
|
+
if (!bScriptConfig) {
|
|
332
|
+
return aScriptConfig ? -1 : 0;
|
|
333
|
+
}
|
|
334
|
+
return (aScriptConfig.order ?? 0) - (bScriptConfig.order ?? 0);
|
|
335
|
+
});
|
|
336
|
+
if (!workspaces.length) {
|
|
337
|
+
const isSingleMatchNotFound =
|
|
338
|
+
options.workspacePatterns?.length === 1 &&
|
|
339
|
+
!options.workspacePatterns[0].includes("*") &&
|
|
340
|
+
!matchedWorkspaces.length;
|
|
341
|
+
throw new PROJECT_ERRORS.ProjectWorkspaceNotFound(
|
|
342
|
+
isSingleMatchNotFound
|
|
343
|
+
? `Workspace name or alias not found: ${JSON.stringify(options?.workspacePatterns?.[0])}`
|
|
344
|
+
: `No matching workspaces found with script ${JSON.stringify(options.script)}`,
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
if (options.dependencyOrder) {
|
|
348
|
+
const cycleDetection = preventDependencyCycles(workspaces);
|
|
349
|
+
workspaces = cycleDetection.workspaces;
|
|
350
|
+
for (const cycle of cycleDetection.cycles) {
|
|
351
|
+
logger.warn(
|
|
352
|
+
`Dependency cycle detected: ${cycle.dependency} -> ${cycle.dependent} (ignoring)`,
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
const recursiveWorkspace = workspaces.find((workspace) =>
|
|
357
|
+
checkIsRecursiveScript(workspace.name, options.script),
|
|
358
|
+
);
|
|
359
|
+
if (recursiveWorkspace && !options.inline) {
|
|
360
|
+
throw new PROJECT_ERRORS.RecursiveWorkspaceScript(
|
|
361
|
+
`Script "${options.script}" recursively calls itself in workspace "${recursiveWorkspace.name}"`,
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
const shell = resolveScriptShell(
|
|
365
|
+
options.inline && typeof options.inline === "object"
|
|
366
|
+
? options.inline.shell
|
|
367
|
+
: this.config.root.defaults.shell,
|
|
368
|
+
);
|
|
369
|
+
logger.debug(
|
|
370
|
+
`Running script ${options.inline ? "inline command" : options.script} across workspaces${options.inline ? ` using the ${shell} shell` : ""}: ${workspaces.map((workspace) => workspace.name).join(", ")}`,
|
|
371
|
+
);
|
|
372
|
+
const result = runScripts({
|
|
373
|
+
scripts: workspaces.map((workspace) => {
|
|
374
|
+
const inlineScriptName =
|
|
375
|
+
typeof options.inline === "object"
|
|
376
|
+
? (options.inline?.scriptName ?? "")
|
|
377
|
+
: "";
|
|
378
|
+
const scriptRuntimeMetadata = {
|
|
379
|
+
projectPath: this.rootDirectory,
|
|
380
|
+
projectName: this.name,
|
|
381
|
+
workspacePath: resolveWorkspacePath(this, workspace),
|
|
382
|
+
workspaceRelativePath: workspace.path,
|
|
383
|
+
workspaceName: workspace.name,
|
|
384
|
+
scriptName: options.inline ? inlineScriptName : options.script,
|
|
385
|
+
};
|
|
386
|
+
const args = interpolateScriptRuntimeMetadata(
|
|
387
|
+
options.args ?? "",
|
|
388
|
+
scriptRuntimeMetadata,
|
|
389
|
+
shell,
|
|
390
|
+
);
|
|
391
|
+
const script = options.inline
|
|
392
|
+
? interpolateScriptRuntimeMetadata(
|
|
393
|
+
options.script,
|
|
394
|
+
scriptRuntimeMetadata,
|
|
395
|
+
shell,
|
|
396
|
+
) + (args ? " " + args : "")
|
|
397
|
+
: options.script;
|
|
398
|
+
const scriptCommand = options.inline
|
|
399
|
+
? {
|
|
400
|
+
command: script,
|
|
401
|
+
workingDirectory: resolveWorkspacePath(this, workspace),
|
|
402
|
+
}
|
|
403
|
+
: this.createScriptCommand({
|
|
404
|
+
workspaceNameOrAlias:
|
|
405
|
+
workspace.name === this.rootWorkspace.name
|
|
406
|
+
? ROOT_WORKSPACE_SELECTOR
|
|
407
|
+
: workspace.name,
|
|
408
|
+
scriptName: script,
|
|
409
|
+
args,
|
|
410
|
+
}).commandDetails;
|
|
411
|
+
return {
|
|
412
|
+
metadata: {
|
|
413
|
+
workspace,
|
|
414
|
+
},
|
|
415
|
+
scriptCommand,
|
|
416
|
+
env: createScriptRuntimeEnvVars(scriptRuntimeMetadata),
|
|
417
|
+
shell,
|
|
418
|
+
dependsOn: options.dependencyOrder
|
|
419
|
+
? workspace.dependencies
|
|
420
|
+
.map((dependency) =>
|
|
421
|
+
workspaces.findIndex((w) => w.name === dependency),
|
|
422
|
+
)
|
|
423
|
+
.filter((index) => index !== -1)
|
|
424
|
+
: undefined,
|
|
425
|
+
};
|
|
426
|
+
}),
|
|
427
|
+
ignoreDependencyFailure: options.ignoreDependencyFailure,
|
|
428
|
+
parallel:
|
|
429
|
+
options.parallel === true || options.parallel === undefined
|
|
430
|
+
? {
|
|
431
|
+
max: this.config.root.defaults.parallelMax,
|
|
432
|
+
}
|
|
433
|
+
: (options.parallel ?? true),
|
|
434
|
+
ignoreOutput: options.ignoreOutput ?? false,
|
|
435
|
+
onScriptEvent: (event, index, exitResult) =>
|
|
436
|
+
options.onScriptEvent?.(event, {
|
|
437
|
+
workspace: workspaces[index],
|
|
438
|
+
exitResult,
|
|
439
|
+
}),
|
|
440
|
+
});
|
|
441
|
+
return {
|
|
442
|
+
...result,
|
|
443
|
+
workspaces,
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
static #initialized = false;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Create a {@link Project} based on a given root directory.
|
|
450
|
+
* Automatically finds workspaces based on the root package.json "workspaces" field
|
|
451
|
+
* and detects and utilizes any provided configuration.
|
|
452
|
+
*/ const createFileSystemProject = (options = {}) =>
|
|
453
|
+
new _FileSystemProject(options);
|
|
454
|
+
|
|
455
|
+
export { createFileSystemProject };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Simplify } from "../../internal/core";
|
|
2
|
+
import { type Workspace } from "../../workspaces";
|
|
3
|
+
import type { Project } from "../project";
|
|
4
|
+
import { ProjectBase } from "./projectBase";
|
|
5
|
+
/** Arguments for {@link createMemoryProject} */
|
|
6
|
+
export type CreateMemoryProjectOptions = {
|
|
7
|
+
/** The list of workspaces in the project */
|
|
8
|
+
workspaces: Workspace[];
|
|
9
|
+
/** The name of the project */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** The root directory of the project (not used in any actual file system interactions in a {@link MemoryProject}) */
|
|
12
|
+
rootDirectory?: string;
|
|
13
|
+
/** The root workspace */
|
|
14
|
+
rootWorkspace?: Workspace;
|
|
15
|
+
/** Whether to include the root workspace as a normal workspace. */
|
|
16
|
+
includeRootWorkspace?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare class _MemoryProject extends ProjectBase implements Project {
|
|
19
|
+
readonly rootDirectory: string;
|
|
20
|
+
readonly workspaces: Workspace[];
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly sourceType = "memory";
|
|
23
|
+
readonly config: {
|
|
24
|
+
root: import("../../config").ResolvedRootConfig;
|
|
25
|
+
workspaces: {};
|
|
26
|
+
};
|
|
27
|
+
readonly rootWorkspace: Workspace;
|
|
28
|
+
constructor(options: CreateMemoryProjectOptions);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An implementation of {@link Project} that is created from a list of workspaces in memory.
|
|
32
|
+
*
|
|
33
|
+
* Mainly used for testing without needing a real file system project. */
|
|
34
|
+
export type MemoryProject = Simplify<InstanceType<typeof _MemoryProject>>;
|
|
35
|
+
/** Create a {@link Project} from a provided list of workspace objects.
|
|
36
|
+
*
|
|
37
|
+
* Mainly used for testing without needing a real file system project. */
|
|
38
|
+
export declare const createMemoryProject: (
|
|
39
|
+
options: CreateMemoryProjectOptions,
|
|
40
|
+
) => MemoryProject;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createDefaultRootConfig } from "../../config/index.mjs";
|
|
2
|
+
import { validateJSTypes } from "../../internal/core/index.mjs";
|
|
3
|
+
import {
|
|
4
|
+
WORKSPACE_ERRORS,
|
|
5
|
+
validateWorkspaceAliases,
|
|
6
|
+
} from "../../workspaces/index.mjs";
|
|
7
|
+
import { ProjectBase } from "./projectBase.mjs"; // CONCATENATED MODULE: external "../../config/index.mjs"
|
|
8
|
+
// CONCATENATED MODULE: external "../../internal/core/index.mjs"
|
|
9
|
+
// CONCATENATED MODULE: external "../../workspaces/index.mjs"
|
|
10
|
+
// CONCATENATED MODULE: external "./projectBase.mjs"
|
|
11
|
+
// CONCATENATED MODULE: ./src/project/implementations/memoryProject.ts
|
|
12
|
+
|
|
13
|
+
class _MemoryProject extends ProjectBase {
|
|
14
|
+
rootDirectory;
|
|
15
|
+
workspaces;
|
|
16
|
+
name;
|
|
17
|
+
sourceType = "memory";
|
|
18
|
+
config = {
|
|
19
|
+
root: createDefaultRootConfig(),
|
|
20
|
+
workspaces: {},
|
|
21
|
+
};
|
|
22
|
+
rootWorkspace;
|
|
23
|
+
constructor(options) {
|
|
24
|
+
super(true);
|
|
25
|
+
validateJSTypes(
|
|
26
|
+
{
|
|
27
|
+
"workspaces option": {
|
|
28
|
+
value: options.workspaces,
|
|
29
|
+
itemOptions: {
|
|
30
|
+
typeofName: "object",
|
|
31
|
+
},
|
|
32
|
+
array: true,
|
|
33
|
+
},
|
|
34
|
+
"name option": {
|
|
35
|
+
value: options.name,
|
|
36
|
+
typeofName: "string",
|
|
37
|
+
optional: true,
|
|
38
|
+
},
|
|
39
|
+
"rootDirectory option": {
|
|
40
|
+
value: options.rootDirectory,
|
|
41
|
+
typeofName: "string",
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
"rootWorkspace option": {
|
|
45
|
+
value: options.rootWorkspace,
|
|
46
|
+
typeofName: "object",
|
|
47
|
+
optional: true,
|
|
48
|
+
},
|
|
49
|
+
"includeRootWorkspace option": {
|
|
50
|
+
value: options.includeRootWorkspace,
|
|
51
|
+
typeofName: "boolean",
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
throw: true,
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
const validateWorkspace = (workspace) =>
|
|
60
|
+
validateJSTypes(
|
|
61
|
+
{
|
|
62
|
+
"workspace name": {
|
|
63
|
+
value: workspace.name,
|
|
64
|
+
typeofName: "string",
|
|
65
|
+
},
|
|
66
|
+
"workspace path": {
|
|
67
|
+
value: workspace.path,
|
|
68
|
+
typeofName: "string",
|
|
69
|
+
},
|
|
70
|
+
"workspace scripts": {
|
|
71
|
+
value: workspace.scripts,
|
|
72
|
+
array: true,
|
|
73
|
+
itemOptions: {
|
|
74
|
+
typeofName: "string",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
"workspace aliases": {
|
|
78
|
+
value: workspace.aliases,
|
|
79
|
+
array: true,
|
|
80
|
+
itemOptions: {
|
|
81
|
+
typeofName: "string",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
"workspace dependencies": {
|
|
85
|
+
value: workspace.dependencies,
|
|
86
|
+
array: true,
|
|
87
|
+
itemOptions: {
|
|
88
|
+
typeofName: "string",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
"workspace dependents": {
|
|
92
|
+
value: workspace.dependents,
|
|
93
|
+
array: true,
|
|
94
|
+
itemOptions: {
|
|
95
|
+
typeofName: "string",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
throw: true,
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
for (const workspace of options.workspaces) {
|
|
104
|
+
validateWorkspace(workspace);
|
|
105
|
+
}
|
|
106
|
+
this.name = options.name ?? "";
|
|
107
|
+
this.rootDirectory = options.rootDirectory ?? "";
|
|
108
|
+
this.workspaces = options.workspaces;
|
|
109
|
+
this.rootWorkspace = options.rootWorkspace ?? {
|
|
110
|
+
name: "default-root-workspace",
|
|
111
|
+
isRoot: true,
|
|
112
|
+
matchPattern: "",
|
|
113
|
+
path: "",
|
|
114
|
+
scripts: [],
|
|
115
|
+
aliases: [],
|
|
116
|
+
dependencies: [],
|
|
117
|
+
dependents: [],
|
|
118
|
+
};
|
|
119
|
+
validateWorkspace(this.rootWorkspace);
|
|
120
|
+
for (const workspace of this.workspaces) {
|
|
121
|
+
if (
|
|
122
|
+
this.workspaces.find(
|
|
123
|
+
(ws) => ws !== workspace && ws.name === workspace.name,
|
|
124
|
+
)
|
|
125
|
+
) {
|
|
126
|
+
throw new WORKSPACE_ERRORS.DuplicateWorkspaceName(
|
|
127
|
+
`Duplicate workspace name found: ${JSON.stringify(workspace.name)}`,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
validateWorkspaceAliases(
|
|
132
|
+
this.workspaces,
|
|
133
|
+
this.workspaces.reduce((acc, workspace) => {
|
|
134
|
+
for (const alias of workspace.aliases) {
|
|
135
|
+
acc[alias] = workspace.name;
|
|
136
|
+
}
|
|
137
|
+
return acc;
|
|
138
|
+
}, {}),
|
|
139
|
+
this.name,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/** Create a {@link Project} from a provided list of workspace objects.
|
|
144
|
+
*
|
|
145
|
+
* Mainly used for testing without needing a real file system project. */ const createMemoryProject =
|
|
146
|
+
(options) => new _MemoryProject(options);
|
|
147
|
+
|
|
148
|
+
export { createMemoryProject };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type Workspace } from "../../workspaces";
|
|
2
|
+
import type {
|
|
3
|
+
CreateProjectScriptCommandOptions,
|
|
4
|
+
CreateProjectScriptCommandResult,
|
|
5
|
+
Project,
|
|
6
|
+
ProjectConfig,
|
|
7
|
+
WorkspaceScriptMetadata,
|
|
8
|
+
} from "../project";
|
|
9
|
+
export declare const resolveWorkspacePath: (
|
|
10
|
+
project: Project,
|
|
11
|
+
workspace: Workspace,
|
|
12
|
+
) => string;
|
|
13
|
+
export declare const ROOT_WORKSPACE_SELECTOR = "@root";
|
|
14
|
+
export declare const resolveRootWorkspaceSelector: (
|
|
15
|
+
workspacePattern: string,
|
|
16
|
+
project: Project,
|
|
17
|
+
) => Workspace | null;
|
|
18
|
+
export declare abstract class ProjectBase implements Project {
|
|
19
|
+
abstract readonly name: string;
|
|
20
|
+
abstract readonly rootDirectory: string;
|
|
21
|
+
abstract readonly rootWorkspace: Workspace;
|
|
22
|
+
abstract readonly workspaces: Workspace[];
|
|
23
|
+
abstract readonly sourceType: "fileSystem" | "memory";
|
|
24
|
+
abstract readonly config: ProjectConfig;
|
|
25
|
+
constructor(_ignoreBunVersion?: boolean);
|
|
26
|
+
listWorkspacesWithScript(scriptName: string): Workspace[];
|
|
27
|
+
mapScriptsToWorkspaces(): Record<string, WorkspaceScriptMetadata>;
|
|
28
|
+
findWorkspaceByName(workspaceName: string): Workspace | null;
|
|
29
|
+
findWorkspaceByAlias(alias: string): Workspace | null;
|
|
30
|
+
findWorkspaceByNameOrAlias(nameOrAlias: string): Workspace | null;
|
|
31
|
+
findWorkspacesByPattern(...workspacePatterns: string[]): Workspace[];
|
|
32
|
+
createScriptCommand(
|
|
33
|
+
options: CreateProjectScriptCommandOptions,
|
|
34
|
+
): CreateProjectScriptCommandResult;
|
|
35
|
+
}
|