bun-workspaces 1.5.0 → 1.5.2

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 (255) hide show
  1. package/bin/cli.js +0 -0
  2. package/package.json +1 -5
  3. package/src/1108.mjs +30 -0
  4. package/src/{cli/commands/commandsConfig.mjs → 2392.mjs} +52 -11
  5. package/src/4427.mjs +9 -0
  6. package/src/5166.mjs +8 -0
  7. package/src/8126.mjs +4 -0
  8. package/src/8257.mjs +4 -0
  9. package/src/{config/util/configLocation.mjs → 8529.mjs} +11 -2
  10. package/src/ai/mcp/bwMcpServer.mjs +213 -9
  11. package/src/ai/mcp/core/index.mjs +3 -1
  12. package/src/ai/mcp/core/server.mjs +1 -3
  13. package/src/ai/mcp/core/transport.mjs +1 -2
  14. package/src/ai/mcp/core/types.mjs +0 -1
  15. package/src/ai/mcp/index.mjs +3 -1
  16. package/src/ai/mcp/resources.mjs +1 -2
  17. package/src/ai/mcp/tools.mjs +1 -5
  18. package/src/cli/commands/commandHandlerUtils.mjs +2 -6
  19. package/src/cli/commands/commands.mjs +1 -4
  20. package/src/cli/commands/handleSimpleCommands.mjs +4 -10
  21. package/src/cli/commands/index.mjs +11 -2
  22. package/src/cli/commands/mcp.mjs +1 -4
  23. package/src/cli/commands/runScript/handleRunScript.mjs +1 -9
  24. package/src/cli/commands/runScript/index.mjs +3 -1
  25. package/src/cli/commands/runScript/output/index.mjs +3 -1
  26. package/src/cli/commands/runScript/output/outputStyle.mjs +1 -3
  27. package/src/cli/commands/runScript/output/renderGroupedOutput.mjs +1 -6
  28. package/src/cli/commands/runScript/output/renderPlainOutput.mjs +1 -2
  29. package/src/cli/commands/runScript/output/sanitizeChunk.mjs +0 -1
  30. package/src/cli/createCli.mjs +2 -12
  31. package/src/cli/fatalErrorLogger.mjs +1 -2
  32. package/src/cli/globalOptions/globalOptions.mjs +2 -9
  33. package/src/cli/globalOptions/index.mjs +3 -2
  34. package/src/cli/index.d.ts +1025 -3
  35. package/src/cli/index.mjs +3 -1
  36. package/src/cli/middleware.mjs +1 -3
  37. package/src/config/index.mjs +3 -1
  38. package/src/config/public.d.ts +93 -10
  39. package/src/config/public.mjs +2 -6
  40. package/src/config/rootConfig/defineRootConfig.mjs +1 -2
  41. package/src/config/rootConfig/errors.mjs +1 -2
  42. package/src/config/rootConfig/index.mjs +2 -1
  43. package/src/config/rootConfig/loadRootConfig.mjs +1 -4
  44. package/src/config/rootConfig/rootConfig.mjs +1 -6
  45. package/src/config/rootConfig/rootConfigSchema.mjs +0 -1
  46. package/src/config/userEnvVars/index.mjs +3 -1
  47. package/src/config/userEnvVars/userEnvVars.mjs +3 -8
  48. package/src/config/util/ajvTypes.mjs +2 -1
  49. package/src/config/util/index.mjs +2 -1
  50. package/src/config/util/loadConfig.mjs +1 -6
  51. package/src/config/util/validateConfig.mjs +0 -1
  52. package/src/config/workspaceConfig/defineWorkspaceConfig.mjs +1 -2
  53. package/src/config/workspaceConfig/errors.mjs +1 -2
  54. package/src/config/workspaceConfig/index.mjs +2 -1
  55. package/src/config/workspaceConfig/loadWorkspaceConfig.mjs +2 -8
  56. package/src/config/workspaceConfig/workspaceConfig.mjs +1 -5
  57. package/src/config/workspaceConfig/workspaceConfigSchema.mjs +0 -1
  58. package/src/doctor/doctor.mjs +1 -5
  59. package/src/doctor/index.mjs +3 -1
  60. package/src/index.d.ts +458 -38
  61. package/src/index.mjs +4 -13
  62. package/src/internal/bun/bunLock.mjs +2 -4
  63. package/src/internal/bun/bunVersion.mjs +1 -3
  64. package/src/internal/bun/index.mjs +3 -1
  65. package/src/internal/bundledDeps/commander.mjs +3843 -0
  66. package/src/internal/bundledDeps/shellQuote.mjs +291 -0
  67. package/src/internal/core/error/error.mjs +0 -1
  68. package/src/internal/core/error/index.mjs +3 -1
  69. package/src/internal/core/index.mjs +3 -1
  70. package/src/internal/core/json/index.mjs +3 -1
  71. package/src/internal/core/json/json.mjs +3 -5
  72. package/src/internal/core/json/jsonc.mjs +0 -1
  73. package/src/internal/core/language/array/index.mjs +3 -1
  74. package/src/internal/core/language/array/optionalArray.mjs +0 -1
  75. package/src/internal/core/language/asyncIterable/asyncIterableQueue.mjs +0 -1
  76. package/src/internal/core/language/asyncIterable/index.mjs +3 -1
  77. package/src/internal/core/language/asyncIterable/mergeAsyncIterables.mjs +0 -1
  78. package/src/internal/core/language/events/typedEventTarget.mjs +0 -1
  79. package/src/internal/core/language/index.mjs +3 -1
  80. package/src/internal/core/language/regex/index.mjs +3 -1
  81. package/src/internal/core/language/regex/regex.mjs +0 -1
  82. package/src/internal/core/language/string/id.mjs +0 -1
  83. package/src/internal/core/language/string/index.mjs +3 -1
  84. package/src/internal/core/language/string/utf/eastAsianWidth.mjs +0 -1
  85. package/src/internal/core/language/string/utf/visibleLength.mjs +1 -2
  86. package/src/internal/core/language/types/index.mjs +3 -1
  87. package/src/internal/core/language/types/typeof.mjs +1 -3
  88. package/src/internal/core/language/types/types.mjs +3 -2
  89. package/src/internal/core/runtime/env.mjs +0 -1
  90. package/src/internal/core/runtime/index.mjs +3 -1
  91. package/src/internal/core/runtime/onExit.mjs +2 -3
  92. package/src/internal/core/runtime/os.mjs +1 -3
  93. package/src/internal/core/runtime/tempFile.mjs +1 -9
  94. package/src/internal/core/runtime/terminal.mjs +0 -1
  95. package/src/internal/generated/aiDocs/.gitkeep.mjs +1 -0
  96. package/src/internal/generated/aiDocs/docs.mjs +0 -1
  97. package/src/internal/logger/index.mjs +3 -1
  98. package/src/internal/logger/logger.mjs +4 -14
  99. package/src/internal/version.mjs +1 -2
  100. package/src/project/errors.mjs +1 -2
  101. package/src/project/implementations/fileSystemProject.mjs +3 -18
  102. package/src/project/implementations/memoryProject.mjs +1 -5
  103. package/src/project/implementations/projectBase.mjs +10 -19
  104. package/src/project/index.mjs +3 -1
  105. package/src/project/project.mjs +2 -1
  106. package/src/rslib-runtime.mjs +62 -0
  107. package/src/runScript/index.mjs +3 -1
  108. package/src/runScript/output/index.mjs +3 -1
  109. package/src/runScript/output/multiProcessOutput.mjs +1 -2
  110. package/src/runScript/output/outputStream.mjs +1 -1
  111. package/src/runScript/output/processOutput.mjs +1 -2
  112. package/src/runScript/parallel.mjs +4 -10
  113. package/src/runScript/recursion.mjs +1 -2
  114. package/src/runScript/runScript.mjs +1 -4
  115. package/src/runScript/runScripts.mjs +1 -6
  116. package/src/runScript/scriptCommand.mjs +1 -2
  117. package/src/runScript/scriptExecution.mjs +1 -3
  118. package/src/runScript/scriptRuntimeMetadata.mjs +38 -56
  119. package/src/runScript/scriptShellOption.mjs +5 -14
  120. package/src/runScript/subprocesses.mjs +4 -4
  121. package/src/workspaces/dependencyGraph/cycles.mjs +0 -1
  122. package/src/workspaces/dependencyGraph/index.mjs +3 -1
  123. package/src/workspaces/dependencyGraph/resolveDependencies.mjs +1 -2
  124. package/src/workspaces/dependencyGraph/validateDependencyRules.mjs +1 -3
  125. package/src/workspaces/errors.mjs +1 -2
  126. package/src/workspaces/findWorkspaces.mjs +1 -11
  127. package/src/workspaces/index.mjs +3 -1
  128. package/src/workspaces/packageJson.mjs +2 -7
  129. package/src/workspaces/workspace.mjs +2 -1
  130. package/src/workspaces/workspacePattern.mjs +4 -4
  131. package/src/ai/mcp/bwMcpServer.d.ts +0 -4
  132. package/src/ai/mcp/core/index.d.ts +0 -3
  133. package/src/ai/mcp/core/server.d.ts +0 -14
  134. package/src/ai/mcp/core/transport.d.ts +0 -12
  135. package/src/ai/mcp/core/types.d.ts +0 -104
  136. package/src/ai/mcp/index.d.ts +0 -2
  137. package/src/ai/mcp/resources.d.ts +0 -6
  138. package/src/ai/mcp/tools.d.ts +0 -6
  139. package/src/cli/commands/commandHandlerUtils.d.ts +0 -51
  140. package/src/cli/commands/commands.d.ts +0 -10
  141. package/src/cli/commands/commandsConfig.d.ts +0 -436
  142. package/src/cli/commands/handleSimpleCommands.d.ts +0 -21
  143. package/src/cli/commands/index.d.ts +0 -4
  144. package/src/cli/commands/mcp.d.ts +0 -3
  145. package/src/cli/commands/runScript/handleRunScript.d.ts +0 -3
  146. package/src/cli/commands/runScript/index.d.ts +0 -2
  147. package/src/cli/commands/runScript/output/index.d.ts +0 -1
  148. package/src/cli/commands/runScript/output/outputStyle.d.ts +0 -9
  149. package/src/cli/commands/runScript/output/renderGroupedOutput.d.ts +0 -75
  150. package/src/cli/commands/runScript/output/renderPlainOutput.d.ts +0 -24
  151. package/src/cli/commands/runScript/output/sanitizeChunk.d.ts +0 -4
  152. package/src/cli/createCli.d.ts +0 -26
  153. package/src/cli/fatalErrorLogger.d.ts +0 -1
  154. package/src/cli/globalOptions/globalOptions.d.ts +0 -43
  155. package/src/cli/globalOptions/globalOptionsConfig.d.ts +0 -52
  156. package/src/cli/globalOptions/globalOptionsConfig.mjs +0 -43
  157. package/src/cli/globalOptions/index.d.ts +0 -2
  158. package/src/cli/middleware.d.ts +0 -83
  159. package/src/config/index.d.ts +0 -3
  160. package/src/config/rootConfig/defineRootConfig.d.ts +0 -4
  161. package/src/config/rootConfig/errors.d.ts +0 -1
  162. package/src/config/rootConfig/index.d.ts +0 -5
  163. package/src/config/rootConfig/loadRootConfig.d.ts +0 -3
  164. package/src/config/rootConfig/rootConfig.d.ts +0 -25
  165. package/src/config/rootConfig/rootConfigLocation.d.ts +0 -2
  166. package/src/config/rootConfig/rootConfigLocation.mjs +0 -5
  167. package/src/config/rootConfig/rootConfigSchema.d.ts +0 -21
  168. package/src/config/userEnvVars/index.d.ts +0 -1
  169. package/src/config/userEnvVars/userEnvVars.d.ts +0 -13
  170. package/src/config/util/ajvTypes.d.ts +0 -10
  171. package/src/config/util/configLocation.d.ts +0 -18
  172. package/src/config/util/index.d.ts +0 -4
  173. package/src/config/util/loadConfig.d.ts +0 -18
  174. package/src/config/util/validateConfig.d.ts +0 -8
  175. package/src/config/workspaceConfig/defineWorkspaceConfig.d.ts +0 -7
  176. package/src/config/workspaceConfig/errors.d.ts +0 -1
  177. package/src/config/workspaceConfig/index.d.ts +0 -5
  178. package/src/config/workspaceConfig/loadWorkspaceConfig.d.ts +0 -3
  179. package/src/config/workspaceConfig/workspaceConfig.d.ts +0 -56
  180. package/src/config/workspaceConfig/workspaceConfigLocation.d.ts +0 -2
  181. package/src/config/workspaceConfig/workspaceConfigLocation.mjs +0 -5
  182. package/src/config/workspaceConfig/workspaceConfigSchema.d.ts +0 -56
  183. package/src/doctor/doctor.d.ts +0 -35
  184. package/src/doctor/index.d.ts +0 -1
  185. package/src/internal/bun/bunLock.d.ts +0 -20
  186. package/src/internal/bun/bunVersion.d.ts +0 -21
  187. package/src/internal/bun/index.d.ts +0 -2
  188. package/src/internal/core/error/error.d.ts +0 -13
  189. package/src/internal/core/error/index.d.ts +0 -1
  190. package/src/internal/core/index.d.ts +0 -4
  191. package/src/internal/core/json/index.d.ts +0 -2
  192. package/src/internal/core/json/json.d.ts +0 -49
  193. package/src/internal/core/json/jsonc.d.ts +0 -9
  194. package/src/internal/core/language/array/index.d.ts +0 -1
  195. package/src/internal/core/language/array/optionalArray.d.ts +0 -15
  196. package/src/internal/core/language/asyncIterable/asyncIterableQueue.d.ts +0 -16
  197. package/src/internal/core/language/asyncIterable/index.d.ts +0 -2
  198. package/src/internal/core/language/asyncIterable/mergeAsyncIterables.d.ts +0 -5
  199. package/src/internal/core/language/events/typedEventTarget.d.ts +0 -50
  200. package/src/internal/core/language/index.d.ts +0 -5
  201. package/src/internal/core/language/regex/index.d.ts +0 -1
  202. package/src/internal/core/language/regex/regex.d.ts +0 -3
  203. package/src/internal/core/language/string/id.d.ts +0 -1
  204. package/src/internal/core/language/string/index.d.ts +0 -1
  205. package/src/internal/core/language/string/utf/eastAsianWidth.d.ts +0 -16
  206. package/src/internal/core/language/string/utf/visibleLength.d.ts +0 -5
  207. package/src/internal/core/language/types/index.d.ts +0 -2
  208. package/src/internal/core/language/types/typeof.d.ts +0 -102
  209. package/src/internal/core/language/types/types.d.ts +0 -19
  210. package/src/internal/core/runtime/env.d.ts +0 -6
  211. package/src/internal/core/runtime/index.d.ts +0 -5
  212. package/src/internal/core/runtime/onExit.d.ts +0 -4
  213. package/src/internal/core/runtime/os.d.ts +0 -6
  214. package/src/internal/core/runtime/tempFile.d.ts +0 -20
  215. package/src/internal/core/runtime/terminal.d.ts +0 -1
  216. package/src/internal/docs/apiQuickstart.d.ts +0 -3
  217. package/src/internal/docs/apiQuickstart.mjs +0 -132
  218. package/src/internal/docs/cliQuickstart.d.ts +0 -2
  219. package/src/internal/docs/cliQuickstart.mjs +0 -86
  220. package/src/internal/docs/index.d.ts +0 -2
  221. package/src/internal/docs/index.mjs +0 -2
  222. package/src/internal/generated/aiDocs/docs.d.ts +0 -10
  223. package/src/internal/logger/index.d.ts +0 -1
  224. package/src/internal/logger/logger.d.ts +0 -45
  225. package/src/internal/version.d.ts +0 -1
  226. package/src/project/errors.d.ts +0 -5
  227. package/src/project/implementations/fileSystemProject.d.ts +0 -148
  228. package/src/project/implementations/memoryProject.d.ts +0 -41
  229. package/src/project/implementations/projectBase.d.ts +0 -37
  230. package/src/project/index.d.ts +0 -5
  231. package/src/project/project.d.ts +0 -79
  232. package/src/runScript/index.d.ts +0 -7
  233. package/src/runScript/output/index.d.ts +0 -3
  234. package/src/runScript/output/multiProcessOutput.d.ts +0 -14
  235. package/src/runScript/output/outputStream.d.ts +0 -1
  236. package/src/runScript/output/processOutput.d.ts +0 -33
  237. package/src/runScript/parallel.d.ts +0 -24
  238. package/src/runScript/recursion.d.ts +0 -4
  239. package/src/runScript/runScript.d.ts +0 -45
  240. package/src/runScript/runScripts.d.ts +0 -65
  241. package/src/runScript/scriptCommand.d.ts +0 -33
  242. package/src/runScript/scriptExecution.d.ts +0 -9
  243. package/src/runScript/scriptRuntimeMetadata.d.ts +0 -73
  244. package/src/runScript/scriptShellOption.d.ts +0 -8
  245. package/src/runScript/subprocesses.d.ts +0 -11
  246. package/src/workspaces/dependencyGraph/cycles.d.ts +0 -9
  247. package/src/workspaces/dependencyGraph/index.d.ts +0 -3
  248. package/src/workspaces/dependencyGraph/resolveDependencies.d.ts +0 -18
  249. package/src/workspaces/dependencyGraph/validateDependencyRules.d.ts +0 -7
  250. package/src/workspaces/errors.d.ts +0 -14
  251. package/src/workspaces/findWorkspaces.d.ts +0 -24
  252. package/src/workspaces/index.d.ts +0 -4
  253. package/src/workspaces/packageJson.d.ts +0 -31
  254. package/src/workspaces/workspace.d.ts +0 -21
  255. package/src/workspaces/workspacePattern.d.ts +0 -22
