* bring in shell impl
* add `$` to global bun scope
* Expose shell parse func on debug mode
* Expose lex tokens and add tests
* refactor parser to have better ast
* assigns and export
* pipeline kinda working
* Decouple Subprocess spawning code from JS stuff
* Subprocess works!
* Conditional execution
* Support JS objects in template expression
* More complete redirection
* Properly drain stdin/stdout/stderr and fix crash from deallocating JSC memory
* Return errors in parser
* Support command substitution
* wip brace expansion stuff
* Rearrange some files
* expansion wip
* Brace expansion working
* wip brace expansion
* refactor brace algorithm
* wip brace expansion on shell
* fix brace expansion
* Working nested brace expansion!
* brace expansion in shell variable assignment only set the last expanded
* stuff
* Small little perf things
* benchmark and test and stuff
* stuff
* fix nested braces but its also kinda broken
* attempt to fix complicated nested braces
* test
* Use fast tokenized algorithm for non nested braces, use parsed algorithm for nested braces
* fix nested braces one and for all
* small stuff
* Not sure if that made a difference
* revert that
* good speed optimization
* rip
* Environment variables, builtin/native shell cmds
* Fix tests
* Support `cd`, `pwd`, add boilerplate for glob expansion
* Support `which`
* Support `rm`
* wip
* wip
* escaping and abstract shell char iterator
* strpool unicode
* Brace expansion support unicode, disallow invalid surrogates in shell script
* shell choose ascii or unicode lexer depending on input
* fix bugs write tests
* kinda start async stuff
* HOLY SHIT big refactor of Subprocess
woops forget to commit this
...and this
* HOLY MOLY it works
* Refactor some stuff, start eval word expansion
* interpret all the nodes
* stuff
* stuff
* stuff
* kind of works but doesnt
* Buffered output works
* no need to heap allocate autosizer
* Fix bug
* Fix some stuff
* unprotect
* move out dummy shell thing
* Bring back assignments
* create expansion state so it can be non blocking for expansions that need IO (glob, cmd subst)
* glob back in action
* Setup builtin non blocking IO commands and implement export
big issue is control flow is really fcked up here need to fix that
* make Cmd state machine use a loop so control flow is a bit more clear
* rename stuff
* move that
* Implement the echo builtin again
* implement cd again but non blocking io
* Fix ls and use proper write function to prevent blockign writes
* Implement which
* holy moly big port std.fs.deleteTree
* fix compile errors
* Okay that works
* rm works thatsnice
* damn
* split it out
* rm async implementation
* fix rm bug for nested
* Work on files as well
* prevent root from being deleted
* rm error handling
* oops
* pwd and fix some script exec bug
* Implement `mv`
* stub out mv to work accross filesystems
* move it around
* woops
* boilerplate for ls and options
* more boilerplate
* stuff
* that got lost in merge
* upgrade shell stuff zig 0.12.0-dev.1828+225fe6ddb
* Implement basic ls
* smol cleanup
* Fix stream, response redirect stdin
* No longer need spawn to be abstract
* Custom promise
* move around some stuff
* shell promise returns shell output
* make tht work for builtins
* refactor IO abstractions to work with JS or mini event loop
* woops
* scaffolding for refactor
* refactor builtins to make event loop refactor easier
* Fix parsing edge case on assignments, fix expansion on cmd assignments
* change subproc to work with any event loop
* Finish refactoring subproc
* move global abstraction out
* big refactor boys
* holy moly: integrate into cli and fix allll the compile errors
* okay works in bun run now
* actually tick the event loop lol
* Fix more stuff
* Support comments
* Fix some tests
* delete that
* Properly report errors when failing to spawn command
* fix a whole bunch of tests
* fix a whole bunch of tests again
* .
* Fix rm
* Fix some exit code bugs, write force rm from deno, fix ls stderr
* fix `rm -d`
* fix `rm -d`
* Fix boolean logic
* error on subshells (e.g. `true && (echo hi && echo lol)`)
* Move out shell state from interpreter struct
* Cmd substitution supports arbitrary script, not just a single cmd
* Some escaping/quotation tests
* Fix stuff add more tests:
- cmd substitution quotations
- escape backticks in single quots
* ALOT of stuff:
- fix proper subshell inheritance of env for cmd subst
- fix: was wrong, assignments don't run in subshell in conditionals
- fix lexing chained vars `$VAR$VAR`
- more tests
* Fix subtle bugs
* Fix crazy redirect to arraybuffer bug
* more crazy echo edgecases
* Proper lexer errors instead of just panicking lol
* yoops
* Proper parsing errors
* Errors for bun run shell script
* Fix redirecting to file
* More test fix bugs yay
* Fix redirect on builtins
* Open redirection fds with O_TRUNC
* Fix lexing invalid variables and add ability to change cwd from JS api
* yoops
* Fix `.cwd()`
* `$PWD` and fix redirection bugs
* `$PWD` and fix redirection bugs
* Get rid of some `FIXME`s
* throw errors in some places instead of panicking
* Print some errors to stderr
* Get rid of some more panics again
* Handle errors on glob
* pwd test
* `.env()`
* copy-on-write abstraction
* Reference counted env strings + fix some tests
* deinit cwd
* Put commands into a pipeline properly
* deinit Expansion and Assigns properly
* comments
* Comments
* Make it compile
* Update types
* [autofix.ci] apply automated fixes
* Only one WaiterThread
* Fix lifetimes and clean up interface
* Update shell.ts
* Add lazy test
* Remove some dead code
* Update shell.zig
* Fix memory leak
* Fix crash with empty braces
* [autofix.ci] apply automated fixes
* Linux build + bun.sh
* Update subproc.zig
* Update interpreter.zig
* Update interpreter.zig
* Fix some stuff that broke
* Fix Windows compile errors
* Fix some fd leaks
* Fix ls
* Fix a bunch of stuff
* Fix quiet
* Update leak tests fix rm bug
* More reproducible tests
* [autofix.ci] apply automated fixes
* more mem leak tests
* [autofix.ci] apply automated fixes
* Fix merge conflict
* Fix test not actually using temp directory
* Update bunshell.test.ts
* Shell instance
* Capture async context
* Increase test timeouts
* [autofix.ci] apply automated fixes
* Escape
* [autofix.ci] apply automated fixes
* Fix crash
* Add more methods
* [autofix.ci] apply automated fixes
* Fix leak
* Treat file(path) blobs as a file path string
* Create bunshell-file.test.ts
* Support Blob input
* Fix leak + organize imports
* doc
* Update shell.md
* Update shell.md
* Update shell.md
* Update shell.md
* Update CMakeLists.txt
* Fix segfault by cloning error path so it's not freed by arena
* deinit ShellErr
* Delete dead code
* fix really stupid segfault
* don't deinit shell ls task in event loop
* Fix ls bug
* Fix tests
* make truly lazy
* allow more things in the shell substitution and escape whitespace
* Fix newline and exit when finishing shell in `bun run`
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(win/upgrade): do not show powershell expand-archive info while upgrading
* start working bun run
* experiment: `bun.new`
* you can now bun run
* Update src/install/install.zig
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
* Update src/install/install.zig
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
* stuff
* fix stuff
* fix this
* farther but not really
* sadfs
* path hell
not sure how much worse or better this makes things. its a mess. windows path handlign is a mess aaaaaaaaaaaaaaaa
* path.resolve bs
* remove old build system stuff from pr
* a
* fix some path.parse/join cases
* path closer not perfect
* normalize and join tests tests done
* paths
* implement path.relative
* ,
* stuff
* assert
* fix compile
* hate
* the code isnt great
* stuff
* housekeeping for build system
* blah
* explain windows sitaution in docs
* some progress? not much though
* zig compiler crashes here
* fix
* yippee
* ok
* a
* ala wala
* fix builds on stuff
* clean
* the tests now run
* a
* aa
* dedupe uv event loop
* fix fs test accuracy
* stuff
* [autofix.ci] apply automated fixes
* huge updat e
* [autofix.ci] apply automated fixes
* url
* [autofix.ci] apply automated fixes
* start windows spawnSync
* [autofix.ci] apply automated fixes
* add --webkit for update submodules
* add better err message for `bun setup`
* fix unix platform build
* .
* [autofix.ci] apply automated fixes
* un-upgrade libarchive
* z
* asdfghj
* wrk
* todo -> panic
* ok
* a
* [autofix.ci] apply automated fixes
* fix build scripts l ol
* dfghj
* fa
* [autofix.ci] apply automated fixes
* aaaa
* a
* l
* [autofix.ci] apply automated fixes
* more logs
* [autofix.ci] apply automated fixes
* j
* fix init_command
* CORE DUMP HELL
* i swear im being pranked by the github actions gods
* fadsjkfdshjkhjkdfsahjkdfshjksdafjkhhjkfdsahfsdkjhfsdjkahf
* thanks IAS
* this is the correct fix
* personal review
* ddisablbe these
* revisions!
* ok
* fix submodule
* stuff
* fix libarchive
* [autofix.ci] apply automated fixes
* stuff
* [autofix.ci] apply automated fixes
* a
* fix addressToJS on windows
* make dns async again
* dx: add flag to update submodules ps1 to clone webkit
* dns error case for libuv
* dx improvements on windows
* newline
* obvious fix
* install steps
* extra note
* fix fs test
* Update building-windows.md
* fix builtins bundler to support \r\n line endnigs
* better
* some windows stuff
* a
* a
* a
* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
* [autofix.ci] apply automated fixes
* bunfile text works
* fix build on the mac
* hellooooooooooo
* install steps
* ci for baseline?
* fix
* aaa
* wow
* install script revamp
* bug
* OK
* ok
* aaaaaaaaaaaaaa
* okay
* fix the node test runner lol
* fix napi stuff
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciai@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
* [install] allow parallel execution of `postinstall` scripts
- fixes spurious exit code 42 from `spawn()`
* postinstall to a pipe
* feat(install): include top 500 packages as defaults for postinstall
* windows newline handling*
*i did not test it
* stuff
* cool
* a
* fix merge
* set `has_trusted_dependencies`
* fix a bunch of tests
* fix merge
* remove `PackageManager`
* remove commented code
* change to function
* Update lockfile.zig
* run scripts if added to `trustedDependencies` after install
* packages without `resolved` properties
* node-gyp scripts
* node-gyp script in the root
* another test
* git deps run prepare scripts
* fix merge
* run lifecycle scripts during installation
* Update lockfile.zig
* always increment
* 🏗️
* update tests
* tickWIthoutIdle
* const uws
* loop forwards through trees
* single buffer bitset list
* tag.isGit
* windows path separators
* `bun.sys.read` and enable/disable buffering
* fix test and waiter thread
* waiter thread and tests
* Update bun-install-registry.test.ts
* workspace exclude `preprepare` and `postprepare`
* Create esbuild.test.ts
* make sure length is the same
* remove deferred binlinks, add estrella test
* test with another version
* address some comments
* remove .verdaccio-db.json
* ooops
* fix build
* use `pid` to wait
* dont register pid_poll when using waiter thread
* stress test
* free
* fix failing tests
* fix linux crash, snapshot stress test
* oops
* concurrent scripts
* activate as soon as possible
* test
* delete stress test packages
* remove unused packages
* comment stress test and maybe fix segfault
* delete snapshot
* fix assertion
* use cpu_count * 2 for default concurrent scripts
* gear emoji
* add --concurrent-scripts to docs
* more docs
---------
Co-authored-by: alexlamsl <alexlamsl@gmail.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Dylan Conway <33744874+MilesWright7@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
* Prepare for windows event loop
* More progress
* Update libuv.zig
* wip
* Make compiling each dependency a shell script
* Bump mimalloc
* Add the build scripts
* Update settings.json
* Fix a bunch of compiler warnings
* Remove more warnings
* more warnings
* cmake works
* Update JSSQLStatement.h
* put it in the zig file
* Fix usockets warnings
* Fixup
* Fix one of the compiler errors
* chunk
* draw the rest of the owl
* theres more
* Rename Process -> BunProcess
Works around a Windows issue
* Add musl polyfill for memmem on Windows
* More
* 12 mb
* Fix getenvZ
* fix variosu issues
* Add fast-ish path for bun install on Windows
* Update windows.zig
* Update windows.zig
* Fix build issue
* it works
* hmmm
* Rename file
* Fixups
* Update wtf-bindings.cpp
* Update src/bun.js/bindings/headers-handwritten.h
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
* further!
* more
* Update .gitignore
* hm
* quite a lot of fixes
* Update CMakeLists.txt
* zig fmt
* Many more things are starting to work.
* reb
* regenaret
* Update JSSink.h
* fixup
* fetch works
* Bun.serve() and much of the event loop works now
* Make require() work
* bun install progress
* more things work
* use less std.os
* Fixes
* small fixes
* Bump
* Bummp
* Undo that change
* We have to bump the version of Debian because libarchive has a higher minimum requirement
* ok
* some clenaup
* windows
* Update bun.zig
* fixup
* avoid duplicate symbols
* avoid undefined symbols
* bump
* Remove issue template for install
It's not used, and use the bug issue instead.
* Add types for cp and cpSync
* Add types for watchFile and unwatchFile
* Add bun-types to 'bun fmt' script
* Update nodejs compat docs cp/cpSync/watchFile/unwatchFile (#4525)
* feat(fetch) rejectUnauthorized and checkServerIdentity (#4514)
* enable root certs on fetch
* rebase
* fix lookup
* some fixes and improvements
* fmt
* more fixes
* more fixes
* check detached onHandshake
* fix promise case
* fix cert non-Native
* add fetch tls tests
* more one test
* churn
* Update feature_flags.zig
* Update response.zig
* Revert "avoid undefined symbols"
This reverts commit ca835b726f.
* Revert "avoid duplicate symbols"
This reverts commit 4ac6ca8700.
* Update feature_flags.zig
* Set permissions
* more
* Update mimalloc
* Fix sqlite test failures
* Fix some test failures
* Make sure we remove libusockets is removed
* hm
* [dave]: fix webcrypto crash
* bump
* Update index.ts
* windows zig compiles
* cmake on mac works
* progress
* yay
* bun run build
* fix
* ok
* oops
* asdfasfdafdsafda
* fghjkl
* git ignore
* wow
* Process -> BunProcess
* hmm
* blah
* finalize merge
* now it only has linker errors on mac
* sdfadsf
* g
* getting farther
* sxdcvbnmk,
* adfhjskfjdhkas
* a
* fgh
* update build dot zig
* asdfg
* theoretical -DCANARY flag we can use
* asdf
* cool
* okay
* colorterm
* New build workflow
* Fix script
* Use sudo
* More sudo
* Tweak dependencies
* Another sudo attempt
* Tweak script
* 16.0 -> 16
* Tweak script
* Tweak script
* Tweak script
* Tweak script
* Tweak script
* bun install
* ssh into github actions
* add more to ssh
* Fix postinstal
* Skip llvm
* New dockerfile
* Build
* More changes to Dockerfile
* chaos chaos chaos
* okay
* a
* more cmake nonsense
* add unified sources code (does not work)
* stuff
* prepare for CI builds
* ok
* yay
* yeah
* make this more stable simply by trying again if it fails, 5 times, then lose. it fixes the stability issue i was running into L O L
* messing with ci
* x
* a
* clean dependencies before build
* oops
* this is not going to work but its closer
* not gonna work either
* a
* a
* did i do it
* a
* a
* work around weird fs+Bun.build issues
* properly pass debug flag correctly
* idk im sorry
* lose
* maybe
* run the tests please
* a
* fix zlib script
* a
* hi
* prevent stupid ci issue
* i totally didnt leave in a syntax error on cmakelists
* a
* lol
* relax
* 😭
* a
* SO SILLY
* 😡 one line mistake
* one character diff
* fix linking symbols missing
* work on dependency scripts
* does this work now?
* fix mac build
* a
* bump!
* woops
* add macos baseline build
* .
* fix sqlite and also enable $assert/$debug support in builtin functions
* okay
* oops
* zig upgrade lol
* Merge
* Fix spawn test issue
* Set a timeout
* yeah
* etc
* mi
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Birk Skyum <74932975+birkskyum@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
* work so far
* stuff
* a
* basics work
* stuff
* yoo
* build lockfile
* correct
* f
* a
* install fixture havent tested
* i made it worse
* lol
* be more reasonable
* make the test easier to pass because bun install doesn't handle obscure lockfile edge cases :/
* a
* works now
* ok
* a
* a
* cool
* nah
* fix stuff
* l
* a
* idfk
* LAME
* prettier errors
* does this fix tests?
* Add more safety checks to Integrity
* Add another check
* More careful lifetime handling
* Fix linux debugger issue
* a
* tmp dir and snapshot test
---------
Co-authored-by: Jarred SUmner <jarred@jarredsumner.com>
* Fix#3497
* Fix#3497
* Run prettier
* Fix package.json
* remove this too
* yeah
* Fix missing tests
* Use native for utf-8-validate
* Add module ID names to builtins
* Defer evaluation of ESM & CJS modules until link time
* Use builtin name for exports in plugins
* Add module IDs to builtins
* Update JSC build with new flag
* WebKit upgrade fixes
* Update WebKit
* prettier
* Upgrade WebKit
* bump
* Update once again
* Add visitAdditionalChildren, remove .fill() usage
* Update process.test.js
* Update fs.test.ts
---------
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* stfdsafsd
sadffdsa
stuff
finish commonjs stuff
asdf
not done but work
not done but work
not done yet but this is how far i am
remove files
lol
update built files
uncomment everything in events lol
export default
stuff
* afdsafsd
* its not perfect but almost done
* okay
* cool
* remove temp file
* finish rebase
* revert settings.json
* a
* ch-ch-ch-ch-changes
* okay
* remove this check in release for now
* sxdcfghnjm,
* lkjhgf
* fmt
* filename can be null
* Update NodeModuleModule.h
* weee
* fmt
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Merge import.meta.require and require to be the same thing
* support `require` and BunPlugin (runtime plugin)
* plugins
* unused code
* revert launch.json
* 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>
* 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>
* 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
* alright now just gotta try running it
* fix a gajillion compiler errors
* even more code
* okay i fixed more errors
* wip
* Update launch.json
* Update string_builder.zig
* `fast_debug_build_mode` makes debug build 2x faster
* Update bundle_v2.zig
* more code!
* It bundles!
* Rename `Bun.Transpiler` to `Bun.Bundler`
* `import()` expressions almost work
* wip attempt to get import() expr to work
* Bundle namespace imports
* Attempt to fix the issue with import() unsuccessfully
* consider current working directory when resolving relative paths (#2313)
* consider current working directory when resolving relative paths
fixes#2298
* comment test
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* support `expect().toThrow(/pattern/)` (#2314)
- fix time-zone-dependent test failure
* fix missing `Blob` error messages on Linux (#2315)
* fix & clean up tests (#2318)
- skip flaky tests when running as `root`
- use `expect().toThrow()`
- clean up temporary files after tests
* feat(tty): add some `tty.WriteStream` methods to `process.{stdout, stderr}` (#2320)
* feat(stdio): add some `tty.WriteStream` methods
* chore(builtins): add process builtin gen'd code
* Fix docker install command
* `bun test` on macOS in GitHub Actions (#2322)
* Fixes#2323
* throw invalid parameter errors in `crypto.scryptSync` (#2331)
* throw invalid parameter errors
* remove comptime, add empty buffer function
* remove error_name comptime
* Add reference documentation for bun:test (#2327)
* Reorganize tests (#2332)
* Fix html-rewriter.test.js
* fix the wrong thing being incremented in hmr example (#2334)
* Add more test harness
* Improve Benchmarking page, small fixes (#2339)
* Improve benchmarking page
* WIP
* Add typescript instructions to hot
* Document preload in Plugins. Fix loader in plugin types.
* Fix typo
* Fix links
* run prettier
* Document openInEditor
* improve `Buffer` compatibility with Node.js (#2341)
* improve `Buffer` compatibility with Node.js
* use `memmove()`
allow `encoding` to be `undefined`
* run `bun test` after macOS builds (#2343)
* "binary" is an alias of "latin1"
Fixes https://github.com/oven-sh/bun/issues/2110
* More spec compliant `Blob.prototype.type` (#2340)
* Make `Blob.prototype. type` more spec compliant
* Add a few more checks for isNumber()
* Fix `make headers`
* Safer JSValue.isString()
* More tests for blob.slice
* Make `Blob.prototype.type` more spec compliant
* Add isASCII check
* Fix types
* Fix failing type test
* Update blob.zig
* Update blob.zig
* Fix .eql check on empty values
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Fix bug in test runner
* Support `import()` expressions
* Implement `require()`
* clean up bit_set.zig slightly
* Move some things around
* misc cleanup
* Cleanup some things
* Fix a lot of stuff
* Fix `module.exports.fn = fn;` in ESM entry point
* Fix crash due when printing file
* Fix issue with class names
* Fix issue with `export default identifier`
* Update js_parser.zig
* optimization: inline single-property object acceses and arrays
* Fix undefined memory in renamed symbols list
* Handle call target
* wip
* Inline it
* Fix undefined memory issue when reclaiming blocks in ast
* Halt linking on any parse errors
* alias
* Rename `enable_bundling` to `enable_legacy_bundling`
* Workaround anonymous struct literal zig bug
* Use slower approach (without bitset) because it doesn't break after 8 symbols
* Fix incorrectly-renaming statically defined symbols
* Handle more edgecases in our bit_set fork
* Reduce number of allocations for `define`
* Do not rename unbound symbols
* Clean up dot defines a little more
* Make the generated names prettier
* Workaround runtime symbol missing issue
* Fail the build on errors
* Support export * from
* Support `--outfile`
* partially fix renaming
* fanicer symbol renaming impl
* misc, extremely revertible cleanup
* Fix up some bugs with symbol renaming
* formatting
* Update launch.json
* Parse `__PURE__` comments
* clean up simd code for pure comments
* changes to merge
* workaround runtime issue
* Fix issue with `export * as` not propagating correctly
* Make all top-level declarations `var` when bundling
* Fix missing prefix
* Fix assigning to stack copy
* Fix missing runtime symbol
* Fix bug with namespace exports
* Dramatically reduce allocations
* Update launch.json
* Add missing flags
* Update js_parser.zig
* small cleanup
* Make the export name better
* Fix unnecessary `var foo = foo`
* Implement CommonJS -> ESM conversion
* Implement module redirects
* Port esbuild bundler tests for new bundler (#2380)
* started porting esbuild tests
* clean up test names and api before moving on
* port tests using a program i wrote
* replace todo generated comment
* fix generated tests not including some files
* work on tests
* [github web editor] add define, external, inject, minifySyntax, minifyWhitespace options.
* get most of the todo comments out of the way, but expectBundled does not handle most of the cases
* continue working on esbuild tests
* use test.skip for unsupported tests
* Fixups for test runner
* Hoist imports & exports
* Fix test
* Hoist classes
* bundler test refining, 51/835
* Fix runtime require
* bundler test refining, 81/835
* bundler test refining, 93/835
* Make the test work in any timezone
* feat(expect): update toBeInstanceOf (#2396)
* feat: update instanceof binding
* fix: according to PR comments
* Rename `expectObjectTypeCount` to `expectMaxObjectTypeCount`
* Fix socket tests with connection errors (#2403)
* release pending activity with connection error handler
* unref poll_ref
* remove trailing comma
* Organize Dockerfiles for official status
* Remove test Dockerfile
* Remove old Docker workflow
* Feat(test): add toMatch (#2404)
* Fix various fetch/response/request tests (#2416)
* fix most fetch tests, skip a few
* fastGet, toValueGC, and invalid init
* bigint unreachable, range error, log process as process
* remove extra fetch_headers
* remove js_type parameter, check isObject()
* throw invalid mime type error, use enum literal
* switch back to promise rejection
* RangeError pascal case
* Fix several bugs (#2418)
* utf16 codepoint with replacement character
* Fix test failure with `TextEncoder("ascii')`
* Add missing type
* Fix Response.prototype.bodyUsed and Request.prototype.bodyUsed
* Fix bug with scrypt error not clearing
* Update server.zig
* oopsie
* 💅
* docs: Use correct url in the 'Issues' link in README header (#2420)
* Fix crash when rendering error page and the server or network is slow
* [fetch] Make the default body value `null` when unspecified
This is better aligned with the fetch spec
* Make node-net tests less flaky
* [node:net] Fix issue with `listen` callback firing before it's listening
* Always clear timers in node test harness
* Fix out of bounds access
Repro'd in Buffer tests
* Update UWS
cc @cirospaciari
* Make this test more thorough
* Hanging abort test
* 0 length body is a null stream
* Several bug fixes (#2427)
* 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>
* Remove usages of port numbers in tests
* Set -O2 and -fno-rtti
* Remove -g
* Prevent undefined memory access
* [bun test] Implement `--rerun-each` flag to run each test N times
* Reduce number of module scopes created
* add some extra abort checks into streams (#2430)
* add some checks to avoid UAF
* avoid multiple calls to finalize if endFromJS is called more than once
* fix no-op comment
* mark as requested_end on abort
* remove requested_end from abort
* remove unnecessary check (#2432)
* Fix bug with scoped aliased dependencies in bun install on macOS
* remove `addLog`, remove `--prominent-compile-errors`
* Finish the upgrade
* Optional chaining flag
* Implement same_target_becomes_destructuring optimization
* bundler test refining, 109/835
* Reset bindings
* Support multiple entry points
* Implement `--entry-names` flag
* Use a tempdir with a better name
* prettier
* Log file name
* Update js_parser.zig
* Mark all bun builtins as external
* Make resolve errors actually errors
* Update bundler_default.test.ts
* Fix `await import(foo)`
* WIP react server components
* Do more stuff at runtime
* ✂️
* Support automatic JSX imports
* Use a module cache for now
* Update tsconfig.base.json
* Fix ThisOutsideFunctionNotRenamed
* woopsie
* moar cpu
* clamp it
* fixup
* Add a bunch of assertions
* Bun uses automatic runtime by default
* Parse Import Attributes
* Add a note about Valgrind
* Update developing.md
* Fix up code splitting for React Server Components
* Implement client component manifest
* Fix crash with --react-server-components and no client components
* Backport 4d31e3c917
* Update launch.json
* Fix for latest zig
* Workaround bug with ?[]const string
Occasionally saw alignment errors in this code
Workaround https://github.com/ziglang/zig/issues/15085
related: https://github.com/ziglang/zig/pull/15089
* switch to regular slice
* Avoid initializing named_imports and named_exports as undefined
* Reduce usages of `undefined`
* Add more assertions
* --watch wip
* Update javascript.zig
* Possibly fix the race condition
* Faster `do`
* bump allocator
* Reduce the size of `Symbol` slightly
* Alphabetically sort runtime import symbols, for determinism
* Prepare for code splitting
* handle overlapping stdout
* pure
* clean up some things
* Fix bug with `$$typeof`
* Address CommonJS -> ESM hoisting bug
* Support `"use server"` in manifest
* Implement `"use server"`
* Fix importing bun builtins when bundling
* Make `commonjs_to_esm` a feature flag, fix some splitting bugs
* ✂️
* fixme remove this
* Fix crash in longestCommonPath
* Chunking! Just need to do import paths now.
* Import paths work...now trying to figure out how to make runtime symbols work
* add workaround
* Replace `bun bun` with `bun build`
* Fix crash with dual package hazard
* Fix many CommonJS <> ESM interop bugs
* Support package.json `"sideEffects"`
also skip loading unnecessary package.json data in `bun run`
* add a not good --watch implementation
* bundler test refining, 140/831
* remove accidentally committed file
* do not return status code 1 on successful bundles
* bundler test refining, 159/830
* pass exit code to exitOrWatch
* clean up help menu
-remove two spaces to line up bun build
-moved all <r> tags to the end of the text they are colorizing
-moved other colors to the start of the text they colorize
-removed unneeded <r> tags, keeping only one at the start of the block
* importstar is fully ported
* wip
* you can run code in this branch now
* Disable this transform
* organize and document bundler tests
* Fix double import
* Fix sloppy mode function declarations
* Disable our CommonJS transform for now
* add `assertNotPresent` to make splitting cases easier
* Bump!
* Update bun.d.ts
* use import.meta.require in runtime code
* Disable this again
* Fix dirname
* Fix ESM -> CJS wrapper
* 💅
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com>
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: zhiyuan <32867472+zhiyuang@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
* very very wip
* almost ready to fix the errors
* Update identity_context.zig
* Update base.zig
* [bun test] It runs successfully
* Remove unnecessary call
* [Bun.js] Improve JS <> Zig unicode string interop
This fixes longstanding unicode bugs with `console.log` & `fetch`.
I believe @evanwashere reported this first awhile ago
* [Bun.js] Implement `Object.is()` binding and a way to set a timeout for script execution
* Update PLCrashReport.zig
* [Bun.js] Make `console.log` more closely match Node.js and Deno
* [Bun.js] Implement formatting specifier for console.*
* Implement `console.clear()`
* bug fix
* Support console.clear()
* Buffer stderr
* [bun test] Begin implementing Node.js `fs`
* Update darwin_c.zig
* Implement more of `fs`
* `mkdir`, `mkdir` recursive, `mkdtemp`
* `open`, `read` (and pread)
* Move some things into more files
* Implement readdir
* `readFile`, `readLink`, and `realpath`
* `writeFile`, `symlink`, `chown`, `rename`, `stat`, `unlink`, `truncate`
* `lutimes`
* Implement `SystemError` and begin wiring up the `fs` module
* `"fs"` - Most of the arguments / validation
* `fs` - Rest of the arguments / validations
* Begin wiring up the `fs` module
* Fix all the build errors
* support printing typed arrays in console.log
* It...works?
* Support `require("fs")`, `import fs from 'fs';`, `import * as fs from 'fs'`
* Fix a couple bugs
* get rid of the crash reporter for now
* Update fs.exports.js
* [bun.js] slight improvement to startup time
* [bun.js] Improve error message printing
* [Bun.js] Add `Bun.gc()` to run the garbage collector manually and report heap size
* [Bun.js] Add Bun.generateHeapSnapshot to return what JS types are using memory
* [Bun.js] Add `Bun.shrink()` to tell JSC to shrink the VM size
* Improve encoding reader
* [bun.js] Improve callback & microtask performance
* Update node_fs.zig
* Implement `console.assert`
* simple test
* [Bun.js] Prepare for multiple globals/realms to support testing
* Create callbacks-overhead.mjs
* Update http.zig
* [Bun.js] Implement `queueMicrotask`
* Add test for queueMicrotask
* 😪
* [Bun.js] Implement `process.versions`, `process.pid`, `process.ppid`, `process.nextTick`, `process.versions`,
* Implement `process.env.toJSON()`
* [Bun.js] Improve performance of `fs.existsSync`
* 💅
* [Bun.js] Implement `process.chdir(str)` and `process.cwd()`, support up to 4 args in `process.nextTick`
* Make creating Zig::Process lazy
* Split processi nto separte file
* [Bun.js] Node.js Streams - Part 1/?
* [Bun.js] Node.js streams 2/?
* WIP streams
* fix crash
* Reduce allocations in many places
* swap
* Make `bun` start 2ms faster
* Always use an apiLock()
* libBacktrace doesn't really work yet
* Fix crash in the upgrade checker
* Clean up code for importing the runtime when not bundling
* 📷
* Update linker.zig
* 68!
* backtrace
* no, really backtrace
* Fix
* Linux fixes
* Fixes on Linux
* Update mimalloc
* [bun test] Automatically scan for {.test,_test,.spec,_spec}.{jsx,tsx,js,cts,mts,ts,cjs}
Most CLI tools have the style convention of referring to themselves in
lowercase. It is, after all, the name that users type in when using
the tool. This PR maintains that convention in bun.
"Drop the uppercase B, it's cleaner"