prjct-cli 0.35.2 → 0.35.3

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 (367) hide show
  1. package/core/commands/workflow.ts +3 -2
  2. package/dist/bin/prjct.mjs +5 -4
  3. package/package.json +1 -1
  4. package/templates/_bases/tracker-base.md +309 -0
  5. package/templates/agentic/orchestrator.md +211 -269
  6. package/templates/commands/github.md +9 -0
  7. package/templates/commands/history.md +296 -83
  8. package/templates/commands/jira.md +9 -0
  9. package/templates/commands/linear.md +9 -0
  10. package/templates/commands/monday.md +9 -0
  11. package/templates/commands/p.md +198 -63
  12. package/templates/commands/resume.md +68 -4
  13. package/templates/commands/sync.md +103 -0
  14. package/packages/shared/node_modules/@types/bun/LICENSE +0 -21
  15. package/packages/shared/node_modules/@types/bun/README.md +0 -20
  16. package/packages/shared/node_modules/@types/bun/index.d.ts +0 -1
  17. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/CLAUDE.md +0 -105
  18. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/README.md +0 -33
  19. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/bun.d.ts +0 -7032
  20. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/bun.ns.d.ts +0 -5
  21. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/bundle.d.ts +0 -74
  22. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/deprecated.d.ts +0 -184
  23. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/devserver.d.ts +0 -187
  24. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/README.md +0 -28
  25. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/bytecode.mdx +0 -465
  26. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/css.mdx +0 -1024
  27. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/esbuild.mdx +0 -298
  28. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/executables.mdx +0 -1277
  29. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/fullstack.mdx +0 -1086
  30. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/hot-reloading.mdx +0 -229
  31. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/html-static.mdx +0 -488
  32. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/index.mdx +0 -1604
  33. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/loaders.mdx +0 -451
  34. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/macros.mdx +0 -328
  35. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/minifier.mdx +0 -1286
  36. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/bundler/plugins.mdx +0 -425
  37. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/feedback.mdx +0 -75
  38. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-array.mdx +0 -29
  39. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-blob.mdx +0 -26
  40. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-buffer.mdx +0 -27
  41. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-string.mdx +0 -17
  42. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/arraybuffer-to-typedarray.mdx +0 -41
  43. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-arraybuffer.mdx +0 -16
  44. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-dataview.mdx +0 -16
  45. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-stream.mdx +0 -16
  46. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-string.mdx +0 -17
  47. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/blob-to-typedarray.mdx +0 -16
  48. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-arraybuffer.mdx +0 -16
  49. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-blob.mdx +0 -16
  50. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-readablestream.mdx +0 -43
  51. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-string.mdx +0 -27
  52. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/buffer-to-typedarray.mdx +0 -16
  53. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/dataview-to-string.mdx +0 -17
  54. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-arraybuffer.mdx +0 -27
  55. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-blob.mdx +0 -18
  56. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-buffer.mdx +0 -16
  57. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-dataview.mdx +0 -16
  58. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-readablestream.mdx +0 -43
  59. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/binary/typedarray-to-string.mdx +0 -18
  60. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/aws-lambda.mdx +0 -204
  61. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/digital-ocean.mdx +0 -161
  62. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/google-cloud-run.mdx +0 -194
  63. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/railway.mdx +0 -145
  64. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/render.mdx +0 -82
  65. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/deployment/vercel.mdx +0 -97
  66. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/astro.mdx +0 -82
  67. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/discordjs.mdx +0 -80
  68. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/docker.mdx +0 -151
  69. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/drizzle.mdx +0 -195
  70. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/elysia.mdx +0 -31
  71. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/express.mdx +0 -43
  72. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/gel.mdx +0 -261
  73. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/hono.mdx +0 -47
  74. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/mongoose.mdx +0 -92
  75. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/neon-drizzle.mdx +0 -234
  76. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/neon-serverless-postgres.mdx +0 -60
  77. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/nextjs.mdx +0 -103
  78. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/nuxt.mdx +0 -96
  79. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/pm2.mdx +0 -55
  80. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/prisma-postgres.mdx +0 -169
  81. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/prisma.mdx +0 -164
  82. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/qwik.mdx +0 -114
  83. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/react.mdx +0 -52
  84. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/remix.mdx +0 -97
  85. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/sentry.mdx +0 -54
  86. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/solidstart.mdx +0 -62
  87. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/ssr-react.mdx +0 -49
  88. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/stric.mdx +0 -54
  89. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/sveltekit.mdx +0 -138
  90. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/systemd.mdx +0 -114
  91. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/tanstack-start.mdx +0 -791
  92. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/upstash.mdx +0 -87
  93. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/ecosystem/vite.mdx +0 -77
  94. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/html-rewriter/extract-links.mdx +0 -71
  95. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/html-rewriter/extract-social-meta.mdx +0 -97
  96. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/cluster.mdx +0 -69
  97. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/fetch-unix.mdx +0 -35
  98. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/fetch.mdx +0 -26
  99. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/file-uploads.mdx +0 -97
  100. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/hot.mdx +0 -28
  101. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/proxy.mdx +0 -50
  102. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/server.mdx +0 -48
  103. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/simple.mdx +0 -20
  104. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/stream-file.mdx +0 -50
  105. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/stream-iterator.mdx +0 -49
  106. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/stream-node-streams-in-bun.mdx +0 -22
  107. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/http/tls.mdx +0 -32
  108. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/index.mdx +0 -10
  109. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-dev.mdx +0 -28
  110. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-git.mdx +0 -40
  111. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-optional.mdx +0 -27
  112. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-peer.mdx +0 -45
  113. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add-tarball.mdx +0 -35
  114. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/add.mdx +0 -44
  115. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/azure-artifacts.mdx +0 -76
  116. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/cicd.mdx +0 -43
  117. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/custom-registry.mdx +0 -32
  118. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/from-npm-install-to-bun-install.mdx +0 -230
  119. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/git-diff-bun-lockfile.mdx +0 -48
  120. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/jfrog-artifactory.mdx +0 -28
  121. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/npm-alias.mdx +0 -25
  122. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/registry-scope.mdx +0 -40
  123. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/trusted.mdx +0 -52
  124. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/workspaces.mdx +0 -70
  125. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/install/yarnlock.mdx +0 -51
  126. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/argv.mdx +0 -66
  127. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/ctrl-c.mdx +0 -18
  128. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/ipc.mdx +0 -69
  129. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/nanoseconds.mdx +0 -15
  130. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/os-signals.mdx +0 -31
  131. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/spawn-stderr.mdx +0 -34
  132. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/spawn-stdout.mdx +0 -28
  133. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/spawn.mdx +0 -43
  134. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/process/stdin.mdx +0 -62
  135. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/arraybuffer.mdx +0 -30
  136. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/buffer.mdx +0 -21
  137. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/exists.mdx +0 -18
  138. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/json.mdx +0 -19
  139. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/mime.mdx +0 -22
  140. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/stream.mdx +0 -28
  141. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/string.mdx +0 -24
  142. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/uint8array.mdx +0 -23
  143. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/read-file/watch.mdx +0 -66
  144. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/build-time-constants.mdx +0 -295
  145. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/cicd.mdx +0 -45
  146. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/codesign-macos-executable.mdx +0 -61
  147. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/define-constant.mdx +0 -149
  148. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/delete-directory.mdx +0 -39
  149. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/delete-file.mdx +0 -21
  150. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/heap-snapshot.mdx +0 -28
  151. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-html.mdx +0 -15
  152. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-json.mdx +0 -46
  153. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-toml.mdx +0 -32
  154. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/import-yaml.mdx +0 -104
  155. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/read-env.mdx +0 -37
  156. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/set-env.mdx +0 -51
  157. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/shell.mdx +0 -42
  158. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/timezone.mdx +0 -38
  159. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/tsconfig-paths.mdx +0 -31
  160. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/typescript.mdx +0 -51
  161. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/vscode-debugger.mdx +0 -47
  162. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/runtime/web-debugger.mdx +0 -103
  163. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-arraybuffer.mdx +0 -13
  164. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-blob.mdx +0 -13
  165. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-json.mdx +0 -14
  166. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-string.mdx +0 -14
  167. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/node-readable-to-uint8array.mdx +0 -13
  168. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-array.mdx +0 -16
  169. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-arraybuffer.mdx +0 -16
  170. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-blob.mdx +0 -16
  171. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-buffer.mdx +0 -17
  172. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-json.mdx +0 -16
  173. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-string.mdx +0 -16
  174. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/streams/to-typedarray.mdx +0 -24
  175. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/bail.mdx +0 -24
  176. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/concurrent-test-glob.mdx +0 -146
  177. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/coverage-threshold.mdx +0 -67
  178. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/coverage.mdx +0 -49
  179. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/happy-dom.mdx +0 -73
  180. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/migrate-from-jest.mdx +0 -125
  181. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/mock-clock.mdx +0 -50
  182. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/mock-functions.mdx +0 -70
  183. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/rerun-each.mdx +0 -16
  184. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/run-tests.mdx +0 -116
  185. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/skip-tests.mdx +0 -43
  186. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/snapshot.mdx +0 -102
  187. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/spy-on.mdx +0 -49
  188. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/svelte-test.mdx +0 -113
  189. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/testing-library.mdx +0 -93
  190. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/timeout.mdx +0 -17
  191. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/todo-tests.mdx +0 -74
  192. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/update-snapshots.mdx +0 -49
  193. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/test/watch-mode.mdx +0 -24
  194. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/base64.mdx +0 -17
  195. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/deep-equals.mdx +0 -41
  196. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/deflate.mdx +0 -20
  197. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/detect-bun.mdx +0 -28
  198. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/entrypoint.mdx +0 -19
  199. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/escape-html.mdx +0 -24
  200. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/file-url-to-path.mdx +0 -16
  201. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/gzip.mdx +0 -20
  202. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/hash-a-password.mdx +0 -56
  203. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/import-meta-dir.mdx +0 -15
  204. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/import-meta-file.mdx +0 -15
  205. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/import-meta-path.mdx +0 -15
  206. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/javascript-uuid.mdx +0 -25
  207. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/main.mdx +0 -43
  208. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/path-to-file-url.mdx +0 -16
  209. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/sleep.mdx +0 -24
  210. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/upgrade.mdx +0 -93
  211. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/version.mdx +0 -23
  212. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/util/which-path-to-executable-bin.mdx +0 -17
  213. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/compression.mdx +0 -33
  214. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/context.mdx +0 -79
  215. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/pubsub.mdx +0 -43
  216. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/websocket/simple.mdx +0 -38
  217. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/append.mdx +0 -54
  218. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/basic.mdx +0 -46
  219. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/blob.mdx +0 -30
  220. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/cat.mdx +0 -19
  221. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/file-cp.mdx +0 -18
  222. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/filesink.mdx +0 -54
  223. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/response.mdx +0 -19
  224. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/stdout.mdx +0 -23
  225. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/stream.mdx +0 -19
  226. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/guides/write-file/unlink.mdx +0 -18
  227. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/index.mdx +0 -133
  228. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/installation.mdx +0 -365
  229. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/bunx.mdx +0 -91
  230. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/catalogs.mdx +0 -292
  231. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/add.mdx +0 -179
  232. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/audit.mdx +0 -60
  233. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/info.mdx +0 -70
  234. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/install.mdx +0 -606
  235. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/link.mdx +0 -61
  236. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/outdated.mdx +0 -197
  237. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/patch.mdx +0 -69
  238. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/pm.mdx +0 -323
  239. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/publish.mdx +0 -131
  240. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/remove.mdx +0 -16
  241. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/update.mdx +0 -140
  242. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/cli/why.mdx +0 -84
  243. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/filter.mdx +0 -102
  244. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/global-cache.mdx +0 -72
  245. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/isolated-installs.mdx +0 -220
  246. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/lifecycle.mdx +0 -64
  247. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/lockfile.mdx +0 -64
  248. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/npmrc.mdx +0 -111
  249. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/overrides.mdx +0 -83
  250. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/scopes-registries.mdx +0 -35
  251. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/security-scanner-api.mdx +0 -95
  252. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/pm/workspaces.mdx +0 -115
  253. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/benchmarking.mdx +0 -241
  254. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/bindgen.mdx +0 -223
  255. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/building-windows.mdx +0 -133
  256. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/contributing.mdx +0 -388
  257. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/feedback.mdx +0 -20
  258. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/license.mdx +0 -78
  259. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/project/roadmap.mdx +0 -8
  260. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/quickstart.mdx +0 -251
  261. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/auto-install.mdx +0 -97
  262. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/binary-data.mdx +0 -846
  263. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/bun-apis.mdx +0 -59
  264. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/bunfig.mdx +0 -723
  265. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/c-compiler.mdx +0 -204
  266. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/child-process.mdx +0 -659
  267. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/color.mdx +0 -267
  268. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/console.mdx +0 -67
  269. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/cookies.mdx +0 -454
  270. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/debugger.mdx +0 -335
  271. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/environment-variables.mdx +0 -231
  272. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/ffi.mdx +0 -565
  273. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/file-io.mdx +0 -306
  274. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/file-system-router.mdx +0 -118
  275. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/file-types.mdx +0 -435
  276. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/glob.mdx +0 -181
  277. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/globals.mdx +0 -72
  278. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/hashing.mdx +0 -315
  279. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/html-rewriter.mdx +0 -333
  280. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/cookies.mdx +0 -79
  281. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/error-handling.mdx +0 -40
  282. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/metrics.mdx +0 -36
  283. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/routing.mdx +0 -289
  284. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/server.mdx +0 -645
  285. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/tls.mdx +0 -101
  286. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/http/websockets.mdx +0 -414
  287. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/index.mdx +0 -223
  288. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/jsx.mdx +0 -115
  289. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/module-resolution.mdx +0 -374
  290. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/dns.mdx +0 -111
  291. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/fetch.mdx +0 -484
  292. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/tcp.mdx +0 -239
  293. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/networking/udp.mdx +0 -129
  294. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/node-api.mdx +0 -19
  295. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/nodejs-compat.mdx +0 -468
  296. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/plugins.mdx +0 -419
  297. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/redis.mdx +0 -583
  298. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/s3.mdx +0 -863
  299. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/secrets.mdx +0 -340
  300. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/semver.mdx +0 -57
  301. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/shell.mdx +0 -637
  302. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/sql.mdx +0 -1404
  303. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/sqlite.mdx +0 -721
  304. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/streams.mdx +0 -232
  305. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/templating/create.mdx +0 -269
  306. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/templating/init.mdx +0 -58
  307. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/transpiler.mdx +0 -288
  308. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/typescript.mdx +0 -58
  309. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/utils.mdx +0 -922
  310. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/watch-mode.mdx +0 -161
  311. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/web-apis.mdx +0 -29
  312. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/workers.mdx +0 -314
  313. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/runtime/yaml.mdx +0 -469
  314. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/add.mdx +0 -166
  315. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/build.mdx +0 -196
  316. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/bunx.mdx +0 -49
  317. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/feedback.mdx +0 -17
  318. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/init.mdx +0 -84
  319. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/install.mdx +0 -173
  320. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/link.mdx +0 -163
  321. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/outdated.mdx +0 -140
  322. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/patch.mdx +0 -171
  323. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/publish.mdx +0 -198
  324. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/remove.mdx +0 -146
  325. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/run.mdx +0 -293
  326. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/test.mdx +0 -100
  327. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/snippets/cli/update.mdx +0 -144
  328. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/code-coverage.mdx +0 -409
  329. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/configuration.mdx +0 -514
  330. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/dates-times.mdx +0 -129
  331. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/discovery.mdx +0 -90
  332. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/dom.mdx +0 -226
  333. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/index.mdx +0 -380
  334. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/lifecycle.mdx +0 -366
  335. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/mocks.mdx +0 -637
  336. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/reporters.mdx +0 -126
  337. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/runtime-behavior.mdx +0 -342
  338. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/snapshots.mdx +0 -434
  339. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/test/writing-tests.mdx +0 -672
  340. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/docs/typescript.mdx +0 -54
  341. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/extensions.d.ts +0 -35
  342. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/fetch.d.ts +0 -79
  343. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/ffi.d.ts +0 -1154
  344. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/globals.d.ts +0 -2067
  345. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/html-rewriter.d.ts +0 -186
  346. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/index.d.ts +0 -32
  347. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/jsc.d.ts +0 -233
  348. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/overrides.d.ts +0 -376
  349. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/package.json +0 -37
  350. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/redis.d.ts +0 -3352
  351. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/s3.d.ts +0 -1299
  352. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/security.d.ts +0 -101
  353. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/serve.d.ts +0 -1296
  354. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/shell.d.ts +0 -380
  355. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/sql.d.ts +0 -887
  356. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/sqlite.d.ts +0 -1321
  357. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/test-globals.d.ts +0 -22
  358. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/test.d.ts +0 -2391
  359. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/branding.d.ts +0 -283
  360. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/index.d.ts +0 -1207
  361. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/messages.d.ts +0 -395
  362. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/overloads.d.ts +0 -669
  363. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/vendor/expect-type/utils.d.ts +0 -431
  364. package/packages/shared/node_modules/@types/bun/node_modules/bun-types/wasm.d.ts +0 -193
  365. package/packages/shared/node_modules/@types/bun/package.json +0 -53
  366. package/templates/commands/redo.md +0 -144
  367. package/templates/commands/undo.md +0 -154
