bun-workspaces 1.0.1-alpha → 1.0.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 (238) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +189 -70
  3. package/bin/cli.js +1 -2
  4. package/package.json +27 -30
  5. package/src/cli/commands/commandHandlerUtils.d.ts +50 -0
  6. package/src/cli/commands/commandHandlerUtils.mjs +91 -0
  7. package/src/cli/commands/commands.d.ts +10 -0
  8. package/src/cli/commands/commands.mjs +23 -0
  9. package/src/cli/commands/commandsConfig.d.ts +351 -0
  10. package/src/cli/commands/commandsConfig.mjs +183 -0
  11. package/src/cli/commands/handleSimpleCommands.d.ts +15 -0
  12. package/src/cli/commands/handleSimpleCommands.mjs +174 -0
  13. package/src/cli/commands/index.d.ts +3 -0
  14. package/src/cli/commands/index.mjs +3 -0
  15. package/src/cli/commands/runScript/handleRunScript.d.ts +3 -0
  16. package/src/cli/commands/runScript/handleRunScript.mjs +250 -0
  17. package/src/cli/commands/runScript/index.d.ts +2 -0
  18. package/src/cli/commands/runScript/index.mjs +2 -0
  19. package/src/cli/commands/runScript/output/index.d.ts +1 -0
  20. package/src/cli/commands/runScript/output/index.mjs +1 -0
  21. package/src/cli/commands/runScript/output/outputStyle.d.ts +8 -0
  22. package/src/cli/commands/runScript/output/outputStyle.mjs +17 -0
  23. package/src/cli/commands/runScript/output/renderGroupedOutput.d.ts +74 -0
  24. package/src/cli/commands/runScript/output/renderGroupedOutput.mjs +331 -0
  25. package/src/cli/commands/runScript/output/renderPlainOutput.d.ts +24 -0
  26. package/src/cli/commands/runScript/output/renderPlainOutput.mjs +44 -0
  27. package/src/cli/commands/runScript/output/sanitizeChunk.d.ts +4 -0
  28. package/src/cli/commands/runScript/output/sanitizeChunk.mjs +101 -0
  29. package/src/cli/createCli.d.ts +25 -0
  30. package/src/cli/createCli.mjs +157 -0
  31. package/src/cli/fatalErrorLogger.d.ts +1 -0
  32. package/src/cli/fatalErrorLogger.mjs +7 -0
  33. package/src/cli/globalOptions/globalOptions.d.ts +42 -0
  34. package/src/cli/globalOptions/globalOptions.mjs +113 -0
  35. package/src/cli/globalOptions/globalOptionsConfig.d.ts +43 -0
  36. package/src/cli/globalOptions/globalOptionsConfig.mjs +34 -0
  37. package/src/cli/globalOptions/index.d.ts +2 -0
  38. package/src/cli/globalOptions/index.mjs +2 -0
  39. package/src/cli/index.d.ts +3 -0
  40. package/src/cli/index.mjs +3 -0
  41. package/src/cli/middleware.d.ts +83 -0
  42. package/src/cli/middleware.mjs +39 -0
  43. package/src/config/index.d.ts +3 -0
  44. package/src/config/index.mjs +3 -0
  45. package/src/config/rootConfig/errors.d.ts +1 -0
  46. package/src/config/rootConfig/errors.mjs +6 -0
  47. package/src/config/rootConfig/index.d.ts +5 -0
  48. package/src/config/rootConfig/index.mjs +5 -0
  49. package/src/config/rootConfig/loadRootConfig.d.ts +3 -0
  50. package/src/config/rootConfig/loadRootConfig.mjs +22 -0
  51. package/src/config/rootConfig/rootConfig.d.ts +17 -0
  52. package/src/config/rootConfig/rootConfig.mjs +43 -0
  53. package/src/config/rootConfig/rootConfigLocation.d.ts +2 -0
  54. package/src/config/rootConfig/rootConfigLocation.mjs +5 -0
  55. package/src/config/rootConfig/rootConfigSchema.d.ts +21 -0
  56. package/src/config/rootConfig/rootConfigSchema.mjs +24 -0
  57. package/src/config/userEnvVars/index.d.ts +1 -0
  58. package/src/config/userEnvVars/index.mjs +1 -0
  59. package/src/config/userEnvVars/userEnvVars.d.ts +13 -0
  60. package/src/config/userEnvVars/userEnvVars.mjs +10 -0
  61. package/src/config/util/ajvTypes.d.ts +10 -0
  62. package/src/config/util/ajvTypes.mjs +2 -0
  63. package/src/config/util/configLocation.d.ts +12 -0
  64. package/src/config/util/configLocation.mjs +11 -0
  65. package/src/config/util/index.d.ts +4 -0
  66. package/src/config/util/index.mjs +3 -0
  67. package/src/config/util/loadConfig.d.ts +16 -0
  68. package/src/config/util/loadConfig.mjs +118 -0
  69. package/src/config/util/validateConfig.d.ts +8 -0
  70. package/src/config/util/validateConfig.mjs +17 -0
  71. package/src/config/workspaceConfig/errors.d.ts +1 -0
  72. package/src/config/workspaceConfig/errors.mjs +6 -0
  73. package/src/config/workspaceConfig/index.d.ts +5 -0
  74. package/src/config/workspaceConfig/index.mjs +5 -0
  75. package/src/config/workspaceConfig/loadWorkspaceConfig.d.ts +3 -0
  76. package/src/config/workspaceConfig/loadWorkspaceConfig.mjs +25 -0
  77. package/src/config/workspaceConfig/workspaceConfig.d.ts +22 -0
  78. package/src/config/workspaceConfig/workspaceConfig.mjs +31 -0
  79. package/src/config/workspaceConfig/workspaceConfigLocation.d.ts +2 -0
  80. package/src/config/workspaceConfig/workspaceConfigLocation.mjs +5 -0
  81. package/src/config/workspaceConfig/workspaceConfigSchema.d.ts +25 -0
  82. package/src/config/workspaceConfig/workspaceConfigSchema.mjs +28 -0
  83. package/src/doctor/doctor.d.ts +35 -0
  84. package/src/doctor/doctor.mjs +52 -0
  85. package/src/doctor/index.d.ts +1 -0
  86. package/src/doctor/index.mjs +1 -0
  87. package/src/index.d.ts +37 -0
  88. package/src/index.mjs +16 -0
  89. package/src/internal/bun/bunLock.d.ts +20 -0
  90. package/src/internal/bun/bunLock.mjs +70 -0
  91. package/src/internal/bun/bunVersion.d.ts +21 -0
  92. package/src/internal/bun/bunVersion.mjs +43 -0
  93. package/src/internal/bun/index.d.ts +2 -0
  94. package/src/internal/bun/index.mjs +2 -0
  95. package/src/internal/core/error/error.d.ts +13 -0
  96. package/src/internal/{error.ts → core/error/error.mjs} +16 -18
  97. package/src/internal/core/error/index.d.ts +1 -0
  98. package/src/internal/core/error/index.mjs +1 -0
  99. package/src/internal/core/index.d.ts +4 -0
  100. package/src/internal/core/index.mjs +4 -0
  101. package/src/internal/core/json/index.d.ts +2 -0
  102. package/src/internal/core/json/index.mjs +2 -0
  103. package/src/internal/core/json/json.d.ts +49 -0
  104. package/src/internal/core/json/json.mjs +12 -0
  105. package/src/internal/core/json/jsonc.d.ts +9 -0
  106. package/src/internal/core/json/jsonc.mjs +117 -0
  107. package/src/internal/core/language/array/index.d.ts +1 -0
  108. package/src/internal/core/language/array/index.mjs +1 -0
  109. package/src/internal/core/language/array/optionalArray.d.ts +15 -0
  110. package/src/internal/core/language/array/optionalArray.mjs +8 -0
  111. package/src/internal/core/language/asyncIterable/asyncIterableQueue.d.ts +16 -0
  112. package/src/internal/core/language/asyncIterable/asyncIterableQueue.mjs +81 -0
  113. package/src/internal/core/language/asyncIterable/index.d.ts +2 -0
  114. package/src/internal/core/language/asyncIterable/index.mjs +2 -0
  115. package/src/internal/core/language/asyncIterable/mergeAsyncIterables.d.ts +5 -0
  116. package/src/internal/core/language/asyncIterable/mergeAsyncIterables.mjs +27 -0
  117. package/src/internal/core/language/events/typedEventTarget.d.ts +50 -0
  118. package/src/internal/core/language/events/typedEventTarget.mjs +14 -0
  119. package/src/internal/core/language/index.d.ts +5 -0
  120. package/src/internal/core/language/index.mjs +5 -0
  121. package/src/internal/core/language/regex/index.d.ts +1 -0
  122. package/src/internal/core/language/regex/index.mjs +1 -0
  123. package/src/internal/core/language/regex/regex.d.ts +3 -0
  124. package/src/internal/core/language/regex/regex.mjs +10 -0
  125. package/src/internal/core/language/string/id.d.ts +1 -0
  126. package/src/internal/core/language/string/id.mjs +10 -0
  127. package/src/internal/core/language/string/index.d.ts +1 -0
  128. package/src/internal/core/language/string/index.mjs +1 -0
  129. package/src/internal/core/language/string/utf/eastAsianWidth.d.ts +16 -0
  130. package/src/internal/core/language/string/utf/eastAsianWidth.mjs +326 -0
  131. package/src/internal/core/language/string/utf/visibleLength.d.ts +5 -0
  132. package/src/internal/core/language/string/utf/visibleLength.mjs +29 -0
  133. package/src/internal/core/language/types/index.d.ts +2 -0
  134. package/src/internal/core/language/types/index.mjs +1 -0
  135. package/src/internal/core/language/types/typeof.d.ts +102 -0
  136. package/src/internal/core/language/types/typeof.mjs +123 -0
  137. package/src/internal/core/language/types/types.d.ts +14 -0
  138. package/src/internal/core/language/types/types.mjs +2 -0
  139. package/src/internal/core/runtime/env.d.ts +6 -0
  140. package/src/internal/core/runtime/env.mjs +36 -0
  141. package/src/internal/core/runtime/index.d.ts +5 -0
  142. package/src/internal/core/runtime/index.mjs +5 -0
  143. package/src/internal/core/runtime/onExit.d.ts +4 -0
  144. package/src/internal/core/runtime/onExit.mjs +54 -0
  145. package/src/internal/core/runtime/os.d.ts +4 -0
  146. package/src/internal/core/runtime/os.mjs +7 -0
  147. package/src/internal/core/runtime/tempFile.d.ts +20 -0
  148. package/src/internal/core/runtime/tempFile.mjs +87 -0
  149. package/src/internal/core/runtime/terminal.d.ts +1 -0
  150. package/src/internal/core/runtime/terminal.mjs +4 -0
  151. package/src/internal/generated/ajv/validateRootConfig.mjs +1 -0
  152. package/src/internal/generated/ajv/validateWorkspaceConfig.mjs +1 -0
  153. package/src/internal/logger/index.d.ts +1 -0
  154. package/src/internal/logger/index.mjs +1 -0
  155. package/src/internal/logger/logger.d.ts +45 -0
  156. package/src/internal/logger/logger.mjs +133 -0
  157. package/src/internal/version.d.ts +1 -0
  158. package/src/internal/version.mjs +6 -0
  159. package/src/project/errors.d.ts +5 -0
  160. package/src/project/errors.mjs +10 -0
  161. package/src/project/implementations/fileSystemProject.d.ts +148 -0
  162. package/src/project/implementations/fileSystemProject.mjs +455 -0
  163. package/src/project/implementations/memoryProject.d.ts +41 -0
  164. package/src/project/implementations/memoryProject.mjs +148 -0
  165. package/src/project/implementations/projectBase.d.ts +35 -0
  166. package/src/project/implementations/projectBase.mjs +197 -0
  167. package/src/project/index.d.ts +5 -0
  168. package/src/project/index.mjs +4 -0
  169. package/src/project/project.d.ts +75 -0
  170. package/src/project/project.mjs +6 -0
  171. package/src/runScript/index.d.ts +7 -0
  172. package/src/runScript/index.mjs +7 -0
  173. package/src/runScript/output/index.d.ts +3 -0
  174. package/src/runScript/output/index.mjs +2 -0
  175. package/src/runScript/output/multiProcessOutput.d.ts +14 -0
  176. package/src/runScript/output/multiProcessOutput.mjs +21 -0
  177. package/src/runScript/output/outputStream.d.ts +1 -0
  178. package/src/runScript/output/outputStream.mjs +1 -0
  179. package/src/runScript/output/processOutput.d.ts +33 -0
  180. package/src/runScript/output/processOutput.mjs +124 -0
  181. package/src/runScript/parallel.d.ts +15 -0
  182. package/src/runScript/parallel.mjs +56 -0
  183. package/src/runScript/recursion.d.ts +4 -0
  184. package/src/runScript/recursion.mjs +17 -0
  185. package/src/runScript/runScript.d.ts +45 -0
  186. package/src/runScript/runScript.mjs +89 -0
  187. package/src/runScript/runScripts.d.ts +65 -0
  188. package/src/runScript/runScripts.mjs +263 -0
  189. package/src/runScript/scriptCommand.d.ts +33 -0
  190. package/src/runScript/scriptCommand.mjs +19 -0
  191. package/src/runScript/scriptExecution.d.ts +9 -0
  192. package/src/runScript/scriptExecution.mjs +50 -0
  193. package/src/runScript/scriptRuntimeMetadata.d.ts +73 -0
  194. package/src/runScript/scriptRuntimeMetadata.mjs +61 -0
  195. package/src/runScript/scriptShellOption.d.ts +8 -0
  196. package/src/runScript/scriptShellOption.mjs +39 -0
  197. package/src/runScript/subprocesses.d.ts +11 -0
  198. package/src/runScript/subprocesses.mjs +34 -0
  199. package/src/workspaces/dependencyGraph/cycles.d.ts +9 -0
  200. package/src/workspaces/dependencyGraph/cycles.mjs +91 -0
  201. package/src/workspaces/dependencyGraph/index.d.ts +2 -0
  202. package/src/workspaces/dependencyGraph/index.mjs +2 -0
  203. package/src/workspaces/dependencyGraph/resolveDependencies.d.ts +18 -0
  204. package/src/workspaces/dependencyGraph/resolveDependencies.mjs +52 -0
  205. package/src/workspaces/errors.d.ts +13 -0
  206. package/src/workspaces/errors.mjs +18 -0
  207. package/src/workspaces/findWorkspaces.d.ts +24 -0
  208. package/src/workspaces/findWorkspaces.mjs +217 -0
  209. package/src/workspaces/index.d.ts +4 -0
  210. package/src/workspaces/index.mjs +3 -0
  211. package/src/workspaces/packageJson.d.ts +31 -0
  212. package/src/workspaces/packageJson.mjs +188 -0
  213. package/src/workspaces/{workspace.ts → workspace.d.ts} +11 -6
  214. package/src/workspaces/workspace.mjs +2 -0
  215. package/src/workspaces/workspacePattern.d.ts +21 -0
  216. package/src/workspaces/workspacePattern.mjs +104 -0
  217. package/bun.lock +0 -576
  218. package/src/cli/cli.ts +0 -87
  219. package/src/cli/globalOptions.ts +0 -122
  220. package/src/cli/index.ts +0 -1
  221. package/src/cli/projectCommands.ts +0 -396
  222. package/src/config/bunWorkspacesConfig.ts +0 -62
  223. package/src/config/configFile.ts +0 -33
  224. package/src/config/index.ts +0 -7
  225. package/src/index.ts +0 -3
  226. package/src/internal/bunVersion.ts +0 -26
  227. package/src/internal/env.ts +0 -25
  228. package/src/internal/logger.ts +0 -145
  229. package/src/internal/regex.ts +0 -5
  230. package/src/project/errors.ts +0 -6
  231. package/src/project/index.ts +0 -6
  232. package/src/project/project.ts +0 -155
  233. package/src/project/scriptCommand.ts +0 -40
  234. package/src/workspaces/errors.ts +0 -14
  235. package/src/workspaces/findWorkspaces.ts +0 -137
  236. package/src/workspaces/index.ts +0 -7
  237. package/src/workspaces/packageJson.ts +0 -166
  238. package/tsconfig.json +0 -28
