Commit Graph

103 Commits

Author SHA1 Message Date
Jarred Sumner
c77c6ea53e Update settings.json 2023-11-05 03:35:20 -08:00
Jarred Sumner
7485c7c7cb feat: Windows + CMake Build System (#4410)
* 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>
2023-10-27 01:51:56 -07:00
dave caruso
98d19fa624 fix(runtime): make some things more stable (partial jsc debug build) (#5881)
* make our debug assertions work

* install bun-webkit-debug

* more progress

* ok

* progress...

* more debug build stuff

* ok

* a

* asdfghjkl

* fix(runtime): fix bad assertion failure in JSBufferList

* ok

* stuff

* upgrade webkit

* Update src/bun.js/bindings/JSDOMWrapperCache.h

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

* fix message for colin's changes

* okay

* fix cjs prototype

* implement mainModule

* i think this fixes it all

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-10-16 21:22:43 -07:00
Dylan Conway
1bad64bc5e Update settings.json 2023-10-13 16:29:06 -07:00
Jarred Sumner
bb9933fa7e Exclude more files 2023-10-07 14:15:53 -07:00
Jarred Sumner
673f6fc634 Exclude more files 2023-10-07 14:14:42 -07:00
Jarred Sumner
09663a5558 Update settings.json 2023-10-07 14:11:39 -07:00
Jarred Sumner
66b15a8df6 Update settings.json 2023-10-07 14:10:54 -07:00
Jarred Sumner
a2ddfe6913 Bring uSockets & uWebSockets forks into Bun's repository (#4372)
* Move uWebSockets and uSockets forks into Bun's repository

* Update Makefile

* Update settings.json

* Update libuwsockets.cpp

* Remove backends we won't be using

* Update bindings.cpp

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-28 08:38:30 -07:00
Jarred Sumner
e26d3821ce Update settings.json 2023-07-07 22:01:43 -07:00
dave caruso
4df1d37ddc Bundle and minify .exports.js files. (#3036)
* move all exports.js into src/js

* finalize the sort of this

* and it works

* add test.ts to gitignore

* okay

* convert some to ts just to show

* finish up

* fixup makefile

* minify syntax in dev

* finish rebase

* dont minify all modules

* merge

* finish rebase merge

* flaky test that hangs
2023-06-01 18:16:47 -07:00
dave caruso
fc40c690ea Write out builtins with TypeScript + Minify them (#2999)
* start work drafting how builtins will work

* work on ts builtin

* builtins stuff so far

* builtins

* done for today

* continue work

* working on it

* bindings so far

* well, it builds. doesnt run

* IT RUNS

* still lots of ts errors but it is functional

* sloppy mode
2023-05-22 18:51:05 -07:00
Jarred Sumner
893f70fee4 Single-file standalone Bun executables (#2879)
* 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 dd968f30bf.

* Revert "leftover"

This reverts commit 7664de7686.

* Revert "leftover"

This reverts commit 498005be06.

* 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-14 06:13:39 -07:00
Jarred Sumner
6362414d65 Bun gets a new bundler (#2312)
* 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>
2023-04-07 20:08:01 -07:00
John Reilly
2503b3409e docs: update moduleResolution to bundler (#2429)
* docs: update moduleResolution to bundler

* docs: bundler as well

* Updates

---------

Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
2023-03-20 19:51:24 -07:00
Colin McDonnell
3852a52601 Add separate bun-types release CI (#2275)
* Release on every commit

* Remove bun-types publish from bun-release-canary

* Undo formatting changes
2023-03-02 15:34:36 -08:00
Jarred Sumner
629be18867 Update recommended extensions 2023-02-22 12:44:50 -08:00
Derrick Farris
e21796acf5 Add mention of bunx --bun to README (#2114)
* readme(bunx): add info about `bun --bun x`

* chore(formatting): add extension for formatting markdown to avoid a bunch of diffs

* chore(formatting): fix JS formatting in README
2023-02-20 16:46:26 -08:00
Jarred Sumner
c40912b8dc formatting 2023-02-06 20:28:59 -08:00
Jarred Sumner
3f472bd511 cleanup 2023-01-08 00:10:02 -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
dd9691289f Don't use zls for formatting 2022-12-13 00:15:50 -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
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
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
729d445b68 change the directory structure 2022-06-22 23:21:48 -07:00
Jarred Sumner
94db83040e [misc] Set editor.formatOnSave 2022-04-18 21:44:31 -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
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
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
eab99b3bae Remove references to s2n 2021-12-18 21:06:15 -08:00
Jarred Sumner
94e469c803 [bun install] WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
449c8b5f36 [internal] Tweak build system to better support unit tests in Zig 2021-10-24 06:18:42 -07:00
Jarred Sumner
da2f85ba4b Exclude snapshots from search 2021-09-17 14:50:21 -07:00
Jarred Sumner
359df89fe3 Fix "browser" map resolution, _almost_ fix symbol collisions, cache absolute paths for file entries 2021-09-12 23:40:12 -07:00
Jarred Sumner
292668ed43 up 2021-09-07 22:09:47 -07:00
Jarred Sumner
10b4b872a2 This is alot
Former-commit-id: 4b2a396611ec03270dc768b70e488b0f5eee2a37
2021-08-10 18:26:16 -07:00
Jarred Sumner
c0273a09f1 alright server-side reloading code works
Former-commit-id: a49ef52eec1037014e3c9cda1a09f387a01116b8
2021-08-05 19:48:36 -07:00
Jarred Sumner
7245f90b2d little bit of errors, little bit of bytecode caching. neither finished
Former-commit-id: c774c395136d58330aa7cad7e9fa434bcef7d5c6
2021-07-30 00:50:29 -07:00
Jarred Sumner
4a8b254652 esmodules work?
Former-commit-id: 5cb5af4416c12518eb195d1b310990fc5c94d6c8
2021-07-28 20:56:29 -07:00
Jarred Sumner
d18ff76912 alright console.log works at least
Former-commit-id: 35b5bb035be33001a3c2accbe590bb5312ea4b04
2021-07-27 16:45:02 -07:00
Jarred Sumner
84d7234f24 cool
Former-commit-id: a7214ab61c
2021-07-26 16:39:40 -07:00
Jarred Sumner
e914c5f3d2 most of the bindings!
Former-commit-id: a8a4f28046
2021-07-21 02:07:07 -07:00