bun-workspaces 1.5.1 → 1.6.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/README.md +96 -2
- 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 +299 -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 +1085 -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 +151 -10
- package/src/config/public.mjs +4 -6
- package/src/config/rootConfig/defineRootConfig.mjs +1 -2
- package/src/config/rootConfig/errors.mjs +1 -2
- package/src/config/rootConfig/index.mjs +3 -1
- package/src/config/rootConfig/loadRootConfig.mjs +1 -4
- package/src/config/rootConfig/mergeRootConfig.mjs +24 -0
- package/src/config/rootConfig/rootConfig.mjs +8 -6
- package/src/config/rootConfig/rootConfigSchema.mjs +19 -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 +3 -1
- package/src/config/workspaceConfig/loadWorkspaceConfig.mjs +2 -8
- package/src/config/workspaceConfig/mergeWorkspaceConfig.mjs +75 -0
- package/src/config/workspaceConfig/workspaceConfig.mjs +1 -13
- 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 +516 -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 +1 -2
- 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 +92 -15
- package/src/internal/generated/ajv/validateRootConfig.mjs +1 -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 +4 -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 +1 -3
- package/src/workspaces/applyWorkspacePatternConfigs.mjs +58 -0
- 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 +12 -13
- package/src/workspaces/errors.mjs +1 -2
- package/src/workspaces/findWorkspaces.mjs +11 -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,4 +1,3 @@
|
|
|
1
|
-
// CONCATENATED MODULE: ./src/internal/generated/aiDocs/docs.ts
|
|
2
1
|
// This file is generated by scripts/generateMcpDocs.ts. Do not edit manually.
|
|
3
2
|
const DOC_OVERVIEW = `## Project Overview
|
|
4
3
|
|
|
@@ -200,10 +199,9 @@ project.runScriptAcrossWorkspaces({
|
|
|
200
199
|
\`\`\``;
|
|
201
200
|
const DOC_CONFIG = `## Root config
|
|
202
201
|
|
|
203
|
-
Optional project config can be placed in \`bw.root.jsonc\`/\`bw.root.json\` in the root directory.
|
|
202
|
+
Optional project config can be placed in \`bw.root.ts\`/\`bw.root.js\`/\`bw.root.jsonc\`/\`bw.root.json\` in the root directory, or in the \`"bw"\` key of \`package.json\`.
|
|
204
203
|
|
|
205
|
-
Config defaults here take precedence over environment variables
|
|
206
|
-
Explicit arguments to the CLI or API take precedence over all other settings.
|
|
204
|
+
Config defaults here take precedence over environment variables. Explicit CLI arguments or API options take precedence over all other settings.
|
|
207
205
|
|
|
208
206
|
\`\`\`jsonc
|
|
209
207
|
{
|
|
@@ -212,16 +210,33 @@ Explicit arguments to the CLI or API take precedence over all other settings.
|
|
|
212
210
|
"shell": "system", // "bun" or "system" (default "bun")
|
|
213
211
|
"includeRootWorkspace": true, // treat root package.json as a normal workspace
|
|
214
212
|
},
|
|
213
|
+
"workspacePatternConfigs": [
|
|
214
|
+
// see Workspace Pattern Configs section below
|
|
215
|
+
],
|
|
215
216
|
}
|
|
216
217
|
\`\`\`
|
|
217
218
|
|
|
219
|
+
### mergeRootConfig
|
|
220
|
+
|
|
221
|
+
\`mergeRootConfig\` merges multiple root configs left to right. Later configs take precedence for scalar fields. \`workspacePatternConfigs\` entries are concatenated. Any argument may be a factory function \`(prev: RootConfig) => RootConfig\`.
|
|
222
|
+
|
|
223
|
+
\`\`\`ts
|
|
224
|
+
import { mergeRootConfig } from "bun-workspaces/config";
|
|
225
|
+
|
|
226
|
+
export default mergeRootConfig(
|
|
227
|
+
{ defaults: { parallelMax: 4 } },
|
|
228
|
+
{ defaults: { shell: "system" } },
|
|
229
|
+
(prevConfig) => ({ defaults: { includeRootWorkspace: true } }),
|
|
230
|
+
);
|
|
231
|
+
\`\`\`
|
|
232
|
+
|
|
218
233
|
## Workspace config
|
|
219
234
|
|
|
220
|
-
Optional config can be placed in \`bw.workspace.jsonc\`/\`bw.workspace.json\` in a workspace directory.
|
|
235
|
+
Optional config can be placed in \`bw.workspace.ts\`/\`bw.workspace.js\`/\`bw.workspace.jsonc\`/\`bw.workspace.json\` in a workspace directory, or in the \`"bw"\` key of \`package.json\`.
|
|
221
236
|
|
|
222
|
-
Aliases must be unique to each workspace and
|
|
237
|
+
Aliases must be unique to each workspace and must not clash with other workspaces' \`package.json\` names.
|
|
223
238
|
|
|
224
|
-
Tags are strings to group workspaces together
|
|
239
|
+
Tags are strings to group workspaces together; they do not need to be unique.
|
|
225
240
|
|
|
226
241
|
\`\`\`jsonc
|
|
227
242
|
{
|
|
@@ -235,10 +250,11 @@ Tags are strings to group workspaces together that therefore don't need to be un
|
|
|
235
250
|
},
|
|
236
251
|
"rules": {
|
|
237
252
|
"workspaceDependencies": {
|
|
238
|
-
//
|
|
253
|
+
// allowPatterns: only workspaces matching these patterns are permitted as dependencies
|
|
239
254
|
"allowPatterns": ["my-allow-pattern-*"],
|
|
240
|
-
//
|
|
241
|
-
//
|
|
255
|
+
// denyPatterns: workspaces matching these patterns are forbidden as dependencies.
|
|
256
|
+
// When combined with allowPatterns, deny filters within the allowed subset.
|
|
257
|
+
"denyPatterns": ["my-deny-pattern-*"],
|
|
242
258
|
},
|
|
243
259
|
},
|
|
244
260
|
}
|
|
@@ -246,16 +262,77 @@ Tags are strings to group workspaces together that therefore don't need to be un
|
|
|
246
262
|
|
|
247
263
|
### Workspace Dependency Rules
|
|
248
264
|
|
|
249
|
-
Using the \`rules.workspaceDependencies\` field, you can define rules for which workspaces are allowed to be dependencies,
|
|
250
|
-
|
|
265
|
+
Using the \`rules.workspaceDependencies\` field, you can define rules for which workspaces are allowed to be dependencies, using \`allowPatterns\`, \`denyPatterns\`, or both.
|
|
266
|
+
|
|
267
|
+
\`allowPatterns\` defines the permitted subset of dependencies. \`denyPatterns\` forbids specific dependencies. When both are present, \`denyPatterns\` further filters within the subset permitted by \`allowPatterns\`.
|
|
251
268
|
|
|
252
269
|
Workspace Patterns are used to match workspaces.
|
|
253
270
|
|
|
254
|
-
|
|
271
|
+
### mergeWorkspaceConfig
|
|
255
272
|
|
|
256
|
-
|
|
273
|
+
\`mergeWorkspaceConfig\` merges multiple workspace configs left to right. Arrays (\`alias\`, \`tags\`, \`allowPatterns\`, \`denyPatterns\`) are concatenated and deduplicated. Scalar fields later wins. \`scripts\` are deep-merged per key. Any argument may be a factory function \`(prev: WorkspaceConfig) => WorkspaceConfig\`.
|
|
274
|
+
|
|
275
|
+
\`\`\`ts
|
|
276
|
+
import { mergeWorkspaceConfig } from "bun-workspaces/config";
|
|
277
|
+
|
|
278
|
+
export default mergeWorkspaceConfig(
|
|
279
|
+
{ alias: "a", tags: ["x"] },
|
|
280
|
+
{ alias: "b", scripts: { build: { order: 1 } } },
|
|
281
|
+
(prevConfig) => ({ tags: ["y"] }),
|
|
282
|
+
);
|
|
283
|
+
// result: { alias: ["a", "b"], tags: ["x", "y"], scripts: { build: { order: 1 } } }
|
|
284
|
+
\`\`\`
|
|
285
|
+
|
|
286
|
+
## Workspace Pattern Configs
|
|
287
|
+
|
|
288
|
+
The root config's \`workspacePatternConfigs\` field applies workspace configs to groups of workspaces matched by [workspace patterns](/concepts/workspace-patterns). Entries are applied in order, left to right.
|
|
289
|
+
|
|
290
|
+
Each entry's \`config\` is merged into the accumulated config of all matching workspaces using the same semantics as \`mergeWorkspaceConfig\`. The local workspace config (from \`bw.workspace.*\` or \`package.json\`) is always the starting base.
|
|
291
|
+
|
|
292
|
+
Pattern matching reflects the accumulated state: aliases and tags added by earlier entries are visible to later entries' patterns.
|
|
257
293
|
|
|
258
|
-
|
|
294
|
+
\`\`\`ts
|
|
295
|
+
import { defineRootConfig } from "bun-workspaces/config";
|
|
296
|
+
|
|
297
|
+
export default defineRootConfig({
|
|
298
|
+
workspacePatternConfigs: [
|
|
299
|
+
{
|
|
300
|
+
patterns: ["path:packages/apps/**/*"],
|
|
301
|
+
config: { tags: ["app"] },
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
// "tag:app" matches because the entry above added it
|
|
305
|
+
patterns: ["tag:app"],
|
|
306
|
+
config: {
|
|
307
|
+
rules: { workspaceDependencies: { allowPatterns: ["tag:lib"] } },
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
patterns: ["tag:app"],
|
|
312
|
+
// Factory form: JS/TS only — receives static workspace data and accumulated config
|
|
313
|
+
config: (workspace, prevConfig) => ({
|
|
314
|
+
alias: workspace.name.replace(/^@my-scope\\//, ""),
|
|
315
|
+
}),
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
});
|
|
319
|
+
\`\`\`
|
|
320
|
+
|
|
321
|
+
### Factory function context (\`RawWorkspace\`)
|
|
322
|
+
|
|
323
|
+
The factory \`(workspace: RawWorkspace, prevConfig: ResolvedWorkspaceConfig) => WorkspaceConfig\` receives:
|
|
324
|
+
|
|
325
|
+
- \`workspace.name\` — package name from package.json
|
|
326
|
+
- \`workspace.isRoot\` — whether this is the root workspace
|
|
327
|
+
- \`workspace.path\` — relative path from project root
|
|
328
|
+
- \`workspace.matchPattern\` — glob from root package.json \`workspaces\` field that matched
|
|
329
|
+
- \`workspace.scripts\` — sorted list of script names from package.json
|
|
330
|
+
- \`workspace.dependencies\` — names of workspace dependencies
|
|
331
|
+
- \`workspace.dependents\` — names of workspaces that depend on this one
|
|
332
|
+
|
|
333
|
+
\`prevConfig\` is the fully resolved workspace config at that point, including the local config and any configs applied by earlier pattern entries. It has \`aliases: string[]\`, \`tags: string[]\`, \`scripts: Record<string, ScriptConfig>\`, \`rules: WorkspaceRules\`.
|
|
334
|
+
|
|
335
|
+
## TypeScript/JSON Config Files
|
|
259
336
|
|
|
260
337
|
### TypeScript
|
|
261
338
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";module.exports = validate11;module.exports.default = validate11;const schema12 = {"type":"object","additionalProperties":false,"properties":{"defaults":{"type":"object","additionalProperties":false,"properties":{"parallelMax":{"type":["number","string"]},"shell":{"type":"string"},"includeRootWorkspace":{"type":"boolean"}}}}};function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!(key0 === "defaults")){validate11.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.defaults !== undefined){let data0 = data.defaults;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){const _errs4 = errors;for(const key1 in data0){if(!(((key1 === "parallelMax") || (key1 === "shell")) || (key1 === "includeRootWorkspace"))){validate11.errors = [{instancePath:instancePath+"/defaults",schemaPath:"#/properties/defaults/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs4 === errors){if(data0.parallelMax !== undefined){let data1 = data0.parallelMax;const _errs5 = errors;if((!((typeof data1 == "number") && (isFinite(data1)))) && (typeof data1 !== "string")){validate11.errors = [{instancePath:instancePath+"/defaults/parallelMax",schemaPath:"#/properties/defaults/properties/parallelMax/type",keyword:"type",params:{type: schema12.properties.defaults.properties.parallelMax.type},message:"must be number,string"}];return false;}var valid1 = _errs5 === errors;}else {var valid1 = true;}if(valid1){if(data0.shell !== undefined){const _errs7 = errors;if(typeof data0.shell !== "string"){validate11.errors = [{instancePath:instancePath+"/defaults/shell",schemaPath:"#/properties/defaults/properties/shell/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs7 === errors;}else {var valid1 = true;}if(valid1){if(data0.includeRootWorkspace !== undefined){const _errs9 = errors;if(typeof data0.includeRootWorkspace !== "boolean"){validate11.errors = [{instancePath:instancePath+"/defaults/includeRootWorkspace",schemaPath:"#/properties/defaults/properties/includeRootWorkspace/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs9 === errors;}else {var valid1 = true;}}}}}else {validate11.errors = [{instancePath:instancePath+"/defaults",schemaPath:"#/properties/defaults/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}}}else {validate11.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate11.errors = vErrors;return errors === 0;}
|
|
1
|
+
"use strict";module.exports = validate11;module.exports.default = validate11;const schema12 = {"type":"object","additionalProperties":false,"properties":{"defaults":{"type":"object","additionalProperties":false,"properties":{"parallelMax":{"type":["number","string"]},"shell":{"type":"string"},"includeRootWorkspace":{"type":"boolean"}}},"workspacePatternConfigs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["patterns","config"],"properties":{"patterns":{"type":"array","items":{"type":"string"}},"config":{}}}}}};function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!((key0 === "defaults") || (key0 === "workspacePatternConfigs"))){validate11.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.defaults !== undefined){let data0 = data.defaults;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){const _errs4 = errors;for(const key1 in data0){if(!(((key1 === "parallelMax") || (key1 === "shell")) || (key1 === "includeRootWorkspace"))){validate11.errors = [{instancePath:instancePath+"/defaults",schemaPath:"#/properties/defaults/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs4 === errors){if(data0.parallelMax !== undefined){let data1 = data0.parallelMax;const _errs5 = errors;if((!((typeof data1 == "number") && (isFinite(data1)))) && (typeof data1 !== "string")){validate11.errors = [{instancePath:instancePath+"/defaults/parallelMax",schemaPath:"#/properties/defaults/properties/parallelMax/type",keyword:"type",params:{type: schema12.properties.defaults.properties.parallelMax.type},message:"must be number,string"}];return false;}var valid1 = _errs5 === errors;}else {var valid1 = true;}if(valid1){if(data0.shell !== undefined){const _errs7 = errors;if(typeof data0.shell !== "string"){validate11.errors = [{instancePath:instancePath+"/defaults/shell",schemaPath:"#/properties/defaults/properties/shell/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs7 === errors;}else {var valid1 = true;}if(valid1){if(data0.includeRootWorkspace !== undefined){const _errs9 = errors;if(typeof data0.includeRootWorkspace !== "boolean"){validate11.errors = [{instancePath:instancePath+"/defaults/includeRootWorkspace",schemaPath:"#/properties/defaults/properties/includeRootWorkspace/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs9 === errors;}else {var valid1 = true;}}}}}else {validate11.errors = [{instancePath:instancePath+"/defaults",schemaPath:"#/properties/defaults/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.workspacePatternConfigs !== undefined){let data4 = data.workspacePatternConfigs;const _errs11 = errors;if(errors === _errs11){if(Array.isArray(data4)){var valid2 = true;const len0 = data4.length;for(let i0=0; i0<len0; i0++){let data5 = data4[i0];const _errs13 = errors;if(errors === _errs13){if(data5 && typeof data5 == "object" && !Array.isArray(data5)){let missing0;if(((data5.patterns === undefined) && (missing0 = "patterns")) || ((data5.config === undefined) && (missing0 = "config"))){validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0,schemaPath:"#/properties/workspacePatternConfigs/items/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs15 = errors;for(const key2 in data5){if(!((key2 === "patterns") || (key2 === "config"))){validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0,schemaPath:"#/properties/workspacePatternConfigs/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"}];return false;break;}}if(_errs15 === errors){if(data5.patterns !== undefined){let data6 = data5.patterns;const _errs16 = errors;if(errors === _errs16){if(Array.isArray(data6)){var valid4 = true;const len1 = data6.length;for(let i1=0; i1<len1; i1++){const _errs18 = errors;if(typeof data6[i1] !== "string"){validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0+"/patterns/" + i1,schemaPath:"#/properties/workspacePatternConfigs/items/properties/patterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs18 === errors;if(!valid4){break;}}}else {validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0+"/patterns",schemaPath:"#/properties/workspacePatternConfigs/items/properties/patterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}}}}}else {validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0,schemaPath:"#/properties/workspacePatternConfigs/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid2 = _errs13 === errors;if(!valid2){break;}}}else {validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs",schemaPath:"#/properties/workspacePatternConfigs/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs11 === errors;}else {var valid0 = true;}}}}else {validate11.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate11.errors = vErrors;return errors === 0;}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { defineErrors } from "../core/error/index.mjs";
|
|
2
|
-
import { IS_TEST } from "../core/runtime/env.mjs";
|
|
3
|
-
|
|
4
|
-
// CONCATENATED MODULE: ./src/internal/logger/logger.ts
|
|
2
|
+
import { IS_TEST } from "../core/runtime/env.mjs";
|
|
3
|
+
import { LOG_LEVELS, getLogLevelNumber } from "../../8126.mjs";
|
|
5
4
|
|
|
6
|
-
const LOG_LEVELS = ["debug", "info", "warn", "error"];
|
|
7
|
-
const getLevelNumber = (level) => LOG_LEVELS.indexOf(level);
|
|
8
5
|
const LOGGER_ERRORS = defineErrors("InvalidLogLevel");
|
|
9
6
|
const validateLogLevel = (level) => {
|
|
10
7
|
if (level === "silent") return;
|
|
@@ -106,7 +103,7 @@ class _Logger {
|
|
|
106
103
|
_printLevel = IS_TEST ? "error" : "info";
|
|
107
104
|
shouldPrint(level) {
|
|
108
105
|
if (this.printLevel === "silent") return false;
|
|
109
|
-
return
|
|
106
|
+
return getLogLevelNumber(level) >= getLogLevelNumber(this.printLevel);
|
|
110
107
|
}
|
|
111
108
|
_printStdout = (...args) => process.stdout.write(...args);
|
|
112
109
|
_printStderr = (...args) => process.stderr.write(...args);
|
|
@@ -123,11 +120,4 @@ const logger = createLogger("bun-workspaces");
|
|
|
123
120
|
logger.printLevel = level;
|
|
124
121
|
};
|
|
125
122
|
|
|
126
|
-
export {
|
|
127
|
-
LOGGER_ERRORS,
|
|
128
|
-
LOG_LEVELS,
|
|
129
|
-
createLogger,
|
|
130
|
-
logger,
|
|
131
|
-
setLogLevel,
|
|
132
|
-
validateLogLevel,
|
|
133
|
-
};
|
|
123
|
+
export { LOGGER_ERRORS, createLogger, logger, setLogLevel, validateLogLevel };
|
package/src/internal/version.mjs
CHANGED
package/src/project/errors.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { defineErrors } from "../internal/core/index.mjs";
|
|
2
|
-
// CONCATENATED MODULE: ./src/project/errors.ts
|
|
1
|
+
import { defineErrors } from "../internal/core/index.mjs";
|
|
3
2
|
|
|
4
3
|
const PROJECT_ERRORS = defineErrors(
|
|
5
4
|
"ProjectWorkspaceNotFound",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { parse, quote } from "shell-quote/";
|
|
4
3
|
import { loadRootConfig } from "../../config/index.mjs";
|
|
5
4
|
import { getUserEnvVar } from "../../config/userEnvVars/index.mjs";
|
|
5
|
+
import { parse, quote } from "../../internal/bundledDeps/shellQuote.mjs";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_TEMP_DIR,
|
|
8
8
|
IS_WINDOWS,
|
|
@@ -26,24 +26,9 @@ import { preventDependencyCycles } from "../../workspaces/dependencyGraph/index.
|
|
|
26
26
|
import { PROJECT_ERRORS } from "../errors.mjs";
|
|
27
27
|
import {
|
|
28
28
|
ProjectBase,
|
|
29
|
-
ROOT_WORKSPACE_SELECTOR,
|
|
30
29
|
resolveRootWorkspaceSelector,
|
|
31
30
|
resolveWorkspacePath,
|
|
32
|
-
} from "./projectBase.mjs";
|
|
33
|
-
// CONCATENATED MODULE: external "path"
|
|
34
|
-
// CONCATENATED MODULE: external "shell-quote/"
|
|
35
|
-
// CONCATENATED MODULE: external "../../config/index.mjs"
|
|
36
|
-
// CONCATENATED MODULE: external "../../config/userEnvVars/index.mjs"
|
|
37
|
-
// CONCATENATED MODULE: external "../../internal/core/index.mjs"
|
|
38
|
-
// CONCATENATED MODULE: external "../../internal/logger/index.mjs"
|
|
39
|
-
// CONCATENATED MODULE: external "../../runScript/index.mjs"
|
|
40
|
-
// CONCATENATED MODULE: external "../../runScript/recursion.mjs"
|
|
41
|
-
// CONCATENATED MODULE: external "../../runScript/scriptShellOption.mjs"
|
|
42
|
-
// CONCATENATED MODULE: external "../../workspaces/index.mjs"
|
|
43
|
-
// CONCATENATED MODULE: external "../../workspaces/dependencyGraph/index.mjs"
|
|
44
|
-
// CONCATENATED MODULE: external "../errors.mjs"
|
|
45
|
-
// CONCATENATED MODULE: external "./projectBase.mjs"
|
|
46
|
-
// CONCATENATED MODULE: ./src/project/implementations/fileSystemProject.ts
|
|
31
|
+
} from "./projectBase.mjs";
|
|
47
32
|
|
|
48
33
|
const quoteArg = (arg, shell) =>
|
|
49
34
|
IS_WINDOWS && shell === "system"
|
|
@@ -126,6 +111,7 @@ class _FileSystemProject extends ProjectBase {
|
|
|
126
111
|
options.includeRootWorkspace ??
|
|
127
112
|
rootConfig.defaults.includeRootWorkspace ??
|
|
128
113
|
getUserEnvVar("includeRootWorkspaceDefault") === "true",
|
|
114
|
+
workspacePatternConfigs: rootConfig.workspacePatternConfigs,
|
|
129
115
|
});
|
|
130
116
|
this.rootWorkspace = rootWorkspace;
|
|
131
117
|
this.workspaces = workspaces;
|
|
@@ -460,7 +446,7 @@ class _FileSystemProject extends ProjectBase {
|
|
|
460
446
|
: this.createScriptCommand({
|
|
461
447
|
workspaceNameOrAlias:
|
|
462
448
|
workspace.name === this.rootWorkspace.name
|
|
463
|
-
? ROOT_WORKSPACE_SELECTOR
|
|
449
|
+
? /* inlined export .ROOT_WORKSPACE_SELECTOR */ "@root"
|
|
464
450
|
: workspace.name,
|
|
465
451
|
scriptName: script,
|
|
466
452
|
args,
|
|
@@ -4,11 +4,7 @@ import {
|
|
|
4
4
|
WORKSPACE_ERRORS,
|
|
5
5
|
validateWorkspaceAliases,
|
|
6
6
|
} from "../../workspaces/index.mjs";
|
|
7
|
-
import { ProjectBase } from "./projectBase.mjs";
|
|
8
|
-
// CONCATENATED MODULE: external "../../internal/core/index.mjs"
|
|
9
|
-
// CONCATENATED MODULE: external "../../workspaces/index.mjs"
|
|
10
|
-
// CONCATENATED MODULE: external "./projectBase.mjs"
|
|
11
|
-
// CONCATENATED MODULE: ./src/project/implementations/memoryProject.ts
|
|
7
|
+
import { ProjectBase } from "./projectBase.mjs";
|
|
12
8
|
|
|
13
9
|
class _MemoryProject extends ProjectBase {
|
|
14
10
|
rootDirectory;
|
|
@@ -5,21 +5,12 @@ import { logger } from "../../internal/logger/index.mjs";
|
|
|
5
5
|
import { createWorkspaceScriptCommand } from "../../runScript/index.mjs";
|
|
6
6
|
import { sortWorkspaces } from "../../workspaces/index.mjs";
|
|
7
7
|
import { matchWorkspacesByPatterns } from "../../workspaces/workspacePattern.mjs";
|
|
8
|
-
import { PROJECT_ERRORS } from "../errors.mjs";
|
|
9
|
-
// CONCATENATED MODULE: external "../../internal/bun/index.mjs"
|
|
10
|
-
// CONCATENATED MODULE: external "../../internal/core/index.mjs"
|
|
11
|
-
// CONCATENATED MODULE: external "../../internal/logger/index.mjs"
|
|
12
|
-
// CONCATENATED MODULE: external "../../runScript/index.mjs"
|
|
13
|
-
// CONCATENATED MODULE: external "../../workspaces/index.mjs"
|
|
14
|
-
// CONCATENATED MODULE: external "../../workspaces/workspacePattern.mjs"
|
|
15
|
-
// CONCATENATED MODULE: external "../errors.mjs"
|
|
16
|
-
// CONCATENATED MODULE: ./src/project/implementations/projectBase.ts
|
|
8
|
+
import { PROJECT_ERRORS } from "../errors.mjs";
|
|
17
9
|
|
|
18
10
|
const resolveWorkspacePath = (project, workspace) =>
|
|
19
11
|
path.resolve(project.rootDirectory, workspace.path);
|
|
20
|
-
const ROOT_WORKSPACE_SELECTOR = "@root";
|
|
21
12
|
const resolveRootWorkspaceSelector = (workspacePattern, project) =>
|
|
22
|
-
workspacePattern === ROOT_WORKSPACE_SELECTOR
|
|
13
|
+
workspacePattern === /* inlined export .ROOT_WORKSPACE_SELECTOR */ "@root"
|
|
23
14
|
? project.rootWorkspace
|
|
24
15
|
: project.findWorkspaceByNameOrAlias(workspacePattern);
|
|
25
16
|
class ProjectBase {
|
|
@@ -140,10 +131,15 @@ class ProjectBase {
|
|
|
140
131
|
}
|
|
141
132
|
findWorkspacesByPattern(...workspacePatterns) {
|
|
142
133
|
const workspaces = [];
|
|
143
|
-
if (
|
|
134
|
+
if (
|
|
135
|
+
workspacePatterns.includes(
|
|
136
|
+
/* inlined export .ROOT_WORKSPACE_SELECTOR */ "@root",
|
|
137
|
+
)
|
|
138
|
+
) {
|
|
144
139
|
workspaces.push(this.rootWorkspace);
|
|
145
140
|
workspacePatterns = workspacePatterns.filter(
|
|
146
|
-
(pattern) =>
|
|
141
|
+
(pattern) =>
|
|
142
|
+
pattern !== /* inlined export .ROOT_WORKSPACE_SELECTOR */ "@root",
|
|
147
143
|
);
|
|
148
144
|
}
|
|
149
145
|
workspaces.push(
|
|
@@ -207,9 +203,4 @@ class ProjectBase {
|
|
|
207
203
|
}
|
|
208
204
|
}
|
|
209
205
|
|
|
210
|
-
export {
|
|
211
|
-
ProjectBase,
|
|
212
|
-
ROOT_WORKSPACE_SELECTOR,
|
|
213
|
-
resolveRootWorkspaceSelector,
|
|
214
|
-
resolveWorkspacePath,
|
|
215
|
-
};
|
|
206
|
+
export { ProjectBase, resolveRootWorkspaceSelector, resolveWorkspacePath };
|
package/src/project/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from "./errors.mjs";
|
|
2
2
|
export * from "./implementations/projectBase.mjs";
|
|
3
3
|
export * from "./implementations/fileSystemProject.mjs";
|
|
4
|
-
export * from "./implementations/memoryProject.mjs";
|
|
4
|
+
export * from "./implementations/memoryProject.mjs";
|
|
5
|
+
|
|
6
|
+
export {};
|
package/src/project/project.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// CONCATENATED MODULE: ./src/project/project.ts
|
|
2
1
|
/**
|
|
3
2
|
* A project contains a collection of workspaces and is the core of `bun-workspaces`'s functionality.
|
|
4
3
|
*
|
|
5
4
|
* Typically based on a root package.json file's `"workspaces"` field and any matching nested package.json files that are found.
|
|
6
5
|
*/
|
|
6
|
+
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
2
|
+
// The module cache
|
|
3
|
+
var __webpack_module_cache__ = {};
|
|
4
|
+
// The require function
|
|
5
|
+
function __webpack_require__(moduleId) {
|
|
6
|
+
// Check if module is in cache
|
|
7
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
8
|
+
if (cachedModule !== undefined) {
|
|
9
|
+
return cachedModule.exports;
|
|
10
|
+
}
|
|
11
|
+
// Create a new module (and put it into the cache)
|
|
12
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
13
|
+
exports: {},
|
|
14
|
+
});
|
|
15
|
+
// Execute the module function
|
|
16
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
17
|
+
|
|
18
|
+
// Return the exports of the module
|
|
19
|
+
return module.exports;
|
|
20
|
+
}
|
|
21
|
+
// expose the modules object (__webpack_modules__)
|
|
22
|
+
__webpack_require__.m = __webpack_modules__;
|
|
23
|
+
|
|
24
|
+
// webpack/runtime/compat_get_default_export
|
|
25
|
+
(() => {
|
|
26
|
+
// getDefaultExport function for compatibility with non-ESM modules
|
|
27
|
+
__webpack_require__.n = (module) => {
|
|
28
|
+
var getter =
|
|
29
|
+
module && module.__esModule ? () => module["default"] : () => module;
|
|
30
|
+
__webpack_require__.d(getter, { a: getter });
|
|
31
|
+
return getter;
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
// webpack/runtime/define_property_getters
|
|
35
|
+
(() => {
|
|
36
|
+
__webpack_require__.d = (exports, definition) => {
|
|
37
|
+
for (var key in definition) {
|
|
38
|
+
if (
|
|
39
|
+
__webpack_require__.o(definition, key) &&
|
|
40
|
+
!__webpack_require__.o(exports, key)
|
|
41
|
+
) {
|
|
42
|
+
Object.defineProperty(exports, key, {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: definition[key],
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
// webpack/runtime/esm_register_module
|
|
51
|
+
(() => {
|
|
52
|
+
__webpack_require__.add = function registerModules(modules) {
|
|
53
|
+
Object.assign(__webpack_require__.m, modules);
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
// webpack/runtime/has_own_property
|
|
57
|
+
(() => {
|
|
58
|
+
__webpack_require__.o = (obj, prop) =>
|
|
59
|
+
Object.prototype.hasOwnProperty.call(obj, prop);
|
|
60
|
+
})();
|
|
61
|
+
|
|
62
|
+
export { __webpack_require__ };
|
package/src/runScript/index.mjs
CHANGED
|
@@ -4,4 +4,6 @@ export * from "./scriptCommand.mjs";
|
|
|
4
4
|
export * from "./output/index.mjs";
|
|
5
5
|
export * from "./parallel.mjs";
|
|
6
6
|
export * from "./scriptRuntimeMetadata.mjs";
|
|
7
|
-
export * from "./scriptShellOption.mjs";
|
|
7
|
+
export * from "./scriptShellOption.mjs";
|
|
8
|
+
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { mergeAsyncIterables } from "../../internal/core/index.mjs";
|
|
2
|
-
// CONCATENATED MODULE: ./src/runScript/output/multiProcessOutput.ts
|
|
1
|
+
import { mergeAsyncIterables } from "../../internal/core/index.mjs";
|
|
3
2
|
|
|
4
3
|
class _MultiProcessOutput {
|
|
5
4
|
processes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -2,8 +2,7 @@ import {
|
|
|
2
2
|
BunWorkspacesError,
|
|
3
3
|
createAsyncIterableQueue,
|
|
4
4
|
defineErrors,
|
|
5
|
-
} from "../../internal/core/index.mjs";
|
|
6
|
-
// CONCATENATED MODULE: ./src/runScript/output/processOutput.ts
|
|
5
|
+
} from "../../internal/core/index.mjs";
|
|
7
6
|
|
|
8
7
|
const ERRORS = defineErrors(
|
|
9
8
|
BunWorkspacesError,
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import os from "os";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../config/userEnvVars/index.mjs";
|
|
6
|
-
import { BunWorkspacesError } from "../internal/core/index.mjs"; // CONCATENATED MODULE: external "os"
|
|
7
|
-
// CONCATENATED MODULE: external "../config/userEnvVars/index.mjs"
|
|
8
|
-
// CONCATENATED MODULE: external "../internal/core/index.mjs"
|
|
9
|
-
// CONCATENATED MODULE: ./src/runScript/parallel.ts
|
|
2
|
+
import { getUserEnvVar } from "../config/userEnvVars/index.mjs";
|
|
3
|
+
import { BunWorkspacesError } from "../internal/core/index.mjs";
|
|
4
|
+
import { getUserEnvVarName } from "../5166.mjs";
|
|
10
5
|
|
|
11
|
-
const PARALLEL_MAX_VALUES = ["auto", "unbounded", "default"];
|
|
12
6
|
/** Should always return at least 1 */ const determineParallelMax = (
|
|
13
7
|
value,
|
|
14
8
|
errorMessageSuffix = "",
|
|
@@ -53,4 +47,4 @@ const PARALLEL_MAX_VALUES = ["auto", "unbounded", "default"];
|
|
|
53
47
|
);
|
|
54
48
|
};
|
|
55
49
|
|
|
56
|
-
export {
|
|
50
|
+
export { determineParallelMax };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { getScriptRuntimeMetadataConfig } from "
|
|
2
|
-
// CONCATENATED MODULE: ./src/runScript/recursion.ts
|
|
1
|
+
import { getScriptRuntimeMetadataConfig } from "../1108.mjs";
|
|
3
2
|
|
|
4
3
|
const checkIsRecursiveScript = (workspaceName, scriptName) => {
|
|
5
4
|
const parentWorkspace =
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
createProcessOutput,
|
|
4
4
|
} from "./output/index.mjs";
|
|
5
5
|
import { createScriptExecutor } from "./scriptExecution.mjs";
|
|
6
|
-
import { createSubprocess } from "./subprocesses.mjs";
|
|
7
|
-
// CONCATENATED MODULE: external "./scriptExecution.mjs"
|
|
8
|
-
// CONCATENATED MODULE: external "./subprocesses.mjs"
|
|
9
|
-
// CONCATENATED MODULE: ./src/runScript/runScript.ts
|
|
6
|
+
import { createSubprocess } from "./subprocesses.mjs";
|
|
10
7
|
|
|
11
8
|
const SIGNAL_MAP = {
|
|
12
9
|
130: "SIGINT",
|
|
@@ -5,12 +5,7 @@ import {
|
|
|
5
5
|
createProcessOutput,
|
|
6
6
|
} from "./output/index.mjs";
|
|
7
7
|
import { determineParallelMax } from "./parallel.mjs";
|
|
8
|
-
import { runScript } from "./runScript.mjs";
|
|
9
|
-
// CONCATENATED MODULE: external "../internal/logger/index.mjs"
|
|
10
|
-
// CONCATENATED MODULE: external "./output/index.mjs"
|
|
11
|
-
// CONCATENATED MODULE: external "./parallel.mjs"
|
|
12
|
-
// CONCATENATED MODULE: external "./runScript.mjs"
|
|
13
|
-
// CONCATENATED MODULE: ./src/runScript/runScripts.ts
|
|
8
|
+
import { runScript } from "./runScript.mjs";
|
|
14
9
|
|
|
15
10
|
/** Validate dependency indices and detect cycles via DFS */ const validateScriptDependencies =
|
|
16
11
|
(scripts) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
// CONCATENATED MODULE: ./src/runScript/scriptCommand.ts
|
|
1
|
+
import path from "path";
|
|
3
2
|
|
|
4
3
|
const WORKSPACE_SCRIPT_COMMAND_METHODS = ["cd", "filter"];
|
|
5
4
|
const spaceArgs = (args) => (args ? ` ${args.trim()}` : "");
|
|
@@ -4,9 +4,7 @@ import {
|
|
|
4
4
|
IS_WINDOWS,
|
|
5
5
|
createShortId,
|
|
6
6
|
} from "../internal/core/index.mjs";
|
|
7
|
-
import { resolveScriptShell } from "./scriptShellOption.mjs";
|
|
8
|
-
// CONCATENATED MODULE: external "./scriptShellOption.mjs"
|
|
9
|
-
// CONCATENATED MODULE: ./src/runScript/scriptExecution.ts
|
|
7
|
+
import { resolveScriptShell } from "./scriptShellOption.mjs";
|
|
10
8
|
|
|
11
9
|
const createWindowsBatchFile = (command) => {
|
|
12
10
|
const fileName = `${createShortId(6)}.cmd`;
|