@@ -0,0 +1,326 @@
1
+ // CONCATENATED MODULE: ./src/internal/core/language/string/utf/eastAsianWidth.ts
2
+ /** A port of the package eastasianwidth */ const eaw = {
3
+ /**
4
+ * F: Full width
5
+ * H: Half width
6
+ * W: Wide
7
+ * Na: Narrow
8
+ * A: Ambiguous
9
+ * N: Neutral
10
+ */ eastAsianWidth: (character) => {
11
+ let x = character.charCodeAt(0);
12
+ let y = character.length === 2 ? character.charCodeAt(1) : 0;
13
+ let codePoint = x;
14
+ if (0xd800 <= x && x <= 0xdbff && 0xdc00 <= y && y <= 0xdfff) {
15
+ x &= 0x3ff;
16
+ y &= 0x3ff;
17
+ codePoint = (x << 10) | y;
18
+ codePoint += 0x10000;
19
+ }
20
+ if (
21
+ 0x3000 === codePoint ||
22
+ (0xff01 <= codePoint && codePoint <= 0xff60) ||
23
+ (0xffe0 <= codePoint && codePoint <= 0xffe6)
24
+ ) {
25
+ return "F";
26
+ }
27
+ if (
28
+ 0x20a9 === codePoint ||
29
+ (0xff61 <= codePoint && codePoint <= 0xffbe) ||
30
+ (0xffc2 <= codePoint && codePoint <= 0xffc7) ||
31
+ (0xffca <= codePoint && codePoint <= 0xffcf) ||
32
+ (0xffd2 <= codePoint && codePoint <= 0xffd7) ||
33
+ (0xffda <= codePoint && codePoint <= 0xffdc) ||
34
+ (0xffe8 <= codePoint && codePoint <= 0xffee)
35
+ ) {
36
+ return "H";
37
+ }
38
+ if (
39
+ (0x1100 <= codePoint && codePoint <= 0x115f) ||
40
+ (0x11a3 <= codePoint && codePoint <= 0x11a7) ||
41
+ (0x11fa <= codePoint && codePoint <= 0x11ff) ||
42
+ (0x2329 <= codePoint && codePoint <= 0x232a) ||
43
+ (0x2e80 <= codePoint && codePoint <= 0x2e99) ||
44
+ (0x2e9b <= codePoint && codePoint <= 0x2ef3) ||
45
+ (0x2f00 <= codePoint && codePoint <= 0x2fd5) ||
46
+ (0x2ff0 <= codePoint && codePoint <= 0x2ffb) ||
47
+ (0x3001 <= codePoint && codePoint <= 0x303e) ||
48
+ (0x3041 <= codePoint && codePoint <= 0x3096) ||
49
+ (0x3099 <= codePoint && codePoint <= 0x30ff) ||
50
+ (0x3105 <= codePoint && codePoint <= 0x312d) ||
51
+ (0x3131 <= codePoint && codePoint <= 0x318e) ||
52
+ (0x3190 <= codePoint && codePoint <= 0x31ba) ||
53
+ (0x31c0 <= codePoint && codePoint <= 0x31e3) ||
54
+ (0x31f0 <= codePoint && codePoint <= 0x321e) ||
55
+ (0x3220 <= codePoint && codePoint <= 0x3247) ||
56
+ (0x3250 <= codePoint && codePoint <= 0x32fe) ||
57
+ (0x3300 <= codePoint && codePoint <= 0x4dbf) ||
58
+ (0x4e00 <= codePoint && codePoint <= 0xa48c) ||
59
+ (0xa490 <= codePoint && codePoint <= 0xa4c6) ||
60
+ (0xa960 <= codePoint && codePoint <= 0xa97c) ||
61
+ (0xac00 <= codePoint && codePoint <= 0xd7a3) ||
62
+ (0xd7b0 <= codePoint && codePoint <= 0xd7c6) ||
63
+ (0xd7cb <= codePoint && codePoint <= 0xd7fb) ||
64
+ (0xf900 <= codePoint && codePoint <= 0xfaff) ||
65
+ (0xfe10 <= codePoint && codePoint <= 0xfe19) ||
66
+ (0xfe30 <= codePoint && codePoint <= 0xfe52) ||
67
+ (0xfe54 <= codePoint && codePoint <= 0xfe66) ||
68
+ (0xfe68 <= codePoint && codePoint <= 0xfe6b) ||
69
+ (0x1b000 <= codePoint && codePoint <= 0x1b001) ||
70
+ (0x1f200 <= codePoint && codePoint <= 0x1f202) ||
71
+ (0x1f210 <= codePoint && codePoint <= 0x1f23a) ||
72
+ (0x1f240 <= codePoint && codePoint <= 0x1f248) ||
73
+ (0x1f250 <= codePoint && codePoint <= 0x1f251) ||
74
+ (0x20000 <= codePoint && codePoint <= 0x2f73f) ||
75
+ (0x2b740 <= codePoint && codePoint <= 0x2fffd) ||
76
+ (0x30000 <= codePoint && codePoint <= 0x3fffd)
77
+ ) {
78
+ return "W";
79
+ }
80
+ if (
81
+ (0x0020 <= codePoint && codePoint <= 0x007e) ||
82
+ (0x00a2 <= codePoint && codePoint <= 0x00a3) ||
83
+ (0x00a5 <= codePoint && codePoint <= 0x00a6) ||
84
+ 0x00ac === codePoint ||
85
+ 0x00af === codePoint ||
86
+ (0x27e6 <= codePoint && codePoint <= 0x27ed) ||
87
+ (0x2985 <= codePoint && codePoint <= 0x2986)
88
+ ) {
89
+ return "Na";
90
+ }
91
+ if (
92
+ 0x00a1 === codePoint ||
93
+ 0x00a4 === codePoint ||
94
+ (0x00a7 <= codePoint && codePoint <= 0x00a8) ||
95
+ 0x00aa === codePoint ||
96
+ (0x00ad <= codePoint && codePoint <= 0x00ae) ||
97
+ (0x00b0 <= codePoint && codePoint <= 0x00b4) ||
98
+ (0x00b6 <= codePoint && codePoint <= 0x00ba) ||
99
+ (0x00bc <= codePoint && codePoint <= 0x00bf) ||
100
+ 0x00c6 === codePoint ||
101
+ 0x00d0 === codePoint ||
102
+ (0x00d7 <= codePoint && codePoint <= 0x00d8) ||
103
+ (0x00de <= codePoint && codePoint <= 0x00e1) ||
104
+ 0x00e6 === codePoint ||
105
+ (0x00e8 <= codePoint && codePoint <= 0x00ea) ||
106
+ (0x00ec <= codePoint && codePoint <= 0x00ed) ||
107
+ 0x00f0 === codePoint ||
108
+ (0x00f2 <= codePoint && codePoint <= 0x00f3) ||
109
+ (0x00f7 <= codePoint && codePoint <= 0x00fa) ||
110
+ 0x00fc === codePoint ||
111
+ 0x00fe === codePoint ||
112
+ 0x0101 === codePoint ||
113
+ 0x0111 === codePoint ||
114
+ 0x0113 === codePoint ||
115
+ 0x011b === codePoint ||
116
+ (0x0126 <= codePoint && codePoint <= 0x0127) ||
117
+ 0x012b === codePoint ||
118
+ (0x0131 <= codePoint && codePoint <= 0x0133) ||
119
+ 0x0138 === codePoint ||
120
+ (0x013f <= codePoint && codePoint <= 0x0142) ||
121
+ 0x0144 === codePoint ||
122
+ (0x0148 <= codePoint && codePoint <= 0x014b) ||
123
+ 0x014d === codePoint ||
124
+ (0x0152 <= codePoint && codePoint <= 0x0153) ||
125
+ (0x0166 <= codePoint && codePoint <= 0x0167) ||
126
+ 0x016b === codePoint ||
127
+ 0x01ce === codePoint ||
128
+ 0x01d0 === codePoint ||
129
+ 0x01d2 === codePoint ||
130
+ 0x01d4 === codePoint ||
131
+ 0x01d6 === codePoint ||
132
+ 0x01d8 === codePoint ||
133
+ 0x01da === codePoint ||
134
+ 0x01dc === codePoint ||
135
+ 0x0251 === codePoint ||
136
+ 0x0261 === codePoint ||
137
+ 0x02c4 === codePoint ||
138
+ 0x02c7 === codePoint ||
139
+ (0x02c9 <= codePoint && codePoint <= 0x02cb) ||
140
+ 0x02cd === codePoint ||
141
+ 0x02d0 === codePoint ||
142
+ (0x02d8 <= codePoint && codePoint <= 0x02db) ||
143
+ 0x02dd === codePoint ||
144
+ 0x02df === codePoint ||
145
+ (0x0300 <= codePoint && codePoint <= 0x036f) ||
146
+ (0x0391 <= codePoint && codePoint <= 0x03a1) ||
147
+ (0x03a3 <= codePoint && codePoint <= 0x03a9) ||
148
+ (0x03b1 <= codePoint && codePoint <= 0x03c1) ||
149
+ (0x03c3 <= codePoint && codePoint <= 0x03c9) ||
150
+ 0x0401 === codePoint ||
151
+ (0x0410 <= codePoint && codePoint <= 0x044f) ||
152
+ 0x0451 === codePoint ||
153
+ 0x2010 === codePoint ||
154
+ (0x2013 <= codePoint && codePoint <= 0x2016) ||
155
+ (0x2018 <= codePoint && codePoint <= 0x2019) ||
156
+ (0x201c <= codePoint && codePoint <= 0x201d) ||
157
+ (0x2020 <= codePoint && codePoint <= 0x2022) ||
158
+ (0x2024 <= codePoint && codePoint <= 0x2027) ||
159
+ 0x2030 === codePoint ||
160
+ (0x2032 <= codePoint && codePoint <= 0x2033) ||
161
+ 0x2035 === codePoint ||
162
+ 0x203b === codePoint ||
163
+ 0x203e === codePoint ||
164
+ 0x2074 === codePoint ||
165
+ 0x207f === codePoint ||
166
+ (0x2081 <= codePoint && codePoint <= 0x2084) ||
167
+ 0x20ac === codePoint ||
168
+ 0x2103 === codePoint ||
169
+ 0x2105 === codePoint ||
170
+ 0x2109 === codePoint ||
171
+ 0x2113 === codePoint ||
172
+ 0x2116 === codePoint ||
173
+ (0x2121 <= codePoint && codePoint <= 0x2122) ||
174
+ 0x2126 === codePoint ||
175
+ 0x212b === codePoint ||
176
+ (0x2153 <= codePoint && codePoint <= 0x2154) ||
177
+ (0x215b <= codePoint && codePoint <= 0x215e) ||
178
+ (0x2160 <= codePoint && codePoint <= 0x216b) ||
179
+ (0x2170 <= codePoint && codePoint <= 0x2179) ||
180
+ 0x2189 === codePoint ||
181
+ (0x2190 <= codePoint && codePoint <= 0x2199) ||
182
+ (0x21b8 <= codePoint && codePoint <= 0x21b9) ||
183
+ 0x21d2 === codePoint ||
184
+ 0x21d4 === codePoint ||
185
+ 0x21e7 === codePoint ||
186
+ 0x2200 === codePoint ||
187
+ (0x2202 <= codePoint && codePoint <= 0x2203) ||
188
+ (0x2207 <= codePoint && codePoint <= 0x2208) ||
189
+ 0x220b === codePoint ||
190
+ 0x220f === codePoint ||
191
+ 0x2211 === codePoint ||
192
+ 0x2215 === codePoint ||
193
+ 0x221a === codePoint ||
194
+ (0x221d <= codePoint && codePoint <= 0x2220) ||
195
+ 0x2223 === codePoint ||
196
+ 0x2225 === codePoint ||
197
+ (0x2227 <= codePoint && codePoint <= 0x222c) ||
198
+ 0x222e === codePoint ||
199
+ (0x2234 <= codePoint && codePoint <= 0x2237) ||
200
+ (0x223c <= codePoint && codePoint <= 0x223d) ||
201
+ 0x2248 === codePoint ||
202
+ 0x224c === codePoint ||
203
+ 0x2252 === codePoint ||
204
+ (0x2260 <= codePoint && codePoint <= 0x2261) ||
205
+ (0x2264 <= codePoint && codePoint <= 0x2267) ||
206
+ (0x226a <= codePoint && codePoint <= 0x226b) ||
207
+ (0x226e <= codePoint && codePoint <= 0x226f) ||
208
+ (0x2282 <= codePoint && codePoint <= 0x2283) ||
209
+ (0x2286 <= codePoint && codePoint <= 0x2287) ||
210
+ 0x2295 === codePoint ||
211
+ 0x2299 === codePoint ||
212
+ 0x22a5 === codePoint ||
213
+ 0x22bf === codePoint ||
214
+ 0x2312 === codePoint ||
215
+ (0x2460 <= codePoint && codePoint <= 0x24e9) ||
216
+ (0x24eb <= codePoint && codePoint <= 0x254b) ||
217
+ (0x2550 <= codePoint && codePoint <= 0x2573) ||
218
+ (0x2580 <= codePoint && codePoint <= 0x258f) ||
219
+ (0x2592 <= codePoint && codePoint <= 0x2595) ||
220
+ (0x25a0 <= codePoint && codePoint <= 0x25a1) ||
221
+ (0x25a3 <= codePoint && codePoint <= 0x25a9) ||
222
+ (0x25b2 <= codePoint && codePoint <= 0x25b3) ||
223
+ (0x25b6 <= codePoint && codePoint <= 0x25b7) ||
224
+ (0x25bc <= codePoint && codePoint <= 0x25bd) ||
225
+ (0x25c0 <= codePoint && codePoint <= 0x25c1) ||
226
+ (0x25c6 <= codePoint && codePoint <= 0x25c8) ||
227
+ 0x25cb === codePoint ||
228
+ (0x25ce <= codePoint && codePoint <= 0x25d1) ||
229
+ (0x25e2 <= codePoint && codePoint <= 0x25e5) ||
230
+ 0x25ef === codePoint ||
231
+ (0x2605 <= codePoint && codePoint <= 0x2606) ||
232
+ 0x2609 === codePoint ||
233
+ (0x260e <= codePoint && codePoint <= 0x260f) ||
234
+ (0x2614 <= codePoint && codePoint <= 0x2615) ||
235
+ 0x261c === codePoint ||
236
+ 0x261e === codePoint ||
237
+ 0x2640 === codePoint ||
238
+ 0x2642 === codePoint ||
239
+ (0x2660 <= codePoint && codePoint <= 0x2661) ||
240
+ (0x2663 <= codePoint && codePoint <= 0x2665) ||
241
+ (0x2667 <= codePoint && codePoint <= 0x266a) ||
242
+ (0x266c <= codePoint && codePoint <= 0x266d) ||
243
+ 0x266f === codePoint ||
244
+ (0x269e <= codePoint && codePoint <= 0x269f) ||
245
+ (0x26be <= codePoint && codePoint <= 0x26bf) ||
246
+ (0x26c4 <= codePoint && codePoint <= 0x26cd) ||
247
+ (0x26cf <= codePoint && codePoint <= 0x26e1) ||
248
+ 0x26e3 === codePoint ||
249
+ (0x26e8 <= codePoint && codePoint <= 0x26ff) ||
250
+ 0x273d === codePoint ||
251
+ 0x2757 === codePoint ||
252
+ (0x2776 <= codePoint && codePoint <= 0x277f) ||
253
+ (0x2b55 <= codePoint && codePoint <= 0x2b59) ||
254
+ (0x3248 <= codePoint && codePoint <= 0x324f) ||
255
+ (0xe000 <= codePoint && codePoint <= 0xf8ff) ||
256
+ (0xfe00 <= codePoint && codePoint <= 0xfe0f) ||
257
+ 0xfffd === codePoint ||
258
+ (0x1f100 <= codePoint && codePoint <= 0x1f10a) ||
259
+ (0x1f110 <= codePoint && codePoint <= 0x1f12d) ||
260
+ (0x1f130 <= codePoint && codePoint <= 0x1f169) ||
261
+ (0x1f170 <= codePoint && codePoint <= 0x1f19a) ||
262
+ (0xe0100 <= codePoint && codePoint <= 0xe01ef) ||
263
+ (0xf0000 <= codePoint && codePoint <= 0xffffd) ||
264
+ (0x100000 <= codePoint && codePoint <= 0x10fffd)
265
+ ) {
266
+ return "A";
267
+ }
268
+ // 🚨 Not in original eastasianwidth package: fallback to detect emojis not accounted for
269
+ if (/\p{Emoji_Presentation}/u.test(character)) {
270
+ return "W";
271
+ }
272
+ return "N";
273
+ },
274
+ characterLength: (character) => {
275
+ const code = eaw.eastAsianWidth(character);
276
+ if (code === "F" || code === "W") {
277
+ // 🚨 Changed from original eastasianwidth package to not treat A as 2,
278
+ // thanks to Western terminal locales generally rendering chars like this as width 1
279
+ // and developers generally using Western locales for ecosystems like Bun etc.
280
+ return 2;
281
+ } else {
282
+ return 1;
283
+ }
284
+ },
285
+ // Split a string considering surrogate-pairs.
286
+ stringToArray: (s) => {
287
+ return s.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
288
+ },
289
+ length: (string) => {
290
+ const characters = eaw.stringToArray(string);
291
+ let len = 0;
292
+ for (let i = 0; i < characters.length; i++) {
293
+ len = len + eaw.characterLength(characters[i]);
294
+ }
295
+ return len;
296
+ },
297
+ slice: (text, start, end) => {
298
+ const textLen = eaw.length(text);
299
+ start = start === undefined || start === null ? 0 : start;
300
+ end = end === undefined || start === null ? 1 : end;
301
+ if (start < 0) {
302
+ start = textLen + start;
303
+ }
304
+ if (end < 0) {
305
+ end = textLen + end;
306
+ }
307
+ let result = "";
308
+ let eawLen = 0;
309
+ const chars = eaw.stringToArray(text);
310
+ for (let i = 0; i < chars.length; i++) {
311
+ const char = chars[i];
312
+ const charLen = eaw.length(char);
313
+ if (eawLen >= start - (charLen === 2 ? 1 : 0)) {
314
+ if (eawLen + charLen <= end) {
315
+ result += char;
316
+ } else {
317
+ break;
318
+ }
319
+ }
320
+ eawLen += charLen;
321
+ }
322
+ return result;
323
+ },
324
+ };
325
+
326
+ export { eaw };
@@ -0,0 +1,5 @@
1
+ export declare const calculateVisibleLength: (str: string) => number;
2
+ export declare const truncateTerminalString: (
3
+ str: string,
4
+ maxVisible: number,
5
+ ) => string;
@@ -0,0 +1,29 @@
1
+ import { eaw } from "./eastAsianWidth.mjs"; // CONCATENATED MODULE: external "./eastAsianWidth.mjs"
2
+ // CONCATENATED MODULE: ./src/internal/core/language/string/utf/visibleLength.ts
3
+
4
+ const getVisibleSliceIndex = (str, maxVisible) => {
5
+ let i = 0;
6
+ let visibleCount = 0;
7
+ while (i < str.length && visibleCount < maxVisible) {
8
+ if (str[i] === "\x1b" && str[i + 1] === "[") {
9
+ i += 2;
10
+ while (i < str.length && /[0-9;?]/.test(str[i])) i++;
11
+ if (i < str.length) i++;
12
+ } else {
13
+ const codePoint = str.codePointAt(i);
14
+ const char = String.fromCodePoint(codePoint);
15
+ const charWidth = eaw.characterLength(char);
16
+ if (visibleCount + charWidth > maxVisible) break;
17
+ visibleCount += charWidth;
18
+ i += char.length;
19
+ }
20
+ }
21
+ return i;
22
+ };
23
+ const calculateVisibleLength = (str) => {
24
+ return eaw.length(Bun.stripANSI(str));
25
+ };
26
+ const truncateTerminalString = (str, maxVisible) =>
27
+ str.slice(0, getVisibleSliceIndex(str, maxVisible));
28
+
29
+ export { calculateVisibleLength, truncateTerminalString };
@@ -0,0 +1,2 @@
1
+ export * from "./typeof";
2
+ export type * from "./types";
@@ -0,0 +1 @@
1
+ export * from "./typeof.mjs"; // CONCATENATED MODULE: ./src/internal/core/language/types/index.ts
@@ -0,0 +1,102 @@
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 {};
@@ -0,0 +1,123 @@
1
+ import { defineErrors } from "../../error/index.mjs";
2
+ import { resolveOptionalArray } from "../array/optionalArray.mjs"; // CONCATENATED MODULE: external "../../error/index.mjs"
3
+ // CONCATENATED MODULE: external "../array/optionalArray.mjs"
4
+ // CONCATENATED MODULE: ./src/internal/core/language/types/typeof.ts
5
+
6
+ const InvalidJSTypeError = defineErrors("InvalidJSType").InvalidJSType;
7
+ const InvalidJSNumberError = defineErrors("InvalidJSNumber").InvalidJSNumber;
8
+ const VALIDATE_NUMBER_ERRORS = defineErrors(
9
+ InvalidJSNumberError,
10
+ "NoNaN",
11
+ "NoNonFinite",
12
+ "NoInfinity",
13
+ "NoNegInfinity",
14
+ );
15
+ const VALIDATE_TYPEOF_ERRORS = defineErrors(
16
+ InvalidJSTypeError,
17
+ "NoNull",
18
+ "InvalidType",
19
+ );
20
+ const isTypeof = (value, ...types) => types.includes(typeof value);
21
+ const isPlainObject = (value) =>
22
+ typeof value === "object" && value !== null && !Array.isArray(value);
23
+ const validateNumber = (value, rules, valueLabel = "Number") => {
24
+ if (Number.isNaN(value) && rules?.noNaN) {
25
+ return new InvalidJSNumberError(
26
+ `Invalid number: ${valueLabel} cannot be NaN`,
27
+ );
28
+ } else if (!Number.isFinite(value) && rules?.noNonFinite) {
29
+ return new InvalidJSNumberError(
30
+ `Invalid number: ${valueLabel} cannot be non-finite`,
31
+ );
32
+ } else if (value === Infinity && rules?.noInfinity) {
33
+ return new InvalidJSNumberError(
34
+ `Invalid number: ${valueLabel} cannot be Infinity`,
35
+ );
36
+ } else if (value === -Infinity && rules?.noNegInfinity) {
37
+ return new InvalidJSNumberError(
38
+ `Invalid number: ${valueLabel} cannot be -Infinity`,
39
+ );
40
+ }
41
+ return null;
42
+ };
43
+ const validateJSType = ({
44
+ value,
45
+ typeofName,
46
+ numberRules,
47
+ valueLabel,
48
+ optional,
49
+ }) => {
50
+ if (optional && (value === null || value === undefined)) return null;
51
+ const typeofNames = resolveOptionalArray(typeofName);
52
+ const isValid = isTypeof(value, ...typeofNames);
53
+ if (isValid && typeof value === "number" && numberRules) {
54
+ return validateNumber(value, numberRules, valueLabel);
55
+ } else if (isValid && typeof value === "object" && value === null) {
56
+ return new InvalidJSTypeError(
57
+ `Type error: ${valueLabel ?? "Value"} cannot be null`,
58
+ );
59
+ } else if (!isValid) {
60
+ return new InvalidJSTypeError(
61
+ `Type error: ${valueLabel ?? "Value"} expects type ${typeofNames.join(" | ")}, received ${value === null ? "null" : typeof value}`,
62
+ );
63
+ }
64
+ return null;
65
+ };
66
+ const validateJSArray = ({ value, valueLabel, optional, itemOptions }) => {
67
+ if (optional && (value === null || value === undefined)) return null;
68
+ if (!Array.isArray(value)) {
69
+ return new InvalidJSTypeError(
70
+ `Type error: ${valueLabel ?? "Value"} expects an array, received ${value === null ? "null" : typeof value}`,
71
+ );
72
+ }
73
+ if (itemOptions) {
74
+ for (let i = 0; i < value.length; i++) {
75
+ const itemError = validateJSType({
76
+ ...itemOptions,
77
+ value: value[i],
78
+ valueLabel: `${valueLabel ?? "Value"}[${i}]`,
79
+ });
80
+ if (itemError) return itemError;
81
+ }
82
+ }
83
+ return null;
84
+ };
85
+ const validateJSTypes = (config, options) => {
86
+ const errors = [];
87
+ for (const [valueLabel, entry] of Object.entries(config)) {
88
+ const error = entry.array
89
+ ? validateJSArray({
90
+ ...entry,
91
+ valueLabel,
92
+ })
93
+ : validateJSType({
94
+ ...entry,
95
+ valueLabel,
96
+ });
97
+ if (error) {
98
+ errors.push(error.message);
99
+ }
100
+ }
101
+ if (errors.length === 0) return null;
102
+ const result =
103
+ errors.length === 1
104
+ ? new InvalidJSTypeError(errors[0])
105
+ : new InvalidJSTypeError(
106
+ `Type errors:\n${errors.map((e) => ` - ${e}`).join("\n")}`,
107
+ );
108
+ if (options?.throw) throw result;
109
+ return result;
110
+ };
111
+
112
+ export {
113
+ InvalidJSNumberError,
114
+ InvalidJSTypeError,
115
+ VALIDATE_NUMBER_ERRORS,
116
+ VALIDATE_TYPEOF_ERRORS,
117
+ isPlainObject,
118
+ isTypeof,
119
+ validateJSArray,
120
+ validateJSType,
121
+ validateJSTypes,
122
+ validateNumber,
123
+ };
@@ -0,0 +1,14 @@
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;
@@ -0,0 +1,2 @@
1
+ // CONCATENATED MODULE: ./src/internal/core/language/types/types.ts
2
+ /** Does not change an object type, but remaps it for cleaner Intellisense only */
@@ -0,0 +1,6 @@
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;
@@ -0,0 +1,36 @@
1
+ // CONCATENATED MODULE: ./src/internal/core/runtime/env.ts
2
+ /* eslint-disable no-console */ const _process =
3
+ typeof process === "undefined"
4
+ ? {
5
+ env: {},
6
+ }
7
+ : process;
8
+ const RUNTIME_MODE_VALUES = ["development", "production", "test"];
9
+ const _RUNTIME_MODE =
10
+ _process.env._BW_RUNTIME_MODE ||
11
+ (process.env.NODE_ENV?.match(/test(ing | s)?/)
12
+ ? "test"
13
+ : process.env.NODE_ENV === "development"
14
+ ? "development"
15
+ : "production");
16
+ const RUNTIME_MODE = RUNTIME_MODE_VALUES.includes(_RUNTIME_MODE)
17
+ ? _RUNTIME_MODE
18
+ : "production";
19
+ if (RUNTIME_MODE !== _RUNTIME_MODE) {
20
+ // eslint-disable-next-line no-console
21
+ console.error(
22
+ `Env var _BW_RUNTIME_MODE has an invalid value: "${_RUNTIME_MODE}". Defaulting to "${RUNTIME_MODE}". Accepted values: ${RUNTIME_MODE_VALUES.join(", ")}.`,
23
+ );
24
+ }
25
+ const IS_INTERNAL_TEST = process.env._BW_IS_INTERNAL_TEST === "true";
26
+ const IS_TEST = RUNTIME_MODE === "test";
27
+ const IS_PRODUCTION = RUNTIME_MODE === "production";
28
+ const IS_DEVELOPMENT = RUNTIME_MODE === "development";
29
+
30
+ export {
31
+ IS_DEVELOPMENT,
32
+ IS_INTERNAL_TEST,
33
+ IS_PRODUCTION,
34
+ IS_TEST,
35
+ RUNTIME_MODE,
36
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./env";
2
+ export * from "./os";
3
+ export * from "./onExit";
4
+ export * from "./tempFile";
5
+ export * from "./terminal";
@@ -0,0 +1,5 @@
1
+ export * from "./env.mjs";
2
+ export * from "./os.mjs";
3
+ export * from "./onExit.mjs";
4
+ export * from "./tempFile.mjs";
5
+ export * from "./terminal.mjs"; // CONCATENATED MODULE: ./src/internal/core/runtime/index.ts
@@ -0,0 +1,4 @@
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 {};