aboutsummaryrefslogtreecommitdiff
path: root/src/env_loader.zig (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-22revamp dotEnv parser (#3347)Gravatar Alex Lam S.L 1-420/+247
- fixes `strings.indexOfAny()` - fixes OOB array access fixes #411 fixes #2823 fixes #3042
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 1-18/+18
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20Fix crash with .env files that are exactly 159 bytes long (#3369)Gravatar Jarred Sumner 1-6/+9
* Fix crash with .env files that are exactly 158 bytes and a newline character * Update env_loader.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24Load `.env.test`, set NODE_ENV=test in `bun test`, load ↵Gravatar Jarred Sumner 1-19/+87
`.env.{test,production,development}.local` (#3037) * Support `.env.test` & `.env.{test,production,development}.local` * Fix bug preventing inlining of process.env.NODE_ENV by default * Update env_loader.zig * add env tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net>
2023-04-20Symbol minification (#2695)Gravatar Dylan Conway 1-7/+1
* minify * Update renamer.zig * --minify-whitespace * Speed up minification a little * handle private names * 5% faster minification * use helper function * fix nested scope slots * `bun build --minify` gets another +8% faster * print semicolons afterwards * print semicolon after checking error * after all error checking * Delete code for generating legacy bundes * remove extra whitespace around if statements * print space before import identifier * Use `@constCast` * Make `S.Local#decls` use `BabyList(Decl)` * Add `fromSlice` helper to `BabyList` * Remove unnecessary optional chains * minify `undefined, true, false` * Another @constCast * Implement merge adjacent local var * Support --minify in `bun build --transform` * skip comments when counting character frequencies * Don't wrap commonjs with --transform on (unless targeting bun) * Support --minify in the runtime * Fix edgecase with import * as * don't infinite loop * --trnasform shouldn't mess with require * Only track comments when minifying --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-19Fix broken autocompleteGravatar Jarred Sumner 1-2/+2
2023-03-19Several bug fixes (#2427)Gravatar Jarred Sumner 1-1/+1
* Fix test * Fix segfault when unexpected type is passed in `expect().toThrow` * Fix issues with request constructor * Don't bother cloning headers when its empty * woops * more tests * fix incorrect test * Make the fetch error messages better * Update response.zig * Fix test that failed on macOS * Fix test * Remove extra hash table lookups * Support running dummy registry directly cc @alexlamsl * Update test * Update test * fixup * Workaround crash in test runner * Fixup test * Fixup test * Update os.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-02-24prefer `bun.copy()` over `std.mem.copy()` (#2152)Gravatar Alex Lam S.L 1-2/+2
2023-02-23Upgrade Zig (#2151)Gravatar Dylan Conway 1-6/+6
* fixup * Upgrade Zig * Remove bad assertion * strings * bump * mode -> optimize * optimize * Linux build * Update bindgen.zig
2023-02-19Fixes #2108Gravatar Jarred Sumner 1-0/+5
2023-01-18micro-optimize loading process environment variablesGravatar Jarred Sumner 1-1/+3
2023-01-17feat(cli): Support `HTTPS_PROXY`, `HTTP_PROXY`, and `NO_PROXY` #1440 (#1814)Gravatar Ciro Spaciari 1-0/+41
* WIP: http_proxy implemented, first steps for https_proxy #1440 * add HTTP_PROXY support to upgrade_command and WIP: tunneling * WIP async handshake, stuck on WANT_READ, try to defer + check * create and upgrade with proxy working, TLS and non-TLS to proxy TLS working * bun install/upgrade/create working with http(s)_proxy #1440 * add NO_PROXY support #1440 * remove commented code and add TODO * fix getHttpProxy no_proxy * fix formatting * refactor catch and getHttpProxy, fix empty strngs in env for proxy * allow optimization for handleResponseBody
2023-01-13move more thingsGravatar Jarred SUmner 1-1/+1
2022-12-28Upgrade to latest Zig (#1610)Gravatar Jarred Sumner 1-6/+6
* @min and @max * builtins and some trivial ones * Most of them * more * more! * More Progress * wip * Update tagged_pointer.zig * Update http_client_async.zig * Most of the iterable dir changes * alright * Remove usages of deprecated formatters * :camera: * fmt * Update shimmer.zig * wip * wip * wip * progress * more * Latest * stuck on error * latest * workaround stage2 * wip * Update string_immutable.zig * wip * Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings * Fix build errors * Fixup most of the test failures * Fix `make headers` * Fix "outside package path" error * Fixup aligned alloc * Add missing file * linux * More linux fixes * use latest peechy * Fix transpiler test failure * Forgot about these * Fixup test failure * Update node-timers.test.ts * [node:htt] Fix `undefined is not an object` error Fixes https://github.com/oven-sh/bun/issues/1618 * Update http.exports.js * Make this test less flaky * fix hashes * Fix hex formatting and zls issues * Download zig version * Update Dockerfile * Update Dockerfile * Update uws * Update Dockerfile * Set llvm version * Update README.md * Update uws * Update Dockerfile * Update io_linux.zig * Update bun.zig * Log output * workaround strange @cInclude error * Make ffi tests better * Don't use cImport * Update c.zig * Update c-bindings.cpp * call setOutputDir * Update Dockerfile * Use a longer name * latest * Update serve.test.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-12-15[bun run] Introduce `--bun` flag to run in bun instead of nodeGravatar Jarred Sumner 1-5/+9
2022-12-04[internal] Make string comparisons fasterGravatar Jarred Sumner 1-2/+2
2022-12-04Mildly faster startup timeGravatar Jarred Sumner 1-1/+1
2022-11-29import everything from "bun" where possibleGravatar Jarred Sumner 1-2/+2
2022-11-07castGravatar Jarred Sumner 1-1/+1
2022-11-07Remove improper coercion of environment variables (#1256)Gravatar Niles Salter 1-156/+1
2022-09-25wipGravatar Jarred Sumner 1-0/+20
2022-09-20Allow .env files to define the same key multiple timesGravatar Jarred Sumner 1-32/+55
Fixes https://github.com/oven-sh/bun/issues/1262
2022-09-17extremely minor perf nitbun-v0.1.12Gravatar Jarred Sumner 1-1/+1
2022-09-17feat: env loader nested values with curly braces (#1246)Gravatar Kit PANG 1-1/+46
* [env loader] Add support for nested value with curly braces does not support default values for nested values, e.g., ${undefined:default}, ${undefined:-default}, or ${undefined-default} * fix: minor fix and add more test * [env loader] Improve nested value parsing performance remove unnecessary branching Co-authored-by: Like <like@ekil.sh>
2022-08-21[env loader] Don't panic when .env fails to load for unexpected reasonsGravatar Jarred Sumner 1-0/+9
2022-07-17[bun install] Forgot to commit `isCI` functionGravatar Jarred Sumner 1-0/+7
2022-07-13fix(env_loader): Off by one error (#668)Gravatar Finn R. Gärtner 1-1/+1
2022-07-12fix(env_loader): Ignore spaces before equals sign (#602)Gravatar Finn R. Gärtner 1-0/+9
* fix(env_loader): Ignore spaces before equals sign * fix(env_loader): Change the type of key_end to usize
2022-07-10Update GitHub URL to match new repo URL (#547)Gravatar Aurora Luna Takemi 1-1/+1
* Update repo URLs * GitHub URL update * Revert accidental URL changes
2022-07-09fix: update build files to latest Zig versionGravatar sno2 1-6/+6
2022-05-05E.String gets a RopeGravatar Jarred Sumner 1-6/+6
2022-03-08rename _global -> bunGravatar Jarred Sumner 1-11/+11
2022-03-04upgrade zigjarred/upgrade-zig-2Gravatar Jarred Sumner 1-1/+1
2022-03-02[bun run] Set more environment variablesGravatar Jarred Sumner 1-0/+24
2022-02-18Simple dead code eliminationGravatar Jarred Sumner 1-3/+151
2022-02-11[bun install] Implement bunfig.toml configGravatar Jarred Sumner 1-0/+15
2021-12-30Upgrade to latest Zig, remove dependency on patched version of Zig (#96)Gravatar Jarred Sumner 1-16/+19
* Prepare to upgrade zig * zig fmt * AllocGate * Update data_url.zig * wip * few files * just headers now? * I think everything works? * Update mimalloc * Update hash_map.zig * Perf improvements to compensate for Allocgate * Bump * :camera: * Update bun.lockb * Less branching * [js parser] Slightly reduce memory usage * Update js_parser.zig * WIP remove unused * [JS parser] WIP support for `with` keyword * Remove more dead code * Fix all the build errors! * cleanup * Move `network_thread` up * Bump peechy * Update README.md
2021-10-29Pass through environment variables from the process verbatimGravatar Jarred Sumner 1-12/+26
Fixes https://github.com/Jarred-Sumner/bun/issues/40
2021-10-26SpacingGravatar Jarred Sumner 1-2/+3
2021-10-26[.env loader] Fix bug with PATH values sometimes getting cut off at the end ↵Gravatar Jarred Sumner 1-9/+17
by one character
2021-10-26New subcommand: `bun run` run scripts in package.json really fastGravatar Jarred Sumner 1-1/+20
2021-10-25[.env loader] Add CLI flag to dump loaded environment variables as JSONGravatar Jarred Sumner 1-1/+1
2021-10-24[.env loader] Environment variables are strings.Gravatar Jarred Sumner 1-49/+37
2021-10-24[.env loader] Tests passGravatar Jarred Sumner 1-25/+50
2021-10-23[`.env` loader] Parse values as JavaScript string literals instead of JSONGravatar Jarred Sumner 1-52/+170
2021-10-18Starting to rewrite the router to fix some bugs and support catch-all + ↵Gravatar Jarred Sumner 1-1/+1
optional routes
2021-10-05analytics is good enough for nowGravatar Jarred Sumner 1-0/+11
2021-10-05Add `BUN_DISABLE_ANALYTICS` flag to disable analytics and automatically ↵Gravatar Jarred Sumner 1-0/+2
disable analytics when running inside `hyperfine`
2021-09-05more mutexesGravatar Jarred Sumner 1-0/+6
Former-commit-id: 52966012b4b74d24ab28a0c75740aef35fb75327
2021-08-23Use mimalloc for a 10% boostGravatar Jarred Sumner 1-13/+13
Former-commit-id: 044e11d720bc6742dc53b30b4e88e8be7e76c419