aboutsummaryrefslogtreecommitdiff
path: root/src/cli (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-26docs: add troubleshooting section to installation page (#3389)Gravatar Peter Weinberg 1-1/+1
* docs: add troubleshooting section to installation page * Add note for unzip * Update msg in install.sh --------- Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-06-25Support reading embedded files in compiled executables (#3405)Gravatar Jarred Sumner 1-0/+1
* Support reading embedded files in compiled executables * :nail_care: --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-22`expect().resolves` and `expect().rejects` (#3318)Gravatar Ashcon Partovi 1-1/+1
* Move expect and snapshots to their own files * expect().resolves and expect().rejects * Fix promise being added to unhandled rejection list * Handle timeouts in expect(<promise>) * wip merge * Fix merge issue --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 9-37/+38
* 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-13`mock` type changes (#3305)Gravatar Colin McDonnell 1-7/+1
* Update mock types and set bun-types@latest in bun init * Remove mockfn methods from toplevel mock * Remove comments
2023-06-13workaround quote escape issues for `bun run` (#3290)Gravatar Alex Lam S.L 1-0/+18
fixes #53
2023-06-11add --save argument to install (#3277)Gravatar Keyhan Vakil 1-3/+3
2023-05-31Small improvements to `bun test` (#3071)Gravatar Ashcon Partovi 1-20/+58
* Change status icon for skipped tests from "-" to "»" * Show file path instead of filename in `bun test` * Emit collapsable logs when running `bun test` in Github Actions https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines * Add fallback for test icons when emojis are not available * Only check for GITHUB_ACTIONS when running `bun test` * Emit error annotations when running `bun test` in Github Actions https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message * Remove ANSI output from Github annotation, it doesn't work * Remove outdated code from internal test runner * Add GithubActionFormatter to handle cases where error name or message is already ANSI * Fix formatting of test * Fix #3070 * Implement `bun test --run-todo` By default, `test.todo()` is no longer run, unless `--run-todo` is specified. * Fix test that relies on test.todo() being run * Support vitest-style test options * Disable GITHUB_ACTION in test harness * Add types for TestOptions * Fix bug where test.skip() actually ran * Implement `test.skipIf()` and `describe.skipIf()` * Implement `test.runIf()` * Move DiffFormatter to its own file * Fix bug where Bun.inspect() would emit a Github annotation * Introduce `bun test --only`, rename `--run-todo` to `--todo` * Implement `test.if()`, `describe.if()`, and other test fixes * Remove unwanted files from last commit * Fix last reference to --run-todo * Fix memory issues with printing github actions text * Update bindings.zig * Fix bug with `test.only()` * Remove debug test * Make the github annotations better * Improve .vscode/launch.json * Implement `expect().toBeNil()` * Remove .only() from test * Implement toBeBoolean(), toBeTrue(), toBeFalse() * Add lots of matchers * toBeNil() * toBeBoolean() * toBeTrue() * toBeFalse() * toBeNumber() * toBeInteger() * toBeFinite() * toBePositive() * toBeNegative() * toBeWithin() * toBeSymbol() * toBeFunction() * toBeDate() * toBeString() * toInclude() * toStartWith() * toEndWith() * Fix #3135 * Reduce verbosity of test * Fix snapshot bug --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-31`--no-macros` flag, disable macros in node_modulesGravatar Jarred Sumner 1-2/+8
2023-05-27Implement process.env.npm_lifecycle_event (#3097)Gravatar Tiramify (A.K. Daniel) 1-0/+1
* Update run_command.zig * Update env.test.ts * Add files via upload * Update run-process-env.test.ts * Update env.test.ts * Update harness.ts
2023-05-26Fix crash in test.todo + remove JSC C API usages in bun:test (#3079)Gravatar Jarred Sumner 1-1/+1
* Fix crash in test.todo * remove usages of JSC C API in bun:test * Remove additional JSC-C API usages * fix `make headers` * URLSearchParams.length * FormData length * URLSearchParams length * Fix `make headers` * very fancy length * Fix bug with exceptions being ignored sometimes * Add tests for extension toHaveLength --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-25jsx runtime from env (#3076)Gravatar Dylan Conway 1-0/+3
* use `NODE_ENV` for jsx mode * check env after `configureRouter` * get `NODE_ENV` from `options.production`
2023-05-24Load `.env.test`, set NODE_ENV=test in `bun test`, load ↵Gravatar Jarred Sumner 2-3/+5
`.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-05-23Implement `bun test --timeout` (#3040)Gravatar Ashcon Partovi 1-0/+1
You can change the default per-test timeout in `bun test`: > bun test --timeout 10 The default timeout is 5000.
2023-05-23fix bun init and update node vm docs (#3014)Gravatar dave caruso 1-3/+2
2023-05-23[bun:test] Don't schedule the GC aggressively on every fileGravatar Jarred Sumner 1-1/+10
We already run the GC automatically whenever heap size grows, so this is mostly unnecessary In one benchmark, this is an 83% performance improvement at a cost of 9% more memory
2023-05-23Support setting a timezone with `process.env.TZ` and `Bun.env.TZ` (#3018)Gravatar Jarred Sumner 1-0/+13
* Support setting a timezone via `process.env.TZ` * Implement `setTimeZone` in `bun:jsc` module * [breaking] `bun:test` now defaults to `Etc/UTC` timezone --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-20[bun:test] `preload` now supports `beforeAll`, `beforeEach`, `afterAll`, ↵Gravatar Jarred Sumner 1-2/+11
`afterEach` hooks Towards #198
2023-05-20Implement `test.todo` (#2961)Gravatar Degreat 1-5/+44
* Implement `test.todo` * remove skip condition * Allow callbacks in .todo * Add descriptive comment * Log todos * Include tests in title * edit test.todo tests --------- Co-authored-by: dave caruso <me@paperdave.net>
2023-05-17do not fail bundles on warnings (#2920)Gravatar dave caruso 1-1/+1
2023-05-16fix asset naming output paths (#2904)Gravatar Dylan Conway 1-10/+13
* rename to `src_path` and `dest_path`, use `dest_path` for output * format * option for compile
2023-05-15[bun build] Automatically set target to `bun` when a hashbang is providedGravatar Jarred Sumner 1-0/+1
2023-05-15More error message cleanupGravatar Jarred Sumner 1-74/+121
2023-05-15Make `bun build --compile` a little more resilient, output better errors, ↵Gravatar Jarred Sumner 1-5/+11
and clean up files
2023-05-14Single-file standalone Bun executables (#2879)Gravatar Jarred Sumner 1-10/+187
* Add LIEF * Compile LIEF * Implement support for embedding files on macOS * proof of concept * Add zstd * Implement runtime support * Move some code around * Update .gitmodules * Upgrade zig https://github.com/ziglang/zig/pull/15278 * leftover * leftover * delete dead code * Fix extname * Revert "Upgrade zig" This reverts commit dd968f30bffb6c06e34302645a3a4468c957fb4e. * Revert "leftover" This reverts commit 7664de7686276cfba431103847d35b9270433dee. * Revert "leftover" This reverts commit 498005be06a8a1747d48824310e5a020b1f90d97. * various fixes * it works! * leftover * Make `zig build` a little faster * give up on code signing support * Support Linux & macOS * Finish removing LIEF * few more * Add zstd to list of deps * make it pretty --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-12`root` bundle option (#2859)Gravatar Dylan Conway 1-2/+29
* handle multiple output files and `[dir]` * get the realpath of `root_dir` * duplicate output paths * add `rootdir` to `JSBundler` * use realpath of input file * add tests for naming and root --------- Co-authored-by: Dave Caruso <me@paperdave.net>
2023-05-12[bundler] Fix --transpile --outfileGravatar Jarred Sumner 1-2/+8
2023-05-11bundler tests and improve `Bun.build` return type (#2833)Gravatar dave caruso 1-1/+1
* importstar_ts * tests * run acorn test suite * bench tweaks * test * bun.build tests very incomplete * remove dataurl and base64 loaders from tests since they dont work yet * tests * stuff * stuff * add errors and array of blobs * work so far * docs * requested changes * fix overwrite docs * remove this file
2023-05-11[bun test] Add timings to successful testsGravatar Jarred Sumner 1-7/+16
2023-05-10feat(fetch) add redirect: 'error' support (#2845)Gravatar Ciro Spaciari 2-6/+6
* add redirect: 'error' support * fix typo * fix typo * refactor FetchRedirect enum * fix FetchRedirect * updated
2023-05-10Implement `BuildArtifact`Gravatar Jarred Sumner 1-10/+10
2023-05-09`bun build --transform` should not run the module resolverGravatar Jarred Sumner 1-1/+4
2023-05-09Fix regression with `bun test` not recursively scanning the directory treeGravatar Jarred Sumner 1-2/+16
2023-05-08Fix bug in Bun.build() where it wouldn't pick up changes to directories on ↵Gravatar Jarred Sumner 2-5/+7
rebuilds (#2824) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-30Implement source maps (#2770)Gravatar Dylan Conway 1-8/+26
* wip * Begin computing source map tables * source map progress * external source maps * fix merge * remove `@as` coercion * inline source maps and output source map shifts * fix `codeWithSourceMapShifts()` after merge * remove second call to `findReachableFiles()` * use `worker.allocator`, remove comment * don't reuse memory for source and sourceContents * don't reuse `quote_buf` * fix writing to stdout * Add comment * Don't include a sourcemap if the text was empty * Make the parser faster * +16% faster sourcemap generation @dylan-conway I'll need you to look this over to make sure I didn't mess anything up Though it currently doesn't generate the offsets in the right order... * 30% performance improvement to Bun.build() * Print `debugId` in source maps cc @mitsuhiko @notzeeg --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-29Clean up args parsing with `--loader`Gravatar Jarred Sumner 1-2/+22
2023-04-28bundler tests: rest of default.test.ts and starting jsx tests (#2765)Gravatar dave caruso 1-2/+6
2023-04-27Implement `outdir` in `Bun.build`Gravatar Jarred Sumner 1-0/+8
2023-04-24In `bun run`, rewrite usages of `npx` to `bun x` instead of `bunx` to ↵Gravatar Jarred Sumner 1-1/+1
workaround missing symlink
2023-04-22Make `Bun.build` more reliable (#2718)Gravatar Jarred Sumner 4-6/+6
* One possible implementation to make `Bun.build` work better * Pass allocator in * Make our temporary buffers a little safer * rename * Fix memory corruption in symbol table * Add support for deferred idle events in ThreadPool * Free more memory * Use a global allocator FS cache * more `inline` * Make duping keys optional in StringMap * Close file handles more often * Update router.zig * wip possibly delete this commit * Fix memory issues and reduce memory usage * > 0.8 * Switch to AsyncIO.Waker and fix memory leak in JSBundleCompletionTask * We don't need to clone this actually * Fix error * Format * Fixup * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-21Add `tsconfig.json` to `bun-types` (#2587)Gravatar Colin McDonnell 2-2/+26
* Add tsconfig.json to bun-types. Document 'extends' pattern. * Updates * Update bun init to use extends:bun-types * Update type:module recommendation * Add note about transpilation. Closes #2553 * Make typescript a peer dep * Revert changes to docs * Revert tsconfig extends * Update readme * FMC * Undo changed
2023-04-20Symbol minification (#2695)Gravatar Dylan Conway 1-2/+7
* 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 13-33/+33
2023-04-18Prepare for JavaScript Bundler APIGravatar Jarred Sumner 1-3/+1
2023-04-17`bun build` should write to stdout instead of stderrGravatar Jarred Sumner 1-1/+1
@paperdave this probably breaks all your tests
2023-04-16fix: replace unknown link with bun docs (#2669)Gravatar Jozef Steinhübl 1-1/+1
2023-04-15Mostly implement cross-module constant inlining, but disable itGravatar Jarred Sumner 1-0/+5
There are some test failures
2023-04-15Fix failing to log error with `--transform`Gravatar Jarred Sumner 1-2/+11
2023-04-14Implement `--transform` CLI flagGravatar Jarred Sumner 1-40/+34
2023-04-09Remove usages of `void{}` in favor of `{}`Gravatar Jarred Sumner 1-10/+10
See https://github.com/ziglang/zig/issues/15213