aboutsummaryrefslogtreecommitdiff
path: root/packages (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-09Add types for mocksGravatar Colin McDonnell 2-31/+515
2023-06-09Implement mocks in bun:test (#3252)Gravatar Jarred Sumner 1-0/+43
* wip * wip * most of the code for mocks in bun:test * finishing up * Implement `toHaveBeenCalled` and `toHaveBeenCalledTimes(1)` * Test * visit * results, not returnValues * exact * Update jest.zig * A couple more tests * Add jest.fn * support resetting mocks * Implement spyOn --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-07improve stream types (#3240)Gravatar dave caruso 1-84/+67
2023-06-06[breaking][bun:sqlite] `.values()` returns `[]` instead of `null` for ↵Gravatar Jarred Sumner 1-2/+7
queries returning 0 results (#3219) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-06Docs for `Bun.password` and ws publish (#3227)Gravatar Colin McDonnell 2-13/+17
* Update websocket docs & jsdoc * Document Bun.password * Update hash encoding docs * Fix typos * Add info about user-specific data in ws * Update outdated websocket jsdoc * Replace usages of req.url * Remove log
2023-06-06Bun.passwordSync -> Bun.password.{method}Sync (#3228)Gravatar Colin McDonnell 1-34/+63
* Bun.passwordSync -> Bun.password.{method}Sync * Update jsdoc * Updates
2023-06-04Implement `Bun.password` and `Bun.passwordSync` (#3204)Gravatar Jarred Sumner 1-0/+191
* Implement `Bun.password.{verify, hash}` and `Bun.passwordSync.{verify, hash}` * flip the booleans * delete unused * Add `cost` for `"bcrypt"`, add `"memoryCost"` and `"timeCost'` for argon2, use SHA512 * Update bun.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-02fix readableStreamToArrayBuffer (#3181)Gravatar dave caruso 1-1/+1
* fix discord.js again * remove one of the async hooks warnings * clarify hardcoded modules docs
2023-06-02Update macro/test docs (#3180)Gravatar Colin McDonnell 1-1/+1
* Add test and fix plugin type * Update docs and config pages
2023-06-02Support NodeJS.ProcessEnvGravatar Colin McDonnell 3-14/+19
2023-06-02types: expose Bun.Env (#3111)Gravatar Jozef Steinhübl 4-29/+26
* expose Bun.Env * export bun.Env * fix: use import instead namespace access * fix(child_process): use import * tests(env): use module instead namespace
2023-06-01random fixes that help vite/sveltekit (#3140)Gravatar dave caruso 1-2/+2
* existsSync with invalid paths should return false * partially support file urls (does not do percent encoding) * add utf16 support for Path.isAbsoluteString * Update src/resolver/resolver.zig Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * fixups * revert * prettier format --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-05-31Small improvements to `bun test` (#3071)Gravatar Ashcon Partovi 3-95/+265
* Change status icon for skipped tests from "-" to "»" * Show file path instead of filename in `bun test` * Emit collapsable logs when running `bun test` in Github Actions https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines * Add fallback for test icons when emojis are not available * Only check for GITHUB_ACTIONS when running `bun test` * Emit error annotations when running `bun test` in Github Actions https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message * Remove ANSI output from Github annotation, it doesn't work * Remove outdated code from internal test runner * Add GithubActionFormatter to handle cases where error name or message is already ANSI * Fix formatting of test * Fix #3070 * Implement `bun test --run-todo` By default, `test.todo()` is no longer run, unless `--run-todo` is specified. * Fix test that relies on test.todo() being run * Support vitest-style test options * Disable GITHUB_ACTION in test harness * Add types for TestOptions * Fix bug where test.skip() actually ran * Implement `test.skipIf()` and `describe.skipIf()` * Implement `test.runIf()` * Move DiffFormatter to its own file * Fix bug where Bun.inspect() would emit a Github annotation * Introduce `bun test --only`, rename `--run-todo` to `--todo` * Implement `test.if()`, `describe.if()`, and other test fixes * Remove unwanted files from last commit * Fix last reference to --run-todo * Fix memory issues with printing github actions text * Update bindings.zig * Fix bug with `test.only()` * Remove debug test * Make the github annotations better * Improve .vscode/launch.json * Implement `expect().toBeNil()` * Remove .only() from test * Implement toBeBoolean(), toBeTrue(), toBeFalse() * Add lots of matchers * toBeNil() * toBeBoolean() * toBeTrue() * toBeFalse() * toBeNumber() * toBeInteger() * toBeFinite() * toBePositive() * toBeNegative() * toBeWithin() * toBeSymbol() * toBeFunction() * toBeDate() * toBeString() * toInclude() * toStartWith() * toEndWith() * Fix #3135 * Reduce verbosity of test * Fix snapshot bug --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-31Remove bun-macro-relay and update docs (#3145)Gravatar Colin McDonnell 7-237/+0
* Update macro docs * Remove bun-macro-relay
2023-05-29More/better docs for JSX, utils, binary data, streams, hashing, `bun test`, ↵Gravatar Colin McDonnell 9-5/+98
`Bun.serve` (#3005) * WIP * Updates * Document deepEquals * WIP * Update typeS * Update TLS docs for Bun.serve * Update types for tls * Draft binary data page. Add Streams page. * Update test runner docs * Add hashing, flesh out utils * Grammar * Update types * Fix * Add import.meta docs * Tee
2023-05-26Implement `expect().toBeEmpty()` (#3060)Gravatar Ashcon Partovi 1-0/+10
* Implement `expect().toBeEmpty()` * Fix formatting on test * Finish up expect().toBeEmpty() * Update expect.test.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24[server.fetch] call when using Request object (#3051)Gravatar Ciro Spaciari 1-1/+1
* patch server.fetch * add tests and fix types
2023-05-23Support test.todo() in ecosystem runnerGravatar Ashcon Partovi 6-292/+430
2023-05-23Support setting a timezone with `process.env.TZ` and `Bun.env.TZ` (#3018)Gravatar Jarred Sumner 2-0/+27
* Support setting a timezone via `process.env.TZ` * Implement `setTimeZone` in `bun:jsc` module * [breaking] `bun:test` now defaults to `Etc/UTC` timezone --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-22add some connect test and type changes (#3013)Gravatar dave caruso 1-2/+2
2023-05-22Write out builtins with TypeScript + Minify them (#2999)Gravatar dave caruso 2-8/+18
* 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[breaking] ServerWebSocket.publish no longer publishes to self by defaultGravatar Jarred Sumner 1-7/+9
This changes `publishToSelf` to be `false` by default instead of `true`. This is a breaking change because it means that `ws.publish("foo", "bar")` will exclude `ws` from the list of websockets to broadcast. We are making this change because many people asked for this and were confused by the status quo - that `w.publish` publishes to self.
2023-05-22[ServerWebSocket] `binaryType` now defaults to `"nodebuffer"`Gravatar Jarred Sumner 1-1/+3
Previously, this defaulted to "uint8array", so this shouldn't be a breaking change unless you make use of `.slice()` in which case it will now be a reference to the same ArrayBuffer rather than a clone. The rationale for this change is most usages of Uint8Array on the server need a little more than just the bytes. Many npm packages expect Buffer rather than Uint8Array. Directly returning it for binary websocket messages is faster than creating another one.
2023-05-21[Bun.serve] Support `"nodebuffer"` binaryType in `ServerWebSocket`Gravatar Jarred Sumner 1-36/+51
2023-05-21[WebSocket] Implement `"nodebuffer"` binaryTypeGravatar Jarred Sumner 1-4/+11
2023-05-21Add node:vm typesGravatar Jarred Sumner 1-0/+509
2023-05-21fix(tls.connect) fix SNI on tls sockets and also servername (mongodb) (#2934)Gravatar Ciro Spaciari 2-3/+46
* fixes SNI on tls sockets and also servername * 💅 * 💅 * add support for https and wss * fix bun types * support Bun.file on ca, key and cert * 💅 * add setTimeout (makes fastify run) * fix httpVersion * fix WebSocketServer and add listen event * fix ws exports and http listening * fix default import * bump uws * add nodebuffer compatibility * fix drain and allow more passing tests to run * fix enqueud messages * default to arraybuffer * fix constructor binaryType * fmt * fixup * skip some tests * skip more * skip fault tests * reuse encoder instance * fix handshake WS Client * temporary revert handshake fix * fix handshake * disable all socket.io test temp * fixup * add back socket.io tests * use node_fs to read cert, ca and key on server.zig * throw the error returned by NodeFS * 💅
2023-05-20[bun:jsc] Rewrite `describe` -> `jscDescribe` to not confuse them in ↵Gravatar Jarred Sumner 1-2/+5
autocomplete
2023-05-20Implement `test.todo` (#2961)Gravatar Degreat 1-0/+17
* Implement `test.todo` * remove skip condition * Allow callbacks in .todo * Add descriptive comment * Log todos * Include tests in title * edit test.todo tests --------- Co-authored-by: dave caruso <me@paperdave.net>
2023-05-20Support test timeouts in `bun:test` (#2969)Gravatar Jarred Sumner 1-0/+12
* [bun:test] Support timeouts in `test` * make this test more resilient * :scissors: --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-18Implement `expect().toBeCloseTo()` (#2870)Gravatar Degreat 1-1/+19
2023-05-17fix: bun-plugin-server-components name (#2919)Gravatar Bryce Kalow 1-1/+1
2023-05-16Tweaks to bundler docs (#2867)Gravatar Colin McDonnell 1-19/+3
* WIP * Fix typo * Updates * Document --compile * Add bundler benchmark * Remove esbuild * Add bench to docs * Add buttons * Updates
2023-05-15Add plugins for yaml & RSC (#2888)Gravatar Colin McDonnell 24-0/+793
* WIP * WIP * Add yaml plugin * Publish v0.0.1 * Updates * Start RSC plugin - not finished * Add readme * Updates * Add shell dirs for a few other plugins
2023-05-11Allow reading config from within plugins, and partially implement esbuild ↵Gravatar dave caruso 1-3/+3
`initialOptions` (#2861) * Implement plugin build.config and initialOptions * update types * default initialoptions entrypoints
2023-05-11bundler tests and improve `Bun.build` return type (#2833)Gravatar dave caruso 2-24/+34
* importstar_ts * tests * run acorn test suite * bench tweaks * test * bun.build tests very incomplete * remove dataurl and base64 loaders from tests since they dont work yet * tests * stuff * stuff * add errors and array of blobs * work so far * docs * requested changes * fix overwrite docs * remove this file
2023-05-10Implement `describe.skip` (#2836)Gravatar Degreat 1-0/+1
* Implement describe.skip * Add more tests to cover hooks
2023-05-10clarify the types moreGravatar Jarred Sumner 2-3/+22
2023-05-10Implement `BuildArtifact`Gravatar Jarred Sumner 1-4/+11
2023-05-08implement build api `define` and `loaders` (#2805)Gravatar dave caruso 1-16/+67
* parse error logs * clean up types * remove --jsx-production. use NODE_ENV instead * add define to js api * add loaders to js api * fixups * sourcemap * typo fix * remove label, comment dir just for now * test tweaks * test work * make optional enums actually optional. allows `sourcemap: undefined` * overload host ram test * string tests * tests * test for 2815 * requested changes * sort this list * remove this test file now that it passes * oops * add --format * finish ts tests * doc typos related to define and loader
2023-05-05[ci] Fix broken test runnerGravatar Jarred Sumner 2-1/+3
cc @Electroid we need `@actions/core` to be installed in node_modules
2023-05-05Start esbuild migration guide. More docs. (#2787)Gravatar Colin McDonnell 1-1/+1
* Bundler docs updates. Start esbuild migration guide. * Updates * Add JS API comp * Tweaks * Updates * Updates * Updates
2023-05-04Actually fix the `git clone` URLGravatar Ashcon Partovi 1-1/+1
2023-05-04Use HTTPS instead of SSH for `git clone` in ecosystem testsGravatar Ashcon Partovi 1-1/+1
2023-05-04Add initial ecosystem tests (#2801)Gravatar Ashcon Partovi 19-16/+3271
* Add initial ecosystem tests * Run ecosystem tests every morning, after canary release
2023-04-30Add missing type for sqlite (#2764)Gravatar Jarred Sumner 1-0/+84
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-28bundler tests: rest of default.test.ts and starting jsx tests (#2765)Gravatar dave caruso 1-18/+3
2023-04-28Bundler docs updates + support for `naming` string (#2767)Gravatar Colin McDonnell 1-10/+10
* Bundler docs updates * Remove comments * Updates * Fix bunx usages * Add info about metafile
2023-04-27fix: make node:crypto Hash.copy work correctly (#2761)Gravatar Silver 1-1/+6
This commit will also: - add a CryptoHasher.copy function - make CryptoHasher.digest reset the hasher so it can be reused Resolves #2651
2023-04-26Basic types for Bun.build (#2713)Gravatar Colin McDonnell 1-5/+46
* Basic types for Bun.build * Tweaks * Updates