@@ -1,1277 +0,0 @@
1
- ---
2
- title: "Single-file executable"
3
- description: "Generate standalone executables from TypeScript or JavaScript files with Bun"
4
- ---
5
-
6
- Bun's bundler implements a `--compile` flag for generating a standalone binary from a TypeScript or JavaScript file.
7
-
8
- <Tabs>
9
- <Tab title="CLI">
10
- ```bash terminal icon="terminal"
11
- bun build ./cli.ts --compile --outfile mycli
12
- ```
13
- </Tab>
14
- <Tab title="JavaScript">
15
- ```ts build.ts icon="/icons/typescript.svg"
16
- await Bun.build({
17
- entrypoints: ["./cli.ts"],
18
- compile: {
19
- outfile: "./mycli",
20
- },
21
- });
22
- ```
23
- </Tab>
24
- </Tabs>
25
-
26
- ```ts cli.ts icon="/icons/typescript.svg"
27
- console.log("Hello world!");
28
- ```
29
-
30
- This bundles `cli.ts` into an executable that can be executed directly:
31
-
32
- ```bash terminal icon="terminal"
33
- ./mycli
34
- ```
35
-
36
- ```txt
37
- Hello world!
38
- ```
39
-
40
- All imported files and packages are bundled into the executable, along with a copy of the Bun runtime. All built-in Bun and Node.js APIs are supported.
41
-
42
- ---
43
-
44
- ## Cross-compile to other platforms
45
-
46
- The `--target` flag lets you compile your standalone executable for a different operating system, architecture, or version of Bun than the machine you're running `bun build` on.
47
-
48
- To build for Linux x64 (most servers):
49
-
50
- <Tabs>
51
- <Tab title="CLI">
52
- ```bash icon="terminal" terminal
53
- bun build --compile --target=bun-linux-x64 ./index.ts --outfile myapp
54
-
55
- # To support CPUs from before 2013, use the baseline version (nehalem)
56
- bun build --compile --target=bun-linux-x64-baseline ./index.ts --outfile myapp
57
-
58
- # To explicitly only support CPUs from 2013 and later, use the modern version (haswell)
59
- # modern is faster, but baseline is more compatible.
60
- bun build --compile --target=bun-linux-x64-modern ./index.ts --outfile myapp
61
- ```
62
-
63
- </Tab>
64
- <Tab title="JavaScript">
65
- ```ts build.ts icon="/icons/typescript.svg"
66
- // Standard Linux x64
67
- await Bun.build({
68
- entrypoints: ["./index.ts"],
69
- compile: {
70
- target: "bun-linux-x64",
71
- outfile: "./myapp",
72
- },
73
- });
74
-
75
- // Baseline (pre-2013 CPUs)
76
- await Bun.build({
77
- entrypoints: ["./index.ts"],
78
- compile: {
79
- target: "bun-linux-x64-baseline",
80
- outfile: "./myapp",
81
- },
82
- });
83
-
84
- // Modern (2013+ CPUs, faster)
85
- await Bun.build({
86
- entrypoints: ["./index.ts"],
87
- compile: {
88
- target: "bun-linux-x64-modern",
89
- outfile: "./myapp",
90
- },
91
- });
92
- ```
93
-
94
- </Tab>
95
- </Tabs>
96
-
97
- To build for Linux ARM64 (e.g. Graviton or Raspberry Pi):
98
-
99
- <Tabs>
100
- <Tab title="CLI">
101
- ```bash icon="terminal" terminal
102
- # Note: the default architecture is x64 if no architecture is specified.
103
- bun build --compile --target=bun-linux-arm64 ./index.ts --outfile myapp
104
- ```
105
- </Tab>
106
- <Tab title="JavaScript">
107
- ```ts build.ts icon="/icons/typescript.svg"
108
- await Bun.build({
109
- entrypoints: ["./index.ts"],
110
- compile: {
111
- target: "bun-linux-arm64",
112
- outfile: "./myapp",
113
- },
114
- });
115
- ```
116
- </Tab>
117
- </Tabs>
118
-
119
- To build for Windows x64:
120
-
121
- <Tabs>
122
- <Tab title="CLI">
123
- ```bash icon="terminal" terminal
124
- bun build --compile --target=bun-windows-x64 ./path/to/my/app.ts --outfile myapp
125
-
126
- # To support CPUs from before 2013, use the baseline version (nehalem)
127
- bun build --compile --target=bun-windows-x64-baseline ./path/to/my/app.ts --outfile myapp
128
-
129
- # To explicitly only support CPUs from 2013 and later, use the modern version (haswell)
130
- bun build --compile --target=bun-windows-x64-modern ./path/to/my/app.ts --outfile myapp
131
-
132
- # note: if no .exe extension is provided, Bun will automatically add it for Windows executables
133
- ```
134
-
135
- </Tab>
136
- <Tab title="JavaScript">
137
- ```ts build.ts icon="/icons/typescript.svg"
138
- // Standard Windows x64
139
- await Bun.build({
140
- entrypoints: ["./path/to/my/app.ts"],
141
- compile: {
142
- target: "bun-windows-x64",
143
- outfile: "./myapp", // .exe added automatically
144
- },
145
- });
146
-
147
- // Baseline or modern variants
148
- await Bun.build({
149
- entrypoints: ["./path/to/my/app.ts"],
150
- compile: {
151
- target: "bun-windows-x64-baseline",
152
- outfile: "./myapp",
153
- },
154
- });
155
- ```
156
-
157
- </Tab>
158
- </Tabs>
159
-
160
- To build for macOS arm64:
161
-
162
- <Tabs>
163
- <Tab title="CLI">
164
- ```bash icon="terminal" terminal
165
- bun build --compile --target=bun-darwin-arm64 ./path/to/my/app.ts --outfile myapp
166
- ```
167
- </Tab>
168
- <Tab title="JavaScript">
169
- ```ts build.ts icon="/icons/typescript.svg"
170
- await Bun.build({
171
- entrypoints: ["./path/to/my/app.ts"],
172
- compile: {
173
- target: "bun-darwin-arm64",
174
- outfile: "./myapp",
175
- },
176
- });
177
- ```
178
- </Tab>
179
- </Tabs>
180
-
181
- To build for macOS x64:
182
-
183
- <Tabs>
184
- <Tab title="CLI">
185
- ```bash icon="terminal" terminal
186
- bun build --compile --target=bun-darwin-x64 ./path/to/my/app.ts --outfile myapp
187
- ```
188
- </Tab>
189
- <Tab title="JavaScript">
190
- ```ts build.ts icon="/icons/typescript.svg"
191
- await Bun.build({
192
- entrypoints: ["./path/to/my/app.ts"],
193
- compile: {
194
- target: "bun-darwin-x64",
195
- outfile: "./myapp",
196
- },
197
- });
198
- ```
199
- </Tab>
200
- </Tabs>
201
-
202
- ### Supported targets
203
-
204
- The order of the `--target` flag does not matter, as long as they're delimited by a `-`.
205
-
206
- | --target | Operating System | Architecture | Modern | Baseline | Libc |
207
- | --------------------- | ---------------- | ------------ | ------ | -------- | ----- |
208
- | bun-linux-x64 | Linux | x64 | ✅ | ✅ | glibc |
209
- | bun-linux-arm64 | Linux | arm64 | ✅ | N/A | glibc |
210
- | bun-windows-x64 | Windows | x64 | ✅ | ✅ | - |
211
- | ~~bun-windows-arm64~~ | ~~Windows~~ | ~~arm64~~ | ❌ | ❌ | - |
212
- | bun-darwin-x64 | macOS | x64 | ✅ | ✅ | - |
213
- | bun-darwin-arm64 | macOS | arm64 | ✅ | N/A | - |
214
- | bun-linux-x64-musl | Linux | x64 | ✅ | ✅ | musl |
215
- | bun-linux-arm64-musl | Linux | arm64 | ✅ | N/A | musl |
216
-
217
- <Warning>
218
- On x64 platforms, Bun uses SIMD optimizations which require a modern CPU supporting AVX2 instructions. The `-baseline`
219
- build of Bun is for older CPUs that don't support these optimizations. Normally, when you install Bun we automatically
220
- detect which version to use but this can be harder to do when cross-compiling since you might not know the target CPU.
221
- You usually don't need to worry about it on Darwin x64, but it is relevant for Windows x64 and Linux x64. If you or
222
- your users see `"Illegal instruction"` errors, you might need to use the baseline version.
223
- </Warning>
224
-
225
- ---
226
-
227
- ## Build-time constants
228
-
229
- Use the `--define` flag to inject build-time constants into your executable, such as version numbers, build timestamps, or configuration values:
230
-
231
- <Tabs>
232
- <Tab title="CLI">
233
- ```bash icon="terminal" terminal
234
- bun build --compile --define BUILD_VERSION='"1.2.3"' --define BUILD_TIME='"2024-01-15T10:30:00Z"' src/cli.ts --outfile mycli
235
- ```
236
- </Tab>
237
- <Tab title="JavaScript">
238
- ```ts build.ts icon="/icons/typescript.svg"
239
- await Bun.build({
240
- entrypoints: ["./src/cli.ts"],
241
- compile: {
242
- outfile: "./mycli",
243
- },
244
- define: {
245
- BUILD_VERSION: JSON.stringify("1.2.3"),
246
- BUILD_TIME: JSON.stringify("2024-01-15T10:30:00Z"),
247
- },
248
- });
249
- ```
250
- </Tab>
251
- </Tabs>
252
-
253
- These constants are embedded directly into your compiled binary at build time, providing zero runtime overhead and enabling dead code elimination optimizations.
254
-
255
- <Note>
256
- For comprehensive examples and advanced patterns, see the [Build-time constants
257
- guide](/docs/guides/runtime/build-time-constants).
258
- </Note>
259
-
260
- ---
261
-
262
- ## Deploying to production
263
-
264
- Compiled executables reduce memory usage and improve Bun's start time.
265
-
266
- Normally, Bun reads and transpiles JavaScript and TypeScript files on `import` and `require`. This is part of what makes so much of Bun "just work", but it's not free. It costs time and memory to read files from disk, resolve file paths, parse, transpile, and print source code.
267
-
268
- With compiled executables, you can move that cost from runtime to build-time.
269
-
270
- When deploying to production, we recommend the following:
271
-
272
- <Tabs>
273
- <Tab title="CLI">
274
- ```bash icon="terminal" terminal
275
- bun build --compile --minify --sourcemap ./path/to/my/app.ts --outfile myapp
276
- ```
277
- </Tab>
278
- <Tab title="JavaScript">
279
- ```ts build.ts icon="/icons/typescript.svg"
280
- await Bun.build({
281
- entrypoints: ["./path/to/my/app.ts"],
282
- compile: {
283
- outfile: "./myapp",
284
- },
285
- minify: true,
286
- sourcemap: "linked",
287
- });
288
- ```
289
- </Tab>
290
- </Tabs>
291
-
292
- ### Bytecode compilation
293
-
294
- To improve startup time, enable bytecode compilation:
295
-
296
- <Tabs>
297
- <Tab title="CLI">
298
- ```bash icon="terminal" terminal
299
- bun build --compile --minify --sourcemap --bytecode ./path/to/my/app.ts --outfile myapp
300
- ```
301
- </Tab>
302
- <Tab title="JavaScript">
303
- ```ts build.ts icon="/icons/typescript.svg"
304
- await Bun.build({
305
- entrypoints: ["./path/to/my/app.ts"],
306
- compile: {
307
- outfile: "./myapp",
308
- },
309
- minify: true,
310
- sourcemap: "linked",
311
- bytecode: true,
312
- });
313
- ```
314
- </Tab>
315
- </Tabs>
316
-
317
- Using bytecode compilation, `tsc` starts 2x faster:
318
-
319
- <Frame>
320
- ![Bytecode performance comparison](https://github.com/user-attachments/assets/dc8913db-01d2-48f8-a8ef-ac4e984f9763)
321
- </Frame>
322
-
323
- Bytecode compilation moves parsing overhead for large input files from runtime to bundle time. Your app starts faster, in exchange for making the `bun build` command a little slower. It doesn't obscure source code.
324
-
325
- <Warning>
326
- **Experimental:** Bytecode compilation is an experimental feature. Only `cjs` format is supported (which means no
327
- top-level-await). Let us know if you run into any issues!
328
- </Warning>
329
-
330
- ### What do these flags do?
331
-
332
- The `--minify` argument optimizes the size of the transpiled output code. If you have a large application, this can save megabytes of space. For smaller applications, it might still improve start time a little.
333
-
334
- The `--sourcemap` argument embeds a sourcemap compressed with zstd, so that errors & stacktraces point to their original locations instead of the transpiled location. Bun will automatically decompress & resolve the sourcemap when an error occurs.
335
-
336
- The `--bytecode` argument enables bytecode compilation. Every time you run JavaScript code in Bun, JavaScriptCore (the engine) will compile your source code into bytecode. We can move this parsing work from runtime to bundle time, saving you startup time.
337
-
338
- ---
339
-
340
- ## Embedding runtime arguments
341
-
342
- **`--compile-exec-argv="args"`** - Embed runtime arguments that are available via `process.execArgv`:
343
-
344
- <Tabs>
345
- <Tab title="CLI">
346
- ```bash icon="terminal" terminal
347
- bun build --compile --compile-exec-argv="--smol --user-agent=MyBot" ./app.ts --outfile myapp
348
- ```
349
- </Tab>
350
- <Tab title="JavaScript">
351
- ```ts build.ts icon="/icons/typescript.svg"
352
- await Bun.build({
353
- entrypoints: ["./app.ts"],
354
- compile: {
355
- execArgv: ["--smol", "--user-agent=MyBot"],
356
- outfile: "./myapp",
357
- },
358
- });
359
- ```
360
- </Tab>
361
- </Tabs>
362
-
363
- ```ts app.ts icon="/icons/typescript.svg"
364
- // In the compiled app
365
- console.log(process.execArgv); // ["--smol", "--user-agent=MyBot"]
366
- ```
367
-
368
- ---
369
-
370
- ## Automatic config loading
371
-
372
- Standalone executables can automatically load configuration files from the directory where they are run. By default:
373
-
374
- - **`tsconfig.json`** and **`package.json`** loading is **disabled** — these are typically only needed at development time, and the bundler already uses them when compiling
375
- - **`.env`** and **`bunfig.toml`** loading is **enabled** — these often contain runtime configuration that may vary per deployment
376
-
377
- <Note>
378
- In a future version of Bun, `.env` and `bunfig.toml` may also be disabled by default for more deterministic behavior.
379
- </Note>
380
-
381
- ### Enabling config loading at runtime
382
-
383
- If your executable needs to read `tsconfig.json` or `package.json` at runtime, you can opt in with the new CLI flags:
384
-
385
- ```bash icon="terminal" terminal
386
- # Enable runtime loading of tsconfig.json
387
- bun build --compile --compile-autoload-tsconfig ./app.ts --outfile myapp
388
-
389
- # Enable runtime loading of package.json
390
- bun build --compile --compile-autoload-package-json ./app.ts --outfile myapp
391
-
392
- # Enable both
393
- bun build --compile --compile-autoload-tsconfig --compile-autoload-package-json ./app.ts --outfile myapp
394
- ```
395
-
396
- ### Disabling config loading at runtime
397
-
398
- To disable `.env` or `bunfig.toml` loading for deterministic execution:
399
-
400
- <Tabs>
401
- <Tab title="CLI">
402
- ```bash icon="terminal" terminal
403
- # Disable .env loading
404
- bun build --compile --no-compile-autoload-dotenv ./app.ts --outfile myapp
405
-
406
- # Disable bunfig.toml loading
407
- bun build --compile --no-compile-autoload-bunfig ./app.ts --outfile myapp
408
-
409
- # Disable all config loading
410
- bun build --compile --no-compile-autoload-dotenv --no-compile-autoload-bunfig ./app.ts --outfile myapp
411
- ```
412
-
413
- </Tab>
414
- <Tab title="JavaScript">
415
- ```ts build.ts icon="/icons/typescript.svg"
416
- await Bun.build({
417
- entrypoints: ["./app.ts"],
418
- compile: {
419
- // tsconfig.json and package.json are disabled by default
420
- autoloadTsconfig: true, // Enable tsconfig.json loading
421
- autoloadPackageJson: true, // Enable package.json loading
422
-
423
- // .env and bunfig.toml are enabled by default
424
- autoloadDotenv: false, // Disable .env loading
425
- autoloadBunfig: false, // Disable bunfig.toml loading
426
- outfile: "./myapp",
427
- },
428
- });
429
- ```
430
-
431
- </Tab>
432
- </Tabs>
433
-
434
- ---
435
-
436
- ## Act as the Bun CLI
437
-
438
- <Note>New in Bun v1.2.16</Note>
439
-
440
- You can run a standalone executable as if it were the `bun` CLI itself by setting the `BUN_BE_BUN=1` environment variable. When this variable is set, the executable will ignore its bundled entrypoint and instead expose all the features of Bun's CLI.
441
-
442
- For example, consider an executable compiled from a simple script:
443
-
444
- ```bash icon="terminal" terminal
445
- echo "console.log(\"you shouldn't see this\");" > such-bun.js
446
- bun build --compile ./such-bun.js
447
- ```
448
-
449
- ```txt
450
- [3ms] bundle 1 modules
451
- [89ms] compile such-bun
452
- ```
453
-
454
- Normally, running `./such-bun` with arguments would execute the script.
455
-
456
- ```bash icon="terminal" terminal
457
- # Executable runs its own entrypoint by default
458
- ./such-bun install
459
- ```
460
-
461
- ```txt
462
- you shouldn't see this
463
- ```
464
-
465
- However, with the `BUN_BE_BUN=1` environment variable, it acts just like the `bun` binary:
466
-
467
- ```bash icon="terminal" terminal
468
- # With the env var, the executable acts like the `bun` CLI
469
- BUN_BE_BUN=1 ./such-bun install
470
- ```
471
-
472
- ```txt
473
- bun install v1.2.16-canary.1 (1d1db811)
474
- Checked 63 installs across 64 packages (no changes) [5.00ms]
475
- ```
476
-
477
- This is useful for building CLI tools on top of Bun that may need to install packages, bundle dependencies, run different or local files and more without needing to download a separate binary or install bun.
478
-
479
- ---
480
-
481
- ## Full-stack executables
482
-
483
- <Note>New in Bun v1.2.17</Note>
484
-
485
- Bun's `--compile` flag can create standalone executables that contain both server and client code, making it ideal for full-stack applications. When you import an HTML file in your server code, Bun automatically bundles all frontend assets (JavaScript, CSS, etc.) and embeds them into the executable. When Bun sees the HTML import on the server, it kicks off a frontend build process to bundle JavaScript, CSS, and other assets.
486
-
487
- <CodeGroup>
488
-
489
- ```ts server.ts icon="/icons/typescript.svg"
490
- import { serve } from "bun";
491
- import index from "./index.html";
492
-
493
- const server = serve({
494
- routes: {
495
- "/": index,
496
- "/api/hello": { GET: () => Response.json({ message: "Hello from API" }) },
497
- },
498
- });
499
-
500
- console.log(`Server running at http://localhost:${server.port}`);
501
- ```
502
-
503
- ```html index.html icon="file-code"
504
- <!DOCTYPE html>
505
- <html>
506
- <head>
507
- <title>My App</title>
508
- <link rel="stylesheet" href="./styles.css" />
509
- </head>
510
- <body>
511
- <h1>Hello World</h1>
512
- <script src="./app.ts"></script>
513
- </body>
514
- </html>
515
- ```
516
-
517
- ```ts app.ts icon="file-code"
518
- console.log("Hello from the client!");
519
- ```
520
-
521
- ```css styles.css icon="file-code"
522
- body {
523
- background-color: #f0f0f0;
524
- }
525
- ```
526
-
527
- </CodeGroup>
528
-
529
- To build this into a single executable:
530
-
531
- <Tabs>
532
- <Tab title="CLI">
533
- ```bash terminal icon="terminal"
534
- bun build --compile ./server.ts --outfile myapp
535
- ```
536
- </Tab>
537
- <Tab title="JavaScript">
538
- ```ts build.ts icon="/icons/typescript.svg"
539
- await Bun.build({
540
- entrypoints: ["./server.ts"],
541
- compile: {
542
- outfile: "./myapp",
543
- },
544
- });
545
- ```
546
- </Tab>
547
- </Tabs>
548
-
549
- This creates a self-contained binary that includes:
550
-
551
- - Your server code
552
- - The Bun runtime
553
- - All frontend assets (HTML, CSS, JavaScript)
554
- - Any npm packages used by your server
555
-
556
- The result is a single file that can be deployed anywhere without needing Node.js, Bun, or any dependencies installed. Just run:
557
-
558
- ```bash terminal icon="terminal"
559
- ./myapp
560
- ```
561
-
562
- Bun automatically handles serving the frontend assets with proper MIME types and cache headers. The HTML import is replaced with a manifest object that `Bun.serve` uses to efficiently serve pre-bundled assets.
563
-
564
- For more details on building full-stack applications with Bun, see the [full-stack guide](/docs/bundler/fullstack).
565
-
566
- ---
567
-
568
- ## Worker
569
-
570
- To use workers in a standalone executable, add the worker's entrypoint to the build:
571
-
572
- <Tabs>
573
- <Tab title="CLI">
574
- ```bash terminal icon="terminal"
575
- bun build --compile ./index.ts ./my-worker.ts --outfile myapp
576
- ```
577
- </Tab>
578
- <Tab title="JavaScript">
579
- ```ts build.ts icon="/icons/typescript.svg"
580
- await Bun.build({
581
- entrypoints: ["./index.ts", "./my-worker.ts"],
582
- compile: {
583
- outfile: "./myapp",
584
- },
585
- });
586
- ```
587
- </Tab>
588
- </Tabs>
589
-
590
- Then, reference the worker in your code:
591
-
592
- ```ts index.ts icon="/icons/typescript.svg"
593
- console.log("Hello from Bun!");
594
-
595
- // Any of these will work:
596
- new Worker("./my-worker.ts");
597
- new Worker(new URL("./my-worker.ts", import.meta.url));
598
- new Worker(new URL("./my-worker.ts", import.meta.url).href);
599
- ```
600
-
601
- When you add multiple entrypoints to a standalone executable, they will be bundled separately into the executable.
602
-
603
- In the future, we may automatically detect usages of statically-known paths in `new Worker(path)` and then bundle those into the executable, but for now, you'll need to add it to the shell command manually like the above example.
604
-
605
- If you use a relative path to a file not included in the standalone executable, it will attempt to load that path from disk relative to the current working directory of the process (and then error if it doesn't exist).
606
-
607
- ---
608
-
609
- ## SQLite
610
-
611
- You can use `bun:sqlite` imports with `bun build --compile`.
612
-
613
- By default, the database is resolved relative to the current working directory of the process.
614
-
615
- ```ts index.ts icon="/icons/typescript.svg"
616
- import db from "./my.db" with { type: "sqlite" };
617
-
618
- console.log(db.query("select * from users LIMIT 1").get());
619
- ```
620
-
621
- That means if the executable is located at `/usr/bin/hello`, the user's terminal is located at `/home/me/Desktop`, it will look for `/home/me/Desktop/my.db`.
622
-
623
- ```bash terminal icon="terminal"
624
- cd /home/me/Desktop
625
- ./hello
626
- ```
627
-
628
- ---
629
-
630
- ## Embed assets & files
631
-
632
- Standalone executables support embedding files directly into the binary. This lets you ship a single executable that contains images, JSON configs, templates, or any other assets your application needs.
633
-
634
- ### How it works
635
-
636
- Use the `with { type: "file" }` [import attribute](https://github.com/tc39/proposal-import-attributes) to embed a file:
637
-
638
- ```ts index.ts icon="/icons/typescript.svg"
639
- import icon from "./icon.png" with { type: "file" };
640
-
641
- console.log(icon);
642
- // During development: "./icon.png"
643
- // After compilation: "$bunfs/icon-a1b2c3d4.png" (internal path)
644
- ```
645
-
646
- The import returns a **path string** that points to the embedded file. At build time, Bun:
647
-
648
- 1. Reads the file contents
649
- 2. Embeds the data into the executable
650
- 3. Replaces the import with an internal path (prefixed with `$bunfs/`)
651
-
652
- You can then read this embedded file using `Bun.file()` or Node.js `fs` APIs.
653
-
654
- ### Reading embedded files with Bun.file()
655
-
656
- `Bun.file()` is the recommended way to read embedded files:
657
-
658
- ```ts index.ts icon="/icons/typescript.svg"
659
- import icon from "./icon.png" with { type: "file" };
660
- import { file } from "bun";
661
-
662
- // Get file contents as different types
663
- const bytes = await file(icon).arrayBuffer(); // ArrayBuffer
664
- const text = await file(icon).text(); // string (for text files)
665
- const blob = file(icon); // Blob
666
-
667
- // Stream the file in a response
668
- export default {
669
- fetch(req) {
670
- return new Response(file(icon), {
671
- headers: { "Content-Type": "image/png" },
672
- });
673
- },
674
- };
675
- ```
676
-
677
- ### Reading embedded files with Node.js fs
678
-
679
- Embedded files work seamlessly with Node.js file system APIs:
680
-
681
- ```ts index.ts icon="/icons/typescript.svg"
682
- import icon from "./icon.png" with { type: "file" };
683
- import config from "./config.json" with { type: "file" };
684
- import { readFileSync, promises as fs } from "node:fs";
685
-
686
- // Synchronous read
687
- const iconBuffer = readFileSync(icon);
688
-
689
- // Async read
690
- const configData = await fs.readFile(config, "utf-8");
691
- const parsed = JSON.parse(configData);
692
-
693
- // Check file stats
694
- const stats = await fs.stat(icon);
695
- console.log(`Icon size: ${stats.size} bytes`);
696
- ```
697
-
698
- ### Practical examples
699
-
700
- #### Embedding a JSON config file
701
-
702
- ```ts index.ts icon="/icons/typescript.svg"
703
- import configPath from "./default-config.json" with { type: "file" };
704
- import { file } from "bun";
705
-
706
- // Load the embedded default configuration
707
- const defaultConfig = await file(configPath).json();
708
-
709
- // Merge with user config if it exists
710
- const userConfig = await file("./user-config.json")
711
- .json()
712
- .catch(() => ({}));
713
- const config = { ...defaultConfig, ...userConfig };
714
- ```
715
-
716
- #### Serving static assets in an HTTP server
717
-
718
- Use `static` routes in `Bun.serve()` for efficient static file serving:
719
-
720
- ```ts server.ts icon="/icons/typescript.svg"
721
- import favicon from "./favicon.ico" with { type: "file" };
722
- import logo from "./logo.png" with { type: "file" };
723
- import styles from "./styles.css" with { type: "file" };
724
- import { file, serve } from "bun";
725
-
726
- serve({
727
- static: {
728
- "/favicon.ico": file(favicon),
729
- "/logo.png": file(logo),
730
- "/styles.css": file(styles),
731
- },
732
- fetch(req) {
733
- return new Response("Not found", { status: 404 });
734
- },
735
- });
736
- ```
737
-
738
- Bun automatically handles Content-Type headers and caching for static routes.
739
-
740
- #### Embedding templates
741
-
742
- ```ts index.ts icon="/icons/typescript.svg"
743
- import templatePath from "./email-template.html" with { type: "file" };
744
- import { file } from "bun";
745
-
746
- async function sendWelcomeEmail(user: { name: string; email: string }) {
747
- const template = await file(templatePath).text();
748
- const html = template.replace("{{name}}", user.name).replace("{{email}}", user.email);
749
-
750
- // Send email with the rendered template...
751
- }
752
- ```
753
-
754
- #### Embedding binary files
755
-
756
- ```ts index.ts icon="/icons/typescript.svg"
757
- import wasmPath from "./processor.wasm" with { type: "file" };
758
- import fontPath from "./font.ttf" with { type: "file" };
759
- import { file } from "bun";
760
-
761
- // Load a WebAssembly module
762
- const wasmBytes = await file(wasmPath).arrayBuffer();
763
- const wasmModule = await WebAssembly.instantiate(wasmBytes);
764
-
765
- // Read binary font data
766
- const fontData = await file(fontPath).bytes();
767
- ```
768
-
769
- ### Embed SQLite databases
770
-
771
- If your application wants to embed a SQLite database into the compiled executable, set `type: "sqlite"` in the import attribute and the `embed` attribute to `"true"`.
772
-
773
- The database file must already exist on disk. Then, import it in your code:
774
-
775
- ```ts index.ts icon="/icons/typescript.svg"
776
- import myEmbeddedDb from "./my.db" with { type: "sqlite", embed: "true" };
777
-
778
- console.log(myEmbeddedDb.query("select * from users LIMIT 1").get());
779
- ```
780
-
781
- Finally, compile it into a standalone executable:
782
-
783
- ```bash terminal icon="terminal"
784
- bun build --compile ./index.ts --outfile mycli
785
- ```
786
-
787
- <Note>
788
- The database file must exist on disk when you run `bun build --compile`. The `embed: "true"` attribute tells the
789
- bundler to include the database contents inside the compiled executable. When running normally with `bun run`, the
790
- database file is loaded from disk just like a regular SQLite import.
791
- </Note>
792
-
793
- In the compiled executable, the embedded database is read-write, but all changes are lost when the executable exits (since it's stored in memory).
794
-
795
- ### Embed N-API Addons
796
-
797
- You can embed `.node` files into executables.
798
-
799
- ```ts index.ts icon="/icons/typescript.svg"
800
- const addon = require("./addon.node");
801
-
802
- console.log(addon.hello());
803
- ```
804
-
805
- Unfortunately, if you're using `@mapbox/node-pre-gyp` or other similar tools, you'll need to make sure the `.node` file is directly required or it won't bundle correctly.
806
-
807
- ### Embed directories
808
-
809
- To embed a directory with `bun build --compile`, include file patterns in your build:
810
-
811
- <Tabs>
812
- <Tab title="CLI">
813
- ```bash terminal icon="terminal"
814
- bun build --compile ./index.ts ./public/**/*.png
815
- ```
816
- </Tab>
817
- <Tab title="JavaScript">
818
- ```ts build.ts icon="/icons/typescript.svg"
819
- import { Glob } from "bun";
820
-
821
- // Expand glob pattern to file list
822
- const glob = new Glob("./public/**/*.png");
823
- const pngFiles = Array.from(glob.scanSync("."));
824
-
825
- await Bun.build({
826
- entrypoints: ["./index.ts", ...pngFiles],
827
- compile: {
828
- outfile: "./myapp",
829
- },
830
- });
831
- ```
832
-
833
- </Tab>
834
- </Tabs>
835
-
836
- Then, you can reference the files in your code:
837
-
838
- ```ts index.ts icon="/icons/typescript.svg"
839
- import icon from "./public/assets/icon.png" with { type: "file" };
840
- import { file } from "bun";
841
-
842
- export default {
843
- fetch(req) {
844
- // Embedded files can be streamed from Response objects
845
- return new Response(file(icon));
846
- },
847
- };
848
- ```
849
-
850
- This is honestly a workaround, and we expect to improve this in the future with a more direct API.
851
-
852
- ### Listing embedded files
853
-
854
- `Bun.embeddedFiles` gives you access to all embedded files as `Blob` objects:
855
-
856
- ```ts index.ts icon="/icons/typescript.svg"
857
- import "./icon.png" with { type: "file" };
858
- import "./data.json" with { type: "file" };
859
- import "./template.html" with { type: "file" };
860
- import { embeddedFiles } from "bun";
861
-
862
- // List all embedded files
863
- for (const blob of embeddedFiles) {
864
- console.log(`${blob.name} - ${blob.size} bytes`);
865
- }
866
- // Output:
867
- // icon-a1b2c3d4.png - 4096 bytes
868
- // data-e5f6g7h8.json - 256 bytes
869
- // template-i9j0k1l2.html - 1024 bytes
870
- ```
871
-
872
- Each item in `Bun.embeddedFiles` is a `Blob` with a `name` property:
873
-
874
- ```ts
875
- embeddedFiles: ReadonlyArray<Blob>;
876
- ```
877
-
878
- This is useful for dynamically serving all embedded assets using `static` routes:
879
-
880
- ```ts server.ts icon="/icons/typescript.svg"
881
- import "./public/favicon.ico" with { type: "file" };
882
- import "./public/logo.png" with { type: "file" };
883
- import "./public/styles.css" with { type: "file" };
884
- import { embeddedFiles, serve } from "bun";
885
-
886
- // Build static routes from all embedded files
887
- const staticRoutes: Record<string, Blob> = {};
888
- for (const blob of embeddedFiles) {
889
- // Remove hash from filename: "icon-a1b2c3d4.png" -> "icon.png"
890
- const name = blob.name.replace(/-[a-f0-9]+\./, ".");
891
- staticRoutes[`/${name}`] = blob;
892
- }
893
-
894
- serve({
895
- static: staticRoutes,
896
- fetch(req) {
897
- return new Response("Not found", { status: 404 });
898
- },
899
- });
900
- ```
901
-
902
- <Note>
903
- `Bun.embeddedFiles` excludes bundled source code (`.ts`, `.js`, etc.) to help protect your application's source.
904
- </Note>
905
-
906
- #### Content hash
907
-
908
- By default, embedded files have a content hash appended to their name. This is useful for situations where you want to serve the file from a URL or CDN and have fewer cache invalidation issues. But sometimes, this is unexpected and you might want the original name instead:
909
-
910
- To disable the content hash, configure asset naming:
911
-
912
- <Tabs>
913
- <Tab title="CLI">
914
- ```bash terminal icon="terminal"
915
- bun build --compile --asset-naming="[name].[ext]" ./index.ts
916
- ```
917
- </Tab>
918
- <Tab title="JavaScript">
919
- ```ts build.ts icon="/icons/typescript.svg"
920
- await Bun.build({
921
- entrypoints: ["./index.ts"],
922
- compile: {
923
- outfile: "./myapp",
924
- },
925
- naming: {
926
- asset: "[name].[ext]",
927
- },
928
- });
929
- ```
930
- </Tab>
931
- </Tabs>
932
-
933
- ---
934
-
935
- ## Minification
936
-
937
- To trim down the size of the executable, enable minification:
938
-
939
- <Tabs>
940
- <Tab title="CLI">
941
- ```bash terminal icon="terminal"
942
- bun build --compile --minify ./index.ts --outfile myapp
943
- ```
944
- </Tab>
945
- <Tab title="JavaScript">
946
- ```ts build.ts icon="/icons/typescript.svg"
947
- await Bun.build({
948
- entrypoints: ["./index.ts"],
949
- compile: {
950
- outfile: "./myapp",
951
- },
952
- minify: true, // Enable all minification
953
- });
954
-
955
- // Or granular control:
956
- await Bun.build({
957
- entrypoints: ["./index.ts"],
958
- compile: {
959
- outfile: "./myapp",
960
- },
961
- minify: {
962
- whitespace: true,
963
- syntax: true,
964
- identifiers: true,
965
- },
966
- });
967
- ```
968
-
969
- </Tab>
970
- </Tabs>
971
-
972
- This uses Bun's minifier to reduce the code size. Overall though, Bun's binary is still way too big and we need to make it smaller.
973
-
974
- ---
975
-
976
- ## Windows-specific flags
977
-
978
- When compiling a standalone executable on Windows, there are platform-specific options to customize metadata on the generated `.exe` file:
979
-
980
- <Tabs>
981
- <Tab title="CLI">
982
- ```bash terminal icon="terminal"
983
- # Custom icon
984
- bun build --compile --windows-icon=path/to/icon.ico ./app.ts --outfile myapp
985
-
986
- # Hide console window (for GUI apps)
987
- bun build --compile --windows-hide-console ./app.ts --outfile myapp
988
- ```
989
-
990
- </Tab>
991
- <Tab title="JavaScript">
992
- ```ts build.ts icon="/icons/typescript.svg"
993
- await Bun.build({
994
- entrypoints: ["./app.ts"],
995
- compile: {
996
- outfile: "./myapp",
997
- windows: {
998
- icon: "./path/to/icon.ico",
999
- hideConsole: true,
1000
- // Additional Windows metadata:
1001
- title: "My Application",
1002
- publisher: "My Company",
1003
- version: "1.0.0",
1004
- description: "A standalone Windows application",
1005
- copyright: "Copyright 2024",
1006
- },
1007
- },
1008
- });
1009
- ```
1010
- </Tab>
1011
- </Tabs>
1012
-
1013
- Available Windows options:
1014
-
1015
- - `icon` - Path to `.ico` file for the executable icon
1016
- - `hideConsole` - Disable the background terminal (for GUI apps)
1017
- - `title` - Application title in file properties
1018
- - `publisher` - Publisher name in file properties
1019
- - `version` - Version string in file properties
1020
- - `description` - Description in file properties
1021
- - `copyright` - Copyright notice in file properties
1022
-
1023
- <Warning>These flags currently cannot be used when cross-compiling because they depend on Windows APIs.</Warning>
1024
-
1025
- ---
1026
-
1027
- ## Code signing on macOS
1028
-
1029
- To codesign a standalone executable on macOS (which fixes Gatekeeper warnings), use the `codesign` command.
1030
-
1031
- ```bash terminal icon="terminal"
1032
- codesign --deep --force -vvvv --sign "XXXXXXXXXX" ./myapp
1033
- ```
1034
-
1035
- We recommend including an `entitlements.plist` file with JIT permissions.
1036
-
1037
- ```xml icon="xml" title="info.plist"
1038
- <?xml version="1.0" encoding="UTF-8"?>
1039
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
1040
- <plist version="1.0">
1041
- <dict>
1042
- <key>com.apple.security.cs.allow-jit</key>
1043
- <true/>
1044
- <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
1045
- <true/>
1046
- <key>com.apple.security.cs.disable-executable-page-protection</key>
1047
- <true/>
1048
- <key>com.apple.security.cs.allow-dyld-environment-variables</key>
1049
- <true/>
1050
- <key>com.apple.security.cs.disable-library-validation</key>
1051
- <true/>
1052
- </dict>
1053
- </plist>
1054
- ```
1055
-
1056
- To codesign with JIT support, pass the `--entitlements` flag to `codesign`.
1057
-
1058
- ```bash terminal icon="terminal"
1059
- codesign --deep --force -vvvv --sign "XXXXXXXXXX" --entitlements entitlements.plist ./myapp
1060
- ```
1061
-
1062
- After codesigning, verify the executable:
1063
-
1064
- ```bash terminal icon="terminal"
1065
- codesign -vvv --verify ./myapp
1066
- ./myapp: valid on disk
1067
- ./myapp: satisfies its Designated Requirement
1068
- ```
1069
-
1070
- <Warning>Codesign support requires Bun v1.2.4 or newer.</Warning>
1071
-
1072
- ---
1073
-
1074
- ## Code splitting
1075
-
1076
- Standalone executables support code splitting. Use `--compile` with `--splitting` to create an executable that loads code-split chunks at runtime.
1077
-
1078
- <Tabs>
1079
- <Tab title="CLI">
1080
- ```bash terminal icon="terminal"
1081
- bun build --compile --splitting ./src/entry.ts --outdir ./build
1082
- ```
1083
- </Tab>
1084
- <Tab title="JavaScript">
1085
- ```ts build.ts icon="/icons/typescript.svg"
1086
- await Bun.build({
1087
- entrypoints: ["./src/entry.ts"],
1088
- compile: true,
1089
- splitting: true,
1090
- outdir: "./build",
1091
- });
1092
- ```
1093
- </Tab>
1094
- </Tabs>
1095
-
1096
- <CodeGroup>
1097
-
1098
- ```ts src/entry.ts icon="/icons/typescript.svg"
1099
- console.log("Entrypoint loaded");
1100
- const lazy = await import("./lazy.ts");
1101
- lazy.hello();
1102
- ```
1103
-
1104
- ```ts src/lazy.ts icon="/icons/typescript.svg"
1105
- export function hello() {
1106
- console.log("Lazy module loaded");
1107
- }
1108
- ```
1109
-
1110
- </CodeGroup>
1111
-
1112
- ```bash terminal icon="terminal"
1113
- ./build/entry
1114
- ```
1115
-
1116
- ```txt
1117
- Entrypoint loaded
1118
- Lazy module loaded
1119
- ```
1120
-
1121
- ---
1122
-
1123
- ## Using plugins
1124
-
1125
- Plugins work with standalone executables, allowing you to transform files during the build process:
1126
-
1127
- ```ts build.ts icon="/icons/typescript.svg"
1128
- import type { BunPlugin } from "bun";
1129
-
1130
- const envPlugin: BunPlugin = {
1131
- name: "env-loader",
1132
- setup(build) {
1133
- build.onLoad({ filter: /\.env\.json$/ }, async args => {
1134
- // Transform .env.json files into validated config objects
1135
- const env = await Bun.file(args.path).json();
1136
-
1137
- return {
1138
- contents: `export default ${JSON.stringify(env)};`,
1139
- loader: "js",
1140
- };
1141
- });
1142
- },
1143
- };
1144
-
1145
- await Bun.build({
1146
- entrypoints: ["./cli.ts"],
1147
- compile: {
1148
- outfile: "./mycli",
1149
- },
1150
- plugins: [envPlugin],
1151
- });
1152
- ```
1153
-
1154
- Example use case - embedding environment config at build time:
1155
-
1156
- ```ts cli.ts icon="/icons/typescript.svg"
1157
- import config from "./config.env.json";
1158
-
1159
- console.log(`Running in ${config.environment} mode`);
1160
- console.log(`API endpoint: ${config.apiUrl}`);
1161
- ```
1162
-
1163
- Plugins can perform any transformation: compile YAML/TOML configs, inline SQL queries, generate type-safe API clients, or preprocess templates. Refer to the [plugin documentation](/docs/bundler/plugins) for more details.
1164
-
1165
- ---
1166
-
1167
- ## Unsupported CLI arguments
1168
-
1169
- Currently, the `--compile` flag can only accept a single entrypoint at a time and does not support the following flags:
1170
-
1171
- - `--outdir` — use `outfile` instead (except when using with `--splitting`).
1172
- - `--public-path`
1173
- - `--target=node` or `--target=browser`
1174
- - `--no-bundle` - we always bundle everything into the executable.
1175
-
1176
- ---
1177
-
1178
- ## API reference
1179
-
1180
- The `compile` option in `Bun.build()` accepts three forms:
1181
-
1182
- ```ts title="types" icon="/icons/typescript.svg"
1183
- interface BuildConfig {
1184
- entrypoints: string[];
1185
- compile: boolean | Bun.Build.Target | CompileBuildOptions;
1186
- // ... other BuildConfig options (minify, sourcemap, define, plugins, etc.)
1187
- }
1188
-
1189
- interface CompileBuildOptions {
1190
- target?: Bun.Build.Target; // Cross-compilation target
1191
- outfile?: string; // Output executable path
1192
- execArgv?: string[]; // Runtime arguments (process.execArgv)
1193
- autoloadTsconfig?: boolean; // Load tsconfig.json (default: false)
1194
- autoloadPackageJson?: boolean; // Load package.json (default: false)
1195
- autoloadDotenv?: boolean; // Load .env files (default: true)
1196
- autoloadBunfig?: boolean; // Load bunfig.toml (default: true)
1197
- windows?: {
1198
- icon?: string; // Path to .ico file
1199
- hideConsole?: boolean; // Hide console window
1200
- title?: string; // Application title
1201
- publisher?: string; // Publisher name
1202
- version?: string; // Version string
1203
- description?: string; // Description
1204
- copyright?: string; // Copyright notice
1205
- };
1206
- }
1207
- ```
1208
-
1209
- Usage forms:
1210
-
1211
- ```ts icon="/icons/typescript.svg"
1212
- // Simple boolean - compile for current platform (uses entrypoint name as output)
1213
- compile: true
1214
-
1215
- // Target string - cross-compile (uses entrypoint name as output)
1216
- compile: "bun-linux-x64"
1217
-
1218
- // Full options object - specify outfile and other options
1219
- compile: {
1220
- target: "bun-linux-x64",
1221
- outfile: "./myapp",
1222
- }
1223
- ```
1224
-
1225
- ### Supported targets
1226
-
1227
- ```ts title="Bun.Build.Target" icon="/icons/typescript.svg"
1228
- type Target =
1229
- | "bun-darwin-x64"
1230
- | "bun-darwin-x64-baseline"
1231
- | "bun-darwin-arm64"
1232
- | "bun-linux-x64"
1233
- | "bun-linux-x64-baseline"
1234
- | "bun-linux-x64-modern"
1235
- | "bun-linux-arm64"
1236
- | "bun-linux-x64-musl"
1237
- | "bun-linux-arm64-musl"
1238
- | "bun-windows-x64"
1239
- | "bun-windows-x64-baseline"
1240
- | "bun-windows-x64-modern";
1241
- ```
1242
-
1243
- ### Complete example
1244
-
1245
- ```ts build.ts icon="/icons/typescript.svg"
1246
- import type { BunPlugin } from "bun";
1247
-
1248
- const myPlugin: BunPlugin = {
1249
- name: "my-plugin",
1250
- setup(build) {
1251
- // Plugin implementation
1252
- },
1253
- };
1254
-
1255
- const result = await Bun.build({
1256
- entrypoints: ["./src/cli.ts"],
1257
- compile: {
1258
- target: "bun-linux-x64",
1259
- outfile: "./dist/mycli",
1260
- execArgv: ["--smol"],
1261
- autoloadDotenv: false,
1262
- autoloadBunfig: false,
1263
- },
1264
- minify: true,
1265
- sourcemap: "linked",
1266
- bytecode: true,
1267
- define: {
1268
- "process.env.NODE_ENV": JSON.stringify("production"),
1269
- VERSION: JSON.stringify("1.0.0"),
1270
- },
1271
- plugins: [myPlugin],
1272
- });
1273
-
1274
- if (result.success) {
1275
- console.log("Build successful:", result.outputs[0].path);
1276
- }
1277
- ```