bun-workspaces 1.0.0-alpha.41 → 1.0.0-alpha.43

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bun-workspaces",
3
- "version": "1.0.0-alpha.41",
3
+ "version": "1.0.0-alpha.43",
4
4
  "description": "A monorepo management tool for Bun, with a CLI and API to enhance Bun's native workspaces.",
5
5
  "license": "MIT",
6
6
  "main": "src/index.mjs",
@@ -67,13 +67,8 @@ const runScript = handleProjectCommand(
67
67
  `Command: Run ${options.inline ? "inline " : ""}script ${JSON.stringify(script)} for ${workspacePatterns.length ? "workspaces " + workspacePatterns.join(", ") : "all workspaces"}`,
68
68
  );
69
69
  logger.debug(`Options: ${JSON.stringify(options)}`);
70
- const workspaces = workspacePatterns.length
71
- ? project.findWorkspacesByPattern(...workspacePatterns)
72
- : options.inline
73
- ? project.workspaces
74
- : project.listWorkspacesWithScript(script);
75
70
  const scriptEventTarget = createScriptEventTarget();
76
- const { output, summary } = project.runScriptAcrossWorkspaces({
71
+ const { output, summary, workspaces } = project.runScriptAcrossWorkspaces({
77
72
  workspacePatterns: workspacePatterns.length
78
73
  ? workspacePatterns
79
74
  : undefined,
@@ -46,6 +46,7 @@ export type RunWorkspaceScriptOptions = {
46
46
  };
47
47
  /** Metadata associated with a workspace script */
48
48
  export type RunWorkspaceScriptMetadata = {
49
+ /** The workspace that the script was run in */
49
50
  workspace: Workspace;
50
51
  };
51
52
  export type RunWorkspaceScriptExit = Simplify<
@@ -58,16 +59,22 @@ export type RunWorkspaceScriptProcessOutput = MultiProcessOutput<
58
59
  >;
59
60
  /** Result of `FileSystemProject.runWorkspaceScript` */
60
61
  export type RunWorkspaceScriptResult = {
62
+ /** Use to get the output of the script */
61
63
  output: RunWorkspaceScriptProcessOutput;
64
+ /** The exit result of the script */
62
65
  exit: Promise<RunWorkspaceScriptExit>;
63
66
  };
64
67
  export type ParallelOption = boolean | RunScriptsParallelOptions;
65
68
  export type ScriptEventMetadata = {
69
+ /** The workspace that the script event occurred in */
66
70
  workspace: Workspace;
71
+ /** The exit result of the script */
67
72
  exitResult: RunScriptExit<RunWorkspaceScriptMetadata> | null;
68
73
  };
69
74
  export type OnScriptEventCallback = (
75
+ /** The event that occurred */
70
76
  event: ScriptEventName,
77
+ /** The metadata for the script event */
71
78
  metadata: ScriptEventMetadata,
72
79
  ) => unknown;
73
80
  /** Arguments for `FileSystemProject.runScriptAcrossWorkspaces` */
@@ -105,8 +112,12 @@ export type RunScriptAcrossWorkspacesOutput = MultiProcessOutput<
105
112
  >;
106
113
  /** Result of `FileSystemProject.runScriptAcrossWorkspaces` */
107
114
  export type RunScriptAcrossWorkspacesResult = {
115
+ /** Use to get the output of the scripts */
108
116
  output: RunScriptAcrossWorkspacesOutput;
117
+ /** The summary of the script run with exit details for each workspace */
109
118
  summary: Promise<RunScriptAcrossWorkspacesSummary>;
119
+ /** The workspaces targeted */
120
+ workspaces: Workspace[];
110
121
  };
111
122
  declare class _FileSystemProject extends ProjectBase implements Project {
112
123
  #private;
@@ -426,7 +426,7 @@ class _FileSystemProject extends ProjectBase {
426
426
  }),
427
427
  ignoreDependencyFailure: options.ignoreDependencyFailure,
428
428
  parallel:
429
- options.parallel === true
429
+ options.parallel === true || options.parallel === undefined
430
430
  ? {
431
431
  max: this.config.root.defaults.parallelMax,
432
432
  }
@@ -438,7 +438,10 @@ class _FileSystemProject extends ProjectBase {
438
438
  exitResult,
439
439
  }),
440
440
  });
441
- return result;
441
+ return {
442
+ ...result,
443
+ workspaces,
444
+ };
442
445
  }
443
446
  static #initialized = false;
444
447
  }