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.
Files changed (260) hide show
  1. package/README.md +96 -2
  2. package/bin/cli.js +0 -0
  3. package/package.json +1 -5
  4. package/src/1108.mjs +30 -0
  5. package/src/{cli/commands/commandsConfig.mjs → 2392.mjs} +52 -11
  6. package/src/4427.mjs +9 -0
  7. package/src/5166.mjs +8 -0
  8. package/src/8126.mjs +4 -0
  9. package/src/8257.mjs +4 -0
  10. package/src/{config/util/configLocation.mjs → 8529.mjs} +11 -2
  11. package/src/ai/mcp/bwMcpServer.mjs +299 -9
  12. package/src/ai/mcp/core/index.mjs +3 -1
  13. package/src/ai/mcp/core/server.mjs +1 -3
  14. package/src/ai/mcp/core/transport.mjs +1 -2
  15. package/src/ai/mcp/core/types.mjs +0 -1
  16. package/src/ai/mcp/index.mjs +3 -1
  17. package/src/ai/mcp/resources.mjs +1 -2
  18. package/src/ai/mcp/tools.mjs +1 -5
  19. package/src/cli/commands/commandHandlerUtils.mjs +2 -6
  20. package/src/cli/commands/commands.mjs +1 -4
  21. package/src/cli/commands/handleSimpleCommands.mjs +4 -10
  22. package/src/cli/commands/index.mjs +11 -2
  23. package/src/cli/commands/mcp.mjs +1 -4
  24. package/src/cli/commands/runScript/handleRunScript.mjs +1 -9
  25. package/src/cli/commands/runScript/index.mjs +3 -1
  26. package/src/cli/commands/runScript/output/index.mjs +3 -1
  27. package/src/cli/commands/runScript/output/outputStyle.mjs +1 -3
  28. package/src/cli/commands/runScript/output/renderGroupedOutput.mjs +1 -6
  29. package/src/cli/commands/runScript/output/renderPlainOutput.mjs +1 -2
  30. package/src/cli/commands/runScript/output/sanitizeChunk.mjs +0 -1
  31. package/src/cli/createCli.mjs +2 -12
  32. package/src/cli/fatalErrorLogger.mjs +1 -2
  33. package/src/cli/globalOptions/globalOptions.mjs +2 -9
  34. package/src/cli/globalOptions/index.mjs +3 -2
  35. package/src/cli/index.d.ts +1085 -3
  36. package/src/cli/index.mjs +3 -1
  37. package/src/cli/middleware.mjs +1 -3
  38. package/src/config/index.mjs +3 -1
  39. package/src/config/public.d.ts +151 -10
  40. package/src/config/public.mjs +4 -6
  41. package/src/config/rootConfig/defineRootConfig.mjs +1 -2
  42. package/src/config/rootConfig/errors.mjs +1 -2
  43. package/src/config/rootConfig/index.mjs +3 -1
  44. package/src/config/rootConfig/loadRootConfig.mjs +1 -4
  45. package/src/config/rootConfig/mergeRootConfig.mjs +24 -0
  46. package/src/config/rootConfig/rootConfig.mjs +8 -6
  47. package/src/config/rootConfig/rootConfigSchema.mjs +19 -1
  48. package/src/config/userEnvVars/index.mjs +3 -1
  49. package/src/config/userEnvVars/userEnvVars.mjs +3 -8
  50. package/src/config/util/ajvTypes.mjs +2 -1
  51. package/src/config/util/index.mjs +2 -1
  52. package/src/config/util/loadConfig.mjs +1 -6
  53. package/src/config/util/validateConfig.mjs +0 -1
  54. package/src/config/workspaceConfig/defineWorkspaceConfig.mjs +1 -2
  55. package/src/config/workspaceConfig/errors.mjs +1 -2
  56. package/src/config/workspaceConfig/index.mjs +3 -1
  57. package/src/config/workspaceConfig/loadWorkspaceConfig.mjs +2 -8
  58. package/src/config/workspaceConfig/mergeWorkspaceConfig.mjs +75 -0
  59. package/src/config/workspaceConfig/workspaceConfig.mjs +1 -13
  60. package/src/config/workspaceConfig/workspaceConfigSchema.mjs +0 -1
  61. package/src/doctor/doctor.mjs +1 -5
  62. package/src/doctor/index.mjs +3 -1
  63. package/src/index.d.ts +516 -38
  64. package/src/index.mjs +4 -13
  65. package/src/internal/bun/bunLock.mjs +2 -4
  66. package/src/internal/bun/bunVersion.mjs +1 -3
  67. package/src/internal/bun/index.mjs +3 -1
  68. package/src/internal/bundledDeps/commander.mjs +3843 -0
  69. package/src/internal/bundledDeps/shellQuote.mjs +291 -0
  70. package/src/internal/core/error/error.mjs +0 -1
  71. package/src/internal/core/error/index.mjs +3 -1
  72. package/src/internal/core/index.mjs +3 -1
  73. package/src/internal/core/json/index.mjs +3 -1
  74. package/src/internal/core/json/json.mjs +3 -5
  75. package/src/internal/core/json/jsonc.mjs +0 -1
  76. package/src/internal/core/language/array/index.mjs +3 -1
  77. package/src/internal/core/language/array/optionalArray.mjs +0 -1
  78. package/src/internal/core/language/asyncIterable/asyncIterableQueue.mjs +0 -1
  79. package/src/internal/core/language/asyncIterable/index.mjs +3 -1
  80. package/src/internal/core/language/asyncIterable/mergeAsyncIterables.mjs +0 -1
  81. package/src/internal/core/language/events/typedEventTarget.mjs +0 -1
  82. package/src/internal/core/language/index.mjs +3 -1
  83. package/src/internal/core/language/regex/index.mjs +3 -1
  84. package/src/internal/core/language/regex/regex.mjs +0 -1
  85. package/src/internal/core/language/string/id.mjs +0 -1
  86. package/src/internal/core/language/string/index.mjs +3 -1
  87. package/src/internal/core/language/string/utf/eastAsianWidth.mjs +0 -1
  88. package/src/internal/core/language/string/utf/visibleLength.mjs +1 -2
  89. package/src/internal/core/language/types/index.mjs +3 -1
  90. package/src/internal/core/language/types/typeof.mjs +1 -3
  91. package/src/internal/core/language/types/types.mjs +3 -2
  92. package/src/internal/core/runtime/env.mjs +0 -1
  93. package/src/internal/core/runtime/index.mjs +3 -1
  94. package/src/internal/core/runtime/onExit.mjs +1 -2
  95. package/src/internal/core/runtime/os.mjs +1 -3
  96. package/src/internal/core/runtime/tempFile.mjs +1 -9
  97. package/src/internal/core/runtime/terminal.mjs +0 -1
  98. package/src/internal/generated/aiDocs/.gitkeep.mjs +1 -0
  99. package/src/internal/generated/aiDocs/docs.mjs +92 -15
  100. package/src/internal/generated/ajv/validateRootConfig.mjs +1 -1
  101. package/src/internal/logger/index.mjs +3 -1
  102. package/src/internal/logger/logger.mjs +4 -14
  103. package/src/internal/version.mjs +1 -2
  104. package/src/project/errors.mjs +1 -2
  105. package/src/project/implementations/fileSystemProject.mjs +4 -18
  106. package/src/project/implementations/memoryProject.mjs +1 -5
  107. package/src/project/implementations/projectBase.mjs +10 -19
  108. package/src/project/index.mjs +3 -1
  109. package/src/project/project.mjs +2 -1
  110. package/src/rslib-runtime.mjs +62 -0
  111. package/src/runScript/index.mjs +3 -1
  112. package/src/runScript/output/index.mjs +3 -1
  113. package/src/runScript/output/multiProcessOutput.mjs +1 -2
  114. package/src/runScript/output/outputStream.mjs +1 -1
  115. package/src/runScript/output/processOutput.mjs +1 -2
  116. package/src/runScript/parallel.mjs +4 -10
  117. package/src/runScript/recursion.mjs +1 -2
  118. package/src/runScript/runScript.mjs +1 -4
  119. package/src/runScript/runScripts.mjs +1 -6
  120. package/src/runScript/scriptCommand.mjs +1 -2
  121. package/src/runScript/scriptExecution.mjs +1 -3
  122. package/src/runScript/scriptRuntimeMetadata.mjs +38 -56
  123. package/src/runScript/scriptShellOption.mjs +5 -14
  124. package/src/runScript/subprocesses.mjs +1 -3
  125. package/src/workspaces/applyWorkspacePatternConfigs.mjs +58 -0
  126. package/src/workspaces/dependencyGraph/cycles.mjs +0 -1
  127. package/src/workspaces/dependencyGraph/index.mjs +3 -1
  128. package/src/workspaces/dependencyGraph/resolveDependencies.mjs +1 -2
  129. package/src/workspaces/dependencyGraph/validateDependencyRules.mjs +12 -13
  130. package/src/workspaces/errors.mjs +1 -2
  131. package/src/workspaces/findWorkspaces.mjs +11 -11
  132. package/src/workspaces/index.mjs +3 -1
  133. package/src/workspaces/packageJson.mjs +2 -7
  134. package/src/workspaces/workspace.mjs +2 -1
  135. package/src/workspaces/workspacePattern.mjs +4 -4
  136. package/src/ai/mcp/bwMcpServer.d.ts +0 -4
  137. package/src/ai/mcp/core/index.d.ts +0 -3
  138. package/src/ai/mcp/core/server.d.ts +0 -14
  139. package/src/ai/mcp/core/transport.d.ts +0 -12
  140. package/src/ai/mcp/core/types.d.ts +0 -104
  141. package/src/ai/mcp/index.d.ts +0 -2
  142. package/src/ai/mcp/resources.d.ts +0 -6
  143. package/src/ai/mcp/tools.d.ts +0 -6
  144. package/src/cli/commands/commandHandlerUtils.d.ts +0 -51
  145. package/src/cli/commands/commands.d.ts +0 -10
  146. package/src/cli/commands/commandsConfig.d.ts +0 -436
  147. package/src/cli/commands/handleSimpleCommands.d.ts +0 -21
  148. package/src/cli/commands/index.d.ts +0 -4
  149. package/src/cli/commands/mcp.d.ts +0 -3
  150. package/src/cli/commands/runScript/handleRunScript.d.ts +0 -3
  151. package/src/cli/commands/runScript/index.d.ts +0 -2
  152. package/src/cli/commands/runScript/output/index.d.ts +0 -1
  153. package/src/cli/commands/runScript/output/outputStyle.d.ts +0 -9
  154. package/src/cli/commands/runScript/output/renderGroupedOutput.d.ts +0 -75
  155. package/src/cli/commands/runScript/output/renderPlainOutput.d.ts +0 -24
  156. package/src/cli/commands/runScript/output/sanitizeChunk.d.ts +0 -4
  157. package/src/cli/createCli.d.ts +0 -26
  158. package/src/cli/fatalErrorLogger.d.ts +0 -1
  159. package/src/cli/globalOptions/globalOptions.d.ts +0 -43
  160. package/src/cli/globalOptions/globalOptionsConfig.d.ts +0 -52
  161. package/src/cli/globalOptions/globalOptionsConfig.mjs +0 -43
  162. package/src/cli/globalOptions/index.d.ts +0 -2
  163. package/src/cli/middleware.d.ts +0 -83
  164. package/src/config/index.d.ts +0 -3
  165. package/src/config/rootConfig/defineRootConfig.d.ts +0 -4
  166. package/src/config/rootConfig/errors.d.ts +0 -1
  167. package/src/config/rootConfig/index.d.ts +0 -5
  168. package/src/config/rootConfig/loadRootConfig.d.ts +0 -3
  169. package/src/config/rootConfig/rootConfig.d.ts +0 -25
  170. package/src/config/rootConfig/rootConfigLocation.d.ts +0 -2
  171. package/src/config/rootConfig/rootConfigLocation.mjs +0 -5
  172. package/src/config/rootConfig/rootConfigSchema.d.ts +0 -21
  173. package/src/config/userEnvVars/index.d.ts +0 -1
  174. package/src/config/userEnvVars/userEnvVars.d.ts +0 -13
  175. package/src/config/util/ajvTypes.d.ts +0 -10
  176. package/src/config/util/configLocation.d.ts +0 -18
  177. package/src/config/util/index.d.ts +0 -4
  178. package/src/config/util/loadConfig.d.ts +0 -18
  179. package/src/config/util/validateConfig.d.ts +0 -8
  180. package/src/config/workspaceConfig/defineWorkspaceConfig.d.ts +0 -7
  181. package/src/config/workspaceConfig/errors.d.ts +0 -1
  182. package/src/config/workspaceConfig/index.d.ts +0 -5
  183. package/src/config/workspaceConfig/loadWorkspaceConfig.d.ts +0 -3
  184. package/src/config/workspaceConfig/workspaceConfig.d.ts +0 -56
  185. package/src/config/workspaceConfig/workspaceConfigLocation.d.ts +0 -2
  186. package/src/config/workspaceConfig/workspaceConfigLocation.mjs +0 -5
  187. package/src/config/workspaceConfig/workspaceConfigSchema.d.ts +0 -56
  188. package/src/doctor/doctor.d.ts +0 -35
  189. package/src/doctor/index.d.ts +0 -1
  190. package/src/internal/bun/bunLock.d.ts +0 -20
  191. package/src/internal/bun/bunVersion.d.ts +0 -21
  192. package/src/internal/bun/index.d.ts +0 -2
  193. package/src/internal/core/error/error.d.ts +0 -13
  194. package/src/internal/core/error/index.d.ts +0 -1
  195. package/src/internal/core/index.d.ts +0 -4
  196. package/src/internal/core/json/index.d.ts +0 -2
  197. package/src/internal/core/json/json.d.ts +0 -49
  198. package/src/internal/core/json/jsonc.d.ts +0 -9
  199. package/src/internal/core/language/array/index.d.ts +0 -1
  200. package/src/internal/core/language/array/optionalArray.d.ts +0 -15
  201. package/src/internal/core/language/asyncIterable/asyncIterableQueue.d.ts +0 -16
  202. package/src/internal/core/language/asyncIterable/index.d.ts +0 -2
  203. package/src/internal/core/language/asyncIterable/mergeAsyncIterables.d.ts +0 -5
  204. package/src/internal/core/language/events/typedEventTarget.d.ts +0 -50
  205. package/src/internal/core/language/index.d.ts +0 -5
  206. package/src/internal/core/language/regex/index.d.ts +0 -1
  207. package/src/internal/core/language/regex/regex.d.ts +0 -3
  208. package/src/internal/core/language/string/id.d.ts +0 -1
  209. package/src/internal/core/language/string/index.d.ts +0 -1
  210. package/src/internal/core/language/string/utf/eastAsianWidth.d.ts +0 -16
  211. package/src/internal/core/language/string/utf/visibleLength.d.ts +0 -5
  212. package/src/internal/core/language/types/index.d.ts +0 -2
  213. package/src/internal/core/language/types/typeof.d.ts +0 -102
  214. package/src/internal/core/language/types/types.d.ts +0 -19
  215. package/src/internal/core/runtime/env.d.ts +0 -6
  216. package/src/internal/core/runtime/index.d.ts +0 -5
  217. package/src/internal/core/runtime/onExit.d.ts +0 -4
  218. package/src/internal/core/runtime/os.d.ts +0 -6
  219. package/src/internal/core/runtime/tempFile.d.ts +0 -20
  220. package/src/internal/core/runtime/terminal.d.ts +0 -1
  221. package/src/internal/docs/apiQuickstart.d.ts +0 -3
  222. package/src/internal/docs/apiQuickstart.mjs +0 -132
  223. package/src/internal/docs/cliQuickstart.d.ts +0 -2
  224. package/src/internal/docs/cliQuickstart.mjs +0 -86
  225. package/src/internal/docs/index.d.ts +0 -2
  226. package/src/internal/docs/index.mjs +0 -2
  227. package/src/internal/generated/aiDocs/docs.d.ts +0 -10
  228. package/src/internal/logger/index.d.ts +0 -1
  229. package/src/internal/logger/logger.d.ts +0 -45
  230. package/src/internal/version.d.ts +0 -1
  231. package/src/project/errors.d.ts +0 -5
  232. package/src/project/implementations/fileSystemProject.d.ts +0 -148
  233. package/src/project/implementations/memoryProject.d.ts +0 -41
  234. package/src/project/implementations/projectBase.d.ts +0 -37
  235. package/src/project/index.d.ts +0 -5
  236. package/src/project/project.d.ts +0 -79
  237. package/src/runScript/index.d.ts +0 -7
  238. package/src/runScript/output/index.d.ts +0 -3
  239. package/src/runScript/output/multiProcessOutput.d.ts +0 -14
  240. package/src/runScript/output/outputStream.d.ts +0 -1
  241. package/src/runScript/output/processOutput.d.ts +0 -33
  242. package/src/runScript/parallel.d.ts +0 -24
  243. package/src/runScript/recursion.d.ts +0 -4
  244. package/src/runScript/runScript.d.ts +0 -45
  245. package/src/runScript/runScripts.d.ts +0 -65
  246. package/src/runScript/scriptCommand.d.ts +0 -33
  247. package/src/runScript/scriptExecution.d.ts +0 -9
  248. package/src/runScript/scriptRuntimeMetadata.d.ts +0 -73
  249. package/src/runScript/scriptShellOption.d.ts +0 -8
  250. package/src/runScript/subprocesses.d.ts +0 -11
  251. package/src/workspaces/dependencyGraph/cycles.d.ts +0 -9
  252. package/src/workspaces/dependencyGraph/index.d.ts +0 -3
  253. package/src/workspaces/dependencyGraph/resolveDependencies.d.ts +0 -18
  254. package/src/workspaces/dependencyGraph/validateDependencyRules.d.ts +0 -7
  255. package/src/workspaces/errors.d.ts +0 -14
  256. package/src/workspaces/findWorkspaces.d.ts +0 -24
  257. package/src/workspaces/index.d.ts +0 -4
  258. package/src/workspaces/packageJson.d.ts +0 -31
  259. package/src/workspaces/workspace.d.ts +0 -21
  260. package/src/workspaces/workspacePattern.d.ts +0 -22