@@ -1,56 +0,0 @@
1
- export declare const WORKSPACE_CONFIG_JSON_SCHEMA: {
2
- readonly type: "object";
3
- readonly additionalProperties: false;
4
- readonly properties: {
5
- readonly alias: {
6
- readonly type: readonly ["string", "array"];
7
- readonly items: {
8
- readonly type: "string";
9
- };
10
- readonly uniqueItems: true;
11
- };
12
- readonly tags: {
13
- readonly type: "array";
14
- readonly items: {
15
- readonly type: "string";
16
- };
17
- readonly uniqueItems: true;
18
- };
19
- readonly scripts: {
20
- readonly type: "object";
21
- readonly additionalProperties: {
22
- readonly type: "object";
23
- readonly properties: {
24
- readonly order: {
25
- readonly type: "number";
26
- };
27
- };
28
- readonly additionalProperties: false;
29
- };
30
- };
31
- readonly rules: {
32
- readonly type: "object";
33
- readonly additionalProperties: false;
34
- readonly properties: {
35
- readonly workspaceDependencies: {
36
- readonly type: "object";
37
- readonly properties: {
38
- readonly allowPatterns: {
39
- readonly type: "array";
40
- readonly items: {
41
- readonly type: "string";
42
- };
43
- };
44
- readonly denyPatterns: {
45
- readonly type: "array";
46
- readonly items: {
47
- readonly type: "string";
48
- };
49
- };
50
- };
51
- readonly additionalProperties: false;
52
- };
53
- };
54
- };
55
- };
56
- };
@@ -1,35 +0,0 @@
1
- import type { Simplify } from "../internal/core";
2
- declare const getBinaryInfo: () => {
3
- binary: {
4
- exec: string;
5
- path: string | null;
6
- };
7
- };
8
- declare const getShellInfo: () => {
9
- shell: {
10
- binary: string | null;
11
- terminal: string | null;
12
- };
13
- };
14
- declare const getSystemInfo: () => {
15
- os: {
16
- type: string;
17
- platform: NodeJS.Platform;
18
- arch: NodeJS.Architecture;
19
- release: string;
20
- version: string;
21
- cpuCount: number;
22
- };
23
- };
24
- declare const getVersionInfo: () => {
25
- version: string;
26
- bunVersion: string;
27
- };
28
- export type DoctorInfo = Simplify<
29
- ReturnType<typeof getVersionInfo> &
30
- ReturnType<typeof getBinaryInfo> &
31
- ReturnType<typeof getSystemInfo> &
32
- ReturnType<typeof getShellInfo>
33
- >;
34
- export declare const getDoctorInfo: () => DoctorInfo;
35
- export {};
@@ -1 +0,0 @@
1
- export * from "./doctor";
@@ -1,20 +0,0 @@
1
- import { type BunWorkspacesError } from "../core";
2
- export declare const BUN_LOCK_ERRORS: import("../core").DefinedErrors<
3
- "BunLockNotFound" | "MalformedBunLock" | "UnsupportedBunLockVersion"
4
- >;
5
- export type RelevantBunLockWorkspace = {
6
- name: string;
7
- };
8
- export type RelevantBunLock = {
9
- lockfileVersion: number;
10
- workspaces: Record<string, RelevantBunLockWorkspace>;
11
- };
12
- export declare const SUPPORTED_BUN_LOCK_VERSIONS: readonly [1];
13
- export declare const parseBunLock: (
14
- jsonString: string,
15
- /** Only for error message */
16
- bunLockPath?: string,
17
- ) => RelevantBunLock | BunWorkspacesError;
18
- export declare const readBunLockfile: (
19
- directory: string,
20
- ) => RelevantBunLock | BunWorkspacesError;
@@ -1,21 +0,0 @@
1
- export declare const LIBRARY_CONSUMER_BUN_VERSION: string;
2
- export declare const BUILD_BUN_VERSION: string;
3
- export declare const BUN_VERSION_ERRORS: import("../core").DefinedErrors<
4
- "InvalidBunVersion" | "NotBunRuntime"
5
- >;
6
- export declare const getRequiredBunVersion: (isBuild?: boolean) => string;
7
- /**
8
- * Validates that the provided version satisfies the required Bun version
9
- * specified in the root `package.json`.
10
- */
11
- export declare const validateBunVersion: (
12
- version: string,
13
- isBuild?: boolean,
14
- ) => import("../core").BunWorkspacesError | null;
15
- /**
16
- * Validates that the Bun version of the current script satisfies the
17
- * required Bun version specified in the root `package.json`.
18
- */
19
- export declare const validateCurrentBunVersion: (
20
- build?: boolean,
21
- ) => import("../core").BunWorkspacesError | null;
@@ -1,2 +0,0 @@
1
- export * from "./bunVersion";
2
- export * from "./bunLock";
@@ -1,13 +0,0 @@
1
- export declare class BunWorkspacesError extends Error {
2
- name: string;
3
- }
4
- export type DefinedErrors<ErrorName extends string> = {
5
- [name in ErrorName]: typeof BunWorkspacesError;
6
- };
7
- export declare function defineErrors<ErrorName extends string>(
8
- parentError: typeof BunWorkspacesError,
9
- ...errorNames: ErrorName[]
10
- ): DefinedErrors<ErrorName>;
11
- export declare function defineErrors<ErrorName extends string>(
12
- ...errorNames: ErrorName[]
13
- ): DefinedErrors<ErrorName>;
@@ -1 +0,0 @@
1
- export * from "./error";
@@ -1,4 +0,0 @@
1
- export * from "./language";
2
- export * from "./error";
3
- export * from "./json";
4
- export * from "./runtime";
@@ -1,2 +0,0 @@
1
- export * from "./json";
2
- export * from "./jsonc";
@@ -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;