Compare commits

...

11 Commits

Author SHA1 Message Date
Colin McDonnell
7efd3a50ae Move rfc 2023-04-03 17:08:48 -07:00
Colin McDonnell
ed3cbe835d disabled -> disable 2023-04-03 17:07:24 -07:00
Colin McDonnell
05a87021dd Autoinstall 2023-04-03 17:07:24 -07:00
Colin McDonnell
bc939e27de telemetry 2023-04-03 17:07:24 -07:00
Colin McDonnell
c04a66813c Autoinstall 2023-04-03 17:07:24 -07:00
Colin McDonnell
56e7e861fb Tweak 2023-04-03 17:07:24 -07:00
Colin McDonnell
6cf36d3e33 Formatting 2023-04-03 17:07:24 -07:00
Colin McDonnell
87eed04f59 Updates 2023-04-03 17:07:24 -07:00
Colin McDonnell
0230f2e057 Fix table 2023-04-03 17:07:24 -07:00
Colin McDonnell
5fd2f56d66 Typo 2023-04-03 17:07:24 -07:00
Colin McDonnell
798eeec15e Propose changes to Bunfig 2023-04-03 17:07:24 -07:00
4 changed files with 168 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
# RFCs
| Number | Name | Issue |
| ------ | ---- | ----- |
| Number | Name | Issue |
| ------ | --------------- | -------------------------------- |
| 1 | Bunfig overhaul | (Proposal)[./bunfig-overhaul.md] |

View File

@@ -0,0 +1,163 @@
# Bunfig overhaul
## Booleans
- Only `true` and `"true"` should be considered truthy.
- Default value should always be `false`
## Diff
```diff
# top-level
logLevel = "debug"
# would be nice
+ extends = "base.bunfig.toml"
# import mapping
+ paths = { "react" = "macro:bun-macro-relay" }
# list of files to run before running a file
# for initializing plugins
# can be extended later with other lifecycle hooks
+ preload = [ "plugins.ts" ]
# also: deprecate DISABLE_BUN_ANALYTICS
# or at least rename to BUN_TELEMETRY_DISABLE
+ [telemetry]
+ disable = false
[debug]
editor = "code"
# deprecate old top-level `bun dev` stuff
- framework = "next"
- publicDir = "public"
- external = ["jquery"]
- origin = "http://localhost:3000"
- jsx = "react" # react, solid, react-jsx, react-jsxDEV
- jsxImportSource
- jsxFragment
- jsxFactory
# redundant with $PORT
# also it's weird that this corresponds to a Bun.js API instead of a CLI command
- [serve]
- port = 3000
[dev]
port = 5000
+ logLevel = "debug" # overrides top-level logLevel
# new `bun dev` stuff goes under here
# this should be done with import mapping
# specifying named import thing is weird
# especially since this doesn't work:
# import { graphql, somethingElse } from "react-relay"
- [macros]
- react-relay = { "graphql" = "bun-macro-relay" }
# deprecate `bun bun` stuff
- [bundle]
- saveTo = "node_modules.bun"
- outDir = "."
- entryPoints = ["./app/index.ts"]
- [bundle.packages]
- "@bigapp/design-system" = true
[define]
- "process.env.bagel" = "'lox'"
"bagel" = "lox" # only support strings
# this should be implemented with plugins
# and `preload`
- [loaders]
- ".bagel" = "js"
[test]
- root = "test/bun.js" # too limited
+ matchers = [ "**/*[.|_][spec|test].{js|jsx|ts|tsx}" ]
+ logLevel = "debug" # overrides top-level logLevel
[install]
+ logLevel = "debug" # overrides top-level logLevel
registry = "https://registry.yarnpkg.com/"
registry = "https://username:password@registry.yarnpkg.com/"
# deprecate object form
# there should be one right way to do things ideally
- registry = { url = "https://registry.yarnpkg.com/", token = "123456", username = "myusername", password = "mypassword" }
production = "$NODE_ENV"
dryRun = true
optional = true
dev = true
peer = false
- globalDir = "~/.bun/install/global"
- globalBinDir = "~/.bun/bin"
+ [global]
+ dir = "~/.bun/install/global"
+ bin = "~/.bun/bin"
# add separate section for autoinstall
- auto = true # true, false, force, fallback, disable
- prefer = "online" # online, offline, latest
+ [autoinstall]
+ disable = false
+ prefer = "online" # online, offline, latest
+ ttl = 86400
# deprecate, object form only (see below)
- cache = true
[install.cache]
dir = "~/.bun/install/cache"
- disable = false
+ mode = "global" # global = use global cache, local = use node_modules/.cache
- disableManifest = false # these are basically the same
+ ttl = 300 # 0 = always check latest
[install.lockfile]
- save = true # bad name
+ disable = false # defaults should always be false
- savePath = "bun.lockb"
+ path = "bun.lockb"
- print = "yarn" # terrible
+ external = [{
+ type: "yarn",
+ path: "yarn.lock",
+ version: 1 # eventually
+ }]
[install.scopes]
"@mybigcompany" = "https://registry.mybigcompany.com"
# always require at sign
# there should be one right way to do things
- "mybigcompany" = "https://registry.mybigcompany.com"
"@mybigcompany5" = "https://username:password@registry.yarnpkg.com/"
"@mybigcompany5" = "https://:$npm_token@registry.yarnpkg.com/"
# drop object form
# there should be one right way to do things
- "@mybigcompany" = { token = "123456", url = "https://registry.mybigcompany.com" }
- "mybigcompany" = { token = "123456", url = "https://registry.mybigcompany.com" }
- "@mybigcompany2" = { token = "$npm_config_token" }
- "@mybigcompany4" = { username = "myusername", password = "$npm_config_password", url = "https://registry.yarnpkg.com/" }
```