280 Commits

Author SHA1 Message Date
Jarred Sumner
3f472bd511 cleanup 2023-01-08 00:10:02 -08:00
Jarred Sumner
9fd3b5587b Auto-install and link webkit 2023-01-02 11:29:22 -08:00
Jarred Sumner
b86915c808 [internal] Add flag to build bun for editor error reporting 2022-12-30 22:37:28 -08:00
Jarred Sumner
97ec866f85 Fixes https://github.com/oven-sh/bun/issues/1677 2022-12-28 17:00:04 -08:00
Jarred Sumner
989ac717fc Update launch.json 2022-12-21 14:57:04 -08:00
Jarred Sumner
6255fe6a4b [internal] Add bun-debug build 2022-12-13 00:16:01 -08:00
Jarred Sumner
dd9691289f Don't use zls for formatting 2022-12-13 00:15:50 -08:00
Jarred Sumner
2fe5b4da2f 📷 2022-12-07 21:41:30 -08:00
Jarred Sumner
3cf229a898 Update launch.json 2022-11-22 02:13:25 -08:00
Jarred Sumner
16d20bde09 Set aggression level in tests 2022-11-19 22:35:26 -08:00
Jarred Sumner
6c01a1191f Fixes #1390 2022-11-15 21:58:31 -08:00
Colin McDonnell
f7f1b60444 Add bun-types, add typechecking, add child_process types (#1475)
* Add bun-types to packages

* Improve typing

* Fix types in tests

* Fix dts tests

* Run formatter

* Fix all type errors

* Add strict mode, fix type errors

* Add ffi changes

* Move workflows to root

* Add workflows

* Remove labeler

* Add child_process types

* Fix synthetic defaults issue

* Remove docs

* Move scripts

* Run prettier

* Include examples in typechecking

* captureStackTrace types

* moved captureStackTrace types to globals

* Address reviews

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2022-11-09 15:40:40 -08:00
Jarred Sumner
af3931371e Fix Buffer.from(text, "base64") and Buffer.toString("base64") 2022-11-08 21:30:54 -08:00
Jarred Sumner
1a92b92f8a Add failing wildcard test 2022-11-02 20:44:13 -07:00
Jarred Sumner
02c920f4fd TCP & TLS Socket API (#1374)
* TCP Socket API

* Wip

* Add snippet for StringDecoder

* Rename `close` to `stop`, replace `close` with `end`

* Add a tcp echo server test

* Some docs

* Update README.md

* Fix build

* Update README.md

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-10-25 00:44:25 -07:00
Jarred Sumner
76652ac3ca Add Web Crypto API (#1384)
* Add Web Crypto API

* Duplicate symbols

* Update c_cpp_properties.json

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2022-10-23 20:25:18 -07:00
Jarred Sumner
85808700c8 Add sqlite to include list 2022-10-21 22:54:26 -07:00
Jarred Sumner
2c548d45f8 Update c_cpp_properties.json 2022-10-15 03:29:25 -07:00
Jarred Sumner
0ce709d96a Make new HTTP client more stable 2022-09-16 00:53:03 -07:00
Jarred Sumner
4891be8d0d Fix C++ intellisense 2022-09-03 21:40:06 -07:00
Jarred Sumner
4e73726bee Delete some dead code 2022-09-01 20:34:41 -07:00
Hyro
7a734e0a28 feat: implement native os module (#1115)
* feat: implement os module

* revert(bun-error): package-lock.json

* feat: implement EOL

* feat: implement EOL

* feat: implement arch function

* feat: implement homedir function

* add comptime to homedir if

* feat: add platform function

* feat: implement type function

* feat: add hostname (not sure iff works on all platforms)

* chore: make requested changes

* fix: change toValueGC into toValue in arch function

* add EOL, devNull constant variables

* fix: store only string

* feat: add tests

* feat: add endianness

* ususe toValue for devNull & EOL

* feat: implement endianness & fix release

* revert javascript.zig fix

* feat: implement tmpdir

* feat: implement totalmem, freemem, uptime

* feat: loadavg

* feat: implement version

* feat: add userInfo

* feat: implement totalmem for macos

* feat: add getPriority (not finished, waiting for dc response)

* feat: finish userInfo implementation

* feat: implement cpus, not done

* feat: finish getPriority implementation & stats cpus()

* feat: implement setPriority

* reemove test.c

* feat: implement constants.dlope.xn, constants.priority.x, constants.UV_UDP_REUSEADDR

* feat: implement signals, errno

* updated cpus function, stilldoesnt work

* increase object length

* feat: add t more ests

* feat: add cpus()

* remov some files

* fix: handle empty array

* started working on interface addresses (in C)

ill use C++ after it work

* fix interface_addresses

* Improved getCpuInfo code, decreased ram usage, increased speed

* getCpuTime optimizations

* started working on networkInterfaces

* feat: networkInterfaces implementation

* delete unnecessary files

* add benchs & fix code

* add tests

* add missing benchs

* Increased buffer of getCpuInfo to 2048, it should skip few iterations

* remove hardcoded constants

* feat: implement errno constants

* fix getWindowsErrorConstant

* feat: add signal constants

* feat: implement priority constants

* remove duplications

* fix: change value to ?i16

* fix(__defineConstant): make some parameters comptime, change value to ?i32

* fix: add E to ERRNO constants, add SIG to SIG constants

* feat: add dlopen constants

* change functions to private

* feat: add UV_UDP_REUSEADDR

* fix typo

* simplify functions

* rename functions in bindings

* feat: implement loadavg for darwin

* feat: implement system uptime

* feat: implement get free memory for darwin

* fix system memory bindings

* feat: implement network interfaces for darwin

* code cleanup

* feat: support for macos version & release

* some fixes

* MacOS support for CpuInfo

* Fixed minor mistake in getCpuInfo_B

* Delete test.zig

* Update c_cpp_properties.json

* Update tasks.json

* feat: implement scopeid

* feat: implement cidr 🚀

* remove unnecesarry changes

* remove unnecesarry changes

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* chore: requested changes

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* fix: import string

* fix: change IPV6 to IPv6

* fix some things

* chore: make requested changes

* revert: launch.json

* fix test

* Fixed few memory leaks

* testing

* again

* added len

* another test

* improved parsing

* added small check

* Bonk

* FINISH 🚀🚀🚀🚀🚀🚀

* Update tasks.json

* NetworkInterface test

* FINISH 🚀🚀🚀

Co-authored-by: Fire-The-Fox <gajdos.jan77@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2022-08-25 19:38:28 -07:00
Carter Snook
afb1dc1d79 chore(vscode): set tab size and tab format (#810) 2022-07-20 13:37:52 -07:00
Jarred Sumner
ef742f2fa8 [internal] Clean up launch.json 2022-07-02 01:36:04 -07:00
Jarred Sumner
729d445b68 change the directory structure 2022-06-22 23:21:48 -07:00
Jarred Sumner
9822ea96b8 [misc] Recommend VSCode extensions 2022-04-18 21:44:31 -07:00
Jarred Sumner
94db83040e [misc] Set editor.formatOnSave 2022-04-18 21:44:31 -07:00
Jarred SUmner
30542225c6 fix bug with io sometimes sleeping permanetly 2022-04-04 23:25:54 -07:00
Jarred Sumner
05a4991a5f Update launch.json 2022-04-04 06:38:09 -07:00
Jarred Sumner
27ad502119 cleanup a few things 2022-04-03 16:35:09 -07:00
Jarred Sumner
0b5a8057f2 add new module 2022-03-20 04:38:41 -07:00
Jarred Sumner
bc85dd2330 the events, they loop 2022-03-20 04:38:04 -07:00
Jarred Sumner
d6831cf801 [Bun.js] Implement HTMLRewriter
https://developers.cloudflare.com/workers/runtime-apis/html-rewriter
2022-03-12 01:14:45 -08:00
Jarred Sumner
7c5c6cd519 source maps work for app code in bun dev! 2022-03-06 07:35:16 -08:00
Jarred Sumner
50560e169c WASM 2022-02-27 23:20:10 -08:00
Jarred Sumner
b2a69a35b8 Slight improvement to non-ascii file path handling 2022-02-03 01:01:27 -08:00
Jarred Sumner
f3c4bfcbae wpi 2022-02-01 18:12:24 -08:00
Jarred Sumner
d3a93d5273 fs.*Sync(), bun wiptest, and More ™ (#106)
* 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}
2022-01-19 02:29:07 -08:00
luke miles
7f33846005 copy: replace Bun with bun (#99)
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"
2022-01-02 03:09:51 -08:00
Jarred Sumner
df1aa76cc5 Update settings.json 2022-01-02 00:22:59 -08:00
Jarred Sumner
113f0427ab Update settings.json 2021-12-30 23:21:10 -08:00
Jarred Sumner
e75c711c68 Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* 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

* 📷

* 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-12-30 21:12:32 -08:00
Jarred Sumner
b73e7a9732 Add VSCode devcontainer environment for easy contributing 2021-12-23 18:40:03 -08:00
Jarred Sumner
eab99b3bae Remove references to s2n 2021-12-18 21:06:15 -08:00
Jarred Sumner
d4c55557c3 Implement hop archive format 2021-12-17 23:06:56 -08:00
Jarred Sumner
11e6ffaae9 Update launch.json 2021-12-16 19:18:51 -08:00
Jarred Sumner
d83c610002 [bun install] Support printing yarn.lock 2021-12-16 19:18:51 -08:00
Jarred Sumner
196f7eb101 Update launch.json 2021-12-16 19:18:51 -08:00
Jarred Sumner
c6dcc1cd9e [bun install] Lockfile saves. Starting to implement diffing 2021-12-16 19:18:51 -08:00
Jarred Sumner
b5744e5da4 save and load manifest 2021-12-16 19:18:51 -08:00