@@ -1,49 +0,0 @@
1
- type JSONPrimitiveMap = {
2
- string: string;
3
- number: number;
4
- boolean: boolean;
5
- null: null;
6
- };
7
- export type JSONPrimitiveName = keyof JSONPrimitiveMap;
8
- export type JSONPrimitiveToName<P extends JSONPrimitive> = {
9
- [key in keyof JSONPrimitiveMap]: P extends JSONPrimitiveMap[key]
10
- ? key
11
- : never;
12
- }[keyof JSONPrimitiveMap];
13
- export type NameToJSONPrimitive<Name extends JSONPrimitiveName> =
14
- JSONPrimitiveMap[Name];
15
- export type JSONPrimitive<N extends JSONPrimitiveName = JSONPrimitiveName> =
16
- NameToJSONPrimitive<N>;
17
- export interface JSONObject {
18
- [key: string]: JSONData;
19
- }
20
- export type JSONItem = JSONPrimitive | JSONObject;
21
- export type JSONArrayItem =
22
- | JSONItem
23
- | JSONItem[]
24
- | JSONItem[][]
25
- | JSONItem[][][]
26
- | JSONItem[][][][]
27
- | JSONItem[][][][][]
28
- | JSONItem[][][][][][]
29
- | JSONItem[][][][][][][]
30
- | JSONItem[][][][][][][][]
31
- | JSONItem[][][][][][][][][]
32
- | JSONItem[][][][][][][][][][]
33
- | JSONItem[][][][][][][][][][][];
34
- export type JSONArray<Item extends JSONArrayItem = JSONArrayItem> = Item[];
35
- export type JSONArrayToItem<A extends JSONArray> = A extends (infer Item)[]
36
- ? Item
37
- : never;
38
- export type JSONData = JSONPrimitive | JSONObject | JSONArray;
39
- export declare const isJSONPrimitive: (
40
- value: unknown,
41
- ) => value is JSONPrimitive;
42
- export declare const isJSONArray: <T extends JSONArray = JSONArray>(
43
- value: unknown,
44
- ) => value is T;
45
- export declare const isJSONObject: <T extends JSONObject = JSONObject>(
46
- value: unknown,
47
- ) => value is T;
48
- export declare const isJSON: (value: unknown) => value is JSONData;
49
- export {};
@@ -1,9 +0,0 @@
1
- export declare const convertJSONCToJSON: (
2
- jsonString: string,
3
- {
4
- whitespace,
5
- }?: {
6
- whitespace?: boolean | undefined;
7
- },
8
- ) => string;
9
- export declare const parseJSONC: (jsonString: string) => any;
@@ -1 +0,0 @@
1
- export * from "./optionalArray";
@@ -1,15 +0,0 @@
1
- /**
2
- * A value that may be its type T or an array of T.
3
- */
4
- export type OptionalArray<
5
- T = unknown,
6
- IncludeReadonly extends boolean = false,
7
- > = IncludeReadonly extends true ? T | T[] | readonly T[] : T | T[];
8
- export type ResolvedOptionalArray<T extends OptionalArray> =
9
- T extends (infer Item)[] ? Item[] : T[];
10
- export type ResolvedOptionalArrayItem<T extends OptionalArray> =
11
- T extends (infer Item)[] ? Item : T;
12
- /** Resolve `OptionalArray<T>` to `T[]` */
13
- export declare const resolveOptionalArray: <T extends OptionalArray>(
14
- value: T,
15
- ) => ResolvedOptionalArray<T>;
@@ -1,16 +0,0 @@
1
- import type { SimpleAsyncIterable } from "../types";
2
- export type AsyncQueueItem<T> =
3
- | {
4
- type: "value";
5
- value: T;
6
- }
7
- | {
8
- type: "done";
9
- };
10
- export declare const createAsyncIterableQueue: <
11
- T,
12
- >() => SimpleAsyncIterable<T> & {
13
- push: (value: T) => void;
14
- close: () => void;
15
- closed: Promise<void>;
16
- };
@@ -1,2 +0,0 @@
1
- export * from "./asyncIterableQueue";
2
- export * from "./mergeAsyncIterables";
@@ -1,5 +0,0 @@
1
- import type { SimpleAsyncIterable } from "../types";
2
- /** Run multiple async iterables in parallel and yield the results in the order they are completed. */
3
- export declare const mergeAsyncIterables: <T>(
4
- iterables: SimpleAsyncIterable<T>[],
5
- ) => SimpleAsyncIterable<T>;
@@ -1,50 +0,0 @@
1
- export type TypedEvent<
2
- TypeName extends string = string,
3
- ExtraProperties extends object = object,
4
- > = Event & {
5
- type: TypeName;
6
- } & ExtraProperties;
7
- export declare const TypedEvent: {
8
- prototype: TypedEvent;
9
- new <TypeName extends string = string>(
10
- type: TypeName,
11
- options?: EventInit,
12
- ): TypedEvent<TypeName>;
13
- };
14
- type ExtraProperties<E> =
15
- E extends TypedEvent<string, infer ExtraProperties>
16
- ? Omit<ExtraProperties, "type">
17
- : undefined;
18
- export declare const createTypedEventFactory: <
19
- E extends TypedEvent = TypedEvent,
20
- >(
21
- type: E["type"],
22
- ) => (properties: ExtraProperties<E>, options?: EventInit) => E;
23
- export type EventConfig = {
24
- [key: string]: TypedEvent;
25
- };
26
- type EventFromName<
27
- E extends keyof Config,
28
- Config extends EventConfig,
29
- > = Config[E];
30
- export interface TypedEventTarget<Config extends EventConfig = EventConfig> {
31
- addEventListener<EventName extends keyof Config>(
32
- event: EventName,
33
- listener: (event: EventFromName<EventName, Config>) => unknown,
34
- ): void;
35
- removeEventListener<EventName extends keyof Config>(
36
- event: EventName,
37
- listener: (event: EventFromName<EventName, Config>) => unknown,
38
- ): void;
39
- dispatchEvent<EventName extends keyof Config>(
40
- event: EventFromName<EventName, Config>,
41
- ): boolean;
42
- }
43
- /**
44
- * An EventTarget with typing for specific events.
45
- */
46
- export declare const TypedEventTarget: {
47
- prototype: TypedEventTarget;
48
- new <Config extends EventConfig = EventConfig>(): TypedEventTarget<Config>;
49
- };
50
- export {};
@@ -1,5 +0,0 @@
1
- export * from "./asyncIterable";
2
- export * from "./array";
3
- export * from "./types";
4
- export * from "./regex";
5
- export * from "./string";
@@ -1 +0,0 @@
1
- export * from "./regex";
@@ -1,3 +0,0 @@
1
- export declare const createRawPattern: (pattern: string) => string;
2
- export declare const createWildcardRegex: (pattern: string) => RegExp;
3
- export declare const sanitizeAnsi: (text: string) => string;
@@ -1 +0,0 @@
1
- export declare const createShortId: (bytes?: number) => string;
@@ -1 +0,0 @@
1
- export * from "./id";
@@ -1,16 +0,0 @@
1
- /** A port of the package eastasianwidth */
2
- export declare const eaw: {
3
- /**
4
- * F: Full width
5
- * H: Half width
6
- * W: Wide
7
- * Na: Narrow
8
- * A: Ambiguous
9
- * N: Neutral
10
- */
11
- eastAsianWidth: (character: string) => "F" | "H" | "W" | "Na" | "A" | "N";
12
- characterLength: (character: string) => 1 | 2;
13
- stringToArray: (s: string) => [] | RegExpMatchArray;
14
- length: (string: string) => number;
15
- slice: (text: string, start: number, end: number) => string;
16
- };
@@ -1,5 +0,0 @@
1
- export declare const calculateVisibleLength: (str: string) => number;
2
- export declare const truncateTerminalString: (
3
- str: string,
4
- maxVisible: number,
5
- ) => string;
@@ -1,2 +0,0 @@
1
- export * from "./typeof";
2
- export type * from "./types";
@@ -1,102 +0,0 @@
1
- import { type OptionalArray } from "../array/optionalArray";
2
- import { type AnyFunction } from "./types";
3
- export declare const InvalidJSTypeError: typeof import("../..").BunWorkspacesError;
4
- export declare const InvalidJSNumberError: typeof import("../..").BunWorkspacesError;
5
- export declare const VALIDATE_NUMBER_ERRORS: import("../..").DefinedErrors<
6
- "NoNaN" | "NoNonFinite" | "NoInfinity" | "NoNegInfinity"
7
- >;
8
- export declare const VALIDATE_TYPEOF_ERRORS: import("../..").DefinedErrors<
9
- "NoNull" | "InvalidType"
10
- >;
11
- interface JSTypeofToTypeMap {
12
- string: string;
13
- number: number;
14
- boolean: boolean;
15
- undefined: undefined;
16
- bigint: bigint;
17
- function: (...args: unknown[]) => unknown;
18
- object: null | object;
19
- symbol: symbol;
20
- }
21
- export type JSDataTypeofName = keyof JSTypeofToTypeMap;
22
- export type TypeToJSTypeofName<T> = {
23
- [K in keyof JSTypeofToTypeMap]: T extends AnyFunction
24
- ? "function"
25
- : T extends JSTypeofToTypeMap[K]
26
- ? K
27
- : never;
28
- }[keyof JSTypeofToTypeMap];
29
- export type JSTypeofNameToType<Name extends JSDataTypeofName> =
30
- JSTypeofToTypeMap[Name];
31
- export type TypeToJSTypeof<T> = JSTypeofNameToType<TypeToJSTypeofName<T>>;
32
- export declare const isTypeof: <T, D extends JSDataTypeofName>(
33
- value: T,
34
- ...types: D[]
35
- ) => value is Extract<T, JSTypeofNameToType<D>>;
36
- export declare const isPlainObject: (value: unknown) => value is object;
37
- export type ValidateNumberRules = {
38
- noNaN?: boolean;
39
- noNonFinite?: boolean;
40
- noInfinity?: boolean;
41
- noNegInfinity?: boolean;
42
- };
43
- export type ValidateJSTypeOptions = {
44
- value: unknown;
45
- typeofName: OptionalArray<JSDataTypeofName>;
46
- /** For use in error message */
47
- valueLabel?: string;
48
- numberRules?: ValidateNumberRules;
49
- optional?: boolean;
50
- };
51
- export type ValidateJSTypesTypeEntry = Omit<
52
- ValidateJSTypeOptions,
53
- "valueLabel"
54
- > & {
55
- array?: false;
56
- };
57
- export type ValidateJSTypesArrayEntry = Omit<
58
- ValidateJSArrayOptions,
59
- "valueLabel"
60
- > & {
61
- array: true;
62
- };
63
- export type ValidateJSTypesConfigEntry =
64
- | ValidateJSTypesTypeEntry
65
- | ValidateJSTypesArrayEntry;
66
- export type ValidateJSTypesConfig = {
67
- [valueLabel: string]: ValidateJSTypesConfigEntry;
68
- };
69
- export declare const validateNumber: (
70
- value: number,
71
- rules: ValidateNumberRules,
72
- valueLabel?: string,
73
- ) => InstanceType<typeof InvalidJSNumberError> | null;
74
- export declare const validateJSType: ({
75
- value,
76
- typeofName,
77
- numberRules,
78
- valueLabel,
79
- optional,
80
- }: ValidateJSTypeOptions) => InstanceType<typeof InvalidJSTypeError> | null;
81
- export type ValidateJSArrayOptions = {
82
- value: unknown;
83
- /** For use in error messages */
84
- valueLabel?: string;
85
- optional?: boolean;
86
- /** Options to validate each item in the array */
87
- itemOptions?: Omit<ValidateJSTypeOptions, "value" | "valueLabel">;
88
- };
89
- export declare const validateJSArray: ({
90
- value,
91
- valueLabel,
92
- optional,
93
- itemOptions,
94
- }: ValidateJSArrayOptions) => InstanceType<typeof InvalidJSTypeError> | null;
95
- export type ValidateJSTypesOptions = {
96
- throw?: boolean;
97
- };
98
- export declare const validateJSTypes: (
99
- config: ValidateJSTypesConfig,
100
- options?: ValidateJSTypesOptions,
101
- ) => InstanceType<typeof InvalidJSTypeError> | null;
102
- export {};
@@ -1,19 +0,0 @@
1
- /** Does not change an object type, but remaps it for cleaner Intellisense only */
2
- export type Simplify<T extends object> = {
3
- [K in keyof T]: T[K];
4
- };
5
- /** A normal `AsyncIterable` that is only intended for `for await` style iteration */
6
- export type SimpleAsyncIterable<T> = AsyncIterable<T, void, undefined>;
7
- export type AnyFunction<Args extends unknown[] = any[], Return = any> = (
8
- ...args: Args
9
- ) => Return;
10
- export type RequiredDeep<T> = T extends object
11
- ? Required<{
12
- [K in keyof T]: RequiredDeep<T[K]>;
13
- }>
14
- : T;
15
- export type PartialDeep<T> = T extends object
16
- ? Partial<{
17
- [K in keyof T]: PartialDeep<T[K]>;
18
- }>
19
- : T;
@@ -1,6 +0,0 @@
1
- export type RuntimeMode = "development" | "production" | "test";
2
- export declare const RUNTIME_MODE: RuntimeMode;
3
- export declare const IS_INTERNAL_TEST: boolean;
4
- export declare const IS_TEST: boolean;
5
- export declare const IS_PRODUCTION: boolean;
6
- export declare const IS_DEVELOPMENT: boolean;
@@ -1,5 +0,0 @@
1
- export * from "./env";
2
- export * from "./os";
3
- export * from "./onExit";
4
- export * from "./tempFile";
5
- export * from "./terminal";
@@ -1,4 +0,0 @@
1
- type ExitCodeOrSignal = NodeJS.Signals | number;
2
- type ExitHandler = (exit?: ExitCodeOrSignal) => unknown;
3
- export declare const runOnExit: <F extends ExitHandler>(fn: F) => void;
4
- export {};
@@ -1,6 +0,0 @@
1
- export declare const IS_WINDOWS: boolean;
2
- export declare const IS_MACOS: boolean;
3
- export declare const IS_LINUX: boolean;
4
- export declare const IS_POSIX: boolean;
5
- /** Expands a leading `~` or `~/` to the user's home directory */
6
- export declare const expandHomePath: (filePath: string) => string;
@@ -1,20 +0,0 @@
1
- import fs from "fs";
2
- export type CreateTempFileOptions = {
3
- name: string;
4
- content: string;
5
- mode?: fs.Mode;
6
- };
7
- declare class TempDir {
8
- readonly id: string;
9
- readonly dir: string;
10
- constructor();
11
- initialize(clean?: boolean): void;
12
- createFilePath(fileName: string): string;
13
- createFile({ name, content, mode }: CreateTempFileOptions): {
14
- filePath: string;
15
- cleanup: () => void;
16
- };
17
- cleanup(): void;
18
- }
19
- export declare let DEFAULT_TEMP_DIR: TempDir;
20
- export {};
@@ -1 +0,0 @@
1
- export declare const IS_TTY: boolean;
@@ -1,3 +0,0 @@
1
- export declare const RUN_WORKSPACE_SCRIPT_EXAMPLE: string;
2
- export declare const RUN_SCRIPT_ACROSS_WORKSPACES_EXAMPLE: string;
3
- export declare const API_QUICKSTART: string;
@@ -1,132 +0,0 @@
1
- // CONCATENATED MODULE: ./src/internal/docs/apiQuickstart.ts
2
- const RUN_WORKSPACE_SCRIPT_EXAMPLE = `
3
- const { output, exit } = project.runWorkspaceScript({
4
- workspaceNameOrAlias: "my-workspace",
5
- script: "my-script",
6
-
7
- // Optional. Arguments to add to the command
8
- // Can be a string or an array of strings
9
- // If string, the argv will be parsed POSIX-style
10
- args: ["--my", "--appended", "--args"],
11
-
12
- // Optional. Whether to ignore all output from the script.
13
- // This saves memory when you don't need script output.
14
- ignoreOutput: false,
15
- });
16
-
17
- // Get a stream of the script subprocess's output
18
- for await (const { chunk, metadata } of output.text()) {
19
- // console.log(chunk); // The output chunk's content (string)
20
- // console.log(metadata.streamName); // The output stream, "stdout" or "stderr"
21
- // console.log(metadata.workspace); // The target Workspace
22
- }
23
-
24
- // Get data about the script execution after it exits
25
- const exitResult = await exit;
26
-
27
- // exitResult.exitCode // The exit code (number)
28
- // exitResult.signal // The exit signal (string), or null
29
- // exitResult.success // true if exit code was 0
30
- // exitResult.startTimeISO // Start time (string)
31
- // exitResult.endTimeISO // End time (string)
32
- // exitResult.durationMs // Duration in milliseconds (number)
33
- // exitResult.metadata.workspace // The target workspace (Workspace)
34
-
35
- `.trim();
36
- const RUN_SCRIPT_ACROSS_WORKSPACES_EXAMPLE = `
37
-
38
- const { output, summary } = project.runScriptAcrossWorkspaces({
39
- // Optional. This will run in all matching workspaces that have my-script
40
- // Accepts same values as the CLI run-script command's workspace patterns
41
- // When not provided, all workspaces that have the script will be used.
42
- workspacePatterns: ["my-workspace", "my-name-pattern-*"],
43
-
44
- // Required. The package.json "scripts" field name to run
45
- script: "my-script",
46
-
47
- // Optional. Arguments to add to the command (same as for runWorkspaceScript)
48
- args: ["--my", "--appended", "--args"],
49
-
50
- // Optional. Whether to run the scripts in parallel (default: true)
51
- parallel: true,
52
-
53
- // Optional. When true, a workspace's script will wait
54
- // until any workspaces it depends on have completed
55
- dependencyOrder: false,
56
-
57
- // Optional. When true and dependencyOrder is true,
58
- // continue running scripts even if a dependency fails
59
- ignoreDependencyFailure: false,
60
-
61
- // Optional. Whether to ignore all output from the scripts.
62
- // This saves memory when you don't need script output.
63
- ignoreOutput: false,
64
-
65
- // Optional, callback when script starts, skips, or exits
66
- onScriptEvent: (event, { workspace, exitResult }) => {
67
- // event: "start", "skip", "exit"
68
- }
69
- });
70
-
71
- // Get a stream of script output
72
- for await (const { chunk, metadata } of output.text()) {
73
- // console.log(chunk); // the output chunk's content (string)
74
- // console.log(metadata.streamName); // "stdout" or "stderr"
75
- // console.log(metadata.workspace); // the Workspace that the output came from
76
- }
77
-
78
- // Get final summary data and script exit details after all scripts have completed
79
- const summaryResult = await summary;
80
-
81
- // summaryResult.totalCount // Total number of scripts
82
- // summaryResult.allSuccess // true if all scripts succeeded
83
- // summaryResult.successCount // Number of scripts that succeeded
84
- // summaryResult.failureCount // Number of scripts that failed
85
- // summaryResult.startTimeISO // Start time (string)
86
- // summaryResult.endTimeISO // End time (string)
87
- // summaryResult.durationMs // Total duration in milliseconds (number)
88
-
89
- // The exit details of each workspace script
90
- for (const exitResult of summaryResult.scriptResults) {
91
- // exitResult.exitCode // The exit code (number)
92
- // exitResult.signal // The exit signal (string), or null
93
- // exitResult.success // true if exit code was 0
94
- // exitResult.startTimeISO // Start time (ISO string)
95
- // exitResult.endTimeISO // End time (ISO string)
96
- // exitResult.durationMs // Duration in milliseconds (number)
97
- // exitResult.metadata.workspace // The target workspace (Workspace)
98
- }
99
- `.trim();
100
- const API_QUICKSTART = `
101
- import { createFileSystemProject } from "bun-workspaces";
102
-
103
- // A Project contains the core functionality of bun-workspaces.
104
- // Below defaults to process.cwd() for the project root directory
105
- // Pass { rootDirectory: "path/to/your/project" } to use a different root directory
106
- const project = createFileSystemProject();
107
-
108
- // A Workspace that matches the name or alias "my-workspace"
109
- const myWorkspace = project.findWorkspaceByNameOrAlias("my-workspace");
110
-
111
- // Array of workspaces whose names match the wildcard pattern
112
- const wildcardWorkspaces = project.findWorkspacesByPattern("my-workspace-*");
113
-
114
- // Array of workspaces that have "my-script" in their package.json "scripts"
115
- const workspacesWithScript = project.listWorkspacesWithScript("my-script");
116
-
117
- // Run a script in a workspace
118
- const runSingleScript = async () => {
119
- ${RUN_WORKSPACE_SCRIPT_EXAMPLE.split("\n").join("\n ")}
120
- }
121
-
122
- // Run a script in all workspaces that have it in their package.json "scripts" field
123
- const runManyScripts = async () => {
124
- ${RUN_SCRIPT_ACROSS_WORKSPACES_EXAMPLE.split("\n").join("\n ")}
125
- }
126
- `.trim();
127
-
128
- export {
129
- API_QUICKSTART,
130
- RUN_SCRIPT_ACROSS_WORKSPACES_EXAMPLE,
131
- RUN_WORKSPACE_SCRIPT_EXAMPLE,
132
- };
@@ -1,2 +0,0 @@
1
- export declare const CLI_QUICKSTART: string;
2
- export declare const INLINE_SCRIPT_EXAMPLE: string;
@@ -1,86 +0,0 @@
1
- // CONCATENATED MODULE: ./src/internal/docs/cliQuickstart.ts
2
- const CLI_QUICKSTART = `
3
- # You can add this to .bashrc, .zshrc, or similar.
4
- # You can also invoke "bw" in your root package.json scripts.
5
- alias bw="bunx bun-workspaces"
6
-
7
- # List all workspaces in your project
8
- bw list-workspaces
9
-
10
- # ls is an alias for list-workspaces
11
- bw ls --json --pretty # Output as formatted JSON
12
-
13
- # Get info about a workspace
14
- bw workspace-info my-workspace
15
- bw info my-workspace --json --pretty # info is alias for workspace-info
16
-
17
- # Get info about a script, such as the workspaces that have it
18
- bw script-info my-script
19
-
20
- # Run the lint script for all workspaces
21
- # that have it in their package.json "scripts" field
22
- bw run-script lint
23
-
24
- # run is an alias for run-script
25
- bw run lint my-workspace # Run for a single workspace
26
- bw run lint my-workspace-a my-workspace-b # Run for multiple workspaces
27
- bw run lint my-alias-a my-alias-b # Run by alias (set by optional config)
28
-
29
- # A workspace's script will wait until any workspaces it depends on have completed
30
- # Similar to Bun's --filter behavior
31
- bw run lint --dep-order
32
-
33
- # Continue running scripts even if a dependency fails
34
- bw run lint --dep-order --ignore-dep-failure
35
-
36
- bw run lint "my-workspace-*" # Run for matching workspace names
37
- bw run lint "alias:my-alias-*" "path:my-glob/**/*" "tag:my-tag" # Use matching specifiers
38
- bw run lint "*" "not:path:my-path/*" # Run for all workspaces not in my-path/
39
-
40
- bw run lint --args="--my-appended-args" # Add args to each script call
41
- bw run lint --args="--my-arg=<workspaceName>" # Use the workspace name in args
42
-
43
- bw run "bun build" --inline # Run an inline command via the Bun shell
44
-
45
- # Scripts run in parallel by default
46
- bw run lint --parallel=false # Run in series
47
- bw run lint --parallel=2 # Run in parallel with a max of 2 concurrent scripts
48
- bw run lint --parallel=auto # Default, based on number of available logical CPUs
49
- bw run lint --parallel=50% # Run in parallel with a max of 50% of the "auto" limit
50
-
51
- # Use the grouped output style (default when on a TTY)
52
- bw run my-script --output-style=grouped
53
-
54
- # Set the max preview lines for script output in grouped output style
55
- bw run my-script --output-style=grouped --grouped-lines=auto
56
- bw run my-script --output-style=grouped --grouped-lines=10
57
-
58
- # Use simple script output with workspace prefixes (default when not on a TTY)
59
- bw run my-script --output-style=prefixed
60
-
61
- # Use the plain output style (no workspace prefixes)
62
- bw run my-script --output-style=plain
63
-
64
- # Silence all output of the run command
65
- bw --log-level=silent run my-script --output-style=none
66
-
67
- # Show usage (you can pass --help to any command)
68
- bw help
69
- bw --help
70
-
71
- # Show version
72
- bw --version
73
-
74
- # Pass --cwd to any command
75
- bw --cwd=/path/to/your/project ls
76
- bw --cwd=/path/to/your/project run my-script
77
-
78
- # Pass --log-level to any command (debug, info, warn, error, or silent)
79
- bw --log-level=debug ls
80
- `.trim();
81
- const INLINE_SCRIPT_EXAMPLE = `
82
- # Run an inline command from the workspace directory
83
- bw run "bun run build" --inline
84
- `.trim();
85
-
86
- export { CLI_QUICKSTART, INLINE_SCRIPT_EXAMPLE };
@@ -1,2 +0,0 @@
1
- export * from "./cliQuickstart";
2
- export * from "./apiQuickstart";
@@ -1,2 +0,0 @@
1
- export * from "./cliQuickstart.mjs";
2
- export * from "./apiQuickstart.mjs"; // CONCATENATED MODULE: ./src/internal/docs/index.ts
@@ -1,10 +0,0 @@
1
- export declare const DOC_OVERVIEW =
2
- '## Project Overview\n\nbun-workspaces is a CLI and TypeScript API to help manage Bun monorepos. It reads `bun.lock` to find all workspaces in the project. It is referred to as "bw" for short, which is also the recommended CLI alias. The overall goal is a monorepo tool that is more lightweight than others, with still powerful comparable features, requiring no special config to get started, only a standard Bun repo using workspaces.\n\nThree main domain terms to know:\n\n- Project: generally represents a monorepo and is defined by the root `package.json` file\n- Workspace: a nested package within a project. The root package.json can count as a workspace as well, but by default, only nested packages are considered workspaces.\n- Script: an entry in the `scripts` field of a workspace\'s `package.json` file. bw can also run one-off commands known as "inline scripts," which can use the Bun shell or system shell (`sh -c` or `cmd /d /s /c` for windows).';
3
- export declare const DOC_CONCEPTS =
4
- '## Concepts\n\n### Workspace patterns\n\nMany features accept a list of workspace patterns to match a subset of workspaces.\n\nBy default, a pattern matches the workspace name or alias: `my-workspace-name` or `my-alias-name`. Aliases are defined in config explained below.\n\nPatterns can include a wildcard to match only by workspace name: `my-workspace-*`.\n\n- Alias pattern specifier: `alias:my-alias-*`.\n- Path pattern specifier (supports glob): `path:packages/**/*`.\n- Name pattern specifier: `name:my-workspace-*`.\n- Tag pattern specifier: `tag:my-tag`.\n- Special root workspace selector: `@root`.\n- Any pattern can start with `not:` to negate the pattern. (e.g. "not:my-workspace-name", "not:tag:my-tag-\\*") This excludes workspaces that match any other present patterns from a result.\n\n### Script runtime metadata\n\nScripts ran via bw can access metadata via env vars. This same metadata can be interpolated into inline scripts and appended args.\n\n```typescript\n// in a script\nconst projectPath = process.env.BW_PROJECT_PATH;\nconst workspaceName = process.env.BW_WORKSPACE_NAME;\nconst workspacePath = process.env.BW_WORKSPACE_PATH;\nconst workspaceRelativePath = process.env.BW_WORKSPACE_RELATIVE_PATH;\nconst scriptName = process.env.BW_SCRIPT_NAME;\n```\n\n```bash\n# interpolated\nbw run "bun <projectPath>/my-script.ts" --inline \\\n --inline-name="my-script-name" \\\n --args="<workspaceName> <workspacePath>"\n```';
5
- export declare const DOC_CLI =
6
- '### CLI examples:\n\n```bash\nalias bw="bunx bun-workspaces"\n\nbw list-workspaces # human-readable output\nbw ls --json --pretty # ls is alias for list-workspaces\nbw ls "name:my-workspace-*" "alias:my-alias-*" "path:packages/**/*" # accepts workspace patterns\n\n# info includes the name, aliases, path, etc.\nbw workspace-info my-workspace\nbw info my-workspace --json --pretty # info is alias for workspace-info\n\n# info includes the script name and workspaces that have it in their package.json "scripts" field\nbw script-info my-script --json --pretty\n\n# run the package.json "lint" script for all workspaces that have it\nbw run-script lint\n\n# run is alias for run-script\n# run the package.json "lint" script for workspaces using matching specifiers\nbw run lint my-workspace-name "alias:my-alias-pattern-*" "path:my-glob/**/*" # accepts workspace patterns\n\n# A workspace\'s script will wait until any workspaces it depends on have completed\n# Similar to Bun\'s --filter behavior\nbw run lint --dep-order\n\n# Continue running scripts even if a dependency fails\nbw run lint --dep-order --ignore-dep-failure\n\n# special root workspace selector (works even if root workspace is not included)\nbw run lint @root\n\n# Scripts run in parallel by default\nbw run lint --parallel=false # Run in series\n\n# Default can be overridden by config or env var BW_PARALLEL_MAX_DEFAULT\nbw run lint --parallel # default "auto", os.availableParallelism()\nbw run lint --parallel=2 # Run in parallel with a max of 2 concurrent scripts\nbw run lint --parallel=50% # 50% of os.availableParallelism()\nbw run lint --parallel=unbounded # run all in one batch\n\n# add args to the script command\nbw run lint --args="--my-arg=value"\nbw run lint --args="--my-arg=<workspaceName>" # use the workspace name in args\n\n# run the script as an inline command from the workspace directory\nbw run "bun build" --inline\nbw run "bun build" --inline --inline-name="my-script"\nbw run "bun build" --inline --shell=system # use the system shell\n\n# Use the grouped output style (default when on a TTY)\nbw run my-script --output-style=grouped\n\n# Set the max preview lines for script output in grouped output style\nbw run my-script --output-style=grouped --grouped-lines=auto\nbw run my-script --output-style=grouped --grouped-lines=10\n\n# Use simple script output with workspace prefixes (default when not on a TTY)\nbw run my-script --output-style=prefixed\n\n# Use the plain output style (no workspace prefixes)\nbw run my-script --output-style=plain\n\n### Global Options ###\n# Root directory of project:\nbw --cwd=/path/to/project ls\nbw -d /path/to/project ls\n\n# Include root workspace as a normal workspace (default false):\nbw --include-root ls\nbw -r ls\nbw --no-include-root ls # override config/env var setting\n\n# Log level (debug|info|warn|error|silent, default info)\nbw --log-level=silent ls\nbw -l silent ls\n```';
7
- export declare const DOC_API =
8
- '### API examples:\n\nThe API is held in close parity with the CLI. It is developed first so that the CLI is a thin wrapper around the API.\n\n```typescript\nimport { createFileSystemProject } from "bun-workspaces";\n\nconst project = createFileSystemProject({\n // the options object itself and its properties are optional\n rootDirectory: "path/to/your/project",\n includeRootWorkspace: false,\n});\nproject.workspaces; // array of all workspaces in the project\nproject.rootWorkspace; // the root workspace (available even when not included in the workspaces array)\nproject.findWorkspaceByName("my-workspace"); // find a workspace by name\nproject.findWorkspaceByAlias("my-alias"); // find a workspace by alias\nproject.findWorkspaceByNameOrAlias("my-workspace-or-alias"); // find a workspace by name or alias\nproject.findWorkspacesByPattern(\n "my-workspace-name",\n "my-workspace-alias",\n "my-name-pattern-*",\n "alias:my-alias-*",\n "path:my-glob/**/*",\n); // find workspaces by pattern like the CLI\nproject.runWorkspaceScript({\n workspaceNameOrAlias: "my-workspace",\n script: "lint",\n inline: true,\n // args can be a string or an array of strings\n // if string, the argv will be parsed POSIX-style\n args: "--my-arg=value",\n});\nproject.runScriptAcrossWorkspaces({\n script: "lint",\n workspacePatterns: [\n "alias:my-alias-pattern-*",\n "path:my-glob/**/*",\n "workspace-name-a",\n "workspace-alias-b",\n ],\n parallel: true, // also could be { max: 2 }, max taking same options as seen in CLI examples above (e.g. "50%", "auto", etc.)\n dependencyOrder: true,\n ignoreDependencyFailure: true,\n // same as for runWorkspaceScript\n args: ["--my", "--appended", "--args"],\n // Optional, callback when script starts, skips, or exits\n onScriptEvent: (event, { workspace, exitResult }) => {\n // event: "start", "skip", "exit"\n },\n});\n```\n\n## The Workspace object\n\n```jsonc\n{\n // The name of the workspace from its package.json\n "name": "my-workspace",\n // Whether the workspace is the root workspace\n "isRoot": false,\n // The relative path to the workspace from the project root\n "path": "my/workspace/path",\n // The glob pattern from the root package.json "workspaces" field\n // that this workspace was matched from\n "matchPattern": "my/workspace/pattern/*",\n // The scripts available in the workspace\'s package.json\n "scripts": ["my-script"],\n // Aliases defined in workspace configuration (bw.workspace.jsonc/bw.workspace.json)\n "aliases": ["my-alias"],\n // Names of other workspaces that this workspace depends on\n "dependencies": ["my-dependency"],\n // Names of other workspaces that depend on this workspace\n "dependents": ["my-dependent"],\n}\n```';
9
- export declare const DOC_CONFIG =
10
- '## Root config\n\nOptional project config can be placed in `bw.root.jsonc`/`bw.root.json` in the root directory.\n\nConfig defaults here take precedence over environment variables that can set defaults.\nExplicit arguments to the CLI or API take precedence over all other settings.\n\n```jsonc\n{\n "defaults": {\n "parallelMax": 5, // same options as seen in CLI examples above\n "shell": "system", // "bun" or "system" (default "bun")\n "includeRootWorkspace": true, // treat root package.json as a normal workspace\n },\n}\n```\n\n## Workspace config\n\nOptional config can be placed in `bw.workspace.jsonc`/`bw.workspace.json` in a workspace directory.\n\nAliases must be unique to each workspace and to not clash with other workspaces\' `package.json` names.\n\nTags are strings to group workspaces together that therefore don\'t need to be unique to each workspace.\n\n```jsonc\n{\n "alias": "my-alias", // can be array\n "tags": ["my-tag"],\n "scripts": {\n "lint": {\n // set optional sorting order for scripts\n "order": 1,\n },\n },\n "rules": {\n "workspaceDependencies": {\n // use workspace patterns to allow or deny other workspaces as dependencies\n "allowPatterns": ["my-allow-pattern-*"],\n // or\n // "denyPatterns": ["my-deny-pattern-*"],\n },\n },\n}\n```\n\n### Workspace Dependency Rules\n\nUsing the `rules.workspaceDependencies` field, you can define rules for which workspaces are allowed to be dependencies,\nusing either `allowPatterns` or `denyPatterns`.\n\nWorkspace Patterns are used to match workspaces.\n\nYou can\'t use both `allowPatterns` and `denyPatterns` at the same time, but you can use\n\n## TypeScript/JSON Config Files\n\nYou can use TypeScript/JSON config files to define your workspace configuration.\n\n### TypeScript\n\n`bw.workspace.ts`\n\n```ts\nimport { defineWorkspaceConfig } from "bun-workspaces/config";\n\nexport default defineWorkspaceConfig({\n alias: "my-alias",\n tags: ["my-tag"],\n});\n```\n\n`bw.root.ts`\n\n```ts\nimport { defineRootConfig } from "bun-workspaces/config";\n\nexport default defineRootConfig({\n defaults: {\n parallelMax: 5,\n },\n});\n```';
@@ -1 +0,0 @@
1
- export * from "./logger";