* work on bundler
* a
* YAAAAYYAYAYAYYAYA
* get some more bundler tests working
* Update src/bundler/bundle_v2.zig
* rev
* ok
* i converted the cmakelists into LF
* personal review
* we didnt win
* okey they pass
* revert :(
* a
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
* yay!!!!!!
* [autofix.ci] apply automated fixes
* ok
* do not use reflect here
* ok
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* 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>
* port 'initial support for using declarations'
1:1 port of this commit:
56a3e01244
* port 'initial support for await using declarations'
1:1 port of this commit:
1634a0b5ad
* fix cmake config for local jsc
* add global defines for symbols
* begin porting lowering implementation
based off of
https://github.com/evanw/esbuild/pull/3192
* [autofix.ci] apply automated fixes
* add some fun webkit scripts
* fix the minification bug
* refactor runtime_js, etc
* rename test file
* finished yapping
* silly silyl
* Update src/bundler.zig
* ok
* a
* Fix crash
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Add brotli test
* Check if we can use brotli
* vendor brotli
* Update .gitattributes
* Brotli is now always available
* Update licensing.md
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Simplify string handling code
* add extra + external
* Update fs.test.ts
* Bump
* woopsie
* prettier
* Rename stats() to resourceUsage()
* Fix leak
* Fix more leaks
* Setup malloc heap breakdown
* Thread safety
* Fix bug when creating buffer from utf-16 string
cc @dylan-conway
* Use global allocator
* More new
* Update fs.test.ts
* Update setTimeout.test.js
* Fix UAF in HTMLRewriter
* More bun.new
* Remove logs
* Un-skip test which no longer is flaky
* Even more `bun.new`
* Fix memory leak in HTMLRewriter.
Fixes#2325
* Don't accept Buffer for now
* Fix issue with node-fetch polyfill
* Don't destruct the response value too soon
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
bump to "657558d4d4c9c33f41b9670e72d96a5a39fe546e" which has some
windows-specific fixes, as well as fixes linux-arm64 debug build,
and adds the debug windows build.
* 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>
* Move code for lifecycle scripts into a separate file
* Fix slow & incorrect pipe reading code used for bun install lifecycle scripts
* Fix crash in IPC due to calling on_socket_long_timeout when its a null ptr
* Only try to get the node path one time
* Fix incorrect glob pattern for rebuilding Zig files
@paperdave doing `**/**/**` does not work
* Implement basic support for ioctl_ficlone
* lowercase these
* intcast
* This is backwards
* Fix "waiting for tasks" spam
* Update install.zig
* Add helper
* Update install.zig
* Address PR feedback
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Parse stack trace string
* Syntax highlight error messages
* Fix off-by-one
* Undo changes to populateStackTrace
* Highlight more things
* Add a way to write tests for it
* Create highlight-cat.ts
* Bump
* fix: off by ones
* feat: add function highlighting to these errors
* revisions
* undo
* l
* fix webkit submodule
* imo this looks worse
* [autofix.ci] apply automated fixes
* fix off by one <3
* fix more situations
* ch changes
* ok
* [autofix.ci] apply automated fixes
* fix this
* fix snapshot
* ok
* mark test as todo
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* dx: automatically install and update zig
* update repo
* ensure system zig compiler in ci
* a
* b
* good
* i am stupid
* why did this happen
* fix installer
* Load `.{m,c}ts{x}` last in node_modules
* feat(console.log): Print className for an object if present (#6508)
* feat(console-log): fix className not printed for objects that are instances of classes
Uses getClassName native method instead of getName
* test(console-log): objects with class names are printed correctly
* test(esbuild): add class name to log message
* Fix failing `which` test (#7258)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Make test less flaky
* Get it working and add test
* Handle relative paths
* Add comment
* Consolidate + add test
* Bump
* Fix getObjectName
* Update dir_info.zig
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jibran Kalia <jibran.kalia@gmail.com>
* Use debug mode by default
* Enable build with assertions enabled
* Update cli.zig
* Update bun-linux-build.yml
* Fixes
* Fix `ASSERT_ENABLED`
* try this
* Update Dockerfile
* mimalloc debug
* Update CMakeLists.txt
* `Bun.deepMatch` - fix assertion failures
cc @dylan-conway, looks like we need to use `putDirectMayBeIndex` and check for `isCell` more carefully.
* Object.create support in code generator and callbacks wrapper
* Remove unused file
* zig upgrade
* zls
* Fix various errors
* Support `BuiltinAccessor` in create_hash_table script
* Fix assertion failure in `process.mainModule`
* Fix assertion failure in `onerror`
* Fix assertion failure when creating a Worker
* Fix asssertion failure when loading lots of files in bun test
* Fix assertion failure when termating a `Worker`
* Add helper for converting BunString to a WTFString
* Fix assertion failure in notifyNeedTermination
* Add more debug logs in `bun test`
* Fix compiler warning in usockets
* Fix assertion failure with `Worker` termination (another)
* Fix assertion failure in `coerceToInt64`
* Fix assertion failure in `BroadcastChannel`
* Fix assertion failure in `Headers.prototype.getAll`
* Fixes#7067
* Add heap analyzer label for CommonJS modules
* Fix assertion failure in module.require && module.require.resolve
* Remove unused code
* Fix assertion failure in debugger
* Fix crash in debugger
* Fix assertion failures in bun:sqlite
* Bump zig
* Bump WebKit
* Fix assertion failure in JSPromise::reject && JSInternalPromise::reject
* Fix assertion failure in ReadableStream::cancel
* Fix assertion failure in AsyncContextFrame::create
* Fix assertion failure in bun:sqlite
* Fix assertion failure in mocks
* Fix assertion failure in ServerWebSocket.close
* Fix assertion failure in N-API with subclasses
* [napi] Make promises cheaper
* undo
* Don't check for exceptions in ObjectInitializationScope
* Add separate entry point for test runner that doesn't generate code
* Don't deref builtin code
* Fix preload test
* Fix assertion failure in memoryUsage()
* Fix preload test, part 2
* Ensure that the env map for a Worker is empty after it is used
* The pointer for the Arena allocator used in parsing should not change
* Terminate thread on exit
* Start to implement scriptExecutionStatus
* Update worker.test.ts
* Fix Dirent.name setter
* Update settings.json
* Fix assertion failure in node:http
* Use correct value for `JSFinalObject::maxInlineCapacity`
* JSFinalObject::maxInlineCapacity x2
* Don't strip when assertions are enabled
* Make `m_wasTerminated` atomic
* Preserve directives in the transpiler
cc @ctjlewis
* Workaround assertion failure in ServerWebSocket.sendBinary and ServerWebSocket.sendText
* windows
* Buffer lockfile serialization in-memory
* PR feedback
* PR feedback
* PR feedback
* Windows
* quotes
* Update CMakeLists.txt
* Update bun-linux-build.yml
* Update bun-linux-build.yml
* Move this code to BunString.cpp
* Update BunString.cpp
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Fix the linux aarch64 workflow.
* sanity check
* do not set march to native
* fix windows compile error
* enable verbose
* fix baseline builds
* fix windows build canary flags
* use a real windows runner
* w