aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.devcontainer/scripts/getting-started.sh2
-rw-r--r--.github/ISSUE_TEMPLATE/1-bug-report.yml43
-rw-r--r--.github/ISSUE_TEMPLATE/2-feature-request.yml25
-rw-r--r--.github/ISSUE_TEMPLATE/3-api-ref-docs-problem.yml18
-rw-r--r--.github/workflows/bun.yml2
-rw-r--r--Makefile8
-rw-r--r--README.md30
-rw-r--r--bench/ffi/plus100/download-napi-plus100.sh2
-rw-r--r--bench/hot-module-reloading/css-stress-test/color-looper.emotion.zig2
-rw-r--r--bench/hot-module-reloading/css-stress-test/color-looper.zig2
-rw-r--r--bench/hot-module-reloading/css-stress-test/run.sh2
-rw-r--r--bench/sqlite/download-northwind.sh2
-rw-r--r--build.zig34
-rwxr-xr-xbun.lockbbin8947 -> 8987 bytes
-rw-r--r--misctools/fetch.zig5
-rw-r--r--misctools/find-unused-zig.sh2
-rw-r--r--misctools/generate-tests-file.sh2
-rw-r--r--misctools/http_bench.zig6
-rw-r--r--misctools/readlink-getfd.zig3
-rw-r--r--misctools/tgz.zig3
-rw-r--r--package.json2
-rw-r--r--packages/bun-error/bun-error.css2
-rw-r--r--packages/bun-error/package-lock.json270
-rw-r--r--packages/bun-framework-next/README.md6
-rw-r--r--packages/bun-landing/index.css2
-rw-r--r--packages/bun-landing/page.tsx49
-rw-r--r--packages/bun-landing/public/favicon.icobin0 -> 15086 bytes
-rw-r--r--packages/bun-landing/public/index.css125
-rw-r--r--packages/bun-landing/public/index.html245
-rw-r--r--packages/bun-landing/public/logo-square.pngbin0 -> 13815 bytes
-rw-r--r--packages/bun-landing/public/logo-square@16px.pngbin0 -> 705 bytes
-rw-r--r--packages/bun-landing/public/logo-square@32px.pngbin0 -> 1585 bytes
-rw-r--r--packages/bun-landing/public/logo.svg1
-rw-r--r--packages/bun-landing/public/manifest.json14
-rw-r--r--packages/bun-landing/ssr.tsx2
-rw-r--r--packages/bun-types/package.json2
-rw-r--r--src/__global.zig2
-rw-r--r--src/bun.js/api/FFI.h2
-rw-r--r--src/bun.js/bindings/ScriptExecutionContext.h2
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.cpp4
-rw-r--r--src/bun.js/bindings/exports.zig8
-rw-r--r--src/bun.js/bindings/header-gen.zig9
-rw-r--r--src/bun.js/bindings/headers-cpp.h2
-rw-r--r--src/bun.js/bindings/headers.h2
-rw-r--r--src/bun.js/bindings/webcore/WebSocket.cpp4
-rw-r--r--src/bun.js/event_loop.zig7
-rw-r--r--src/bun_js.zig2
-rw-r--r--src/bundler.zig1
-rw-r--r--src/cli.zig9
-rw-r--r--src/cli/create_command.zig35
-rw-r--r--src/cli/install.sh4
-rw-r--r--src/cli/install_completions_command.zig6
-rw-r--r--src/cli/run_command.zig17
-rw-r--r--src/cli/upgrade_command.zig29
-rw-r--r--src/deps/backtrace.zig41
-rw-r--r--src/env_loader.zig14
-rw-r--r--src/exact_size_matcher.zig2
-rw-r--r--src/favicon.pngbin9076 -> 7804 bytes
-rw-r--r--src/futex.zig2
-rw-r--r--src/hash_map.zig6
-rw-r--r--src/http.zig4
-rw-r--r--src/http_client_async.zig3
-rw-r--r--src/install/extract_tarball.zig4
-rw-r--r--src/install/install.zig31
-rw-r--r--src/install/lockfile.zig8
-rw-r--r--src/js_parser.zig4
-rw-r--r--src/main.zig4
-rw-r--r--src/meta.zig14
-rw-r--r--src/node-fallbacks/net.js58
-rw-r--r--src/node_fallbacks.zig17
-rw-r--r--src/open.zig6
-rw-r--r--src/report.zig9
-rw-r--r--src/resolver/resolver.zig4
-rw-r--r--src/sha.zig17
-rw-r--r--src/string_immutable.zig20
-rw-r--r--src/tagged_pointer.zig19
-rw-r--r--src/zlib.zig2
-rw-r--r--test/apps/bun-create-next.sh25
-rw-r--r--test/apps/bun-create-react.sh15
-rw-r--r--test/apps/bun-dev-index-html.sh20
-rw-r--r--test/apps/bun-dev.sh16
-rw-r--r--test/apps/bun-install-lockfile-status.sh8
-rw-r--r--test/apps/bun-install-utf8.sh10
-rw-r--r--test/apps/bun-install.sh12
-rw-r--r--test/apps/bun-run-check.sh25
-rw-r--r--test/bun.js/ffi.test.fixture.callback.c2
-rw-r--r--test/bun.js/ffi.test.fixture.receiver.c2
-rw-r--r--test/bun.js/url.test.ts4
-rwxr-xr-xtest/scripts/bun.lockbbin15723 -> 15723 bytes
-rw-r--r--test/scripts/package-lock.json8
-rw-r--r--test/scripts/package.json2
-rw-r--r--test/snapshots/array-args-with-default-values.hmr.js2
-rw-r--r--test/snapshots/bundled-entry-point.hmr.js16
-rw-r--r--test/snapshots/bundled-entry-point.js4
-rw-r--r--test/snapshots/caught-require.hmr.js8
-rw-r--r--test/snapshots/caught-require.js8
-rw-r--r--test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js22
-rw-r--r--test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js1
-rw-r--r--test/snapshots/code-simplification-neql-define.hmr.js2
-rw-r--r--test/snapshots/code-simplification-neql-define.js2
-rw-r--r--test/snapshots/custom-emotion-jsx/file.hmr.jsx10
-rw-r--r--test/snapshots/custom-emotion-jsx/file.jsx10
-rw-r--r--test/snapshots/export-default-module-hot.hmr.js2
-rw-r--r--test/snapshots/export.hmr.js24
-rw-r--r--test/snapshots/export.js2
-rw-r--r--test/snapshots/forbid-in-is-correct.hmr.js2
-rw-r--r--test/snapshots/global-is-remapped-to-globalThis.hmr.js12
-rw-r--r--test/snapshots/jsx-entities.hmr.jsx14
-rw-r--r--test/snapshots/jsx-entities.jsx14
-rw-r--r--test/snapshots/jsx-spacing.hmr.jsx10
-rw-r--r--test/snapshots/jsx-spacing.jsx10
-rw-r--r--test/snapshots/latin1-chars-in-regexp.hmr.js2
-rw-r--r--test/snapshots/lodash-regexp.hmr.js18
-rw-r--r--test/snapshots/lodash-regexp.js6
-rw-r--r--test/snapshots/multiple-imports.hmr.js26
-rw-r--r--test/snapshots/multiple-imports.js14
-rw-r--r--test/snapshots/multiple-var.hmr.js2
-rw-r--r--test/snapshots/number-literal-bug.hmr.js2
-rw-r--r--test/snapshots/optional-chain-with-function.hmr.js2
-rw-r--r--test/snapshots/package-json-exports/index.hmr.js30
-rw-r--r--test/snapshots/package-json-exports/index.js18
-rw-r--r--test/snapshots/package-json-utf8.hmr.js2
-rw-r--r--test/snapshots/package-json-utf8.js2
-rw-r--r--test/snapshots/react-context-value-func.hmr.tsx10
-rw-r--r--test/snapshots/react-context-value-func.tsx10
-rw-r--r--test/snapshots/spread_with_key.hmr.tsx12
-rw-r--r--test/snapshots/spread_with_key.tsx13
-rw-r--r--test/snapshots/string-escapes.hmr.js22
-rw-r--r--test/snapshots/string-escapes.js9
-rw-r--r--test/snapshots/styledcomponents-output.hmr.js18
-rw-r--r--test/snapshots/styledcomponents-output.js18
-rw-r--r--test/snapshots/template-literal.hmr.js2
-rw-r--r--test/snapshots/ts-fallback-rewrite-works.hmr.js10
-rw-r--r--test/snapshots/tsx-fallback-rewrite-works.hmr.js12
-rw-r--r--test/snapshots/type-only-imports.hmr.ts10
-rw-r--r--test/snapshots/unicode-identifiers.hmr.js12
-rw-r--r--test/snapshots/void-shouldnt-delete-call-expressions.hmr.js2
-rwxr-xr-xtest/snippets/bun.lockbbin20500 -> 27153 bytes
-rw-r--r--types/bun/bun.d.ts2
-rw-r--r--types/bun/bundle.ts2
-rw-r--r--types/bun/fs.d.ts2
-rw-r--r--types/bun/header.txt2
-rw-r--r--types/bun/index.d.ts2
-rw-r--r--zig-build/release.sh2
144 files changed, 1058 insertions, 909 deletions
diff --git a/.devcontainer/scripts/getting-started.sh b/.devcontainer/scripts/getting-started.sh
index aeef96865..32c29443a 100644
--- a/.devcontainer/scripts/getting-started.sh
+++ b/.devcontainer/scripts/getting-started.sh
@@ -4,7 +4,7 @@ echo "To get started, login to GitHub and clone bun's GitHub repo into /workspac
echo "Make sure to login with a Personal Access Token"
echo "# First time setup"
echo "gh auth login"
-echo "gh repo clone Jarred-Sumner/bun . -- --depth=1 --progress -j8"
+echo "gh repo clone oven-sh/bun . -- --depth=1 --progress -j8"
echo ""
echo "# Compile bun dependencies (zig is already compiled)"
echo "make devcontainer"
diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml
new file mode 100644
index 000000000..53a4a38ae
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/1-bug-report.yml
@@ -0,0 +1,43 @@
+name: 🐛 Bug report
+description: Create a report to help us improve
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for reporting an issue.
+
+ This issue tracker is for bugs and issues found within bun.
+ If you require more general support please reach out to our [discord server](https://bun.sh/discord).
+
+ Please fill in as much of the following form as you're able.
+ - type: input
+ attributes:
+ label: Version
+ description: Output of `bun -v`
+ - type: input
+ attributes:
+ label: Platform
+ description: |
+ UNIX: output of `uname -a`
+ Windows: output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console
+ - type: textarea
+ attributes:
+ label: What steps will reproduce the bug?
+ description: Enter details about your bug, preferably a simple code snippet that can be run using `bun` directly without installing third-party dependencies.
+ - type: textarea
+ attributes:
+ label: How often does it reproduce? Is there a required condition?
+ - type: textarea
+ attributes:
+ label: What is the expected behavior?
+ description: If possible, please provide textual output instead of screenshots.
+ - type: textarea
+ attributes:
+ label: What do you see instead?
+ description: If possible, please provide textual output instead of screenshots.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Additional information
+ description: Tell us anything else you think we should know.
diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.yml b/.github/ISSUE_TEMPLATE/2-feature-request.yml
new file mode 100644
index 000000000..da49bd515
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/2-feature-request.yml
@@ -0,0 +1,25 @@
+name: 🚀 Feature request
+description: Suggest an idea for this project
+labels: [feature request]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for suggesting an idea to make bun better.
+
+ Please fill in as much of the following form as you're able.
+
+ For more information on development, please reach out to our [discord server](https://bun.sh/discord).
+ - type: textarea
+ attributes:
+ label: What is the problem this feature will solve?
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: What is the feature you are proposing to solve the problem?
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: What alternatives have you considered?
diff --git a/.github/ISSUE_TEMPLATE/3-api-ref-docs-problem.yml b/.github/ISSUE_TEMPLATE/3-api-ref-docs-problem.yml
new file mode 100644
index 000000000..de879583c
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/3-api-ref-docs-problem.yml
@@ -0,0 +1,18 @@
+name: 📗 Open an issue regarding the bun docs
+description: Let us know about any problematic documentations
+labels: [doc]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thank you for wanting to make bun better!
+
+ Please fill in as much of the following form as you're able.
+ - type: input
+ attributes:
+ label: Affected URL(s)
+ - type: textarea
+ attributes:
+ label: Description of the problem
+ validations:
+ required: true
diff --git a/.github/workflows/bun.yml b/.github/workflows/bun.yml
index dffab549c..b7be54d5f 100644
--- a/.github/workflows/bun.yml
+++ b/.github/workflows/bun.yml
@@ -161,7 +161,7 @@ jobs:
org.opencontainers.image.title=bun
org.opencontainers.image.description=bun is a fast bundler, transpiler, JavaScript Runtime environment and package manager for web software. The image is an Ubuntu 20.04 image with bun preinstalled into /opt/bun.
org.opencontainers.image.vendor=bun
- org.opencontainers.image.source=https://github.com/Jarred-Sumner/bun
+ org.opencontainers.image.source=https://github.com/oven-sh/bun
org.opencontainers.image.url=https://bun.sh
builder: ${{ steps.buildx.outputs.name }}
push: true
diff --git a/Makefile b/Makefile
index abcf5b0d5..f29934f9c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-SHELL := /bin/bash # Use bash syntax to be consistent
+SHELL := $(shell which bash) # Use bash syntax to be consistent
OS_NAME := $(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH_NAME_RAW := $(shell uname -m)
@@ -429,6 +429,8 @@ prepare-types:
cd /tmp && tsc /tmp/bun-types.d.ts
release-types:
+ # can be removed when/if "bun publish" is implemented
+ @npm --version >/dev/null 2>&1 || (echo -e "ERROR: npm is required."; exit 1)
cd packages/bun-types && npm publish
format:
@@ -511,7 +513,7 @@ require:
@if [ $(CLANG_VERSION) -lt "13" ]; then echo -e "ERROR: clang version >=13 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@13"; exit 1; fi
@cmake --version >/dev/null 2>&1 || (echo -e "ERROR: cmake is required."; exit 1)
@esbuild --version >/dev/null 2>&1 || (echo -e "ERROR: esbuild is required."; exit 1)
- @npm --version >/dev/null 2>&1 || (echo -e "ERROR: npm is required."; exit 1)
+ @$(NPM_CLIENT) --version >/dev/null 2>&1 || (echo -e "ERROR: NPM client (bun or npm) is required."; exit 1)
@go version >/dev/null 2>&1 || (echo -e "ERROR: go is required."; exit 1)
@which aclocal > /dev/null || (echo -e "ERROR: automake is required. Install with:\n\n $(POSIX_PKG_MANAGER) install automake"; exit 1)
@which $(LIBTOOL) > /dev/null || (echo -e "ERROR: libtool is required. Install with:\n\n $(POSIX_PKG_MANAGER) install libtool"; exit 1)
@@ -746,7 +748,7 @@ release-create-auto-updater:
release-create:
gh release create --title "bun v$(PACKAGE_JSON_VERSION)" "$(BUN_BUILD_TAG)"
- gh release create --repo=$(BUN_AUTO_UPDATER_REPO) --title "bun v$(PACKAGE_JSON_VERSION)" "$(BUN_BUILD_TAG)" -n "See https://github.com/Jarred-Sumner/bun/releases/tag/$(BUN_BUILD_TAG) for release notes. Using the install script or bun upgrade is the recommended way to install bun. Join bun's Discord to get access https://bun.sh/discord"
+ gh release create --repo=$(BUN_AUTO_UPDATER_REPO) --title "bun v$(PACKAGE_JSON_VERSION)" "$(BUN_BUILD_TAG)" -n "See https://github.com/oven-sh/bun/releases/tag/$(BUN_BUILD_TAG) for release notes. Using the install script or bun upgrade is the recommended way to install bun. Join bun's Discord to get access https://bun.sh/discord"
release-bin-entitlements:
diff --git a/README.md b/README.md
index 6ac5a32ba..970ca47be 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
bun is a new:
-- JavaScript runtime with Web APIs like [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch), [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), and several more builtin. bun embeds JavaScriptCore, which tends to be faster and more memory efficient than more popular engines like V8 (though harder to embed)
+- JavaScript runtime with Web APIs like [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch), [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), and several more built-in. bun embeds JavaScriptCore, which tends to be faster and more memory efficient than more popular engines like V8 (though harder to embed)
- JavaScript/TypeScript/JSX transpiler
- JavaScript & CSS bundler
- Task runner for package.json scripts
@@ -195,7 +195,7 @@ bun.js prefers Web API compatibility instead of designing new APIs when possible
- `.env` files automatically load into `process.env` and `Bun.env`
- top level await
-The runtime uses JavaScriptCore, the JavaScript engine powering WebKit and Safari. Some web APIs like [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) and [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) directly use [Safari's implementation](https://github.com/Jarred-Sumner/bun/blob/HEAD/src/bun.js/bindings/webcore/JSFetchHeaders.cpp).
+The runtime uses JavaScriptCore, the JavaScript engine powering WebKit and Safari. Some web APIs like [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) and [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL) directly use [Safari's implementation](https://github.com/oven-sh/bun/blob/HEAD/src/bun.js/bindings/webcore/JSFetchHeaders.cpp).
`cat` clone that runs [2x faster than GNU cat](https://twitter.com/jarredsumner/status/1511707890708586496) for large files on Linux
@@ -454,7 +454,7 @@ If `public/index.html` exists, it becomes the default page instead of a 404 page
### Using bun with Create React App
-To create new a React app:
+To create a new React app:
```bash
bun create react ./app
@@ -519,9 +519,9 @@ And to the `types` field in your `tsconfig.json`:
## Not implemented yet
-bun is a project with an incredibly large scope and still in it's early days.
+bun is a project with an incredibly large scope and is still in its early days.
-You can see [Bun's Roadmap](https://github.com/Jarred-Sumner/bun/issues/159), but here are some additional things that are planned:
+You can see [Bun's Roadmap](https://github.com/oven-sh/bun/issues/159), but here are some additional things that are planned:
| Feature | In |
| ------------------------------------------------------------------------------------- | -------------- |
@@ -541,7 +541,7 @@ You can see [Bun's Roadmap](https://github.com/Jarred-Sumner/bun/issues/159), bu
| `@jsxPragma` comments | JS Transpiler |
| Sharing `.bun` files | bun |
| Dates & timestamps | TOML parser |
-| [Hash components for Fast Refresh](https://github.com/Jarred-Sumner/bun/issues/18) | JSX Transpiler |
+| [Hash components for Fast Refresh](https://github.com/oven-sh/bun/issues/18) | JSX Transpiler |
<small>
JS Transpiler == JavaScript Transpiler
@@ -914,6 +914,8 @@ If you get this error while bun is initializing, You probably need to wrap the b
# cd sde-external*
# mkdir /usr/local/bin -p
# cp sde64 /usr/local/bin/sde
+# cp -r intel64 /usr/local/bin/
+# cp -r misc /usr/local/bin/
```
2. Add alias to bashrc
```
@@ -1171,7 +1173,7 @@ Packages, metadata for those packages, the hoisted install order, dependencies f
#### Why is it fast?
-It uses linear arrays for all data. [Packages](https://github.com/Jarred-Sumner/bun/blob/be03fc273a487ac402f19ad897778d74b6d72963/src/install/install.zig#L1825) are referenced by auto-incrementing integer ID or a hash of the package name. Strings longer than 8 characters are de-duplicated. Prior to saving on disk, the lockfile is garbage-collected & made deterministic by walking the package tree and cloning the packages in dependency order.
+It uses linear arrays for all data. [Packages](https://github.com/oven-sh/bun/blob/be03fc273a487ac402f19ad897778d74b6d72963/src/install/install.zig#L1825) are referenced by auto-incrementing integer ID or a hash of the package name. Strings longer than 8 characters are de-duplicated. Prior to saving on disk, the lockfile is garbage-collected & made deterministic by walking the package tree and cloning the packages in dependency order.
#### Cache
@@ -1184,7 +1186,7 @@ rm -rf ~/.bun/install/cache
#### npm registry metadata
bun uses a binary format for caching NPM registry responses. This loads much faster than JSON and tends to be smaller on disk.
-You will see these files in `~/.bun/install/cache/*.npm`. The filename pattern is `${hash(packageName)}.npm`. It’s a hash so that extra directories don’t need to be created for scoped packages
+You will see these files in `~/.bun/install/cache/*.npm`. The filename pattern is `${hash(packageName)}.npm`. It’s a hash so that extra directories don’t need to be created for scoped packages.
bun’s usage of `Cache-Control` ignores `Age`. This improves performance but means bun may be about 5 minutes out of date to receive the latest package version metadata from npm.
@@ -1362,7 +1364,7 @@ Warning: unlike with remote templates, **bun will delete the entire destination
| GITHUB_API_DOMAIN | If you’re using a GitHub enterprise or a proxy, you can change what the endpoint requests to GitHub go |
| GITHUB_API_TOKEN | This lets `bun create` work with private repositories or if you get rate-limited |
-By default, `bun create` will cancel if there are existing files it would overwrite and its a remote template. You can pass `--force` to disable this behavior.
+By default, `bun create` will cancel if there are existing files it would overwrite and it's a remote template. You can pass `--force` to disable this behavior.
#### Publishing a new template
@@ -1473,7 +1475,7 @@ Run `bun bun ./path-to.js` to generate a `node_modules.bun` file containing all
#### What is `.bun`?
-Note: [This format may change soon](https://github.com/Jarred-Sumner/bun/issues/121)
+Note: [This format may change soon](https://github.com/oven-sh/bun/issues/121)
The `.bun` file contains:
@@ -2790,7 +2792,7 @@ const out = encode_png(
);
```
-The [auto-generated wrapper](https://github.com/Jarred-Sumner/bun/blob/c6d732eee2721cd6191672cbe2c57fb17c3fffe4/src/bun.js/ffi.exports.js#L146-L148) converts the pointer to a TypedArray
+The [auto-generated wrapper](https://github.com/oven-sh/bun/blob/c6d732eee2721cd6191672cbe2c57fb17c3fffe4/src/bun.js/ffi.exports.js#L146-L148) converts the pointer to a TypedArray
<details>
@@ -2858,7 +2860,7 @@ await Bun.write("out.png", png);
Bun.js implements 90% of the APIs available in [Node-API](https://nodejs.org/api/n-api.html) (napi).
-You can see the status of [this here](https://github.com/Jarred-Sumner/bun/issues/158).
+You can see the status of [this here](https://github.com/oven-sh/bun/issues/158).
Loading Node-API modules in Bun.js works the same as in Node.js:
@@ -2889,7 +2891,7 @@ require("./my-node-module.node");
import.meta.require("./my-node-module.node");
```
-Bun doesn't currently support dynamic requires, but `import.meta.require` is an escape hatch for that. It uses a [JavaScriptCore builtin function](https://github.com/Jarred-Sumner/bun/blob/aa87d40f4b7fdfb52575f44d151906ddba6a82d0/src/bun.js/bindings/builtins/js/JSZigGlobalObject.js#L26).
+Bun doesn't currently support dynamic requires, but `import.meta.require` is an escape hatch for that. It uses a [JavaScriptCore builtin function](https://github.com/oven-sh/bun/blob/aa87d40f4b7fdfb52575f44d151906ddba6a82d0/src/bun.js/bindings/builtins/js/JSZigGlobalObject.js#L26).
### `Bun.Transpiler`
@@ -3212,7 +3214,7 @@ Inside the container, run this:
```bash
# First time setup
gh auth login
-gh repo clone Jarred-Sumner/bun . -- --depth=1 --progress -j8
+gh repo clone oven-sh/bun . -- --depth=1 --progress -j8
# update all submodules except webkit because webkit takes awhile and it's already compiled for you.
git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress
diff --git a/bench/ffi/plus100/download-napi-plus100.sh b/bench/ffi/plus100/download-napi-plus100.sh
index 431fa88b3..6fff674c6 100644
--- a/bench/ffi/plus100/download-napi-plus100.sh
+++ b/bench/ffi/plus100/download-napi-plus100.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
rm -rf plus100-napi
git clone https://github.com/Jarred-Sumner/napi-plus100 plus100-napi --depth=1
diff --git a/bench/hot-module-reloading/css-stress-test/color-looper.emotion.zig b/bench/hot-module-reloading/css-stress-test/color-looper.emotion.zig
index 725485ec2..9b7a83cf3 100644
--- a/bench/hot-module-reloading/css-stress-test/color-looper.emotion.zig
+++ b/bench/hot-module-reloading/css-stress-test/color-looper.emotion.zig
@@ -75,7 +75,7 @@ pub fn main() anyerror!void {
std.fs.deleteFileAbsolute(video) catch {};
var screen_recorder_argv = [_][]const u8{ "screencapture", "-v", video };
- var recorder = try std.ChildProcess.init(&screen_recorder_argv, allocator);
+ var recorder = std.ChildProcess.init(&screen_recorder_argv, allocator);
recorder.stdin_behavior = .Pipe;
try recorder.spawn();
std.time.sleep(std.time.ns_per_s);
diff --git a/bench/hot-module-reloading/css-stress-test/color-looper.zig b/bench/hot-module-reloading/css-stress-test/color-looper.zig
index 184475faa..87f08d32f 100644
--- a/bench/hot-module-reloading/css-stress-test/color-looper.zig
+++ b/bench/hot-module-reloading/css-stress-test/color-looper.zig
@@ -75,7 +75,7 @@ pub fn main() anyerror!void {
std.fs.deleteFileAbsolute(video) catch {};
var screen_recorder_argv = [_][]const u8{ "screencapture", "-v", video };
- var recorder = try std.ChildProcess.init(&screen_recorder_argv, allocator);
+ var recorder = std.ChildProcess.init(&screen_recorder_argv, allocator);
recorder.stdin_behavior = .Pipe;
try recorder.spawn();
std.time.sleep(std.time.ns_per_s);
diff --git a/bench/hot-module-reloading/css-stress-test/run.sh b/bench/hot-module-reloading/css-stress-test/run.sh
index a30da5a0f..285b4f60d 100644
--- a/bench/hot-module-reloading/css-stress-test/run.sh
+++ b/bench/hot-module-reloading/css-stress-test/run.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
echo "Running next at 24ms"
PROJECT=next SLEEP_INTERVAL=24 make generate &
diff --git a/bench/sqlite/download-northwind.sh b/bench/sqlite/download-northwind.sh
index 5fc523a14..a703ac876 100644
--- a/bench/sqlite/download-northwind.sh
+++ b/bench/sqlite/download-northwind.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
rm -rf Northwind_large.sqlite.zip
diff --git a/build.zig b/build.zig
index ef6f85534..a6a3bc96d 100644
--- a/build.zig
+++ b/build.zig
@@ -43,45 +43,45 @@ const color_map = std.ComptimeStringMap([]const u8, .{
fn addInternalPackages(step: *std.build.LibExeObjStep, _: std.mem.Allocator, target: anytype) !void {
var boringssl: std.build.Pkg = .{
.name = "boringssl",
- .path = pkgPath("src/boringssl.zig"),
+ .source = pkgPath("src/boringssl.zig"),
};
var datetime: std.build.Pkg = .{
.name = "datetime",
- .path = pkgPath("src/deps/zig-datetime/src/datetime.zig"),
+ .source = pkgPath("src/deps/zig-datetime/src/datetime.zig"),
};
var thread_pool: std.build.Pkg = .{
.name = "thread_pool",
- .path = pkgPath("src/thread_pool.zig"),
+ .source = pkgPath("src/thread_pool.zig"),
};
var crash_reporter: std.build.Pkg = .{
.name = "crash_reporter",
- .path = pkgPath("src/deps/backtrace.zig"),
+ .source = pkgPath("src/deps/backtrace.zig"),
};
var picohttp: std.build.Pkg = .{
.name = "picohttp",
- .path = pkgPath("src/deps/picohttp.zig"),
+ .source = pkgPath("src/deps/picohttp.zig"),
};
var io_darwin: std.build.Pkg = .{
.name = "io",
- .path = pkgPath("src/io/io_darwin.zig"),
+ .source = pkgPath("src/io/io_darwin.zig"),
};
var io_linux: std.build.Pkg = .{
.name = "io",
- .path = pkgPath("src/io/io_linux.zig"),
+ .source = pkgPath("src/io/io_linux.zig"),
};
var io_stub: std.build.Pkg = .{
.name = "io",
- .path = pkgPath("src/io/io_stub.zig"),
+ .source = pkgPath("src/io/io_stub.zig"),
};
var lol_html: std.build.Pkg = .{
.name = "lolhtml",
- .path = pkgPath("src/deps/lol-html.zig"),
+ .source = pkgPath("src/deps/lol-html.zig"),
};
var io = if (target.isDarwin())
@@ -93,32 +93,32 @@ fn addInternalPackages(step: *std.build.LibExeObjStep, _: std.mem.Allocator, tar
var strings: std.build.Pkg = .{
.name = "strings",
- .path = pkgPath("src/string_immutable.zig"),
+ .source = pkgPath("src/string_immutable.zig"),
};
var clap: std.build.Pkg = .{
.name = "clap",
- .path = pkgPath("src/deps/zig-clap/clap.zig"),
+ .source = pkgPath("src/deps/zig-clap/clap.zig"),
};
var http: std.build.Pkg = .{
.name = "http",
- .path = pkgPath("src/http_client_async.zig"),
+ .source = pkgPath("src/http_client_async.zig"),
};
var javascript_core_real: std.build.Pkg = .{
.name = "javascript_core",
- .path = pkgPath("src/jsc.zig"),
+ .source = pkgPath("src/jsc.zig"),
};
var javascript_core_stub: std.build.Pkg = .{
.name = "javascript_core",
- .path = pkgPath("src/jsc_stub.zig"),
+ .source = pkgPath("src/jsc_stub.zig"),
};
var uws: std.build.Pkg = .{
.name = "uws",
- .path = pkgPath("src/deps/uws.zig"),
+ .source = pkgPath("src/deps/uws.zig"),
};
var javascript_core = if (target.getOsTag() == .freestanding)
@@ -128,7 +128,7 @@ fn addInternalPackages(step: *std.build.LibExeObjStep, _: std.mem.Allocator, tar
var analytics: std.build.Pkg = .{
.name = "analytics",
- .path = pkgPath("src/analytics.zig"),
+ .source = pkgPath("src/analytics.zig"),
};
io.dependencies = &.{analytics};
@@ -452,7 +452,7 @@ pub fn build(b: *std.build.Builder) !void {
for (headers_obj.packages.items) |pkg_| {
const pkg: std.build.Pkg = pkg_;
if (std.mem.eql(u8, pkg.name, "clap")) continue;
- var test_ = b.addTestSource(pkg.path);
+ var test_ = b.addTestSource(pkg.source);
test_.setMainPkgPath(obj.main_pkg_path.?);
test_.setTarget(target);
diff --git a/bun.lockb b/bun.lockb
index 35bf65c4a..c8855362d 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/misctools/fetch.zig b/misctools/fetch.zig
index 2966e79e6..a286b4dee 100644
--- a/misctools/fetch.zig
+++ b/misctools/fetch.zig
@@ -115,13 +115,11 @@ pub const Arguments = struct {
var body_file = std.fs.openFileAbsoluteZ(absolute_path_, .{ .mode = .read_only }) catch |err| {
Output.printErrorln("<r><red>{s}<r> opening file {s}", .{ @errorName(err), absolute_path });
- Output.flush();
Global.exit(1);
};
var file_contents = body_file.readToEndAlloc(allocator, try body_file.getEndPos()) catch |err| {
Output.printErrorln("<r><red>{s}<r> reading file {s}", .{ @errorName(err), absolute_path });
- Output.flush();
Global.exit(1);
};
body_string = file_contents;
@@ -140,7 +138,6 @@ pub const Arguments = struct {
if (raw_args.items.len == 0) {
Output.prettyErrorln("<r><red>error<r><d>:<r> <b>Missing URL<r>\n\nExample:\n<r><b>fetch GET https://example.com<r>\n\n<b>fetch example.com/foo<r>\n\n", .{});
- Output.flush();
Global.exit(1);
}
@@ -148,7 +145,6 @@ pub const Arguments = struct {
url = URL.parse(raw_args.swapRemove(url_position));
if (!url.isAbsolute()) {
Output.prettyErrorln("<r><red>error<r><d>:<r> <b>Invalid URL<r>\n\nExample:\n<r><b>fetch GET https://example.com<r>\n\n<b>fetch example.com/foo<r>\n\n", .{});
- Output.flush();
Global.exit(1);
}
}
@@ -217,7 +213,6 @@ pub fn main() anyerror!void {
while (channel.tryReadItem() catch null) |http| {
var response = http.response orelse {
Output.prettyErrorln("<r><red>error<r><d>:<r> <b>HTTP response missing<r>", .{});
- Output.flush();
Global.exit(1);
};
diff --git a/misctools/find-unused-zig.sh b/misctools/find-unused-zig.sh
index 78c1f09e8..882e56bd5 100644
--- a/misctools/find-unused-zig.sh
+++ b/misctools/find-unused-zig.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
rg "@import\(\"(.*\.zig)\"\)" src -r "\$1" --only-matching -I | xargs basename | sort | uniq > /tmp/imported-names.txt
find src -iname "*.zig" | xargs basename | sort | uniq > /tmp/all-names.txt
diff --git a/misctools/generate-tests-file.sh b/misctools/generate-tests-file.sh
index eaae47a98..fcc05d8df 100644
--- a/misctools/generate-tests-file.sh
+++ b/misctools/generate-tests-file.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
cd src
rg -l "^test " --type zig | sed -e 's/\(.*\)/@import\(\".\/\1"\);/' | sed '/schema/d' | sed '/deps/d' > /tmp/tests.zig
diff --git a/misctools/http_bench.zig b/misctools/http_bench.zig
index 40938b172..dbbb1723e 100644
--- a/misctools/http_bench.zig
+++ b/misctools/http_bench.zig
@@ -121,13 +121,11 @@ pub const Arguments = struct {
var body_file = std.fs.openFileAbsoluteZ(absolute_path_, .{ .mode = .read_only }) catch |err| {
Output.printErrorln("<r><red>{s}<r> opening file {s}", .{ @errorName(err), absolute_path });
- Output.flush();
Global.exit(1);
};
var file_contents = body_file.readToEndAlloc(allocator, try body_file.getEndPos()) catch |err| {
Output.printErrorln("<r><red>{s}<r> reading file {s}", .{ @errorName(err), absolute_path });
- Output.flush();
Global.exit(1);
};
body_string = file_contents;
@@ -146,7 +144,6 @@ pub const Arguments = struct {
if (raw_args.items.len == 0) {
Output.prettyErrorln("<r><red>error<r><d>:<r> <b>Missing URL<r>\n\nExample:\n<r><b>fetch GET https://example.com<r>\n\n<b>fetch example.com/foo<r>\n\n", .{});
- Output.flush();
Global.exit(1);
}
@@ -154,7 +151,6 @@ pub const Arguments = struct {
url = URL.parse(raw_args.swapRemove(url_position));
if (!url.isAbsolute()) {
Output.prettyErrorln("<r><red>error<r><d>:<r> <b>Invalid URL<r>\n\nExample:\n<r><b>fetch GET https://example.com<r>\n\n<b>fetch example.com/foo<r>\n\n", .{});
- Output.flush();
Global.exit(1);
}
}
@@ -171,12 +167,10 @@ pub const Arguments = struct {
.turbo = args.flag("--turbo"),
.timeout = std.fmt.parseInt(usize, args.option("--timeout") orelse "0", 10) catch |err| {
Output.prettyErrorln("<r><red>{s}<r> parsing timeout", .{@errorName(err)});
- Output.flush();
Global.exit(1);
},
.count = std.fmt.parseInt(usize, args.option("--count") orelse "10", 10) catch |err| {
Output.prettyErrorln("<r><red>{s}<r> parsing count", .{@errorName(err)});
- Output.flush();
Global.exit(1);
},
};
diff --git a/misctools/readlink-getfd.zig b/misctools/readlink-getfd.zig
index c8faa8a82..4ec18e224 100644
--- a/misctools/readlink-getfd.zig
+++ b/misctools/readlink-getfd.zig
@@ -50,8 +50,7 @@ pub fn main() anyerror!void {
switch (err) {
error.NotDir, error.FileNotFound => {
Output.prettyError("<r><red>404 Not Found<r>: <b>\"{s}\"<r>", .{joined_z});
- Output.flush();
- std.process.exit(1);
+ Global.exit(1);
},
else => {
return err;
diff --git a/misctools/tgz.zig b/misctools/tgz.zig
index c423b9d9a..5ec619dec 100644
--- a/misctools/tgz.zig
+++ b/misctools/tgz.zig
@@ -34,8 +34,7 @@ pub fn main() anyerror!void {
var args = try std.process.argsAlloc(std.heap.c_allocator);
if (args.len < 2) {
Output.prettyErrorln("<r><b>usage<r>: tgz ./tar.gz", .{});
- Output.flush();
- std.os.abort();
+ Global.exit(1);
}
var tarball_path_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
diff --git a/package.json b/package.json
index e565372e5..ab0f50e5f 100644
--- a/package.json
+++ b/package.json
@@ -17,4 +17,4 @@
"typescript": "4.6.3"
},
"version": "0.0.0"
-}
+} \ No newline at end of file
diff --git a/packages/bun-error/bun-error.css b/packages/bun-error/bun-error.css
index 79a2ffef6..40ddf8aee 100644
--- a/packages/bun-error/bun-error.css
+++ b/packages/bun-error/bun-error.css
@@ -329,7 +329,7 @@
#BunError-poweredBy {
height: 16px;
- content: url("data:image/webp;base64,UklGRhwFAABXRUJQVlA4TBAFAAAv3MAHEBeioG0jx3f8MY+fGAgkbdz7Zz4Ekjbu/TMftpEkOaFfC5vgSJ4sHswjm7TZk7R34AJUQAFAQwYAQAUkQAZUAFTUz5XDIaPd77AAN2DlBrAAG/Ai8CFwcKICP6L+BzgTEBEBp6xqWyZJejDAWERMQEwHEuEip1yEmPDc/w1qRs7/OqL/EyBbtu22bQ4ViCHTKM0gUUNmIjMmZfu6s7nz3v//KwIgRfe3iP5PAP9bdVNLfR/hfdqK3bxLjDgr9Q4JGpfk7xHxPPu8KRdApEaiIpdSr8iU9id7Cn+vE6WbWqRuTORqm7pujCV+LKW8jyymEZHGALqpRer76LU4NXya9fhb5XgQZ2ks02uxtgBmtXSrBEAr1jO04mxfiazx06Lp71TgQXzbzoPYWSMoxV4pGLEWaMXz/xuHIyPevACm4r6BEXcaNBZeGPGt1NvmKij9pFL47cE48TgLaksRlF6SgnhtsKbrV/w0rVdO2yhdg+lKg+naB9OvK/+Ko+2KrNfeTfuV0/pp2q5rj3/G9OtK22C7ou3Laj6EXEvfHMYnOvM4D8R+Lf434PQ9/din0Vrt6wYsundZj+7QABzNPoeumpMa4Gj2JQ7mqlq3735vqjUCWmxzoq9D9C/217cCWbOtVPXsNvXOt7pD0NxVLV2xAklbflW9A6BF/YFD/clVawBi1XYX3+WbrHdRa4SiE8uWaDJcXbo4GhmrzhM41BWo+jtw6DtAsQJRfQegmSFqjcCpaeC9ALFaI5A0AVnvCWL1G2uEeOsJSXUnJFpjuI1xyWZsUVfok56wa6ZPesChEXZLc4VFN8ga6Zt1FAF23emL70DQGgGW7yJAbL4DQbedOdGvceRjyE2vbRD0hpfOg6h/wKw7vDyyJxwa4PZmmDV2hb74Zph0ZtHM8P6mMMw6Q5EmAA4pwzhOxrDpNw9oVijKWCtQzVCddwsUC6DWYfvi1jpsurLrMcrfnKOkOyySBkKi9UjOnkUcVd9QvzqtzFaCBprH6HPlSfVhjd3+J6VnNNoCmih8weaRVigaPhVg0XiYobgvOgPNm8dPKk93PUavb/KDDUhEExzSFiPJ/e7GcgwWLXDqOlg0A6G5FzdInocV4Pb9YYuPXhpGa4RZy6h+8x4VnYGZSIdE87GkPnJbj6WG7qU7LFoGWTeAYtYAi7WYu6THIHk/OjQNkm+g6dolv/HoVq30W9pqosleymsXay/vPVnXuL60RqDoayaeWukPtQA0detC831MxFPzo1A1RaZTbyBp3eeYbF+Z5pia7gNNlNEae/EtMHsOp+MNIFbHNQ6imrqsho7f/FjjI+bquEaA4rDmb87q8IfhZEdEP8ZyimkfHkXcq/qzMIy5qe2aGBdb7BY9GcfStTQBFM8RMXftFRmmpv7Ewxo+heYWs9oSH5dEGQa6mPXhCEHjdzkbZOGjBjAvkafzMk88XCaGcebhtCwzH2eeLss88XCeJ2CZeBhnYFrmic+a6M8AdaeaNj2OAeRenPy1HQeNi/U3jwIf/sszorAfTjqSf6u8rgBgWnrwcVBaOELuKhA0ruzVW7d/RGsMGJedKklKF5+rDuLSwad4ki4fA8G1jRdAUtkKZQn/Xb8pURYOgbhgEb5BfMYsIlwdwBmfMYtwdYBpwSLCxwCgzpiFCw0AScEsfB4BxHLw3x1vs1WIgXWaagBQOs1NAu94kadaAUCS5hsFe7wwCZx6sVF4/wI=");
+ content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPMAAAAgCAYAAADHXE6+AAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AYht+mSqVUHOwg4pChCooFURFHqWIRLJS2QqsOJpf+QZOGJMXFUXAtOPizWHVwcdbVwVUQBH9AHJ2cFF2kxO+SQosY7zju4b3vfbn7DhAaFaaaXROAqllGKh4Ts7lVMfCKAII0RzEmMVNPpBcz8Bxf9/Dx/S7Ks7zr/hy9St5kgE8knmO6YRFvEM9sWjrnfeIwK0kK8TnxuEEXJH7kuuzyG+eiwwLPDBuZ1DxxmFgsdrDcwaxkqMTTxBFF1ShfyLqscN7irFZqrHVP/sJQXltJc53WEOJYQgJJiJBRQxkVWIjSrpFiIkXnMQ//oONPkksmVxmMHAuoQoXk+MH/4HdvzcLUpJsUigHdL7b9MQwEdoFm3ba/j227eQL4n4Erre2vNoDZT9LrbS1yBPRtAxfXbU3eAy53gIEnXTIkR/LTEgoF4P2MvikH9N8CwTW3b61znD4AGerV8g1wcAiMFCl73ePdPZ19+7em1b8foeJyunuPxOcAAAAGYktHRAC0ABcAF4a+JZkAAAAJcEhZcwAALiMAAC4jAXilP3YAAAAHdElNRQfmBwoKLQocPFhsAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAACkNJREFUeNrtXT1sG0cW/rg2yMLcFKYAk2pMQDq6kXDCsQkNA3ETxYXTJC7uKl+TNGnuBzinuKuuSopclavjFEmKOI1VOK4UwLaaCLHBNBIkgGpIBhBd3PKKJWAyxb4Jn55mdmd3uTJp7wMWS3Jn3ryZfd+8n5ldFpBTThmT4ziF8XjsAigDqAK4BGBC38tUrAzggqb6L3Q+ANCnc04aKuRDkFNGdAvAKh1VBlpJk5h8hwCeAngM4EE+zDmYc8qeti3LTVK00QdwNwd1QOfyIcgpI/rzGRiUMoBr9PnZax/O5DqXUwZUfgkTx63XfdDP53qX0ysAZgC4Te72UMhRDYnZh3T06TBRlR0mHgeatsuUMyhrwgNo6nBv4/eivSF5H49MsuYxc05ZUBXANzHKT2bU7ucAvmXfPwbwjmXs/aeQ618bgMzpAYBP2PcbAO5E1HkM4J/s+yqAf1u29bmcCHLLPD9UArAGwAOwb1mnAcAF0AYwWsA+TxBkph8COBTKeYkAsRkj7q45juMAmIzH4zhxeiGibMFQhk9CruM4DmvXpTphE9WKmAD/Y+nV3ACwAeADPmY5mOeH/gBgnT53LMBZAXCdPo8I0IsG5GcA/h5iLZ8B+B7AZyGg4CC7QGAqhIBUC1wC4okZ4Ny5c4UXL14ULCeSsqheFtcnBg+mTIC0BTKvewfAv37rQ46hubLMus8mKho+LwqQbUO8p3TYAPMXS+CdovF4DLLqv5WNAHKcPoS1XaUYuZpgHK+Rhc7BnNPcA1mCNKre4xAQRbbJrfpJXMebGGLSKqbLa0nodu5m55QlzTqbvWJR5gFmu9VzllaZ85Tu9i3KDySlDeWqn2fB+jqALsVrALAMoEYu3/8AHFFyJspVrACok+vnARgwnpKaVOeJgVcTgA9gN+T6MfQJoxKA3wF4g2Q5juhDnfrcpjLL9JuOfwnAZQBLrJ89Gr+o8akRbxDvnsW4xnHVVZ/9kLGXfUWC8U0K5rgguE3WSwKiIOLrL2c5e8RMoKWZwFZEP8oJeG0AeKTAvEZHA0Ea/m2mcIquEqh2DQyXAbxFE4MkD8COUKwaKQsMCtMieUwJngbJrEsYrVNCqSTKX6V2nmgSTC2SXYGzya5x/jreinoItjF6hoTVpmZ81NikpSsA3tTI5QHYEjJtMpnuG/hdZuM7oGPWVIV56aiKYK11I4LHISWB+nPmjcQB5F0ES2pDFgt/FCOOrnI3u8QSKS0Cpg/gOQnlMkta1ChfHSeXENTNr9Dh0vVtBtqBmAgkmGuCf1vTplLWkbD2Cog+WeMik6PBlJjXc9m5wX7vCiC3xLUhyerS+SaAexreHMg+1RtRnespweKyPg8YX3XtpgB0j67XaGxGhsmBTwjICMx3EtYd0jjfXfBQQ66NA8HGEJXhtrbuupi5QcDZEZauxT4fCZeSK/gPAPYMda8yKzcSSiWV0xVWTSrdRaaYOqXWWaQWyVOhs87LqBEgnmh4r4XwVpOIq+HdZP0ZUF1fgK2WQnEaGpnUBFJhsu+wSajGQNvWjL+6vo/5W8MuMCu2gSDbvaj0yPD7U8oBrMa1zNJVlJa3TWBqMhesyxTJZTd+L6RuUShPh1k1lylijclykTyHJdZmjXkTHQEaRVsai7JD8pbobAoZHmrq1lg/dzXXd1meYR3TjRxFZuk94u0Lq7cN4N2USiH7q9p6j/p7hWRUIUszxOupiRAjKzoA8F+WVJLx6AqA9w3uZhXTTG4fwKcLDmpTCGENZl3+3bT5oC3cYunuhtXdN9TthrjVSpGO2ASiaMnAo8Ksn8k1PDJYfz6ZeSFu5ygkIdRl4YorZArj3UvpZpv4eqy/XKYR8zqUqw3hTan6WYJZPZtsOu4B+BtO71/WKfNnFvH1K03nDQqgoxFZlJK4+SURKyOC50VR3iMl43FzhYHDJ8u2pAF7T7iAFXY27bVNusGiyM42vEsiFkcEYAcC+HHoOOSaJ8ZHyfAj8wa4t+QyOXoJ5ZllMqqPYBfY+xZl/wHgQwb+oWUb5VcBzI4BtAgBtARw2oHoCMtcYS73QFwvigmhE5EU0h0lpuReAjCn4e1ndB+TxLQ9Jk/d4Gntzome2k4OVWGd44B54a36+ZiWy9Uo5ZD9XrRQrKEGzOsMEMvCKvBEWZ1AUtK42GCew4BctCzIQ7B8l4RKlpNFXHITgv5nip15VrsR4bq/DFqNUXaFJZXieAjvGWJuU8y+EJZ52VC2ZgDksSGWNdX1NO6lz8rVNVa3y6z2EuMzMEwUUcpdjwEA6SK7EcBbDnGt6yH1KinuYz1CHtPYd0ROgLvYe2egfzZe3Tuwe4xRx/OQzjYbVa6Rm76B6X7pOwjWe5N4D2e+7q2zzGt0I0eGpIi80R12rQn9LqgrBgVS1uI5pjujahqr2yXedQbYnsFlV8tY69An5NQSUlzr3WOgMS1rKd4jAF+IyYrv/upq6rkp7qOpv3w8dZPfQHg9CLlPWVncrxDsqVZv31TAu0Qg1rm/YdspOYjUw/+2oeANOpJu15w7N9sl1+IHlpxaw8lNGj2h5Hy9eJMUfcDq8qWZjgGENeHijTTxHc9A6/i0qT21FRGUVPOZLOsWySgd7VF9V/BWbj9/hNEzuLNAsEtOjY9ya5sM8EmpRaDuML5rFvFvh927MuvXWa0tVy2TW7aAlu8CO0gZD98Fe5hh0cDcJqW8aaizo1HWbSrvEujrhlhzK0ShWhq3mtMRTu/M0sWE2zSjq91sLYMscZM7IwTrtpsM0E0D74fiN74G7WL6HDLEBNlIeB/bNOYmmbowL6ftYbo9le8XWERSGy04fZkCzAfkvS0EmHUx88/Q7y/uItgC2QkB6j5OZ2x94vldSEKFW3vfoEx7QnlNluOIElQ6N1w9tKGTpafJAeji5i2DfD6NzZahn/epbV8zrlvMU/Bgl/XmuYaeQS7V362ISWpf3Ituhjo3yaj+EMHGER3A+wlluIfpO74W0jKrmXmfxZ9DRGc21U4m4OT2y6Glct4ny/XcUL5HIC1auMge8Sthuow1iqh3HyfXYaP6uc3iUdt+qgdVKkwBfTZBHVP/bVzcEU1KfDy2yXO6GHPsh+Lep6WzTv4MEWwuMbX7KYJNJVHxtuzD9xau+mTewYyEcWXaej0LIMUhH/E2PgxmLG/cduLy82bQZ4jYOmsXu5AiwTTRfH9GYO1HuN+fwO6hjglNDn9lvx1auOovPZudv2nk9SX1vPZNESvPam35QYRCT1IC+SkB7i+O4/Qt5fmjJp+hA/4HAHqO40yYZT6IAPKBeDvJ/yPce/WK32EE377FJHIANjteZ8mXL7CYb3rMyZ4u4/TarRcS76ehNxAsQa1g+qdxZXZ2LYHcJ6AdQv/uaO0bNB3HwXg8nigg0Yv7qkwmDoqfLPlWAYx18bR4Q6eiCzj5p3hJ4nDdSwv6UlBgmmHtYPHe8phTfOKPR6qHMdrIdsdXIcIiVwVoJgkVv2Bp/W3L2cqftnxOOeWUU0C/AoLy/OlRotLzAAAAAElFTkSuQmCC");
}
#BunError-SourceLine-text-highlightExpression {
diff --git a/packages/bun-error/package-lock.json b/packages/bun-error/package-lock.json
index 29e3c4ab4..8c97c5c13 100644
--- a/packages/bun-error/package-lock.json
+++ b/packages/bun-error/package-lock.json
@@ -4,155 +4,182 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+ "@types/prop-types": {
+ "version": "15.7.5",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz",
+ "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==",
+ "dev": true
+ },
+ "@types/react": {
+ "version": "17.0.47",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.47.tgz",
+ "integrity": "sha512-mk0BL8zBinf2ozNr3qPnlu1oyVTYq+4V7WA76RgxUAtf0Em/Wbid38KN6n4abEkvO4xMTBWmnP1FtQzgkEiJoA==",
+ "dev": true,
+ "requires": {
+ "@types/prop-types": "*",
+ "@types/scheduler": "*",
+ "csstype": "^3.0.2"
+ }
+ },
+ "@types/scheduler": {
+ "version": "0.16.2",
+ "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz",
+ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==",
+ "dev": true
+ },
+ "csstype": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz",
+ "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==",
+ "dev": true
+ },
"esbuild": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.11.tgz",
- "integrity": "sha512-xZvPtVj6yecnDeFb3KjjCM6i7B5TCAQZT77kkW/CpXTMnd6VLnRPKrUB1XHI1pSq6a4Zcy3BGueQ8VljqjDGCg==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.48.tgz",
+ "integrity": "sha512-w6N1Yn5MtqK2U1/WZTX9ZqUVb8IOLZkZ5AdHkT6x3cHDMVsYWC7WPdiLmx19w3i4Rwzy5LqsEMtVihG3e4rFzA==",
"requires": {
- "esbuild-android-arm64": "0.14.11",
- "esbuild-darwin-64": "0.14.11",
- "esbuild-darwin-arm64": "0.14.11",
- "esbuild-freebsd-64": "0.14.11",
- "esbuild-freebsd-arm64": "0.14.11",
- "esbuild-linux-32": "0.14.11",
- "esbuild-linux-64": "0.14.11",
- "esbuild-linux-arm": "0.14.11",
- "esbuild-linux-arm64": "0.14.11",
- "esbuild-linux-mips64le": "0.14.11",
- "esbuild-linux-ppc64le": "0.14.11",
- "esbuild-linux-s390x": "0.14.11",
- "esbuild-netbsd-64": "0.14.11",
- "esbuild-openbsd-64": "0.14.11",
- "esbuild-sunos-64": "0.14.11",
- "esbuild-windows-32": "0.14.11",
- "esbuild-windows-64": "0.14.11",
- "esbuild-windows-arm64": "0.14.11"
+ "esbuild-android-64": "0.14.48",
+ "esbuild-android-arm64": "0.14.48",
+ "esbuild-darwin-64": "0.14.48",
+ "esbuild-darwin-arm64": "0.14.48",
+ "esbuild-freebsd-64": "0.14.48",
+ "esbuild-freebsd-arm64": "0.14.48",
+ "esbuild-linux-32": "0.14.48",
+ "esbuild-linux-64": "0.14.48",
+ "esbuild-linux-arm": "0.14.48",
+ "esbuild-linux-arm64": "0.14.48",
+ "esbuild-linux-mips64le": "0.14.48",
+ "esbuild-linux-ppc64le": "0.14.48",
+ "esbuild-linux-riscv64": "0.14.48",
+ "esbuild-linux-s390x": "0.14.48",
+ "esbuild-netbsd-64": "0.14.48",
+ "esbuild-openbsd-64": "0.14.48",
+ "esbuild-sunos-64": "0.14.48",
+ "esbuild-windows-32": "0.14.48",
+ "esbuild-windows-64": "0.14.48",
+ "esbuild-windows-arm64": "0.14.48"
}
},
+ "esbuild-android-64": {
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.48.tgz",
+ "integrity": "sha512-3aMjboap/kqwCUpGWIjsk20TtxVoKck8/4Tu19rubh7t5Ra0Yrpg30Mt1QXXlipOazrEceGeWurXKeFJgkPOUg==",
+ "optional": true
+ },
"esbuild-android-arm64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.11.tgz",
- "integrity": "sha512-6iHjgvMnC/SzDH8TefL+/3lgCjYWwAd1LixYfmz/TBPbDQlxcuSkX0yiQgcJB9k+ibZ54yjVXziIwGdlc+6WNw==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.48.tgz",
+ "integrity": "sha512-vptI3K0wGALiDq+EvRuZotZrJqkYkN5282iAfcffjI5lmGG9G1ta/CIVauhY42MBXwEgDJkweiDcDMRLzBZC4g==",
"optional": true
},
"esbuild-darwin-64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.11.tgz",
- "integrity": "sha512-olq84ikh6TiBcrs3FnM4eR5VPPlcJcdW8BnUz/lNoEWYifYQ+Po5DuYV1oz1CTFMw4k6bQIZl8T3yxL+ZT2uvQ==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.48.tgz",
+ "integrity": "sha512-gGQZa4+hab2Va/Zww94YbshLuWteyKGD3+EsVon8EWTWhnHFRm5N9NbALNbwi/7hQ/hM1Zm4FuHg+k6BLsl5UA==",
"optional": true
},
"esbuild-darwin-arm64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.11.tgz",
- "integrity": "sha512-Jj0ieWLREPBYr/TZJrb2GFH8PVzDqiQWavo1pOFFShrcmHWDBDrlDxPzEZ67NF/Un3t6sNNmeI1TUS/fe1xARg==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.48.tgz",
+ "integrity": "sha512-bFjnNEXjhZT+IZ8RvRGNJthLWNHV5JkCtuOFOnjvo5pC0sk2/QVk0Qc06g2PV3J0TcU6kaPC3RN9yy9w2PSLEA==",
"optional": true
},
"esbuild-freebsd-64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.11.tgz",
- "integrity": "sha512-C5sT3/XIztxxz/zwDjPRHyzj/NJFOnakAanXuyfLDwhwupKPd76/PPHHyJx6Po6NI6PomgVp/zi6GRB8PfrOTA==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.48.tgz",
+ "integrity": "sha512-1NOlwRxmOsnPcWOGTB10JKAkYSb2nue0oM1AfHWunW/mv3wERfJmnYlGzL3UAOIUXZqW8GeA2mv+QGwq7DToqA==",
"optional": true
},
"esbuild-freebsd-arm64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.11.tgz",
- "integrity": "sha512-y3Llu4wbs0bk4cwjsdAtVOesXb6JkdfZDLKMt+v1U3tOEPBdSu6w8796VTksJgPfqvpX22JmPLClls0h5p+L9w==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.48.tgz",
+ "integrity": "sha512-gXqKdO8wabVcYtluAbikDH2jhXp+Klq5oCD5qbVyUG6tFiGhrC9oczKq3vIrrtwcxDQqK6+HDYK8Zrd4bCA9Gw==",
"optional": true
},
"esbuild-linux-32": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.11.tgz",
- "integrity": "sha512-Cg3nVsxArjyLke9EuwictFF3Sva+UlDTwHIuIyx8qpxRYAOUTmxr2LzYrhHyTcGOleLGXUXYsnUVwKqnKAgkcg==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.48.tgz",
+ "integrity": "sha512-ghGyDfS289z/LReZQUuuKq9KlTiTspxL8SITBFQFAFRA/IkIvDpnZnCAKTCjGXAmUqroMQfKJXMxyjJA69c/nQ==",
"optional": true
},
"esbuild-linux-64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.11.tgz",
- "integrity": "sha512-oeR6dIrrojr8DKVrxtH3xl4eencmjsgI6kPkDCRIIFwv4p+K7ySviM85K66BN01oLjzthpUMvBVfWSJkBLeRbg==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.48.tgz",
+ "integrity": "sha512-vni3p/gppLMVZLghI7oMqbOZdGmLbbKR23XFARKnszCIBpEMEDxOMNIKPmMItQrmH/iJrL1z8Jt2nynY0bE1ug==",
"optional": true
},
"esbuild-linux-arm": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.11.tgz",
- "integrity": "sha512-vcwskfD9g0tojux/ZaTJptJQU3a7YgTYsptK1y6LQ/rJmw7U5QJvboNawqM98Ca3ToYEucfCRGbl66OTNtp6KQ==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.48.tgz",
+ "integrity": "sha512-+VfSV7Akh1XUiDNXgqgY1cUP1i2vjI+BmlyXRfVz5AfV3jbpde8JTs5Q9sYgaoq5cWfuKfoZB/QkGOI+QcL1Tw==",
"optional": true
},
"esbuild-linux-arm64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.11.tgz",
- "integrity": "sha512-+e6ZCgTFQYZlmg2OqLkg1jHLYtkNDksxWDBWNtI4XG4WxuOCUErLqfEt9qWjvzK3XBcCzHImrajkUjO+rRkbMg==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.48.tgz",
+ "integrity": "sha512-3CFsOlpoxlKPRevEHq8aAntgYGYkE1N9yRYAcPyng/p4Wyx0tPR5SBYsxLKcgPB9mR8chHEhtWYz6EZ+H199Zw==",
"optional": true
},
"esbuild-linux-mips64le": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.11.tgz",
- "integrity": "sha512-Rrs99L+p54vepmXIb87xTG6ukrQv+CzrM8eoeR+r/OFL2Rg8RlyEtCeshXJ2+Q66MXZOgPJaokXJZb9snq28bw==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.48.tgz",
+ "integrity": "sha512-cs0uOiRlPp6ymknDnjajCgvDMSsLw5mST2UXh+ZIrXTj2Ifyf2aAP3Iw4DiqgnyYLV2O/v/yWBJx+WfmKEpNLA==",
"optional": true
},
"esbuild-linux-ppc64le": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.11.tgz",
- "integrity": "sha512-JyzziGAI0D30Vyzt0HDihp4s1IUtJ3ssV2zx9O/c+U/dhUHVP2TmlYjzCfCr2Q6mwXTeloDcLS4qkyvJtYptdQ==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.48.tgz",
+ "integrity": "sha512-+2F0vJMkuI0Wie/wcSPDCqXvSFEELH7Jubxb7mpWrA/4NpT+/byjxDz0gG6R1WJoeDefcrMfpBx4GFNN1JQorQ==",
+ "optional": true
+ },
+ "esbuild-linux-riscv64": {
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.48.tgz",
+ "integrity": "sha512-BmaK/GfEE+5F2/QDrIXteFGKnVHGxlnK9MjdVKMTfvtmudjY3k2t8NtlY4qemKSizc+QwyombGWTBDc76rxePA==",
"optional": true
},
"esbuild-linux-s390x": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.11.tgz",
- "integrity": "sha512-DoThrkzunZ1nfRGoDN6REwmo8ZZWHd2ztniPVIR5RMw/Il9wiWEYBahb8jnMzQaSOxBsGp0PbyJeVLTUatnlcw==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.48.tgz",
+ "integrity": "sha512-tndw/0B9jiCL+KWKo0TSMaUm5UWBLsfCKVdbfMlb3d5LeV9WbijZ8Ordia8SAYv38VSJWOEt6eDCdOx8LqkC4g==",
"optional": true
},
"esbuild-netbsd-64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.11.tgz",
- "integrity": "sha512-12luoRQz+6eihKYh1zjrw0CBa2aw3twIiHV/FAfjh2NEBDgJQOY4WCEUEN+Rgon7xmLh4XUxCQjnwrvf8zhACw==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.48.tgz",
+ "integrity": "sha512-V9hgXfwf/T901Lr1wkOfoevtyNkrxmMcRHyticybBUHookznipMOHoF41Al68QBsqBxnITCEpjjd4yAos7z9Tw==",
"optional": true
},
"esbuild-openbsd-64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.11.tgz",
- "integrity": "sha512-l18TZDjmvwW6cDeR4fmizNoxndyDHamGOOAenwI4SOJbzlJmwfr0jUgjbaXCUuYVOA964siw+Ix+A+bhALWg8Q==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.48.tgz",
+ "integrity": "sha512-+IHf4JcbnnBl4T52egorXMatil/za0awqzg2Vy6FBgPcBpisDWT2sVz/tNdrK9kAqj+GZG/jZdrOkj7wsrNTKA==",
"optional": true
},
"esbuild-sunos-64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.11.tgz",
- "integrity": "sha512-bmYzDtwASBB8c+0/HVOAiE9diR7+8zLm/i3kEojUH2z0aIs6x/S4KiTuT5/0VKJ4zk69kXel1cNWlHBMkmavQg==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.48.tgz",
+ "integrity": "sha512-77m8bsr5wOpOWbGi9KSqDphcq6dFeJyun8TA+12JW/GAjyfTwVtOnN8DOt6DSPUfEV+ltVMNqtXUeTeMAxl5KA==",
"optional": true
},
"esbuild-windows-32": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.11.tgz",
- "integrity": "sha512-J1Ys5hMid8QgdY00OBvIolXgCQn1ARhYtxPnG6ESWNTty3ashtc4+As5nTrsErnv8ZGUcWZe4WzTP/DmEVX1UQ==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.48.tgz",
+ "integrity": "sha512-EPgRuTPP8vK9maxpTGDe5lSoIBHGKO/AuxDncg5O3NkrPeLNdvvK8oywB0zGaAZXxYWfNNSHskvvDgmfVTguhg==",
"optional": true
},
"esbuild-windows-64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.11.tgz",
- "integrity": "sha512-h9FmMskMuGeN/9G9+LlHPAoiQk9jlKDUn9yA0MpiGzwLa82E7r1b1u+h2a+InprbSnSLxDq/7p5YGtYVO85Mlg==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.48.tgz",
+ "integrity": "sha512-YmpXjdT1q0b8ictSdGwH3M8VCoqPpK1/UArze3X199w6u8hUx3V8BhAi1WjbsfDYRBanVVtduAhh2sirImtAvA==",
"optional": true
},
"esbuild-windows-arm64": {
- "version": "0.14.11",
- "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.11.tgz",
- "integrity": "sha512-dZp7Krv13KpwKklt9/1vBFBMqxEQIO6ri7Azf8C+ob4zOegpJmha2XY9VVWP/OyQ0OWk6cEeIzMJwInRZrzBUQ==",
+ "version": "0.14.48",
+ "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.48.tgz",
+ "integrity": "sha512-HHaOMCsCXp0rz5BT2crTka6MPWVno121NKApsGs/OIW5QC0ggC69YMGs1aJct9/9FSUF4A1xNE/cLvgB5svR4g==",
"optional": true
},
- "immutability-helper": {
- "version": "2.9.1",
- "resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-2.9.1.tgz",
- "integrity": "sha512-r/RmRG8xO06s/k+PIaif2r5rGc3j4Yhc01jSBfwPCXDLYZwp/yxralI37Df1mwmuzcCsen/E/ITKcTEvc1PQmQ==",
- "requires": {
- "invariant": "^2.2.0"
- }
- },
- "invariant": {
- "version": "2.2.4",
- "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
- "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
- "requires": {
- "loose-envify": "^1.0.0"
- }
- },
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -171,57 +198,6 @@
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
- "preact": {
- "version": "10.5.14",
- "resolved": "https://registry.npmjs.org/preact/-/preact-10.5.14.tgz",
- "integrity": "sha512-KojoltCrshZ099ksUZ2OQKfbH66uquFoxHSbnwKbTJHeQNvx42EmC7wQVWNuDt6vC5s3nudRHFtKbpY4ijKlaQ=="
- },
- "preact-compat": {
- "version": "3.19.0",
- "resolved": "https://registry.npmjs.org/preact-compat/-/preact-compat-3.19.0.tgz",
- "integrity": "sha512-f83A4hIhH8Uzhb9GbIcGk8SM19ffWlwP9mDaYwQdRnMdekZwcCA7eIAbeV4EMQaV9C0Yuy8iKgBAtyTKPZQt/Q==",
- "requires": {
- "immutability-helper": "^2.7.1",
- "preact-context": "^1.1.3",
- "preact-render-to-string": "^3.8.2",
- "preact-transition-group": "^1.1.1",
- "prop-types": "^15.6.2",
- "standalone-react-addons-pure-render-mixin": "^0.1.1"
- }
- },
- "preact-context": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/preact-context/-/preact-context-1.1.4.tgz",
- "integrity": "sha512-gcCjPJ65R0MiW9hDu8W/3WAmyTElIvwLyEO6oLQiM6/TbLKLxCpBCWV8GJjx52TTEyUr60HLDcmoCXZlslelzQ=="
- },
- "preact-render-to-string": {
- "version": "3.8.2",
- "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-3.8.2.tgz",
- "integrity": "sha512-przuZPajiurStGgxMoJP0EJeC4xj5CgHv+M7GfF3YxAdhGgEWAkhOSE0xympAFN20uMayntBZpttIZqqLl77fw==",
- "requires": {
- "pretty-format": "^3.5.1"
- }
- },
- "preact-transition-group": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/preact-transition-group/-/preact-transition-group-1.1.1.tgz",
- "integrity": "sha1-8KSTJ+pRXs406ivoZMSn0p5dbhA="
- },
- "pretty-format": {
- "version": "3.8.0",
- "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz",
- "integrity": "sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U="
- },
- "prop-types": {
- "version": "15.7.2",
- "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
- "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
- "requires": {
- "loose-envify": "^1.4.0",
- "object-assign": "^4.1.1",
- "react-is": "^16.8.1"
- }
- },
"react": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
@@ -241,11 +217,6 @@
"scheduler": "^0.20.2"
}
},
- "react-is": {
- "version": "16.13.1",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
- "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
- },
"scheduler": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz",
@@ -254,11 +225,6 @@
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
- },
- "standalone-react-addons-pure-render-mixin": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/standalone-react-addons-pure-render-mixin/-/standalone-react-addons-pure-render-mixin-0.1.1.tgz",
- "integrity": "sha1-PHQJ9MecQN6axyxhbPZ5qZTzdVE="
}
}
}
diff --git a/packages/bun-framework-next/README.md b/packages/bun-framework-next/README.md
index 1dccfe07d..557fe4482 100644
--- a/packages/bun-framework-next/README.md
+++ b/packages/bun-framework-next/README.md
@@ -15,8 +15,10 @@ npm install bun-framework-next
bun bun --use next
```
-Launch bun:
+Launch the development server:
```bash
-bun
+bun dev
```
+
+Open http://localhost:3000 with your browser to see the result. \ No newline at end of file
diff --git a/packages/bun-landing/index.css b/packages/bun-landing/index.css
index 78b440edc..d8cd2798b 100644
--- a/packages/bun-landing/index.css
+++ b/packages/bun-landing/index.css
@@ -440,7 +440,7 @@ header {
.BarGraphItem--bun .BarGraphBar {
background-color: rgb(249, 241, 225);
box-shadow: inset 1px 1px 3px rgb(204, 198, 187);
- background-image: url("/logo.png");
+ background-image: url("/logo.svg");
background-repeat: no-repeat;
background-size: 56px 48.8px;
background-position: 6px 20%;
diff --git a/packages/bun-landing/page.tsx b/packages/bun-landing/page.tsx
index d3f4cd867..f508d7038 100644
--- a/packages/bun-landing/page.tsx
+++ b/packages/bun-landing/page.tsx
@@ -1,7 +1,7 @@
import { readFileSync } from "fs";
import * as shiki from "shiki";
-const DOCS = "https://github.com/Jarred-Sumner/bun#Reference";
+const DOCS = "https://github.com/oven-sh/bun#Reference";
// because we don't want to wait for it to reload everytime this page reloads
globalThis._highlighter ||= await shiki.getHighlighter({
@@ -180,7 +180,7 @@ const InstallBox = ({ desktop = false }) => (
>
<div className="InstallBox-label">
<div className="InstallBox-label-heading">
- Install Bun CLI v0.1.0 (beta)
+ Install Bun CLI v{process.version} (beta)
</div>
<div className="InstallBox-label-subtitle">
macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux
@@ -224,6 +224,19 @@ export default ({ inlineCSS }) => (
projects – all in Bun. Bun is a new JavaScript runtime with
a native bundler, transpiler, task runner and npm client built-in.`}
/>
+ <meta name="og:locale" content="en_US" />
+ <meta name="twitter:site" content="@jarredsumner" />
+ <meta
+ name="description"
+ content={`Bundle, transpile, install and run JavaScript & TypeScript
+ projects – all in Bun. Bun is a new JavaScript runtime with
+ a native bundler, transpiler, task runner and npm client built-in.`}
+ />
+ <meta name="theme-color" content="#fbf0df" />
+ <link rel="manifest" href="manifest.json" />
+ <link rel="icon" type="image/png" sizes="256x256" href="/logo-square.png" />
+ <link rel="icon" type="image/png" sizes="32x32" href="/logo-square@32px.png" />
+ <link rel="icon" type="image/png" sizes="16x16" href="/logo-square@16px.png" />
<title>Bun is a fast all-in-one JavaScript runtime</title>
{inlineCSS ? (
@@ -241,7 +254,7 @@ export default ({ inlineCSS }) => (
<div id="header-wrap">
<header>
<a href="/" id="logo-link" aria-label="home">
- <img height="61px" src="/logo.png" srcSet="/logo.png 1x, /logo@2x.png 2x" alt="Bun logo" id="logo" />
+ <img height="61px" src="/logo.svg" alt="Bun logo" id="logo" />
<img
height="31.65px"
src="/Bun.png"
@@ -266,7 +279,7 @@ export default ({ inlineCSS }) => (
<li>
<a
className="NavText"
- href="https://github.com/Jarred-Sumner/bun"
+ href="https://github.com/oven-sh/bun"
>
GitHub
</a>
@@ -358,17 +371,17 @@ export default ({ inlineCSS }) => (
<BarGraphLabel
name="bun"
version="v0.1.0"
- source="https://github.com/Jarred-Sumner/bun/bench/react-hello-world.jsx"
+ source="https://github.com/oven-sh/bun/bench/react-hello-world.jsx"
/>
<BarGraphLabel
name="node"
version="v18.1.0"
- source="https://github.com/Jarred-Sumner/bun/bench/react-hello-world.node.jsx"
+ source="https://github.com/oven-sh/bun/bench/react-hello-world.node.jsx"
/>
<BarGraphLabel
name="deno"
version="v1.23.2"
- source="https://github.com/Jarred-Sumner/bun/bench/react-hello-world.deno.jsx"
+ source="https://github.com/oven-sh/bun/bench/react-hello-world.deno.jsx"
/>
</div>
</div>
@@ -410,17 +423,17 @@ export default ({ inlineCSS }) => (
<BarGraphLabel
name="bun:sqlite"
version="v0.1.0"
- source="https://github.com/Jarred-Sumner/bun/blob/main/bench/sqlite/query.js"
+ source="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.js"
/>
<BarGraphLabel
name="better-sqlite3"
- source="https://github.com/Jarred-Sumner/bun/blob/main/bench/sqlite/query.better-sqlite3.mjs"
+ source="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.better-sqlite3.mjs"
version="node v18.2.0"
/>
<BarGraphLabel
name="deno (x/sqlite)"
version="v1.23.2"
- source="https://github.com/Jarred-Sumner/bun/blob/main/bench/sqlite/query.deno.js"
+ source="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.deno.js"
/>
</div>
</div>
@@ -460,17 +473,17 @@ export default ({ inlineCSS }) => (
<BarGraphLabel
name="bun:ffi"
version="v0.1.0"
- source="https://github.com/Jarred-Sumner/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.bun.js"
+ source="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.bun.js"
/>
<BarGraphLabel
name="node (napi)"
- source="https://github.com/Jarred-Sumner/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.napi.mjs"
+ source="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.napi.mjs"
version="node v18.2.0"
/>
<BarGraphLabel
name="deno (ffi)"
version="v1.23.2"
- source="https://github.com/Jarred-Sumner/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.deno.js"
+ source="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.deno.js"
/>
</div>
</div>
@@ -555,13 +568,13 @@ export default ({ inlineCSS }) => (
<li>
bun.js automatically loads environment variables from{" "}
<Bun>.env</Bun> files. No more{" "}
- <code class="mono">require("dotenv").load()</code>
+ <code class="mono">require("dotenv").config()</code>
</li>
<li>
bun ships with a fast SQLite3 client builtin <Bun>bun:sqlite</Bun>
</li>
<li>
- <NodeJS href="https://github.com/Jarred-Sumner/bun/issues/158">
+ <NodeJS href="https://github.com/oven-sh/bun/issues/158">
Node-API
</NodeJS>{" "}
bun.js implements most of{" "}
@@ -616,7 +629,7 @@ export default ({ inlineCSS }) => (
but one general theme:{" "}
<a href="https://ziglang.org/">
<Zig></Zig>
- </a>{" "}
+ </a>
's low-level control over memory and lack of hidden control flow
makes it much simpler to write fast software.{" "}
<a href="https://github.com/sponsors/ziglang">
@@ -671,7 +684,7 @@ export default {
<br />
<br />
See{" "}
- <a href="https://github.com/Jarred-Sumner/bun/tree/main/examples">
+ <a href="https://github.com/oven-sh/bun/tree/main/examples">
more examples
</a>{" "}
and check out <a href={DOCS}>the docs</a>. If you have any questions
@@ -736,7 +749,7 @@ export default {
</p>
<h2>How do I see the source code?</h2>
<p>
- Bun is on <a href="https://github.com/Jarred-Sumner/bun">GitHub</a>
+ Bun is on <a href="https://github.com/oven-sh/bun">GitHub</a>
</p>
</div>
</section>
diff --git a/packages/bun-landing/public/favicon.ico b/packages/bun-landing/public/favicon.ico
new file mode 100644
index 000000000..5b9f93874
--- /dev/null
+++ b/packages/bun-landing/public/favicon.ico
Binary files differ
diff --git a/packages/bun-landing/public/index.css b/packages/bun-landing/public/index.css
index 6c2a6a9d7..bc28c45f0 100644
--- a/packages/bun-landing/public/index.css
+++ b/packages/bun-landing/public/index.css
@@ -17,9 +17,11 @@
--vertical-padding: 4rem;
--line-height: 1.4;
}
+
* {
box-sizing: border-box;
}
+
head,
body,
:root {
@@ -37,14 +39,17 @@ a {
text-decoration: none;
transition: transform 0.1s linear;
}
+
a:visited {
color: inherit;
}
+
a:hover {
text-decoration: underline;
transform: scale(1.06, 1.06);
transform-origin: middle center;
}
+
#header-wrap,
#pitch {
background-color: var(--black);
@@ -58,6 +63,7 @@ a:hover {
gap: 24px;
align-items: center;
}
+
main {
width: auto;
@@ -65,6 +71,7 @@ main {
max-width: var(--max-width);
display: grid;
grid-template-columns: auto auto;
+ overflow-y: hidden;
}
main,
@@ -95,6 +102,7 @@ header {
.subtitle {
font-size: 1.2rem;
}
+
nav {
white-space: nowrap;
display: flex;
@@ -139,6 +147,7 @@ header {
cursor: pointer;
transform: scale(1.06);
}
+
#HeaderInstallButton {
transition: transform 0.1s linear;
background: #00a6e1;
@@ -226,15 +235,12 @@ header {
align-items: center;
border: 1px solid var(--orange);
margin-top: 1rem;
- display: grid;
+ display: flex;
+ justify-content: space-between;
align-content: center;
white-space: nowrap;
margin-bottom: 1rem;
-}
-
-#code-box {
font-family: var(--monospace-font);
- position: relative;
}
#curl:hover {
@@ -244,7 +250,7 @@ header {
#curl::before {
display: block;
- content: "$";
+ content: "$" / "";
color: var(--orange);
pointer-events: none;
width: 1ch;
@@ -267,21 +273,18 @@ header {
}
#code-box-copy {
- position: absolute;
- right: 16px;
- top: 0;
- bottom: 0;
height: 100%;
-
display: flex;
align-items: center;
- z-index: 5;
-
color: var(--orange-light);
transition: transform 0.05s linear;
transition-property: color, transform;
transform-origin: center center;
cursor: pointer;
+ background: transparent;
+ border: none;
+ font-size: inherit;
+ font-family: inherit;
}
#code-box-copy:hover {
@@ -302,6 +305,8 @@ header {
align-items: center;
width: min-content;
white-space: nowrap;
+ list-style-type: none;
+ padding: 0;
}
.Tab {
@@ -311,15 +316,25 @@ header {
padding-bottom: 8px;
border-bottom: 1px solid #ccc;
cursor: pointer;
+ padding: 0;
+}
+
+.TabButton {
+ background: transparent;
+ border: none;
padding: 16px 16px;
+ color: inherit;
+ font-size: inherit;
+ font-family: inherit;
+ cursor: inherit;
}
-.Tab[data-tab="react"]:hover,
-.Graphs--active-react .Tab[data-tab="react"],
-.Tab[data-tab="sqlite"]:hover,
-.Graphs--active-sqlite .Tab[data-tab="sqlite"],
-.Tab[data-tab="ffi"]:hover,
-.Graphs--active-ffi .Tab[data-tab="ffi"] {
+.TabButton[data-tab="react"]:hover,
+.Graphs--active-react .TabButton[data-tab="react"],
+.TabButton[data-tab="sqlite"]:hover,
+.Graphs--active-sqlite .TabButton[data-tab="sqlite"],
+.TabButton[data-tab="ffi"]:hover,
+.Graphs--active-ffi .TabButton[data-tab="ffi"] {
border-bottom-color: aquamarine;
background-color: rgba(130, 216, 247, 0.1);
border-right-color: aquamarine;
@@ -335,12 +350,16 @@ header {
.BarGraph-heading {
font-weight: 500;
font-size: 1.5rem;
+ margin: 0;
}
.BarGraphList {
flex: 1;
position: relative;
+ list-style-type: none;
+ padding: 0;
}
+
.BarGraph,
.ActiveTab,
.Graphs {
@@ -350,6 +369,7 @@ header {
.BarGraph-subheading {
font-size: 0.9rem;
color: rgb(135, 134, 134);
+ margin: 0;
}
.BarGraphList {
@@ -385,30 +405,27 @@ header {
.BarGraphBar {
margin: 0 auto;
-
width: var(--primary);
height: var(--opposite);
-
background-color: rgb(93, 89, 134);
- transform-origin: bottom center;
- transform: scaleY(var(--level));
position: relative;
+ height: calc(200px * var(--level));
}
.BarGraphItem {
border-right: 1px dashed var(--dark-border);
border-top: 1px dashed var(--dark-border);
border-bottom: 1px dashed var(--dark-border);
+ min-height: 200px;
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-end;
}
.BarGraphItem--deno {
border-right-color: transparent;
}
-.BarGraph--horizontal .BarGraphBar {
- min-height: 200px;
-}
-
.BarGraph--vertical .BarGraphBar {
max-width: 90%;
}
@@ -419,8 +436,9 @@ header {
font-family: var(--monospace-font);
width: 100%;
text-align: center;
-
position: relative;
+ display: flex;
+ justify-content: center;
}
.CardContent {
@@ -434,14 +452,13 @@ header {
}
.BarGraph--horizontal .BarGraphBar-label {
- transform: scaleY(var(--inverse));
- top: calc(-20px * var(--inverse));
+ top: -22px;
}
.BarGraphItem--bun .BarGraphBar {
background-color: rgb(249, 241, 225);
box-shadow: inset 1px 1px 3px rgb(204, 198, 187);
- background-image: url("/logo.png");
+ background-image: url("/logo.svg");
background-repeat: no-repeat;
background-size: 56px 48.8px;
background-position: 6px 20%;
@@ -460,10 +477,8 @@ header {
.BarGraph--vertical .BarGraphBar {
height: var(--primary);
width: var(--opposite);
-
transform: scaleX(var(--level));
transform-origin: bottom left;
-
max-height: 40px;
margin-top: 1rem;
margin-bottom: 1rem;
@@ -484,13 +499,13 @@ header {
}
.BarGraphKeyItem-value {
- color: #666;
+ color: #7a7a7a;
margin-top: 0.5rem;
}
.BarGraphKeyItem-viewSource {
margin-top: 0.5rem;
- color: #666;
+ color: #7a7a7a;
text-transform: lowercase;
font-weight: thin;
font-size: 0.8rem;
@@ -520,7 +535,7 @@ header {
}
.DemphasizedLabel {
- color: #666;
+ color: #7a7a7a;
font-weight: 300;
}
@@ -535,8 +550,6 @@ header {
display: grid;
}
-#explain-section {
-}
#explain ul {
font-size: 1.2rem;
}
@@ -572,7 +585,7 @@ header {
}
.Tag--Command:before {
- content: "❯";
+ content: "❯" / "";
color: rgba(255, 255, 255, 0.35);
margin-top: auto;
margin-bottom: auto;
@@ -603,22 +616,18 @@ header {
.Tag--React:before {
color: rgba(130, 216, 247, 0.5);
- content: "<";
+ content: "<" / "";
}
.Tag--React:after {
color: rgba(130, 216, 247, 0.5);
- content: ">";
+ content: ">" / "";
}
.Tag--Bun {
--background: #ff17ff;
}
-ul,
-li {
-}
-
.mono {
font-family: var(--monospace-font);
border-radius: 6px;
@@ -817,9 +826,6 @@ li {
gap: 2rem;
}
- .Tabs {
- }
-
.tagline,
.subtitle,
.BarGraph-heading,
@@ -852,16 +858,17 @@ li {
margin: 0;
gap: 0rem;
width: 100%;
+ border-top: 1px solid rgba(200, 200, 200, 0.1);
}
.Tab {
width: 100%;
- padding-top: 16px;
- padding-bottom: 16px;
+ border-bottom-color: #333;
}
- .Tab {
- border-bottom-color: #333;
+ .TabButton {
+ padding-top: 16px;
+ padding-bottom: 16px;
}
#pitch-content {
@@ -873,10 +880,6 @@ li {
.Graphs--active-ffi .Tab[data-tab="ffi"] {
background-color: rgba(100, 100, 100, 0.1);
}
-
- .Tabs {
- border-top: 1px solid rgba(200, 200, 200, 0.1);
- }
}
#explain p > code {
@@ -926,3 +929,13 @@ li {
img {
object-fit: contain;
}
+
+.visually-hidden {
+ clip: rect(0 0 0 0);
+ clip-path: inset(50%);
+ height: 1px;
+ overflow: hidden;
+ position: absolute;
+ white-space: nowrap;
+ width: 1px;
+}
diff --git a/packages/bun-landing/public/index.html b/packages/bun-landing/public/index.html
index 27b3863c7..453104c92 100644
--- a/packages/bun-landing/public/index.html
+++ b/packages/bun-landing/public/index.html
@@ -1,6 +1,12 @@
<!DOCTYPE html><html><head><meta charSet="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta property="og:title" content="Bun is a fast all-in-one JavaScript runtime"/><meta property="og:description" content="Bundle, transpile, install and run JavaScript &amp; TypeScript
+
+ projects – all in Bun. Bun is a new JavaScript runtime with
+
+ a native bundler, transpiler, task runner and npm client built-in."/><meta name="og:locale" content="en_US"/><meta name="twitter:site" content="@jarredsumner"/><meta name="description" content="Bundle, transpile, install and run JavaScript &amp; TypeScript
+
projects – all in Bun. Bun is a new JavaScript runtime with
- a native bundler, transpiler, task runner and npm client built-in."/><title>Bun is a fast all-in-one JavaScript runtime</title><style>:root {
+
+ a native bundler, transpiler, task runner and npm client built-in."/><meta name="theme-color" content="#fbf0df"/><link rel="manifest" href="manifest.json"/><link rel="icon" type="image/png" sizes="256x256" href="/logo-square.png"/><link rel="icon" type="image/png" sizes="32x32" href="/logo-square@32px.png"/><link rel="icon" type="image/png" sizes="16x16" href="/logo-square@16px.png"/><title>Bun is a fast all-in-one JavaScript runtime</title><style>:root {
--black: #0b0a08;
--blue: #00a6e1;
--orange: #f89b4b;
@@ -19,9 +25,11 @@
--vertical-padding: 4rem;
--line-height: 1.4;
}
+
* {
box-sizing: border-box;
}
+
head,
body,
:root {
@@ -39,14 +47,17 @@ a {
text-decoration: none;
transition: transform 0.1s linear;
}
+
a:visited {
color: inherit;
}
+
a:hover {
text-decoration: underline;
transform: scale(1.06, 1.06);
transform-origin: middle center;
}
+
#header-wrap,
#pitch {
background-color: var(--black);
@@ -60,6 +71,7 @@ a:hover {
gap: 24px;
align-items: center;
}
+
main {
width: auto;
@@ -67,6 +79,7 @@ main {
max-width: var(--max-width);
display: grid;
grid-template-columns: auto auto;
+ overflow-y: hidden;
}
main,
@@ -97,6 +110,7 @@ header {
.subtitle {
font-size: 1.2rem;
}
+
nav {
white-space: nowrap;
display: flex;
@@ -141,6 +155,7 @@ header {
cursor: pointer;
transform: scale(1.06);
}
+
#HeaderInstallButton {
transition: transform 0.1s linear;
background: #00a6e1;
@@ -228,15 +243,12 @@ header {
align-items: center;
border: 1px solid var(--orange);
margin-top: 1rem;
- display: grid;
+ display: flex;
+ justify-content: space-between;
align-content: center;
white-space: nowrap;
margin-bottom: 1rem;
-}
-
-#code-box {
font-family: var(--monospace-font);
- position: relative;
}
#curl:hover {
@@ -246,7 +258,7 @@ header {
#curl::before {
display: block;
- content: "$";
+ content: "$" / "";
color: var(--orange);
pointer-events: none;
width: 1ch;
@@ -269,21 +281,18 @@ header {
}
#code-box-copy {
- position: absolute;
- right: 16px;
- top: 0;
- bottom: 0;
height: 100%;
-
display: flex;
align-items: center;
- z-index: 5;
-
color: var(--orange-light);
transition: transform 0.05s linear;
transition-property: color, transform;
transform-origin: center center;
cursor: pointer;
+ background: transparent;
+ border: none;
+ font-size: inherit;
+ font-family: inherit;
}
#code-box-copy:hover {
@@ -304,6 +313,8 @@ header {
align-items: center;
width: min-content;
white-space: nowrap;
+ list-style-type: none;
+ padding: 0;
}
.Tab {
@@ -313,15 +324,25 @@ header {
padding-bottom: 8px;
border-bottom: 1px solid #ccc;
cursor: pointer;
+ padding: 0;
+}
+
+.TabButton {
+ background: transparent;
+ border: none;
padding: 16px 16px;
+ color: inherit;
+ font-size: inherit;
+ font-family: inherit;
+ cursor: inherit;
}
-.Tab[data-tab="react"]:hover,
-.Graphs--active-react .Tab[data-tab="react"],
-.Tab[data-tab="sqlite"]:hover,
-.Graphs--active-sqlite .Tab[data-tab="sqlite"],
-.Tab[data-tab="ffi"]:hover,
-.Graphs--active-ffi .Tab[data-tab="ffi"] {
+.TabButton[data-tab="react"]:hover,
+.Graphs--active-react .TabButton[data-tab="react"],
+.TabButton[data-tab="sqlite"]:hover,
+.Graphs--active-sqlite .TabButton[data-tab="sqlite"],
+.TabButton[data-tab="ffi"]:hover,
+.Graphs--active-ffi .TabButton[data-tab="ffi"] {
border-bottom-color: aquamarine;
background-color: rgba(130, 216, 247, 0.1);
border-right-color: aquamarine;
@@ -337,12 +358,16 @@ header {
.BarGraph-heading {
font-weight: 500;
font-size: 1.5rem;
+ margin: 0;
}
.BarGraphList {
flex: 1;
position: relative;
+ list-style-type: none;
+ padding: 0;
}
+
.BarGraph,
.ActiveTab,
.Graphs {
@@ -352,6 +377,7 @@ header {
.BarGraph-subheading {
font-size: 0.9rem;
color: rgb(135, 134, 134);
+ margin: 0;
}
.BarGraphList {
@@ -387,30 +413,27 @@ header {
.BarGraphBar {
margin: 0 auto;
-
width: var(--primary);
height: var(--opposite);
-
background-color: rgb(93, 89, 134);
- transform-origin: bottom center;
- transform: scaleY(var(--level));
position: relative;
+ height: calc(200px * var(--level));
}
.BarGraphItem {
border-right: 1px dashed var(--dark-border);
border-top: 1px dashed var(--dark-border);
border-bottom: 1px dashed var(--dark-border);
+ min-height: 200px;
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-end;
}
.BarGraphItem--deno {
border-right-color: transparent;
}
-.BarGraph--horizontal .BarGraphBar {
- min-height: 200px;
-}
-
.BarGraph--vertical .BarGraphBar {
max-width: 90%;
}
@@ -421,8 +444,9 @@ header {
font-family: var(--monospace-font);
width: 100%;
text-align: center;
-
position: relative;
+ display: flex;
+ justify-content: center;
}
.CardContent {
@@ -436,14 +460,13 @@ header {
}
.BarGraph--horizontal .BarGraphBar-label {
- transform: scaleY(var(--inverse));
- top: calc(-20px * var(--inverse));
+ top: -22px;
}
.BarGraphItem--bun .BarGraphBar {
background-color: rgb(249, 241, 225);
box-shadow: inset 1px 1px 3px rgb(204, 198, 187);
- background-image: url("/logo.png");
+ background-image: url("/logo.svg");
background-repeat: no-repeat;
background-size: 56px 48.8px;
background-position: 6px 20%;
@@ -462,10 +485,8 @@ header {
.BarGraph--vertical .BarGraphBar {
height: var(--primary);
width: var(--opposite);
-
transform: scaleX(var(--level));
transform-origin: bottom left;
-
max-height: 40px;
margin-top: 1rem;
margin-bottom: 1rem;
@@ -486,13 +507,13 @@ header {
}
.BarGraphKeyItem-value {
- color: #666;
+ color: #7a7a7a;
margin-top: 0.5rem;
}
.BarGraphKeyItem-viewSource {
margin-top: 0.5rem;
- color: #666;
+ color: #7a7a7a;
text-transform: lowercase;
font-weight: thin;
font-size: 0.8rem;
@@ -522,7 +543,7 @@ header {
}
.DemphasizedLabel {
- color: #666;
+ color: #7a7a7a;
font-weight: 300;
}
@@ -537,8 +558,6 @@ header {
display: grid;
}
-#explain-section {
-}
#explain ul {
font-size: 1.2rem;
}
@@ -574,7 +593,7 @@ header {
}
.Tag--Command:before {
- content: "❯";
+ content: "❯" / "";
color: rgba(255, 255, 255, 0.35);
margin-top: auto;
margin-bottom: auto;
@@ -605,22 +624,18 @@ header {
.Tag--React:before {
color: rgba(130, 216, 247, 0.5);
- content: "<";
+ content: "<" / "";
}
.Tag--React:after {
color: rgba(130, 216, 247, 0.5);
- content: ">";
+ content: ">" / "";
}
.Tag--Bun {
--background: #ff17ff;
}
-ul,
-li {
-}
-
.mono {
font-family: var(--monospace-font);
border-radius: 6px;
@@ -819,9 +834,6 @@ li {
gap: 2rem;
}
- .Tabs {
- }
-
.tagline,
.subtitle,
.BarGraph-heading,
@@ -854,16 +866,17 @@ li {
margin: 0;
gap: 0rem;
width: 100%;
+ border-top: 1px solid rgba(200, 200, 200, 0.1);
}
.Tab {
width: 100%;
- padding-top: 16px;
- padding-bottom: 16px;
+ border-bottom-color: #333;
}
- .Tab {
- border-bottom-color: #333;
+ .TabButton {
+ padding-top: 16px;
+ padding-bottom: 16px;
}
#pitch-content {
@@ -875,10 +888,6 @@ li {
.Graphs--active-ffi .Tab[data-tab="ffi"] {
background-color: rgba(100, 100, 100, 0.1);
}
-
- .Tabs {
- border-top: 1px solid rgba(200, 200, 200, 0.1);
- }
}
#explain p > code {
@@ -928,24 +937,128 @@ li {
img {
object-fit: contain;
}
-</style></head><body><div id="header-wrap"><header><a href="/" id="logo-link"><img height="61px" src="/logo@2x.png" alt="Bun" id="logo"/><img height="31.65px" src="/Bun@2x.png" alt="Bun" id="logo-text"/></a><nav class="Navigation"><li><a class="NavText" href="https://github.com/Jarred-Sumner/bun#Reference">Docs</a></li><li><a class="NavText" href="https://bun.sh/discord">Discord</a></li><li><a class="NavText" href="https://github.com/Jarred-Sumner/bun">GitHub</a></li></nav></header></div><div id="pitch"><main><div id="pitch-content"><h1 class="tagline">Bun is a fast all-in-one JavaScript runtime</h1><p class="subtitle">Bundle, transpile, install and run JavaScript &amp; TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.</p><div class="InstallBox InstallBox--desktop" id="install"><div id="install-label"><div class="unselectable" id="install-label-heading">Install Bun CLI v0.1.0 (beta)</div><div class="unselectable" id="install-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div id="code-box"><div id="curl">curl https://bun.sh/install | bash</div><div class="unselectable" id="code-box-copy">copy</div></div><a class="unselectable" id="view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></div><div class="Graphs Graphs--active-react"><div class="Tabs"><div data-tab="react" class="Tab">Bun.serve</div><div data-tab="sqlite" class="Tab">bun:sqlite</div><div data-tab="ffi" class="Tab">bun:ffi</div></div><div id="active-tab" class="ActiveTab"><div class="BarGraph BarGraph--react BarGraph--horizontal BarGraph--dark"><div class="BarGraph-heading">Server-side rendering React</div><div title="oha -z 5s" class="BarGraph-subheading">HTTP requests per second (Linux AMD64)</div><div style="--count:3" class="BarGraphList"><div class="BarGraphItem BarGraphItem--bun" style="--amount:48936;--max:61170"><div style="--amount:48936;--max:61170" title="48936 requests per second" class="BarGraphBar"><div style="--amount:48936;--max:61170" class="BarGraphBar-label">48,936</div></div></div><div class="BarGraphItem BarGraphItem--node" style="--amount:16288;--max:61170"><div style="--amount:16288;--max:61170" title="16288 requests per second" class="BarGraphBar"><div style="--amount:16288;--max:61170" class="BarGraphBar-label">16,288</div></div></div><div class="BarGraphItem BarGraphItem--deno" style="--amount:12289;--max:61170"><div style="--amount:12289;--max:61170" title="12289 requests per second" class="BarGraphBar"><div style="--amount:12289;--max:61170" class="BarGraphBar-label">12,289</div></div></div></div><div style="--count:3" class="BarGraphKey"><a href="https://github.com/Jarred-Sumner/bun/bench/react-hello-world.jsx" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">bun</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/Jarred-Sumner/bun/bench/react-hello-world.deno.jsx" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">node</div><div class="BarGraphKeyItem-value">v18.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/Jarred-Sumner/bun/bench/react-hello-world.node.jsx" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">deno</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div class="BarGraph--sqlite BarGraph BarGraph--horizontal BarGraph--dark"><div class="BarGraph-heading">Load a huge table</div><div class="BarGraph-subheading">Average queries per second</div><div style="--count:3" class="BarGraphList"><div class="BarGraphItem BarGraphItem--bun" style="--amount:60.24;--max:76"><div style="--amount:60.24;--max:76" title="60.24 queries per second" class="BarGraphBar"><div style="--amount:60.24;--max:76" class="BarGraphBar-label">60.24</div></div></div><div class="BarGraphItem BarGraphItem--better-sqlite3" style="--amount:23.28;--max:76"><div style="--amount:23.28;--max:76" title="23.28 queries per second" class="BarGraphBar"><div style="--amount:23.28;--max:76" class="BarGraphBar-label">23.28</div></div></div><div class="BarGraphItem BarGraphItem--deno" style="--amount:9.55;--max:76"><div style="--amount:9.55;--max:76" title="9.55 queries per second" class="BarGraphBar"><div style="--amount:9.55;--max:76" class="BarGraphBar-label">9.55</div></div></div></div><div style="--count:3" class="BarGraphKey"><a href="https://github.com/Jarred-Sumner/bun/blob/main/bench/sqlite/query.js" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">bun:sqlite</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/Jarred-Sumner/bun/blob/main/bench/sqlite/query.node.mjs" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">better-sqlite3</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/Jarred-Sumner/bun/blob/main/bench/sqlite/query.deno.js" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">deno (x/sqlite)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div class="BarGraph BarGraph--ffi BarGraph--horizontal BarGraph--dark"><div class="BarGraph-heading">How fast can it get?</div><div class="BarGraph-subheading">Operations per second</div><div style="--count:3" class="BarGraphList"><div class="BarGraphItem BarGraphItem--bun" style="--amount:115473441.00;--max:144341802"><div style="--amount:115473441.00;--max:144341802" title="115473441.00 operations per second" class="BarGraphBar"><div style="--amount:115473441.00;--max:144341802" class="BarGraphBar-label">115,473,441</div></div></div><div class="BarGraphItem BarGraphItem--Node-API" style="--amount:43478261.00;--max:144341802"><div style="--amount:43478261.00;--max:144341802" title="43478261.00 operations per second" class="BarGraphBar"><div style="--amount:43478261.00;--max:144341802" class="BarGraphBar-label">43,478,261</div></div></div><div class="BarGraphItem BarGraphItem--deno" style="--amount:2891761.00;--max:144341802"><div style="--amount:2891761.00;--max:144341802" title="2891761.00 oeprations per iteration" class="BarGraphBar"><div style="--amount:2891761.00;--max:144341802" class="BarGraphBar-label">2,891,761</div></div></div></div><div style="--count:3" class="BarGraphKey"><a href="https://github.com/Jarred-Sumner/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.bun.js" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">bun:ffi</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/Jarred-Sumner/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.napi.mjs" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">node (napi)</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/Jarred-Sumner/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.deno.js" target="_blank" class="BarGraphKeyItem"><div class="BarGraphKeyItem-label">deno (ffi)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div></div></div><div class="InstallBox InstallBox--mobile" id="install"><div id="install-label"><div class="unselectable" id="install-label-heading">Install Bun CLI v0.1.0 (beta)</div><div class="unselectable" id="install-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div id="code-box"><div id="curl">curl https://bun.sh/install | bash</div><div class="unselectable" id="code-box-copy">copy</div></div><a class="unselectable" id="view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></main></div><section id="explain-section"><div id="explain"><h1>Tell me more about Bun</h1><p>Bun is a modern JavaScript runtime like Node or Deno. It was built from scratch to focus on three main things:</p><ul><li>Start fast (it has the edge in mind).</li><li>New levels of performance (extending JavaScriptCore, the engine).</li><li>Being a great and complete tool (bundler, transpiler, package manager).</li></ul><p>Bun is designed as a drop-in replacement for your current JavaScript &amp; TypeScript apps or scripts — on your local computer, server or on the edge. Bun natively implements hundreds of Node.js and Web APIs, including ~90% of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html" target="_blank">Node-API</a> <!-- -->functions (native modules), fs, path, Buffer and more.<!-- --></p><p>The goal of Bun is to run most of the worlds JavaScript outside of browsers, bringing performance and complexity enhancements to your future infrastructure, as well as developer productivity through better, simpler tooling.</p><h1>Batteries included</h1><ul id="batteries"><li>Web APIs like<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/fetch" class="Tag Tag--WebAPI">fetch</a>,<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket" class="Tag Tag--WebAPI">WebSocket</a>, and<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream" class="Tag Tag--WebAPI">ReadableStream</a> <!-- -->are builtin<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node_modules</span> bun implements Node.js&#x27; module resolution algorithm, so you can use npm packages in bun.js. ESM and CommonJS are supported, but Bun internally uses ESM.<!-- --></li><li>In bun.js, every file is transpiled.<!-- --> <!-- --><span target="_blank" class="Tag Tag--TypeScript">TypeScript</span> &amp; <!-- --><span target="_blank" class="Tag Tag--React">JSX</span> just work.<!-- --></li><li>bun supports <!-- --><code class="">&quot;paths&quot;</code>,<!-- --> <!-- --><code>&quot;jsxImportSource&quot;</code>and more from <!-- --><span target="_blank" class="Tag Tag--TypeScript">tsconfig.json</span> files<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">Bun.Transpiler</span> bun&#x27;s JSX &amp; TypeScript transpiler is available as an API in Bun.js<!-- --></li><li>use the fastest system calls available with <!-- --><span target="_blank" class="Tag Tag--Bun">Bun.write</span> <!-- -->to write, copy, pipe, send and clone files.<!-- --></li><li>bun.js automatically loads environment variables from<!-- --> <!-- --><span target="_blank" class="Tag Tag--Bun">.env</span> files. No more<!-- --> <!-- --><code class="mono">require(&quot;dotenv&quot;).load()</code></li><li>bun ships with a fast SQLite3 client builtin <!-- --><span target="_blank" class="Tag Tag--Bun">bun:sqlite</span></li><li><a target="_blank" href="https://github.com/Jarred-Sumner/bun/issues/158" class="Tag Tag--NodeJS">Node-API</a> <!-- -->bun.js implements most of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html#node-api" target="_blank">Node-API (N-API)</a>. Many Node.js native modules just work.<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">bun:ffi</span> call native code from JavaScript with bun&#x27;s low-overhead foreign function interface<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node:fs</span> <!-- --><span target="_blank" class="Tag Tag--NodeJS">node:path</span> bun.js natively supports a growing list of Node.js core modules along with globals like Buffer and process.<!-- --></li></ul><h1>How does Bun work?</h1><p>Bun.js uses the<!-- --> <!-- --><a href="https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore">JavaScriptCore</a> <!-- -->engine, which tends<!-- --> <!-- --><a target="blank" href="https://twitter.com/jarredsumner/status/1499225725492076544">to start</a> <!-- -->and perform a little faster than more traditional choices like V8. Bun is written in<!-- --> <!-- --><a href="https://ziglang.org/"><svg xmlns="http://www.w3.org/2000/svg" height="1.2rem" class="Zig" viewBox="0 0 400 140"><g fill="#F7A41D"><g><polygon points="46,22 28,44 19,30"></polygon><polygon points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22" shape-rendering="crispEdges"></polygon><polygon points="31,95 12,117 4,106"></polygon></g><g><polygon points="56,22 62,36 37,44"></polygon><polygon points="56,22 111,22 111,44 37,44 56,32" shape-rendering="crispEdges"></polygon><polygon points="116,95 97,117 90,104"></polygon><polygon points="116,95 100,104 97,117 42,117 42,95" shape-rendering="crispEdges"></polygon><polygon points="150,0 52,117 3,140 101,22"></polygon></g><g><polygon points="141,22 140,40 122,45"></polygon><polygon points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22" shape-rendering="crispEdges"></polygon><polygon points="125,95 130,110 106,117"></polygon></g></g><g fill="#121212"><g><polygon points="260,22 260,37 229,40 177,40 177,22" shape-rendering="crispEdges"></polygon><polygon points="260,37 207,99 207,103 176,103 229,40 229,37"></polygon><polygon points="261,99 261,117 176,117 176,103 206,99" shape-rendering="crispEdges"></polygon></g><rect x="272" y="22" shape-rendering="crispEdges" width="22" height="95"></rect><g><polygon points="394,67 394,106 376,106 376,81 360,70 346,67" shape-rendering="crispEdges"></polygon><polygon points="360,68 376,81 346,67"></polygon><path d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
+
+.visually-hidden {
+ clip: rect(0 0 0 0);
+ clip-path: inset(50%);
+ height: 1px;
+ overflow: hidden;
+ position: absolute;
+ white-space: nowrap;
+ width: 1px;
+}
+</style></head><body><div id="header-wrap"><header><a href="/" id="logo-link" aria-label="home"><img height="61px" src="/logo.svg" alt="Bun logo" id="logo"/><img height="31.65px" src="/Bun.png" srcSet="/Bun.png 1x, /Bun@2x.png 2x" alt="Bun" id="logo-text"/></a><nav class="Navigation"><li><a class="NavText" href="https://github.com/oven-sh/bun#Reference">Docs</a></li><li><a class="NavText" href="https://bun.sh/discord">Discord</a></li><li><a class="NavText" href="https://github.com/oven-sh/bun">GitHub</a></li></nav></header></div><div id="pitch"><main><div id="pitch-content"><h1 class="tagline">Bun is a fast all-in-one JavaScript runtime</h1><p class="subtitle">Bundle, transpile, install and run JavaScript &amp; TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.</p><div class="InstallBox InstallBox--desktop" id="install"><div id="install-label"><div class="unselectable" id="install-label-heading">Install Bun CLI v0.1.0 (beta)</div><div class="unselectable" id="install-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div id="code-box"><div id="curl">curl https://bun.sh/install | bash</div><button class="unselectable" id="code-box-copy" aria-label="Copy installation script">copy</button></div><a class="unselectable" id="view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></div><div class="Graphs Graphs--active-react"><ul class="Tabs" role="tablist"><li class="Tab"><button data-tab="react" id="tab-react" aria-controls="react-tab-content" class="TabButton" role="tab" aria-selected="true" tabindex="0">Bun.serve</button></li><li class="Tab"><button data-tab="sqlite" id="tab-sqlite" aria-controls="sqlite-tab-content" class="TabButton" role="tab" tabindex="-1">bun:sqlite</button></li><li class="Tab"><button data-tab="ffi" id="tab-ffi" aria-controls="ffi-tab-content" class="TabButton" role="tab" tabindex="-1">bun:ffi</button></li></ul><div id="active-tab" class="ActiveTab"><div role="tabpanel" tabindex="0" id="react-tab-content" aria-labelledby="tab-react" class="BarGraph BarGraph--react BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">Server-side rendering React</h2><p class="BarGraph-subheading">HTTP requests per second (Linux AMD64)</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:48936;--max:61170"><div class="visually-hidden">bun: 48,936 requests per second</div><div style="--amount:48936;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:48936;--max:61170" class="BarGraphBar-label">48,936</div></div></li><li class="BarGraphItem BarGraphItem--node" style="--amount:16288;--max:61170"><div class="visually-hidden">node: 16,288 requests per second</div><div style="--amount:16288;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:16288;--max:61170" class="BarGraphBar-label">16,288</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:15786;--max:61170"><div class="visually-hidden">deno: 15,786 requests per second</div><div style="--amount:15786;--max:61170" class="BarGraphBar" aria-hidden="true"><div style="--amount:15786;--max:61170" class="BarGraphBar-label">15,786</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/bench/react-hello-world.jsx" target="_blank" class="BarGraphKeyItem" aria-label="bun benchmark source"><div class="BarGraphKeyItem-label">bun</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/bench/react-hello-world.node.jsx" target="_blank" class="BarGraphKeyItem" aria-label="node benchmark source"><div class="BarGraphKeyItem-label">node</div><div class="BarGraphKeyItem-value">v18.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/bench/react-hello-world.deno.jsx" target="_blank" class="BarGraphKeyItem" aria-label="deno benchmark source"><div class="BarGraphKeyItem-label">deno</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div role="tabpanel" tabindex="-1" id="sqlite-tab-content" aria-labelledby="tab-sqlite" class="BarGraph--sqlite BarGraph BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">Load a huge table</h2><p class="BarGraph-subheading">Average queries per second</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:60.24;--max:76"><div class="visually-hidden">bun: 60.24 queries per second</div><div style="--amount:60.24;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:60.24;--max:76" class="BarGraphBar-label">60.24</div></div></li><li class="BarGraphItem BarGraphItem--better-sqlite3" style="--amount:23.28;--max:76"><div class="visually-hidden">better-sqlite3: 23.28 queries per second</div><div style="--amount:23.28;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:23.28;--max:76" class="BarGraphBar-label">23.28</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:9.55;--max:76"><div class="visually-hidden">deno: 9.55 queries per second</div><div style="--amount:9.55;--max:76" class="BarGraphBar" aria-hidden="true"><div style="--amount:9.55;--max:76" class="BarGraphBar-label">9.55</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.js" target="_blank" class="BarGraphKeyItem" aria-label="bun:sqlite benchmark source"><div class="BarGraphKeyItem-label">bun:sqlite</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.better-sqlite3.mjs" target="_blank" class="BarGraphKeyItem" aria-label="better-sqlite3 benchmark source"><div class="BarGraphKeyItem-label">better-sqlite3</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/main/bench/sqlite/query.deno.js" target="_blank" class="BarGraphKeyItem" aria-label="deno (x/sqlite) benchmark source"><div class="BarGraphKeyItem-label">deno (x/sqlite)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div><div role="tabpanel" tabindex="-1" id="ffi-tab-content" aria-labelledby="tab-ffi" class="BarGraph BarGraph--ffi BarGraph--horizontal BarGraph--dark"><h2 class="BarGraph-heading">How fast can it get?</h2><p class="BarGraph-subheading">Operations per second</p><ul style="--count:3" class="BarGraphList"><li class="BarGraphItem BarGraphItem--bun" style="--amount:115473441.00;--max:144341802"><div class="visually-hidden">bun: 115,473,441 operations per second</div><div style="--amount:115473441.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:115473441.00;--max:144341802" class="BarGraphBar-label">115,473,441</div></div></li><li class="BarGraphItem BarGraphItem--Node-API" style="--amount:43478261.00;--max:144341802"><div class="visually-hidden">Node-API: 43,478,261 operations per second</div><div style="--amount:43478261.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:43478261.00;--max:144341802" class="BarGraphBar-label">43,478,261</div></div></li><li class="BarGraphItem BarGraphItem--deno" style="--amount:2891761.00;--max:144341802"><div class="visually-hidden">deno: 2,891,761 operations per iteration</div><div style="--amount:2891761.00;--max:144341802" class="BarGraphBar" aria-hidden="true"><div style="--amount:2891761.00;--max:144341802" class="BarGraphBar-label">2,891,761</div></div></li></ul><div style="--count:3" class="BarGraphKey"><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.bun.js" target="_blank" class="BarGraphKeyItem" aria-label="bun:ffi benchmark source"><div class="BarGraphKeyItem-label">bun:ffi</div><div class="BarGraphKeyItem-value">v0.1.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.napi.mjs" target="_blank" class="BarGraphKeyItem" aria-label="node (napi) benchmark source"><div class="BarGraphKeyItem-label">node (napi)</div><div class="BarGraphKeyItem-value">node v18.2.0</div><div class="BarGraphKeyItem-viewSource">View source</div></a><a href="https://github.com/oven-sh/bun/blob/f5527c976e20cb60b977cc1b21df079f3e388cc9/bench/ffi/plus100/add3.deno.js" target="_blank" class="BarGraphKeyItem" aria-label="deno (ffi) benchmark source"><div class="BarGraphKeyItem-label">deno (ffi)</div><div class="BarGraphKeyItem-value">v1.23.2</div><div class="BarGraphKeyItem-viewSource">View source</div></a></div></div></div></div><div class="InstallBox InstallBox--mobile" id="install"><div id="install-label"><div class="unselectable" id="install-label-heading">Install Bun CLI v0.1.0 (beta)</div><div class="unselectable" id="install-label-subtitle">macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux</div></div><div id="code-box"><div id="curl">curl https://bun.sh/install | bash</div><button class="unselectable" id="code-box-copy" aria-label="Copy installation script">copy</button></div><a class="unselectable" id="view-source-link" target="_blank" href="https://bun.sh/install">Show script source</a></div></main></div><section id="explain-section"><div id="explain"><h2>Tell me more about Bun</h2><p>Bun is a modern JavaScript runtime like Node or Deno. It was built from scratch to focus on three main things:</p><ul><li>Start fast (it has the edge in mind).</li><li>New levels of performance (extending JavaScriptCore, the engine).</li><li>Being a great and complete tool (bundler, transpiler, package manager).</li></ul><p>Bun is designed as a drop-in replacement for your current JavaScript &amp; TypeScript apps or scripts — on your local computer, server or on the edge. Bun natively implements hundreds of Node.js and Web APIs, including ~90% of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html" target="_blank">Node-API</a> <!-- -->functions (native modules), fs, path, Buffer and more.<!-- --></p><p>The goal of Bun is to run most of the worlds JavaScript outside of browsers, bringing performance and complexity enhancements to your future infrastructure, as well as developer productivity through better, simpler tooling.</p><h2>Batteries included</h2><ul id="batteries"><li>Web APIs like<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/fetch" class="Tag Tag--WebAPI">fetch</a>,<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket" class="Tag Tag--WebAPI">WebSocket</a>, and<!-- --> <!-- --><a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream" class="Tag Tag--WebAPI">ReadableStream</a> <!-- -->are builtin<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node_modules</span> bun implements Node.js&#x27; module resolution algorithm, so you can use npm packages in bun.js. ESM and CommonJS are supported, but Bun internally uses ESM.<!-- --></li><li>In bun.js, every file is transpiled.<!-- --> <!-- --><span target="_blank" class="Tag Tag--TypeScript">TypeScript</span> &amp; <!-- --><span target="_blank" class="Tag Tag--React">JSX</span> just work.<!-- --></li><li>bun supports <!-- --><code class="">&quot;paths&quot;</code>,<!-- --> <!-- --><code>&quot;jsxImportSource&quot;</code>and more from <!-- --><span target="_blank" class="Tag Tag--TypeScript">tsconfig.json</span> files<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">Bun.Transpiler</span> bun&#x27;s JSX &amp; TypeScript transpiler is available as an API in Bun.js<!-- --></li><li>use the fastest system calls available with <!-- --><span target="_blank" class="Tag Tag--Bun">Bun.write</span> <!-- -->to write, copy, pipe, send and clone files.<!-- --></li><li>bun.js automatically loads environment variables from<!-- --> <!-- --><span target="_blank" class="Tag Tag--Bun">.env</span> files. No more<!-- --> <!-- --><code class="mono">require(&quot;dotenv&quot;).load()</code></li><li>bun ships with a fast SQLite3 client builtin <!-- --><span target="_blank" class="Tag Tag--Bun">bun:sqlite</span></li><li><a target="_blank" href="https://github.com/oven-sh/bun/issues/158" class="Tag Tag--NodeJS">Node-API</a> <!-- -->bun.js implements most of<!-- --> <!-- --><a href="https://nodejs.org/api/n-api.html#node-api" target="_blank">Node-API (N-API)</a>. Many Node.js native modules just work.<!-- --></li><li><span target="_blank" class="Tag Tag--Bun">bun:ffi</span> call native code from JavaScript with bun&#x27;s low-overhead foreign function interface<!-- --></li><li><span target="_blank" class="Tag Tag--NodeJS">node:fs</span> <!-- --><span target="_blank" class="Tag Tag--NodeJS">node:path</span> bun.js natively supports a growing list of Node.js core modules along with globals like Buffer and process.<!-- --></li></ul><h2>How does Bun work?</h2><p>Bun.js uses the<!-- --> <!-- --><a href="https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore">JavaScriptCore</a> <!-- -->engine, which tends<!-- --> <!-- --><a target="blank" href="https://twitter.com/jarredsumner/status/1499225725492076544">to start</a> <!-- -->and perform a little faster than more traditional choices like V8. Bun is written in<!-- --> <!-- --><a href="https://ziglang.org/"><svg xmlns="http://www.w3.org/2000/svg" height="1.2rem" class="Zig" viewBox="0 0 400 140"><title>Zig</title><g fill="#F7A41D"><g><polygon points="46,22 28,44 19,30"></polygon><polygon points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22" shape-rendering="crispEdges"></polygon><polygon points="31,95 12,117 4,106"></polygon></g><g><polygon points="56,22 62,36 37,44"></polygon><polygon points="56,22 111,22 111,44 37,44 56,32" shape-rendering="crispEdges"></polygon><polygon points="116,95 97,117 90,104"></polygon><polygon points="116,95 100,104 97,117 42,117 42,95" shape-rendering="crispEdges"></polygon><polygon points="150,0 52,117 3,140 101,22"></polygon></g><g><polygon points="141,22 140,40 122,45"></polygon><polygon points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22" shape-rendering="crispEdges"></polygon><polygon points="125,95 130,110 106,117"></polygon></g></g><g fill="#121212"><g><polygon points="260,22 260,37 229,40 177,40 177,22" shape-rendering="crispEdges"></polygon><polygon points="260,37 207,99 207,103 176,103 229,40 229,37"></polygon><polygon points="261,99 261,117 176,117 176,103 206,99" shape-rendering="crispEdges"></polygon></g><rect x="272" y="22" shape-rendering="crispEdges" width="22" height="95"></rect><g><polygon points="394,67 394,106 376,106 376,81 360,70 346,67" shape-rendering="crispEdges"></polygon><polygon points="360,68 376,81 346,67"></polygon><path d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
c14.3,0,29.2,5.5,38.9,14l-13,15c-7.1-6.3-16.8-10-25.9-10c-17,0-30.2,12.9-30.2,29.5c0,16.8,13.3,29.6,30.3,29.6
- c5.7,0,12.8-2.3,19-5.5L394,106z"></path></g></g></svg></a>, a low-level programming language with manual memory management.<!-- --><br/><br/>Most of Bun is written from scratch including the JSX/TypeScript transpiler, npm client, bundler, SQLite client, HTTP client, WebSocket client and more.<!-- --></p><h1>Why is Bun fast?</h1><p>An enormous amount of time spent profiling, benchmarking and optimizing things. The answer is different for every part of Bun, but one general theme:<!-- --> <!-- --><a href="https://ziglang.org/"><svg xmlns="http://www.w3.org/2000/svg" height="1.2rem" class="Zig" viewBox="0 0 400 140"><g fill="#F7A41D"><g><polygon points="46,22 28,44 19,30"></polygon><polygon points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22" shape-rendering="crispEdges"></polygon><polygon points="31,95 12,117 4,106"></polygon></g><g><polygon points="56,22 62,36 37,44"></polygon><polygon points="56,22 111,22 111,44 37,44 56,32" shape-rendering="crispEdges"></polygon><polygon points="116,95 97,117 90,104"></polygon><polygon points="116,95 100,104 97,117 42,117 42,95" shape-rendering="crispEdges"></polygon><polygon points="150,0 52,117 3,140 101,22"></polygon></g><g><polygon points="141,22 140,40 122,45"></polygon><polygon points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22" shape-rendering="crispEdges"></polygon><polygon points="125,95 130,110 106,117"></polygon></g></g><g fill="#121212"><g><polygon points="260,22 260,37 229,40 177,40 177,22" shape-rendering="crispEdges"></polygon><polygon points="260,37 207,99 207,103 176,103 229,40 229,37"></polygon><polygon points="261,99 261,117 176,117 176,103 206,99" shape-rendering="crispEdges"></polygon></g><rect x="272" y="22" shape-rendering="crispEdges" width="22" height="95"></rect><g><polygon points="394,67 394,106 376,106 376,81 360,70 346,67" shape-rendering="crispEdges"></polygon><polygon points="360,68 376,81 346,67"></polygon><path d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
+ c5.7,0,12.8-2.3,19-5.5L394,106z"></path></g></g></svg></a>, a low-level programming language with manual memory management.<!-- --><br/><br/>Most of Bun is written from scratch including the JSX/TypeScript transpiler, npm client, bundler, SQLite client, HTTP client, WebSocket client and more.<!-- --></p><h2>Why is Bun fast?</h2><p>An enormous amount of time spent profiling, benchmarking and optimizing things. The answer is different for every part of Bun, but one general theme:<!-- --> <!-- --><a href="https://ziglang.org/"><svg xmlns="http://www.w3.org/2000/svg" height="1.2rem" class="Zig" viewBox="0 0 400 140"><title>Zig</title><g fill="#F7A41D"><g><polygon points="46,22 28,44 19,30"></polygon><polygon points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22" shape-rendering="crispEdges"></polygon><polygon points="31,95 12,117 4,106"></polygon></g><g><polygon points="56,22 62,36 37,44"></polygon><polygon points="56,22 111,22 111,44 37,44 56,32" shape-rendering="crispEdges"></polygon><polygon points="116,95 97,117 90,104"></polygon><polygon points="116,95 100,104 97,117 42,117 42,95" shape-rendering="crispEdges"></polygon><polygon points="150,0 52,117 3,140 101,22"></polygon></g><g><polygon points="141,22 140,40 122,45"></polygon><polygon points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22" shape-rendering="crispEdges"></polygon><polygon points="125,95 130,110 106,117"></polygon></g></g><g fill="#121212"><g><polygon points="260,22 260,37 229,40 177,40 177,22" shape-rendering="crispEdges"></polygon><polygon points="260,37 207,99 207,103 176,103 229,40 229,37"></polygon><polygon points="261,99 261,117 176,117 176,103 206,99" shape-rendering="crispEdges"></polygon></g><rect x="272" y="22" shape-rendering="crispEdges" width="22" height="95"></rect><g><polygon points="394,67 394,106 376,106 376,81 360,70 346,67" shape-rendering="crispEdges"></polygon><polygon points="360,68 376,81 346,67"></polygon><path d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
c14.3,0,29.2,5.5,38.9,14l-13,15c-7.1-6.3-16.8-10-25.9-10c-17,0-30.2,12.9-30.2,29.5c0,16.8,13.3,29.6,30.3,29.6
- c5.7,0,12.8-2.3,19-5.5L394,106z"></path></g></g></svg></a> <!-- -->&#x27;s low-level control over memory and lack of hidden control flow makes it much simpler to write fast software.<!-- --> <!-- --><a href="https://github.com/sponsors/ziglang">Sponsor the Zig Software Foundation</a></p><h1>Getting started</h1><p>To install bun, run this<!-- --> <!-- --><a target="_blank" href="https://bun.sh/install">install script</a> <!-- -->in your terminal. It downloads Bun from GitHub.<!-- --></p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #F8F8F2">curl https://bun.sh/install </span><span style="color: #FF79C6">|</span><span style="color: #F8F8F2"> bash</span></span></code></pre></div><p> <!-- -->Bun&#x27;s HTTP server is built on web standards like<!-- --> <!-- --><a class="Identifier" href="https://developer.mozilla.org/en-US/docs/Web/API/Request">Request</a> <!-- -->and<!-- --> <!-- --><a class="Identifier" href="https://developer.mozilla.org/en-US/docs/Web/API/Response">Response</a></p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #6272A4">// http.js</span></span>
+ c5.7,0,12.8-2.3,19-5.5L394,106z"></path></g></g></svg></a>&#x27;s low-level control over memory and lack of hidden control flow makes it much simpler to write fast software.<!-- --> <!-- --><a href="https://github.com/sponsors/ziglang">Sponsor the Zig Software Foundation</a></p><h2>Getting started</h2><p>To install bun, run this<!-- --> <!-- --><a target="_blank" href="https://bun.sh/install">install script</a> <!-- -->in your terminal. It downloads Bun from GitHub.<!-- --></p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #F8F8F2">curl https://bun.sh/install </span><span style="color: #FF79C6">|</span><span style="color: #F8F8F2"> bash</span></span></code></pre></div><p> <!-- -->Bun&#x27;s HTTP server is built on web standards like<!-- --> <!-- --><a class="Identifier" href="https://developer.mozilla.org/en-US/docs/Web/API/Request">Request</a> <!-- -->and<!-- --> <!-- --><a class="Identifier" href="https://developer.mozilla.org/en-US/docs/Web/API/Response">Response</a></p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #6272A4">// http.js</span></span>
+<span class="line"></span>
<span class="line"><span style="color: #FF79C6">export</span><span style="color: #F8F8F2"> </span><span style="color: #FF79C6">default</span><span style="color: #F8F8F2"> {</span></span>
+<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> port</span><span style="color: #FF79C6">:</span><span style="color: #F8F8F2"> </span><span style="color: #BD93F9">3000</span><span style="color: #F8F8F2">,</span></span>
+<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> </span><span style="color: #50FA7B">fetch</span><span style="color: #F8F8F2">(</span><span style="color: #FFB86C; font-style: italic">request</span><span style="color: #F8F8F2">) {</span></span>
+<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> </span><span style="color: #FF79C6">return</span><span style="color: #F8F8F2"> </span><span style="color: #FF79C6; font-weight: bold">new</span><span style="color: #F8F8F2"> </span><span style="color: #50FA7B">Response</span><span style="color: #F8F8F2">(</span><span style="color: #E9F284">&quot;</span><span style="color: #F1FA8C">Welcome to Bun!</span><span style="color: #E9F284">&quot;</span><span style="color: #F8F8F2">);</span></span>
+<span class="line"></span>
<span class="line"><span style="color: #F8F8F2"> },</span></span>
-<span class="line"><span style="color: #F8F8F2">};</span></span></code></pre></div><p>Run it with bun:</p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #F8F8F2">bun run http.js</span></span></code></pre></div><p>Then open<!-- --> <!-- --><a target="_blank" href="http://localhost:3000">http://localhost:3000</a> <!-- -->in your browser<!-- --><br/><br/>See<!-- --> <!-- --><a href="https://github.com/Jarred-Sumner/bun/tree/main/examples">more examples</a> <!-- -->and check out <!-- --><a href="https://github.com/Jarred-Sumner/bun#Reference">the docs</a>. If you have any questions or want help, join<!-- --> <!-- --><a href="https://bun.sh/discord">Bun&#x27;s Discord</a></p><h1>Bun CLI</h1><div title="npm takes 160ms to run a script that does nothing" class="Group"><span target="_blank" class="Tag Tag--Command">bun run</span><p>The same command for running JavaScript &amp; TypeScript files with bun&#x27;s JavaScript runtime also runs package.json<!-- --> <!-- --><code class="mono">&quot;scripts&quot;</code>.<!-- --></p><strong>Replace <!-- --><code class="mono">npm run</code> with<!-- --> <!-- --><code class="mono">bun run</code> and save 160ms on every run.<!-- --></strong><br/><div>bun runs package.json scripts<!-- --> <!-- --><a href="https://twitter.com/jarredsumner/status/1454218996983623685" target="_blank" class="PerformanceClaim">30x faster than <!-- --><code class="mono">npm run</code></a></div> <!-- --></div><div title="JavaScript package managers are not using the fastest system calls" class="Group"><span target="_blank" class="Tag Tag--Command">bun install</span><p>bun install is an npm-compatible package manager. You probably will be surprised by how much faster copying files can get.</p><strong>Replace <!-- --><code class="mono">yarn</code> with<!-- --> <!-- --><code class="mono">bun install</code> and get 20x faster package installs.<!-- --></strong><br/><div>bun install uses the fastest system calls available to copy files.</div></div><div class="Group"><span target="_blank" class="Tag Tag--Command">bun wiptest</span><p>A Jest-like test runner for JavaScript &amp; TypeScript projects builtin to bun</p><div class="Label"><a href="https://twitter.com/jarredsumner/status/1542824445810642946" target="_blank" class="PerformanceClaim">You&#x27;ve never seen a JavaScript test runner this fast</a> <!-- -->(or incomplete)<!-- --></div></div><h1>What is the license?</h1><p>MIT License, excluding dependencies which have various licenses.</p><h1>How do I see the source code?</h1><p>Bun is on <!-- --><a href="https://github.com/Jarred-Sumner/bun">GitHub</a></p></div></section><section id="explain-section"><div id="explain"></div></section><script>
-[...document.querySelectorAll(".Tab")].map(el => el.addEventListener("click", function(e) {
- var tab = e.srcElement.getAttribute("data-tab");
- document.querySelector(".Graphs").setAttribute("class", "Graphs Graphs--active-" + tab);
-}));
+<span class="line"></span>
+<span class="line"><span style="color: #F8F8F2">};</span></span></code></pre></div><p>Run it with bun:</p><div class="CodeBlock"><pre class="shiki" style="background-color: #282A36"><code><span class="line"><span style="color: #F8F8F2">bun run http.js</span></span></code></pre></div><p>Then open<!-- --> <!-- --><a target="_blank" href="http://localhost:3000">http://localhost:3000</a> <!-- -->in your browser<!-- --><br/><br/>See<!-- --> <!-- --><a href="https://github.com/oven-sh/bun/tree/main/examples">more examples</a> <!-- -->and check out <!-- --><a href="https://github.com/oven-sh/bun#Reference">the docs</a>. If you have any questions or want help, join<!-- --> <!-- --><a href="https://bun.sh/discord">Bun&#x27;s Discord</a></p><h2>Bun CLI</h2><div class="Group"><span target="_blank" class="Tag Tag--Command">bun run</span><p>The same command for running JavaScript &amp; TypeScript files with bun&#x27;s JavaScript runtime also runs package.json<!-- --> <!-- --><code class="mono">&quot;scripts&quot;</code>.<!-- --></p><strong>Replace <!-- --><code class="mono">npm run</code> with<!-- --> <!-- --><code class="mono">bun run</code> and save 160ms on every run.<!-- --></strong><br/><div>bun runs package.json scripts<!-- --> <!-- --><a href="https://twitter.com/jarredsumner/status/1454218996983623685" target="_blank" class="PerformanceClaim">30x faster than <!-- --><code class="mono">npm run</code></a></div> <!-- --></div><div class="Group"><span target="_blank" class="Tag Tag--Command">bun install</span><p>bun install is an npm-compatible package manager. You probably will be surprised by how much faster copying files can get.</p><strong>Replace <!-- --><code class="mono">yarn</code> with<!-- --> <!-- --><code class="mono">bun install</code> and get 20x faster package installs.<!-- --></strong><br/><div>bun install uses the fastest system calls available to copy files.</div></div><div class="Group"><span target="_blank" class="Tag Tag--Command">bun wiptest</span><p>A Jest-like test runner for JavaScript &amp; TypeScript projects builtin to bun</p><div class="Label"><a href="https://twitter.com/jarredsumner/status/1542824445810642946" target="_blank" class="PerformanceClaim">You&#x27;ve never seen a JavaScript test runner this fast</a> <!-- -->(or incomplete)<!-- --></div></div><h2>What is the license?</h2><p>MIT License, excluding dependencies which have various licenses.</p><h2>How do I see the source code?</h2><p>Bun is on <!-- --><a href="https://github.com/oven-sh/bun">GitHub</a></p></div></section><section id="explain-section"><div id="explain"></div></section><script>
+
+[...document.querySelectorAll(".TabButton")].map(el => {
+
+ el.addEventListener("click", function(e) {
+
+ var tab = e.srcElement.getAttribute("data-tab");
+
+ [...document.querySelectorAll(".TabButton")].map(el => {
+
+ var active = el.getAttribute("data-tab") === tab;
+
+ el.setAttribute("tabindex", active ? 0 : -1);
+
+ el.setAttribute("aria-selected", active);
+
+ });
+
+ [...document.querySelectorAll(".BarGraph")].map(el => {
+
+ var active = el.id === tab + "-tab-content";
+
+ el.setAttribute("tabindex", active ? 0 : -1);
+
+ });
+
+ document.querySelector(".Graphs").setAttribute("class", "Graphs Graphs--active-" + tab);
+
+ });
+
+
+
+ el.addEventListener("keydown", e => {
+
+ var tabs = [...document.querySelectorAll(".TabButton")];
+
+ var activeTabEl = document.querySelector(".TabButton[aria-selected='true']");
+
+ var activeTabIndex = tabs.indexOf(activeTabEl);
+
+ if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
+
+ e.preventDefault();
+
+ activeTabIndex = (activeTabIndex + 1) % tabs.length;
+
+ tabs[activeTabIndex].click();
+
+ tabs[activeTabIndex].focus();
+
+ }
+
+ if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
+
+ e.preventDefault();
+
+ activeTabIndex = (activeTabIndex + tabs.length - 1) % tabs.length;
+
+ tabs[activeTabIndex].click();
+
+ tabs[activeTabIndex].focus();
+
+ }
+
+ if (e.key === 'Home') {
+
+ e.preventDefault();
+
+ tabs[0].click();
+
+ tabs[0].focus();
+
+ }
+
+ if (e.key === 'End') {
+
+ e.preventDefault();
+
+ tabs[tabs.length - 1].click();
+
+ tabs[tabs.length - 1].focus();
+
+ }
+
+ });
+
+});
+
+
document.querySelector("#code-box-copy").addEventListener("click", async e => {
+
var el = document.querySelector("#code-box");
+
await navigator.clipboard.writeText("curl https://bun.sh/install | bash");
+
});
- </script><div class="Built">Built with Bun <!-- -->v0.1.1<!-- --></div></body></html> \ No newline at end of file
+
+ </script><div class="Built">Built with Bun <!-- -->v0.1.2<!-- --></div></body></html> \ No newline at end of file
diff --git a/packages/bun-landing/public/logo-square.png b/packages/bun-landing/public/logo-square.png
new file mode 100644
index 000000000..fedd94ab9
--- /dev/null
+++ b/packages/bun-landing/public/logo-square.png
Binary files differ
diff --git a/packages/bun-landing/public/logo-square@16px.png b/packages/bun-landing/public/logo-square@16px.png
new file mode 100644
index 000000000..90dede13a
--- /dev/null
+++ b/packages/bun-landing/public/logo-square@16px.png
Binary files differ
diff --git a/packages/bun-landing/public/logo-square@32px.png b/packages/bun-landing/public/logo-square@32px.png
new file mode 100644
index 000000000..33bfb9f23
--- /dev/null
+++ b/packages/bun-landing/public/logo-square@32px.png
Binary files differ
diff --git a/packages/bun-landing/public/logo.svg b/packages/bun-landing/public/logo.svg
new file mode 100644
index 000000000..7ef15001d
--- /dev/null
+++ b/packages/bun-landing/public/logo.svg
@@ -0,0 +1 @@
+<svg id="Bun" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 70"><title>Bun Logo</title><path id="Shadow" d="M71.09,20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46,26.46,0,0,1,75.5,35.7c0,16.57-16.82,30.05-37.5,30.05-11.58,0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55,65.3,30.14,69.75,42,69.75c20.68,0,37.5-13.48,37.5-30C79.5,32.69,76.46,26,71.09,20.74Z"/><g id="Body"><path id="Background" d="M73,35.7c0,15.21-15.67,27.54-35,27.54S3,50.91,3,35.7C3,26.27,9,17.94,18.22,13S33.18,3,38,3s8.94,4.13,19.78,10C67,17.94,73,26.27,73,35.7Z" style="fill:#fbf0df"/><path id="Bottom_Shadow" data-name="Bottom Shadow" d="M73,35.7a21.67,21.67,0,0,0-.8-5.78c-2.73,33.3-43.35,34.9-59.32,24.94A40,40,0,0,0,38,63.24C57.3,63.24,73,50.89,73,35.7Z" style="fill:#f6dece"/><path id="Light_Shine" data-name="Light Shine" d="M24.53,11.17C29,8.49,34.94,3.46,40.78,3.45A9.29,9.29,0,0,0,38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7c0,.4,0,.8,0,1.19C9.06,15.48,20.07,13.85,24.53,11.17Z" style="fill:#fffefc"/><path id="Top" d="M35.12,5.53A16.41,16.41,0,0,1,29.49,18c-.28.25-.06.73.3.59,3.37-1.31,7.92-5.23,6-13.14C35.71,5,35.12,5.12,35.12,5.53Zm2.27,0A16.24,16.24,0,0,1,39,19c-.12.35.31.65.55.36C41.74,16.56,43.65,11,37.93,5,37.64,4.74,37.19,5.14,37.39,5.49Zm2.76-.17A16.42,16.42,0,0,1,47,17.12a.33.33,0,0,0,.65.11c.92-3.49.4-9.44-7.17-12.53C40.08,4.54,39.82,5.08,40.15,5.32ZM21.69,15.76a16.94,16.94,0,0,0,10.47-9c.18-.36.75-.22.66.18-1.73,8-7.52,9.67-11.12,9.45C21.32,16.4,21.33,15.87,21.69,15.76Z" style="fill:#ccbea7;fill-rule:evenodd"/><path id="Outline" d="M38,65.75C17.32,65.75.5,52.27.5,35.7c0-10,6.18-19.33,16.53-24.92,3-1.6,5.57-3.21,7.86-4.62,1.26-.78,2.45-1.51,3.6-2.19C32,1.89,35,.5,38,.5s5.62,1.2,8.9,3.14c1,.57,2,1.19,3.07,1.87,2.49,1.54,5.3,3.28,9,5.27C69.32,16.37,75.5,25.69,75.5,35.7,75.5,52.27,58.68,65.75,38,65.75ZM38,3c-2.42,0-5,1.25-8.25,3.13-1.13.66-2.3,1.39-3.54,2.15-2.33,1.44-5,3.07-8,4.7C8.69,18.13,3,26.62,3,35.7,3,50.89,18.7,63.25,38,63.25S73,50.89,73,35.7C73,26.62,67.31,18.13,57.78,13,54,11,51.05,9.12,48.66,7.64c-1.09-.67-2.09-1.29-3-1.84C42.63,4,40.42,3,38,3Z"/></g><g id="Mouth"><g id="Background-2" data-name="Background"><path d="M45.05,43a8.93,8.93,0,0,1-2.92,4.71,6.81,6.81,0,0,1-4,1.88A6.84,6.84,0,0,1,34,47.71,8.93,8.93,0,0,1,31.12,43a.72.72,0,0,1,.8-.81H44.26A.72.72,0,0,1,45.05,43Z" style="fill:#b71422"/></g><g id="Tongue"><path id="Background-3" data-name="Background" d="M34,47.79a6.91,6.91,0,0,0,4.12,1.9,6.91,6.91,0,0,0,4.11-1.9,10.63,10.63,0,0,0,1-1.07,6.83,6.83,0,0,0-4.9-2.31,6.15,6.15,0,0,0-5,2.78C33.56,47.4,33.76,47.6,34,47.79Z" style="fill:#ff6164"/><path id="Outline-2" data-name="Outline" d="M34.16,47a5.36,5.36,0,0,1,4.19-2.08,6,6,0,0,1,4,1.69c.23-.25.45-.51.66-.77a7,7,0,0,0-4.71-1.93,6.36,6.36,0,0,0-4.89,2.36A9.53,9.53,0,0,0,34.16,47Z"/></g><path id="Outline-3" data-name="Outline" d="M38.09,50.19a7.42,7.42,0,0,1-4.45-2,9.52,9.52,0,0,1-3.11-5.05,1.2,1.2,0,0,1,.26-1,1.41,1.41,0,0,1,1.13-.51H44.26a1.44,1.44,0,0,1,1.13.51,1.19,1.19,0,0,1,.25,1h0a9.52,9.52,0,0,1-3.11,5.05A7.42,7.42,0,0,1,38.09,50.19Zm-6.17-7.4c-.16,0-.2.07-.21.09a8.29,8.29,0,0,0,2.73,4.37A6.23,6.23,0,0,0,38.09,49a6.28,6.28,0,0,0,3.65-1.73,8.3,8.3,0,0,0,2.72-4.37.21.21,0,0,0-.2-.09Z"/></g><g id="Face"><ellipse id="Right_Blush" data-name="Right Blush" cx="53.22" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/><ellipse id="Left_Bluch" data-name="Left Bluch" cx="22.95" cy="40.18" rx="5.85" ry="3.44" style="fill:#febbd0"/><path id="Eyes" d="M25.7,38.8a5.51,5.51,0,1,0-5.5-5.51A5.51,5.51,0,0,0,25.7,38.8Zm24.77,0A5.51,5.51,0,1,0,45,33.29,5.5,5.5,0,0,0,50.47,38.8Z" style="fill-rule:evenodd"/><path id="Iris" d="M24,33.64a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,24,33.64Zm24.77,0a2.07,2.07,0,1,0-2.06-2.07A2.07,2.07,0,0,0,48.75,33.64Z" style="fill:#fff;fill-rule:evenodd"/></g></svg> \ No newline at end of file
diff --git a/packages/bun-landing/public/manifest.json b/packages/bun-landing/public/manifest.json
new file mode 100644
index 000000000..9d78a2d26
--- /dev/null
+++ b/packages/bun-landing/public/manifest.json
@@ -0,0 +1,14 @@
+{
+ "name": "Bun",
+ "icons": [
+ {
+ "src": "/logo-square.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#fbf0df",
+ "background_color": "#fbf0df",
+ "start_url": "/",
+ "display": "minimal-ui"
+}
diff --git a/packages/bun-landing/ssr.tsx b/packages/bun-landing/ssr.tsx
index 3ff8adac9..e62dc3c2d 100644
--- a/packages/bun-landing/ssr.tsx
+++ b/packages/bun-landing/ssr.tsx
@@ -6,7 +6,7 @@ import liveReload from "bun-livereload";
import { join } from "path";
async function fetch(req: Request) {
- if (req.url.endsWith("favicon.ico")) {
+ if (req.url.endsWith("robots.txt")) {
return new Response("", { status: 404 });
}
diff --git a/packages/bun-types/package.json b/packages/bun-types/package.json
index c98586107..4845bbfb8 100644
--- a/packages/bun-types/package.json
+++ b/packages/bun-types/package.json
@@ -12,6 +12,6 @@
"bun.js",
"types"
],
- "repository": "https://github.com/Jarred-Sumner/bun",
+ "repository": "https://github.com/oven-sh/bun",
"homepage": "https://bun.sh"
}
diff --git a/src/__global.zig b/src/__global.zig
index 76b93d29d..bbdbcf63c 100644
--- a/src/__global.zig
+++ b/src/__global.zig
@@ -107,7 +107,6 @@ inline fn _invariant(comptime fmt: string, args: anytype) noreturn {
@panic(fmt);
} else {
Output.prettyErrorln(fmt, args);
- Output.flush();
Global.exit(1);
}
}
@@ -120,7 +119,6 @@ pub fn notimpl() noreturn {
// Make sure we always print any leftover
pub fn crash() noreturn {
@setCold(true);
- Output.flush();
Global.exit(1);
}
diff --git a/src/bun.js/api/FFI.h b/src/bun.js/api/FFI.h
index b0a754a01..84a2dad83 100644
--- a/src/bun.js/api/FFI.h
+++ b/src/bun.js/api/FFI.h
@@ -1,6 +1,6 @@
// This file is part of Bun!
// You can find the original source:
-// https://github.com/Jarred-Sumner/bun/blob/main/src/bun.js/api/FFI.h#L2
+// https://github.com/oven-sh/bun/blob/main/src/bun.js/api/FFI.h#L2
//
// clang-format off
// This file is only compatible with 64 bit CPUs
diff --git a/src/bun.js/bindings/ScriptExecutionContext.h b/src/bun.js/bindings/ScriptExecutionContext.h
index 227c57e6a..ab86b6816 100644
--- a/src/bun.js/bindings/ScriptExecutionContext.h
+++ b/src/bun.js/bindings/ScriptExecutionContext.h
@@ -145,7 +145,7 @@ private:
public:
template<bool isSSL, bool isServer>
- us_socket_context_t* connnectedWebSocketContext()
+ us_socket_context_t* connectedWebSocketContext()
{
if constexpr (isSSL) {
if (!m_connected_ssl_client_websockets_ctx) {
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index 138267cd6..5b0ec6734 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -1496,8 +1496,8 @@ JSC_DEFINE_HOST_FUNCTION(functionPerformanceNow, (JSGlobalObject * globalObject,
auto* global = reinterpret_cast<GlobalObject*>(globalObject);
// nanoseconds to seconds
uint64_t time = Bun__readOriginTimer(global->bunVM());
- double result = time / 1000000000.0;
- return JSValue::encode(jsNumber(time));
+ double result = time / 1000000.0;
+ return JSValue::encode(jsNumber(result));
}
JSC_DECLARE_HOST_FUNCTION(functionBunNanoseconds);
diff --git a/src/bun.js/bindings/exports.zig b/src/bun.js/bindings/exports.zig
index aff961154..9d4db4309 100644
--- a/src/bun.js/bindings/exports.zig
+++ b/src/bun.js/bindings/exports.zig
@@ -29,6 +29,8 @@ const JSPrivateDataPtr = @import("../base.zig").JSPrivateDataPtr;
const Backtrace = @import("../../deps/backtrace.zig");
const JSPrinter = @import("../../js_printer.zig");
const JSLexer = @import("../../js_lexer.zig");
+const typeBaseName = @import("../../meta.zig").typeBaseName;
+
pub const ZigGlobalObject = extern struct {
pub const shim = Shimmer("Zig", "GlobalObject", @This());
bytes: shim.Bytes,
@@ -40,7 +42,7 @@ pub const ZigGlobalObject = extern struct {
pub fn create(class_ref: [*]CAPI.JSClassRef, count: i32, console: *anyopaque) *JSGlobalObject {
var global = shim.cppFn("create", .{ class_ref, count, console });
- Backtrace.reloadHandlers();
+ Backtrace.reloadHandlers() catch unreachable;
return global;
}
@@ -194,7 +196,7 @@ pub fn Errorable(comptime Type: type) type {
return extern struct {
result: Result,
success: bool,
- pub const name = "Errorable" ++ @typeName(Type);
+ pub const name = "Errorable" ++ typeBaseName(@typeName(Type));
pub const Result = extern union {
value: Type,
@@ -1615,7 +1617,7 @@ pub const ZigConsoleClient = struct {
writer.print(comptime Output.prettyFmt("<r><yellow>{s}n<r>", enable_ansi_colors), .{out_str});
},
.Double => {
- writer.print(comptime Output.prettyFmt("<r><yellow>{d}n<r>", enable_ansi_colors), .{value.asNumber()});
+ writer.print(comptime Output.prettyFmt("<r><yellow>{d}<r>", enable_ansi_colors), .{value.asNumber()});
},
.Undefined => {
writer.print(comptime Output.prettyFmt("<r><d>undefined<r>", enable_ansi_colors), .{});
diff --git a/src/bun.js/bindings/header-gen.zig b/src/bun.js/bindings/header-gen.zig
index c11241233..ab93fad47 100644
--- a/src/bun.js/bindings/header-gen.zig
+++ b/src/bun.js/bindings/header-gen.zig
@@ -7,6 +7,7 @@ const EnumMeta = std.builtin.TypeInfo.Enum;
const UnionMeta = std.builtin.TypeInfo.Union;
const warn = std.debug.warn;
const StaticExport = @import("./static_export.zig");
+const typeBaseName = @import("../../meta.zig").typeBaseName;
const TypeNameMap = std.StringHashMap([]const u8);
@@ -156,7 +157,7 @@ pub const C_Generator = struct {
switch (@typeInfo(ArgType)) {
.Enum => {
- self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ @typeName(ArgType), i }));
+ self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i }));
},
else => {
@@ -202,7 +203,7 @@ pub const C_Generator = struct {
// } else {
const ArgType = arg.arg_type.?;
if (@typeInfo(ArgType) == .Enum) {
- self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ @typeName(ArgType), i }));
+ self.write(comptime std.fmt.comptimePrint(" {s}{d}", .{ typeBaseName(@typeName(ArgType)), i }));
} else {
self.write(comptime std.fmt.comptimePrint(" arg{d}", .{i}));
}
@@ -419,7 +420,7 @@ pub const C_Generator = struct {
self.writeType(Enum.tag_type);
},
else => {
- return self.write(@typeName(T));
+ return self.write(comptime typeBaseName(@typeName(T)));
},
}
}
@@ -472,7 +473,7 @@ pub fn getCStruct(comptime T: type) ?NamedStruct {
if (std.mem.eql(u8, decl.name, "Type")) {
switch (decl.data) {
.Type => {
- return NamedStruct{ .Type = T, .name = @typeName(T) };
+ return NamedStruct{ .Type = T, .name = comptime typeBaseName(@typeName(T)) };
},
else => {},
}
diff --git a/src/bun.js/bindings/headers-cpp.h b/src/bun.js/bindings/headers-cpp.h
index b7bb32042..627b234cd 100644
--- a/src/bun.js/bindings/headers-cpp.h
+++ b/src/bun.js/bindings/headers-cpp.h
@@ -1,4 +1,4 @@
-//-- AUTOGENERATED FILE -- 1656747036
+//-- AUTOGENERATED FILE -- 1657408675
// clang-format off
#pragma once
diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h
index 1877339b1..c1e70807f 100644
--- a/src/bun.js/bindings/headers.h
+++ b/src/bun.js/bindings/headers.h
@@ -1,5 +1,5 @@
// clang-format off
-//-- AUTOGENERATED FILE -- 1656747036
+//-- AUTOGENERATED FILE -- 1657408675
#pragma once
#include <stddef.h>
diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp
index 763668056..a21560b2c 100644
--- a/src/bun.js/bindings/webcore/WebSocket.cpp
+++ b/src/bun.js/bindings/webcore/WebSocket.cpp
@@ -909,11 +909,11 @@ void WebSocket::didConnect(us_socket_t* socket, char* bufferedData, size_t buffe
{
this->m_upgradeClient = nullptr;
if (m_isSecure) {
- us_socket_context_t* ctx = (us_socket_context_t*)this->scriptExecutionContext()->connnectedWebSocketContext<true, false>();
+ us_socket_context_t* ctx = (us_socket_context_t*)this->scriptExecutionContext()->connectedWebSocketContext<true, false>();
this->m_connectedWebSocket.clientSSL = Bun__WebSocketClientTLS__init(this, socket, ctx, this->scriptExecutionContext()->jsGlobalObject());
this->m_connectedWebSocketKind = ConnectedWebSocketKind::ClientSSL;
} else {
- us_socket_context_t* ctx = (us_socket_context_t*)this->scriptExecutionContext()->connnectedWebSocketContext<false, false>();
+ us_socket_context_t* ctx = (us_socket_context_t*)this->scriptExecutionContext()->connectedWebSocketContext<false, false>();
this->m_connectedWebSocket.client = Bun__WebSocketClient__init(this, socket, ctx, this->scriptExecutionContext()->jsGlobalObject());
this->m_connectedWebSocketKind = ConnectedWebSocketKind::Client;
}
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index df6af2748..f5ed49eb7 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -10,6 +10,7 @@ const Fetch = JSC.WebCore.Fetch;
const WebCore = JSC.WebCore;
const Bun = JSC.API.Bun;
const TaggedPointerUnion = @import("../tagged_pointer.zig").TaggedPointerUnion;
+const typeBaseName = @import("../meta.zig").typeBaseName;
const CopyFilePromiseTask = WebCore.Blob.Store.CopyFile.CopyFilePromiseTask;
const AsyncTransformTask = @import("./api/transpiler.zig").TransformTask.AsyncTransformTask;
const BunTimerTimeoutTask = Bun.Timer.Timeout.TimeoutTask;
@@ -335,7 +336,7 @@ pub const EventLoop = struct {
finished += 1;
vm_.active_tasks -|= 1;
},
- @field(Task.Tag, @typeName(JSC.napi.napi_async_work)) => {
+ @field(Task.Tag, typeBaseName(@typeName(JSC.napi.napi_async_work))) => {
var transform_task: *JSC.napi.napi_async_work = task.get(JSC.napi.napi_async_work).?;
transform_task.*.runFromJS();
finished += 1;
@@ -361,13 +362,13 @@ pub const EventLoop = struct {
finished += 1;
vm_.active_tasks -|= 1;
},
- @field(Task.Tag, @typeName(AnyTask)) => {
+ @field(Task.Tag, typeBaseName(@typeName(AnyTask))) => {
var any: *AnyTask = task.get(AnyTask).?;
any.run();
finished += 1;
vm_.active_tasks -|= 1;
},
- @field(Task.Tag, @typeName(CppTask)) => {
+ @field(Task.Tag, typeBaseName(@typeName(CppTask))) => {
var any: *CppTask = task.get(CppTask).?;
any.run(global);
finished += 1;
diff --git a/src/bun_js.zig b/src/bun_js.zig
index a2472d864..896b25627 100644
--- a/src/bun_js.zig
+++ b/src/bun_js.zig
@@ -67,7 +67,6 @@ pub const Run = struct {
run.vm.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false) catch {};
}
Output.prettyErrorln("\n", .{});
- Output.flush();
Global.exit(1);
};
run.vm.bundler.configureDefines() catch {
@@ -77,7 +76,6 @@ pub const Run = struct {
run.vm.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false) catch {};
}
Output.prettyErrorln("\n", .{});
- Output.flush();
Global.exit(1);
};
AsyncHTTP.max_simultaneous_requests = 255;
diff --git a/src/bundler.zig b/src/bundler.zig
index c21162129..912d935dc 100644
--- a/src/bundler.zig
+++ b/src/bundler.zig
@@ -1493,7 +1493,6 @@ pub const Bundler = struct {
} else {
const output_dir = bundler.options.output_dir_handle orelse {
Output.printError("Invalid or missing output directory.", .{});
- Output.flush();
Global.crash();
};
diff --git a/src/cli.zig b/src/cli.zig
index 32ad9bca5..7bdf75dbb 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -75,7 +75,6 @@ pub const Cli = struct {
switch (err) {
error.MissingEntryPoint => {
Output.prettyErrorln("<r><red>MissingEntryPoint<r> what do you want to bundle?\n\n<d>Example:\n\n<r> <b><cyan>bun bun --use next<r>\n\n <b><cyan>bun bun ./src/index.ts ./src/file2.ts<r>\n", .{});
- Output.flush();
Global.exit(1);
},
else => {
@@ -211,7 +210,6 @@ pub const Arguments = struct {
fn printVersionAndExit() noreturn {
@setCold(true);
Output.writer().writeAll(Global.package_json_version ++ "\n") catch {};
- Output.flush();
Global.exit(0);
}
@@ -222,7 +220,6 @@ pub const Arguments = struct {
@errorName(err),
std.mem.span(config_path),
});
- Output.flush();
Global.exit(1);
};
defer config_file.close();
@@ -232,7 +229,6 @@ pub const Arguments = struct {
@errorName(err),
std.mem.span(config_path),
});
- Output.flush();
Global.exit(1);
};
@@ -417,7 +413,6 @@ pub const Arguments = struct {
Output.prettyln("\n-------\n\n", .{});
Output.flush();
HelpCommand.printWithReason(.explicit);
- Output.flush();
Global.exit(0);
}
@@ -1196,7 +1191,6 @@ pub const Command = struct {
std.fs.path.basename(file_path),
@errorName(err),
});
- Output.flush();
Global.exit(1);
};
}
@@ -1211,7 +1205,6 @@ pub const Command = struct {
Output.prettyErrorln("<r><red>error<r>: Script not found \"<b>{s}<r>\"", .{
ctx.positionals[0],
});
- Output.flush();
Global.exit(1);
}
@@ -1219,13 +1212,11 @@ pub const Command = struct {
Output.prettyErrorln("<r><red>error<r>: Module not found \"<b>{s}<r>\"", .{
ctx.positionals[0],
});
- Output.flush();
Global.exit(1);
} else if (ctx.positionals.len > 0) {
Output.prettyErrorln("<r><red>error<r>: File not found \"<b>{s}<r>\"", .{
ctx.positionals[0],
});
- Output.flush();
Global.exit(1);
}
diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig
index 03739fa50..e2a3088ca 100644
--- a/src/cli/create_command.zig
+++ b/src/cli/create_command.zig
@@ -107,8 +107,7 @@ fn execTask(allocator: std.mem.Allocator, task_: string, cwd: string, _: string,
const npm_args = 2 * @intCast(usize, @boolToInt(npm_client != null));
const total = count + npm_args;
var argv = allocator.alloc(string, total) catch return;
- var proc: *std.ChildProcess = undefined;
- defer proc.deinit();
+ var proc: std.ChildProcess = undefined;
defer if (argv.len > 32) allocator.free(argv);
if (npm_client) |client| {
@@ -145,7 +144,7 @@ fn execTask(allocator: std.mem.Allocator, task_: string, cwd: string, _: string,
Output.disableBuffering();
defer Output.enableBuffering();
- proc = std.ChildProcess.init(argv, allocator) catch return;
+ proc = std.ChildProcess.init(argv, allocator) ;
proc.stdin_behavior = .Inherit;
proc.stdout_behavior = .Inherit;
proc.stderr_behavior = .Inherit;
@@ -419,7 +418,6 @@ pub const CreateCommand = struct {
const examples = try Example.fetchAllLocalAndRemote(ctx, null, &env_loader, filesystem);
Example.print(examples.items, dirname);
- Output.flush();
Global.exit(1);
},
else => {
@@ -533,7 +531,6 @@ pub const CreateCommand = struct {
}
Output.prettyErrorln("<r>\n<d>To download {s} anyway, use --force<r>", .{template});
- Output.flush();
Global.exit(1);
}
}
@@ -572,7 +569,6 @@ pub const CreateCommand = struct {
progress.refresh();
Output.prettyErrorln("<r><red>{s}<r>: opening dir {s}", .{ @errorName(err), template });
- Output.flush();
Global.exit(1);
};
@@ -583,7 +579,6 @@ pub const CreateCommand = struct {
progress.refresh();
Output.prettyErrorln("<r><red>{s}<r>: creating dir {s}", .{ @errorName(err), destination });
- Output.flush();
Global.exit(1);
};
@@ -611,7 +606,6 @@ pub const CreateCommand = struct {
progress_.refresh();
Output.prettyErrorln("<r><red>{s}<r>: copying file {s}", .{ @errorName(err), entry.path });
- Output.flush();
Global.exit(1);
};
};
@@ -632,7 +626,6 @@ pub const CreateCommand = struct {
progress_.refresh();
Output.prettyErrorln("<r><red>{s}<r>: copying file {s}", .{ @errorName(err), entry.path });
- Output.flush();
Global.exit(1);
};
};
@@ -1514,7 +1507,7 @@ pub const CreateCommand = struct {
Output.pretty("<r>\n", .{});
Output.flush();
- var process = try std.ChildProcess.init(install_args, ctx.allocator);
+ var process = std.ChildProcess.init(install_args, ctx.allocator);
process.cwd = destination;
defer {
@@ -1526,7 +1519,6 @@ pub const CreateCommand = struct {
Output.print("\n", .{});
Output.flush();
}
- defer process.deinit();
_ = try process.spawnAndWait();
@@ -1648,7 +1640,7 @@ pub const CreateCommand = struct {
if (create_options.open) {
if (which(&bun_path_buf, PATH, destination, "bun")) |bin| {
var argv = [_]string{std.mem.span(bin)};
- var child = try std.ChildProcess.init(&argv, ctx.allocator);
+ var child = std.ChildProcess.init(&argv, ctx.allocator);
child.cwd = destination;
child.stdin_behavior = .Inherit;
child.stdout_behavior = .Inherit;
@@ -1878,11 +1870,9 @@ pub const Example = struct {
if (content_type.len > 0) {
Output.prettyErrorln("<r><red>error<r>: Unexpected content type from GitHub: {s}", .{content_type});
- Output.flush();
Global.crash();
} else {
Output.prettyErrorln("<r><red>error<r>: Invalid response from GitHub (missing content type)", .{});
- Output.flush();
Global.crash();
}
}
@@ -1892,7 +1882,6 @@ pub const Example = struct {
refresher.refresh();
Output.prettyErrorln("<r><red>error<r>: Invalid response from GitHub (missing body)", .{});
- Output.flush();
Global.crash();
}
@@ -1939,11 +1928,9 @@ pub const Example = struct {
} else {
try ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false);
}
- Output.flush();
Global.exit(1);
} else {
Output.prettyErrorln("Error parsing package: <r><red>{s}<r>", .{@errorName(err)});
- Output.flush();
Global.exit(1);
}
};
@@ -1957,7 +1944,6 @@ pub const Example = struct {
} else {
try ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false);
}
- Output.flush();
Global.exit(1);
}
@@ -1976,7 +1962,6 @@ pub const Example = struct {
refresher.refresh();
Output.prettyErrorln("package.json is missing tarball url. This is an internal error!", .{});
- Output.flush();
Global.exit(1);
};
@@ -2001,7 +1986,6 @@ pub const Example = struct {
progress.end();
refresher.refresh();
Output.prettyErrorln("Error fetching tarball: <r><red>{d}<r>", .{response.status_code});
- Output.flush();
Global.exit(1);
}
@@ -2028,12 +2012,10 @@ pub const Example = struct {
switch (err) {
error.WouldBlock => {
Output.prettyErrorln("Request timed out while trying to fetch examples list. Please try again", .{});
- Output.flush();
Global.exit(1);
},
else => {
Output.prettyErrorln("<r><red>{s}<r> while trying to fetch examples list. Please try again", .{@errorName(err)});
- Output.flush();
Global.exit(1);
},
}
@@ -2041,7 +2023,6 @@ pub const Example = struct {
if (response.status_code != 200) {
Output.prettyErrorln("<r><red>{d}<r> fetching examples :( {s}", .{ response.status_code, mutable.list.items });
- Output.flush();
Global.exit(1);
}
@@ -2055,10 +2036,8 @@ pub const Example = struct {
try ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false);
}
Global.exit(1);
- Output.flush();
} else {
Output.prettyErrorln("Error parsing examples: <r><red>{s}<r>", .{@errorName(err)});
- Output.flush();
Global.exit(1);
}
};
@@ -2069,7 +2048,6 @@ pub const Example = struct {
} else {
try ctx.log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false);
}
- Output.flush();
Global.exit(1);
}
@@ -2094,7 +2072,6 @@ pub const Example = struct {
}
Output.prettyErrorln("Corrupt examples data: expected object but received {s}", .{@tagName(examples_object.data)});
- Output.flush();
Global.exit(1);
}
};
@@ -2152,7 +2129,6 @@ const GitHandler = struct {
thread = std.Thread.spawn(.{}, spawnThread, .{ destination, PATH, verbose }) catch |err| {
Output.prettyErrorln("<r><red>{s}<r>", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
}
@@ -2221,12 +2197,11 @@ const GitHandler = struct {
inline for (comptime std.meta.fieldNames(@TypeOf(Commands))) |command_field| {
const command: []const string = @field(git_commands, command_field);
- var process = try std.ChildProcess.init(command, default_allocator);
+ var process = std.ChildProcess.init(command, default_allocator);
process.cwd = destination;
process.stdin_behavior = .Inherit;
process.stdout_behavior = .Inherit;
process.stderr_behavior = .Inherit;
- defer process.deinit();
_ = try process.spawnAndWait();
_ = process.kill() catch undefined;
diff --git a/src/cli/install.sh b/src/cli/install.sh
index 57d10e581..5d2577d72 100644
--- a/src/cli/install.sh
+++ b/src/cli/install.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Reset
Color_Off=''
@@ -30,7 +30,7 @@ if test -t 1; then
fi
if ! command -v unzip >/dev/null; then
- echo -e "\n${Red}error${Color_Off}: unzip is required to install bun (see: https://github.com/Jarred-Sumner/bun#unzip-is-required)." 1>&2
+ echo -e "\n${Red}error${Color_Off}: unzip is required to install bun (see: https://github.com/oven-sh/bun#unzip-is-required)." 1>&2
exit 1
fi
diff --git a/src/cli/install_completions_command.zig b/src/cli/install_completions_command.zig
index d82169aaa..2316c92e5 100644
--- a/src/cli/install_completions_command.zig
+++ b/src/cli/install_completions_command.zig
@@ -78,7 +78,6 @@ pub const InstallCompletionsCommand = struct {
var cwd_buf: [bun.MAX_PATH_BYTES]u8 = undefined;
var cwd = std.os.getcwd(&cwd_buf) catch {
Output.prettyErrorln("<r><red>error<r>: Could not get current working directory", .{});
- Output.flush();
Global.exit(fail_exit_code);
};
@@ -99,7 +98,6 @@ pub const InstallCompletionsCommand = struct {
if (!std.fs.path.isAbsolute(completions_dir)) {
Output.prettyErrorln("<r><red>error:<r> Please pass an absolute path. {s} is invalid", .{completions_dir});
- Output.flush();
Global.exit(fail_exit_code);
}
@@ -107,7 +105,6 @@ pub const InstallCompletionsCommand = struct {
.iterate = true,
}) catch |err| {
Output.prettyErrorln("<r><red>error:<r> accessing {s} errored {s}", .{ completions_dir, @errorName(err) });
- Output.flush();
Global.exit(fail_exit_code);
};
}
@@ -247,7 +244,6 @@ pub const InstallCompletionsCommand = struct {
"Please either pipe it:\n bun completions > /to/a/file\n\n Or pass a directory:\n\n bun completions /my/completions/dir\n",
.{},
);
- Output.flush();
Global.exit(fail_exit_code);
};
@@ -267,7 +263,6 @@ pub const InstallCompletionsCommand = struct {
filename,
@errorName(err),
});
- Output.flush();
Global.exit(fail_exit_code);
};
@@ -276,7 +271,6 @@ pub const InstallCompletionsCommand = struct {
filename,
@errorName(err),
});
- Output.flush();
Global.exit(fail_exit_code);
};
diff --git a/src/cli/run_command.zig b/src/cli/run_command.zig
index 6f9932970..5986781e4 100644
--- a/src/cli/run_command.zig
+++ b/src/cli/run_command.zig
@@ -240,14 +240,14 @@ pub const RunCommand = struct {
}
var argv = [_]string{ shell_bin, "-c", combined_script };
- var child_process = try std.ChildProcess.init(&argv, ctx.allocator);
+ var child_process = std.ChildProcess.init(&argv, ctx.allocator);
if (!silent) {
Output.prettyErrorln("<r><d><magenta>$<r> <d><b>{s}<r>", .{combined_script});
Output.flush();
}
- var buf_map = try env.map.cloneToBufMap(ctx.allocator);
+ var buf_map = try env.map.cloneToEnvMap(ctx.allocator);
child_process.env_map = &buf_map;
child_process.cwd = cwd;
@@ -287,9 +287,9 @@ pub const RunCommand = struct {
argv = array_list.toOwnedSlice();
}
- var child_process = try std.ChildProcess.init(argv, ctx.allocator);
+ var child_process = std.ChildProcess.init(argv, ctx.allocator);
- var buf_map = try env.map.cloneToBufMap(ctx.allocator);
+ var buf_map = try env.map.cloneToEnvMap(ctx.allocator);
child_process.cwd = cwd;
child_process.env_map = &buf_map;
child_process.stderr_behavior = .Inherit;
@@ -304,20 +304,17 @@ pub const RunCommand = struct {
if (rc == 0) {
if (std.os.S.ISDIR(stat.mode)) {
Output.prettyErrorln("<r><red>error<r>: Failed to run directory \"<b>{s}<r>\"\n", .{executable});
- Output.flush();
Global.exit(1);
}
}
}
}
Output.prettyErrorln("<r><red>error<r>: Failed to run \"<b>{s}<r>\" due to error <b>{s}<r>", .{ std.fs.path.basename(executable), @errorName(err) });
- Output.flush();
Global.exit(1);
};
if (result.Exited > 0) {
Output.prettyErrorln("<r><red>error<r> \"<b>{s}<r>\" exited with {d} status<r>", .{ std.fs.path.basename(executable), result.Exited });
- Output.flush();
Global.exit(result.Exited);
}
@@ -629,7 +626,6 @@ pub const RunCommand = struct {
var shebang_buf: [64]u8 = undefined;
const shebang_size = file.pread(&shebang_buf, 0) catch |err| {
Output.prettyErrorln("<r><red>error<r>: Failed to read file <b>{s}<r> due to error <b>{s}<r>", .{ file_path, @errorName(err) });
- Output.flush();
Global.exit(1);
};
@@ -653,7 +649,6 @@ pub const RunCommand = struct {
std.fs.path.basename(file_path),
@errorName(err),
});
- Output.flush();
Global.exit(1);
};
@@ -913,8 +908,7 @@ pub const RunCommand = struct {
if (script_name_to_search.len == 0) {
if (comptime log_errors) {
- Output.prettyError("<r>No \"scripts\" in package.json found.", .{});
- Output.flush();
+ Output.prettyError("<r>No \"scripts\" in package.json found.\n", .{});
Global.exit(0);
}
@@ -961,7 +955,6 @@ pub const RunCommand = struct {
if (comptime log_errors) {
Output.prettyError("<r><red>error:<r> Missing script \"<b>{s}<r>\"\n", .{script_name_to_search});
- Output.flush();
Global.exit(0);
}
diff --git a/src/cli/upgrade_command.zig b/src/cli/upgrade_command.zig
index 8f94b54c4..a64985bbb 100644
--- a/src/cli/upgrade_command.zig
+++ b/src/cli/upgrade_command.zig
@@ -218,11 +218,9 @@ pub const UpgradeCommand = struct {
} else {
try log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false);
}
- Output.flush();
Global.exit(1);
} else {
Output.prettyErrorln("Error parsing releases from GitHub: <r><red>{s}<r>", .{@errorName(err)});
- Output.flush();
Global.exit(1);
}
}
@@ -240,7 +238,6 @@ pub const UpgradeCommand = struct {
} else {
try log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false);
}
- Output.flush();
Global.exit(1);
}
@@ -256,7 +253,6 @@ pub const UpgradeCommand = struct {
const json_type: js_ast.Expr.Tag = @as(js_ast.Expr.Tag, expr.data);
Output.prettyErrorln("JSON error - expected an object but received {s}", .{@tagName(json_type)});
- Output.flush();
Global.exit(1);
}
@@ -275,7 +271,6 @@ pub const UpgradeCommand = struct {
refresher.refresh();
Output.prettyErrorln("JSON Error parsing releases from GitHub: <r><red>tag_name<r> is missing?\n{s}", .{metadata_body.list.items});
- Output.flush();
Global.exit(1);
}
@@ -331,7 +326,6 @@ pub const UpgradeCommand = struct {
});
}
- Output.flush();
Global.exit(0);
}
@@ -344,7 +338,6 @@ pub const UpgradeCommand = struct {
_exec(ctx) catch |err| {
Output.prettyErrorln("<r>bun upgrade failed with error: <red><b>{s}<r>\n\n<cyan>Please upgrade manually<r>:\n <b>curl https://bun.sh/install | bash<r>\n\n", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
}
@@ -380,7 +373,6 @@ pub const UpgradeCommand = struct {
version.name().?,
},
);
- Output.flush();
Global.exit(0);
}
@@ -389,7 +381,6 @@ pub const UpgradeCommand = struct {
"<r><red>error:<r> bun versions are currently unavailable (the latest version name didn't match the expeccted format)",
.{},
);
- Output.flush();
Global.exit(1);
}
}
@@ -436,7 +427,6 @@ pub const UpgradeCommand = struct {
if (bytes.len == 0) {
Output.prettyErrorln("<r><red>error:<r> Failed to download the latest version of bun. Received empty content", .{});
- Output.flush();
Global.exit(1);
}
@@ -445,12 +435,10 @@ pub const UpgradeCommand = struct {
var save_dir_ = filesystem.tmpdir();
var save_dir = save_dir_.makeOpenPath(version_name, .{ .iterate = true }) catch {
Output.prettyErrorln("<r><red>error:<r> Failed to open temporary directory", .{});
- Output.flush();
Global.exit(1);
};
var tmpdir_path = std.os.getFdPath(save_dir.fd, &tmpdir_path_buf) catch {
Output.prettyErrorln("<r><red>error:<r> Failed to read temporary directory", .{});
- Output.flush();
Global.exit(1);
};
@@ -462,7 +450,6 @@ pub const UpgradeCommand = struct {
var zip_file = save_dir.createFileZ(tmpname, .{ .truncate = true }) catch |err| {
Output.prettyErrorln("<r><red>error:<r> Failed to open temp file {s}", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
@@ -470,7 +457,6 @@ pub const UpgradeCommand = struct {
_ = zip_file.writeAll(bytes) catch |err| {
save_dir.deleteFileZ(tmpname) catch {};
Output.prettyErrorln("<r><red>error:<r> Failed to write to temp file {s}", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
zip_file.close();
@@ -484,7 +470,6 @@ pub const UpgradeCommand = struct {
const unzip_exe = which(&unzip_path_buf, env_loader.map.get("PATH") orelse "", filesystem.top_level_dir, "unzip") orelse {
save_dir.deleteFileZ(tmpname) catch {};
Output.prettyErrorln("<r><red>error:<r> Failed to locate \"unzip\" in PATH. bun upgrade needs \"unzip\" to work.", .{});
- Output.flush();
Global.exit(1);
};
@@ -499,8 +484,7 @@ pub const UpgradeCommand = struct {
std.mem.span(tmpname),
};
- var unzip_process = try std.ChildProcess.init(&unzip_argv, ctx.allocator);
- defer unzip_process.deinit();
+ var unzip_process = std.ChildProcess.init(&unzip_argv, ctx.allocator);
unzip_process.cwd = tmpdir_path;
unzip_process.stdin_behavior = .Inherit;
unzip_process.stdout_behavior = .Inherit;
@@ -509,13 +493,11 @@ pub const UpgradeCommand = struct {
const unzip_result = unzip_process.spawnAndWait() catch |err| {
save_dir.deleteFileZ(tmpname) catch {};
Output.prettyErrorln("<r><red>error:<r> Failed to spawn unzip due to {s}.", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
if (unzip_result.Exited != 0) {
Output.prettyErrorln("<r><red>Unzip failed<r> (exit code: {d})", .{unzip_result.Exited});
- Output.flush();
save_dir.deleteFileZ(tmpname) catch {};
Global.exit(1);
}
@@ -535,14 +517,12 @@ pub const UpgradeCommand = struct {
}) catch |err| {
save_dir_.deleteTree(version_name) catch {};
Output.prettyErrorln("<r><red>error<r> Failed to verify bun {s}<r>)", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
if (result.term.Exited != 0) {
save_dir_.deleteTree(version_name) catch {};
Output.prettyErrorln("<r><red>error<r> failed to verify bun<r> (exit code: {d})", .{result.term.Exited});
- Output.flush();
Global.exit(1);
}
@@ -556,7 +536,6 @@ pub const UpgradeCommand = struct {
version_name,
},
);
- Output.flush();
Global.exit(1);
}
}
@@ -573,7 +552,6 @@ pub const UpgradeCommand = struct {
var target_dir = std.fs.openDirAbsoluteZ(target_dirname, .{ .iterate = true }) catch |err| {
save_dir_.deleteTree(version_name) catch {};
Output.prettyErrorln("<r><red>error:<r> Failed to open bun's install directory {s}", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
@@ -581,7 +559,6 @@ pub const UpgradeCommand = struct {
C.moveFileZ(save_dir.fd, exe_subpath, target_dir.fd, target_filename) catch |err| {
save_dir_.deleteTree(version_name) catch {};
Output.prettyErrorln("<r><red>error:<r> Failed to move new version of bun due to {s}. You could try the install script instead:\n curl -L https://bun.sh/install | bash", .{@errorName(err)});
- Output.flush();
Global.exit(1);
};
}
@@ -594,7 +571,7 @@ pub const UpgradeCommand = struct {
};
env_loader.map.put("IS_BUN_AUTO_UPDATE", "true") catch unreachable;
- var buf_map = try env_loader.map.cloneToBufMap(ctx.allocator);
+ var buf_map = try env_loader.map.cloneToEnvMap(ctx.allocator);
_ = std.ChildProcess.exec(.{
.allocator = ctx.allocator,
.argv = &completions_argv,
@@ -606,7 +583,7 @@ pub const UpgradeCommand = struct {
Output.printStartEnd(ctx.start_time, std.time.nanoTimestamp());
- Output.prettyErrorln("<r> Upgraded.\n\n<b><green>Welcome to bun v{s}!<r>\n\n Report any bugs:\n https://github.com/Jarred-Sumner/bun/issues\n\n What's new:\n https://github.com/Jarred-Sumner/bun/releases/tag/{s}<r>", .{ version_name, version.tag });
+ Output.prettyErrorln("<r> Upgraded.\n\n<b><green>Welcome to bun v{s}!<r>\n\n Report any bugs:\n https://github.com/oven-sh/bun/issues\n\n What's new:\n https://github.com/oven-sh/bun/releases/tag/{s}<r>", .{ version_name, version.tag });
Output.flush();
return;
}
diff --git a/src/deps/backtrace.zig b/src/deps/backtrace.zig
index 3a5bc7a49..47293d1cf 100644
--- a/src/deps/backtrace.zig
+++ b/src/deps/backtrace.zig
@@ -94,17 +94,21 @@ pub inline fn print() void {
_ = backtrace_full(state, 2, full_callback, null, null);
}
+fn setup_sigactions(act: ?*const os.Sigaction) !void {
+ try os.sigaction(os.SIG.ABRT, act, null);
+ try os.sigaction(os.SIG.BUS, act, null);
+ try os.sigaction(os.SIG.FPE, act, null);
+ try os.sigaction(os.SIG.ILL, act, null);
+ try os.sigaction(os.SIG.SEGV, act, null);
+ try os.sigaction(os.SIG.TRAP, act, null);
+}
+
const builtin = @import("builtin");
const ErrorCallback = fn (sig: i32, addr: usize) void;
var on_error: ?ErrorCallback = null;
noinline fn sigaction_handler(sig: i32, info: *const std.os.siginfo_t, _: ?*const anyopaque) callconv(.C) void {
// Prevent recursive calls
- os.sigaction(os.SIG.ABRT, null, null);
- os.sigaction(os.SIG.BUS, null, null);
- os.sigaction(os.SIG.FPE, null, null);
- os.sigaction(os.SIG.ILL, null, null);
- os.sigaction(os.SIG.SEGV, null, null);
- os.sigaction(os.SIG.TRAP, null, null);
+ setup_sigactions(null) catch unreachable;
const addr = switch (comptime builtin.target.os.tag) {
.linux => @ptrToInt(info.fields.sigfault.addr),
@@ -117,13 +121,8 @@ noinline fn sigaction_handler(sig: i32, info: *const std.os.siginfo_t, _: ?*cons
if (on_error) |handle| handle(sig, addr);
}
-pub fn reloadHandlers() void {
- os.sigaction(os.SIG.ABRT, null, null);
- os.sigaction(os.SIG.BUS, null, null);
- os.sigaction(os.SIG.FPE, null, null);
- os.sigaction(os.SIG.ILL, null, null);
- os.sigaction(os.SIG.SEGV, null, null);
- os.sigaction(os.SIG.TRAP, null, null);
+pub fn reloadHandlers() !void {
+ try setup_sigactions(null);
var act = os.Sigaction{
.handler = .{ .sigaction = sigaction_handler },
@@ -131,15 +130,10 @@ pub fn reloadHandlers() void {
.flags = (os.SA.SIGINFO | os.SA.RESTART | os.SA.RESETHAND),
};
- os.sigaction(os.SIG.ABRT, &act, null);
- os.sigaction(os.SIG.BUS, &act, null);
- os.sigaction(os.SIG.FPE, &act, null);
- os.sigaction(os.SIG.ILL, &act, null);
- os.sigaction(os.SIG.SEGV, &act, null);
- os.sigaction(os.SIG.TRAP, &act, null);
+ try setup_sigactions(&act);
}
const os = std.os;
-pub fn start(ctx: ?*anyopaque, callback_: PrintCallback, onError: ErrorCallback) void {
+pub fn start(ctx: ?*anyopaque, callback_: PrintCallback, onError: ErrorCallback) !void {
callback_ctx = ctx;
callback = callback_;
on_error = onError;
@@ -150,10 +144,5 @@ pub fn start(ctx: ?*anyopaque, callback_: PrintCallback, onError: ErrorCallback)
.flags = (os.SA.SIGINFO | os.SA.RESTART | os.SA.RESETHAND),
};
- os.sigaction(os.SIG.ABRT, &act, null);
- os.sigaction(os.SIG.BUS, &act, null);
- os.sigaction(os.SIG.FPE, &act, null);
- os.sigaction(os.SIG.ILL, &act, null);
- os.sigaction(os.SIG.SEGV, &act, null);
- os.sigaction(os.SIG.TRAP, &act, null);
+ try setup_sigactions(&act);
}
diff --git a/src/env_loader.zig b/src/env_loader.zig
index 55e1d74f0..afd7fa9ff 100644
--- a/src/env_loader.zig
+++ b/src/env_loader.zig
@@ -298,7 +298,7 @@ pub const Lexer = struct {
// we don't need to do special parsing on process-level environment variable values
// if they're quoted, we should keep them quoted.
- // https://github.com/Jarred-Sumner/bun/issues/40
+ // https://github.com/oven-sh/bun/issues/40
if (comptime is_process_env) {
const current = this.current;
// TODO: remove this loop
@@ -435,8 +435,8 @@ pub const Loader = struct {
return this.get(key) orelse key;
}
- /// Load values from the environment into Define.
- ///
+ /// Load values from the environment into Define.
+ ///
/// If there is a framework, values from the framework are inserted with a
/// **lower priority** so that users may override defaults. Unlike regular
/// defines, environment variables are loaded as JavaScript string literals.
@@ -959,8 +959,8 @@ pub const Map = struct {
map: HashTable,
- pub fn cloneToBufMap(this: *Map, allocator: std.mem.Allocator) !std.BufMap {
- var buf_map = std.BufMap.init(allocator);
+ pub fn cloneToEnvMap(this: *Map, allocator: std.mem.Allocator) !std.process.EnvMap {
+ var env_map = std.process.EnvMap.init(allocator);
const Convert = struct {
pub fn constStrToU8(s: string) []u8 {
@@ -970,10 +970,10 @@ pub const Map = struct {
var iter_ = this.map.iterator();
while (iter_.next()) |entry| {
- try buf_map.putMove(Convert.constStrToU8(entry.key_ptr.*), Convert.constStrToU8(entry.value_ptr.*));
+ try env_map.putMove(Convert.constStrToU8(entry.key_ptr.*), Convert.constStrToU8(entry.value_ptr.*));
}
- return buf_map;
+ return env_map;
}
pub inline fn init(allocator: std.mem.Allocator) Map {
diff --git a/src/exact_size_matcher.zig b/src/exact_size_matcher.zig
index 011adb7f8..961737a9d 100644
--- a/src/exact_size_matcher.zig
+++ b/src/exact_size_matcher.zig
@@ -29,7 +29,7 @@ pub fn ExactSizeMatcher(comptime max_bytes: usize) type {
return std.mem.readIntNative(T, &tmp);
},
max_bytes => {
- return std.mem.readIntSliceNative(T, str);
+ return std.mem.readIntSliceNative(T, str[0..]);
},
0 => {
return 0;
diff --git a/src/favicon.png b/src/favicon.png
index 074beae19..46009fba5 100644
--- a/src/favicon.png
+++ b/src/favicon.png
Binary files differ
diff --git a/src/futex.zig b/src/futex.zig
index 6fad775c9..ad8ff84b9 100644
--- a/src/futex.zig
+++ b/src/futex.zig
@@ -163,7 +163,7 @@ const LinuxFutex = struct {
switch (linux.getErrno(linux.futex_wake(
@ptrCast(*const i32, ptr),
linux.FUTEX.PRIVATE_FLAG | linux.FUTEX.WAKE,
- std.math.cast(i32, num_waiters) catch std.math.maxInt(i32),
+ std.math.cast(i32, num_waiters) orelse std.math.maxInt(i32),
))) {
.SUCCESS => {}, // successful wake up
.INVAL => {}, // invalid futex_wait() on ptr done elsewhere
diff --git a/src/hash_map.zig b/src/hash_map.zig
index 4f5c72e2f..58171eae0 100644
--- a/src/hash_map.zig
+++ b/src/hash_map.zig
@@ -1180,7 +1180,7 @@ test "std.hash_map put and remove loop in random order" {
var rng = std.rand.DefaultPrng.init(0);
while (i < iterations) : (i += 1) {
- std.rand.Random.shuffle(&rng.random, u32, keys.items);
+ std.rand.Random.shuffle(rng.random(), u32, keys.items);
for (keys.items) |key| {
try map.put(key, key);
@@ -1209,13 +1209,13 @@ test "std.hash_map remove one million elements in random order" {
}
var rng = std.rand.DefaultPrng.init(0);
- std.rand.Random.shuffle(&rng.random, u32, keys.items);
+ std.rand.Random.shuffle(rng.random(), u32, keys.items);
for (keys.items) |key| {
map.put(key, key) catch unreachable;
}
- std.rand.Random.shuffle(&rng.random, u32, keys.items);
+ std.rand.Random.shuffle(rng.random(), u32, keys.items);
i = 0;
while (i < n) : (i += 1) {
const key = keys.items[i];
diff --git a/src/http.zig b/src/http.zig
index e619e1517..1515f976f 100644
--- a/src/http.zig
+++ b/src/http.zig
@@ -128,7 +128,7 @@ pub const RequestContext = struct {
pub var fallback_only = false;
const default_favicon = @embedFile("favicon.png");
- const default_favicon_shasum = "07877ad4cdfe472cc70759d1f237d358ae1f6a9b";
+ const default_favicon_shasum = "68d5047bec9a8cd56e2e8999d74cad7ba448dce9";
pub fn sendFavicon(ctx: *RequestContext) !void {
ctx.appendHeader("Content-Type", MimeType.byExtension("png").value);
ctx.appendHeader("ETag", default_favicon_shasum);
@@ -3474,7 +3474,6 @@ pub const Server = struct {
},
else => {
Output.prettyErrorln("<r><red>{s} while trying to start listening on port {d}.\n\n", .{ @errorName(err), port });
- Output.flush();
Global.exit(1);
},
}
@@ -3494,7 +3493,6 @@ pub const Server = struct {
random_number.random().intRangeAtMost(u16, 3011, 65535),
},
);
- Output.flush();
Global.exit(1);
}
}
diff --git a/src/http_client_async.zig b/src/http_client_async.zig
index 33f004f28..2da75b652 100644
--- a/src/http_client_async.zig
+++ b/src/http_client_async.zig
@@ -70,8 +70,7 @@ pub fn onThreadStart(_: ?*anyopaque) ?*anyopaque {
Output.prettyErrorln("<r><red>error<r>: Failed to initialize network thread: <red><b>{s}<r>.\nHTTP requests will not work. Please file an issue and run strace().", .{@errorName(err)});
}
- Output.flush();
- os.exit(1);
+ Global.exit(1);
};
AsyncIO.global_loaded = true;
diff --git a/src/install/extract_tarball.zig b/src/install/extract_tarball.zig
index b58596540..fe50aa734 100644
--- a/src/install/extract_tarball.zig
+++ b/src/install/extract_tarball.zig
@@ -183,7 +183,6 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !string {
name,
},
);
- Output.flush();
Global.crash();
};
_ = if (PackageManager.verbose_install)
@@ -243,7 +242,6 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !string {
folder_name,
},
);
- Output.flush();
Global.crash();
};
@@ -257,7 +255,6 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !string {
name,
},
);
- Output.flush();
Global.crash();
};
defer final_dir.close();
@@ -273,7 +270,6 @@ fn extract(this: *const ExtractTarball, tgz_bytes: []const u8) !string {
name,
},
);
- Output.flush();
Global.crash();
};
return try FileSystem.instance.dirname_store.append(@TypeOf(final_path), final_path);
diff --git a/src/install/install.zig b/src/install/install.zig
index 051eebb03..68b9c422a 100644
--- a/src/install/install.zig
+++ b/src/install/install.zig
@@ -186,7 +186,7 @@ const NetworkTask = struct {
}
// We must use a less restrictive Acccept header value
- // https://github.com/Jarred-Sumner/bun/issues/341
+ // https://github.com/oven-sh/bun/issues/341
// https://www.jfrog.com/jira/browse/RTFACT-18398
const accept_header_value = "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*";
@@ -943,7 +943,6 @@ const PackageInstall = struct {
progress_.refresh();
Output.prettyErrorln("<r><red>{s}<r>: copying file {s}", .{ @errorName(err), entry.path });
- Output.flush();
Global.exit(1);
};
};
@@ -962,7 +961,6 @@ const PackageInstall = struct {
progress_.refresh();
Output.prettyErrorln("<r><red>{s}<r>: copying file {s}", .{ @errorName(err), entry.path });
- Output.flush();
Global.exit(1);
};
};
@@ -1151,8 +1149,8 @@ pub const CacheLevel = struct {
use_last_modified: bool,
};
-// We can't know all the package s we need until we've downloaded all the packages
-// The easy way wouild be:
+// We can't know all the packages we need until we've downloaded all the packages
+// The easy way would be:
// 1. Download all packages, parsing their dependencies and enqueuing all dependnecies for resolution
// 2.
pub const PackageManager = struct {
@@ -1317,7 +1315,6 @@ pub const PackageManager = struct {
return std.fs.cwd().makeOpenPath("node_modules/.cache", .{ .iterate = true }) catch |err| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to write files: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
}
@@ -1339,7 +1336,6 @@ pub const PackageManager = struct {
tried_dot_tmp = true;
break :brk cache_directory.makeOpenPath(".tmp", .{ .iterate = true }) catch |err| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to access tempdir: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
};
@@ -1353,7 +1349,6 @@ pub const PackageManager = struct {
tempdir = cache_directory.makeOpenPath(".tmp", .{ .iterate = true }) catch |err| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to access tempdir: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
continue :brk;
@@ -1361,7 +1356,6 @@ pub const PackageManager = struct {
Output.prettyErrorln("<r><red>error<r>: {s} accessing temporary directory. Please set <b>$BUN_TMPDIR<r> or <b>$BUN_INSTALL<r>", .{
@errorName(err2),
});
- Output.flush();
Global.crash();
};
@@ -1370,7 +1364,6 @@ pub const PackageManager = struct {
tried_dot_tmp = true;
tempdir = cache_directory.makeOpenPath(".tmp", .{ .iterate = true }) catch |err2| {
Output.prettyErrorln("<r><red>error<r>: bun is unable to write files to tempdir: {s}", .{@errorName(err2)});
- Output.flush();
Global.crash();
};
continue :brk;
@@ -1379,7 +1372,6 @@ pub const PackageManager = struct {
Output.prettyErrorln("<r><red>error<r>: {s} accessing temporary directory. Please set <b>$BUN_TMPDIR<r> or <b>$BUN_INSTALL<r>", .{
@errorName(err),
});
- Output.flush();
Global.crash();
};
cache_directory.deleteFileZ(tmpname) catch {};
@@ -1788,7 +1780,7 @@ pub const PackageManager = struct {
var tmpfile = FileSystem.RealFS.Tmpfile{};
var secret: [32]u8 = undefined;
std.mem.writeIntNative(u64, secret[0..8], @intCast(u64, std.time.milliTimestamp()));
- var rng = std.rand.Gimli.init(secret).random();
+ var rng = std.rand.Xoodoo.init(secret).random();
var base64_bytes: [64]u8 = undefined;
rng.bytes(&base64_bytes);
@@ -1798,7 +1790,6 @@ pub const PackageManager = struct {
tmpfile.create(&FileSystem.instance.fs, tmpname) catch |err| {
Output.prettyErrorln("<r><red>error:<r> failed to create tmpfile: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
@@ -3418,7 +3409,6 @@ pub const PackageManager = struct {
clap.help(Output.writer(), params) catch {};
- Output.flush();
Global.exit(0);
}
@@ -3456,7 +3446,6 @@ pub const PackageManager = struct {
// cli.omit.peer = true;
// } else {
// Output.prettyErrorln("<b>error<r><d>:<r> Invalid argument <b>\"--omit\"<r> must be one of <cyan>\"dev\"<r>, <cyan>\"optional\"<r>, or <cyan>\"peer\"<r>. ", .{});
- // Output.flush();
// Global.exit(1);
// }
// }
@@ -3566,7 +3555,6 @@ pub const PackageManager = struct {
@tagName(op),
});
}
- Output.flush();
Global.exit(1);
}
@@ -3589,7 +3577,6 @@ pub const PackageManager = struct {
@tagName(op),
});
}
- Output.flush();
Global.exit(1);
}
@@ -3706,7 +3693,6 @@ pub const PackageManager = struct {
\\
, .{});
}
- Output.flush();
Global.exit(0);
},
.remove => {
@@ -3765,7 +3751,6 @@ pub const PackageManager = struct {
}
}
- Output.flush();
Global.crash();
}
@@ -3797,12 +3782,10 @@ pub const PackageManager = struct {
if (op == .remove) {
if (current_package_json.data != .e_object) {
Output.prettyErrorln("<red>error<r><d>:<r> package.json is not an Object {{}}, so there's nothing to remove!", .{});
- Output.flush();
Global.exit(1);
return;
} else if (current_package_json.data.e_object.properties.len == 0) {
Output.prettyErrorln("<red>error<r><d>:<r> package.json is empty {{}}, so there's nothing to remove!", .{});
- Output.flush();
Global.exit(1);
return;
} else if (current_package_json.asProperty("devDependencies") == null and
@@ -3811,7 +3794,6 @@ pub const PackageManager = struct {
current_package_json.asProperty("peerDependencies") == null)
{
Output.prettyErrorln("package.json doesn't have dependencies, there's nothing to remove!", .{});
- Output.flush();
Global.exit(0);
return;
}
@@ -3875,7 +3857,6 @@ pub const PackageManager = struct {
if (!any_changes) {
Output.prettyErrorln("\n<red>error<r><d>:<r> \"<b>{s}<r>\" is not in a package.json file", .{updates[0].name});
- Output.flush();
Global.exit(1);
return;
}
@@ -3927,7 +3908,6 @@ pub const PackageManager = struct {
// so we can commit the version we changed from the lockfile
current_package_json = json_parser.ParseJSONUTF8(&source, ctx.log, manager.allocator) catch |err| {
Output.prettyErrorln("<red>error<r><d>:<r> package.json failed to parse due to error {s}", .{@errorName(err)});
- Output.flush();
Global.exit(1);
return;
};
@@ -4315,12 +4295,10 @@ pub const PackageManager = struct {
skip_verify = true;
std.fs.cwd().makeDirZ("node_modules") catch |err| {
Output.prettyErrorln("<r><red>error<r>: <b><red>{s}<r> creating <b>node_modules<r> folder", .{@errorName(err)});
- Output.flush();
Global.crash();
};
break :brk std.fs.cwd().openDirZ("node_modules", .{ .iterate = true }) catch |err| {
Output.prettyErrorln("<r><red>error<r>: <b><red>{s}<r> opening <b>node_modules<r> folder", .{@errorName(err)});
- Output.flush();
Global.crash();
};
};
@@ -4814,7 +4792,6 @@ pub const PackageManager = struct {
}
if (manager.log.errors > 0) {
- Output.flush();
Global.exit(1);
}
diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig
index 21ee9f314..e3b1b2345 100644
--- a/src/install/lockfile.zig
+++ b/src/install/lockfile.zig
@@ -894,7 +894,6 @@ pub const Printer = struct {
try log.printForLogLevelWithEnableAnsiColors(Output.errorWriter(), false);
}
}
- Output.flush();
Global.exit(1);
return;
},
@@ -902,7 +901,6 @@ pub const Printer = struct {
Output.prettyErrorln("<r><red>lockfile not found:<r> {s}", .{
std.mem.span(lockfile_path),
});
- Output.flush();
Global.exit(1);
return;
},
@@ -1378,7 +1376,6 @@ pub fn saveToDisk(this: *Lockfile, filename: stringZ) void {
if (comptime Environment.allow_assert) {
this.verifyData() catch |err| {
Output.prettyErrorln("<r><red>error:<r> failed to verify lockfile: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
}
@@ -1388,7 +1385,7 @@ pub fn saveToDisk(this: *Lockfile, filename: stringZ) void {
var tmpfile = FileSystem.RealFS.Tmpfile{};
var secret: [32]u8 = undefined;
std.mem.writeIntNative(u64, secret[0..8], @intCast(u64, std.time.milliTimestamp()));
- var rng = std.rand.Gimli.init(secret);
+ var rng = std.rand.Xoodoo.init(secret);
var base64_bytes: [64]u8 = undefined;
rng.random().bytes(&base64_bytes);
@@ -1398,7 +1395,6 @@ pub fn saveToDisk(this: *Lockfile, filename: stringZ) void {
tmpfile.create(&FileSystem.instance.fs, tmpname) catch |err| {
Output.prettyErrorln("<r><red>error:<r> failed to open lockfile: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
@@ -1407,7 +1403,6 @@ pub fn saveToDisk(this: *Lockfile, filename: stringZ) void {
Lockfile.Serializer.save(this, std.fs.File, file) catch |err| {
tmpfile.dir().deleteFileZ(tmpname) catch {};
Output.prettyErrorln("<r><red>error:<r> failed to serialize lockfile: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
@@ -1420,7 +1415,6 @@ pub fn saveToDisk(this: *Lockfile, filename: stringZ) void {
tmpfile.promote(tmpname, std.fs.cwd().fd, filename) catch |err| {
tmpfile.dir().deleteFileZ(tmpname) catch {};
Output.prettyErrorln("<r><red>error:<r> failed to save lockfile: {s}", .{@errorName(err)});
- Output.flush();
Global.crash();
};
}
diff --git a/src/js_parser.zig b/src/js_parser.zig
index 23a945bbe..34e4b3a9f 100644
--- a/src/js_parser.zig
+++ b/src/js_parser.zig
@@ -16044,7 +16044,7 @@ fn NewParser_(
return;
},
.s_class => |class| {
- // TODO: https://github.com/Jarred-Sumner/bun/issues/51
+ // TODO: https://github.com/oven-sh/bun/issues/51
_ = p.visitClass(s2.loc, &class.class);
if (p.is_control_flow_dead)
@@ -17175,7 +17175,7 @@ fn NewParser_(
stmts.append(closure) catch unreachable;
}
- // TODO: https://github.com/Jarred-Sumner/bun/issues/51
+ // TODO: https://github.com/oven-sh/bun/issues/51
fn lowerClass(
p: *P,
stmtorexpr: js_ast.StmtOrExpr,
diff --git a/src/main.zig b/src/main.zig
index fdd93e4a7..9d92942be 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -24,7 +24,7 @@ pub const MainPanicHandler = panicky.NewPanicHandler(std.builtin.default_panic);
const js = @import("bun.js/bindings/bindings.zig");
const JavaScript = @import("bun.js/javascript.zig");
pub const io_mode = .blocking;
-pub const bindgen = @import("build_options").bindgen;
+pub const bindgen = if (@import("builtin").is_test) undefined else @import("build_options").bindgen;
const Report = @import("./report.zig");
pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {
MainPanicHandler.handle_panic(msg, error_return_trace);
@@ -39,7 +39,7 @@ pub fn PLCrashReportHandler() void {
pub var start_time: i128 = 0;
pub fn main() void {
if (comptime Environment.isRelease)
- CrashReporter.start(null, Report.CrashReportWriter.printFrame, Report.handleCrash);
+ CrashReporter.start(null, Report.CrashReportWriter.printFrame, Report.handleCrash) catch unreachable;
start_time = std.time.nanoTimestamp();
diff --git a/src/meta.zig b/src/meta.zig
index afc502d58..c104e378d 100644
--- a/src/meta.zig
+++ b/src/meta.zig
@@ -10,3 +10,17 @@ pub fn ReturnOfType(comptime Type: type) type {
const typeinfo: std.builtin.TypeInfo.Fn = @typeInfo(Type);
return typeinfo.return_type orelse void;
}
+
+// partially emulates behaviour of @typeName in previous Zig versions,
+// converting "some.namespace.MyType" to "MyType"
+pub fn typeBaseName(comptime fullname: []const u8) []const u8 {
+
+ // leave type name like "namespace.WrapperType(namespace.MyType)" as it is
+ const baseidx = comptime std.mem.indexOf(u8, fullname, "(");
+ if (baseidx != null) return fullname;
+
+ const idx = comptime std.mem.lastIndexOf(u8, fullname, ".");
+
+ const name = if (idx == null) fullname else fullname[(idx.? + 1)..];
+ return comptime std.fmt.comptimePrint("{s}", .{name});
+}
diff --git a/src/node-fallbacks/net.js b/src/node-fallbacks/net.js
new file mode 100644
index 000000000..8f58ce134
--- /dev/null
+++ b/src/node-fallbacks/net.js
@@ -0,0 +1,58 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// IPv4 Segment
+const v4Seg = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
+const v4Str = `(${v4Seg}[.]){3}${v4Seg}`;
+const IPv4Reg = new RegExp(`^${v4Str}$`);
+
+// IPv6 Segment
+const v6Seg = '(?:[0-9a-fA-F]{1,4})';
+const IPv6Reg = new RegExp('^(' +
+ `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` +
+ `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` +
+ `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` +
+ `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` +
+ `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` +
+ `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` +
+ `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` +
+ `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` +
+')(%[0-9a-zA-Z-.:]{1,})?$');
+
+export function isIPv4(s) {
+ return IPv4Reg.test(s);
+}
+
+export function isIPv6(s) {
+ return IPv6Reg.test(s);
+}
+
+export function isIP(s) {
+ if (isIPv4(s)) return 4;
+ if (isIPv6(s)) return 6;
+ return 0;
+}
+
+export default {
+ isIP,
+ isIPv4,
+ isIPv6,
+} \ No newline at end of file
diff --git a/src/node_fallbacks.zig b/src/node_fallbacks.zig
index d3ffad3a8..b08b24f57 100644
--- a/src/node_fallbacks.zig
+++ b/src/node_fallbacks.zig
@@ -14,6 +14,7 @@ const domain_code: string = @embedFile("./node-fallbacks/out/domain.js");
const events_code: string = @embedFile("./node-fallbacks/out/events.js");
const http_code: string = @embedFile("./node-fallbacks/out/http.js");
const https_code: string = @embedFile("./node-fallbacks/out/https.js");
+const net_code: string = @embedFile("./node-fallbacks/out/net.js");
const os_code: string = @embedFile("./node-fallbacks/out/os.js");
const path_code: string = @embedFile("./node-fallbacks/out/path.js");
const process_code: string = @embedFile("./node-fallbacks/out/process.js");
@@ -42,6 +43,7 @@ const domain_import_path = "/bun-vfs/node_modules/domain/index.js";
const events_import_path = "/bun-vfs/node_modules/events/index.js";
const http_import_path = "/bun-vfs/node_modules/http/index.js";
const https_import_path = "/bun-vfs/node_modules/https/index.js";
+const net_import_path = "/bun-vfs/node_modules/net/index.js";
const os_import_path = "/bun-vfs/node_modules/os/index.js";
const path_import_path = "/bun-vfs/node_modules/path/index.js";
const process_import_path = "/bun-vfs/node_modules/process/index.js";
@@ -142,6 +144,15 @@ const https_package_json = PackageJSON{
.browser_map = undefined,
.source = logger.Source.initPathString("/bun-vfs/node_modules/https/package.json", ""),
};
+const net_package_json = PackageJSON{
+ .name = "net",
+ .version = "0.0.0-polyfill",
+ .module_type = .cjs,
+ .hash = @truncate(u32, std.hash.Wyhash.hash(0, "net@0.0.0-polyfill")),
+ .main_fields = undefined,
+ .browser_map = undefined,
+ .source = logger.Source.initPathString("/bun-vfs/node_modules/net/package.json", ""),
+};
const os_package_json = PackageJSON{
.name = "os",
.version = "0.0.0-polyfill",
@@ -353,6 +364,11 @@ pub const FallbackModule = struct {
.code = https_code,
.package_json = &https_package_json,
};
+ pub const @"net" = FallbackModule{
+ .path = Fs.Path.initWithNamespaceVirtual(net_import_path, "node", "net"),
+ .code = net_code,
+ .package_json = &net_package_json,
+ };
pub const @"os" = FallbackModule{
.path = Fs.Path.initWithNamespaceVirtual(os_import_path, "node", "os"),
.code = os_code,
@@ -454,6 +470,7 @@ pub const Map = ComptimeStringMap(FallbackModule, .{
&.{ "events", FallbackModule.events },
&.{ "http", FallbackModule.http },
&.{ "https", FallbackModule.https },
+ &.{ "net", FallbackModule.net },
&.{ "os", FallbackModule.os },
&.{ "path", FallbackModule.path },
&.{ "process", FallbackModule.process },
diff --git a/src/open.zig b/src/open.zig
index 26b980a66..36c4a9a35 100644
--- a/src/open.zig
+++ b/src/open.zig
@@ -25,7 +25,7 @@ pub fn openURL(url: string) !void {
}
var args_buf = [_]string{ opener, url };
- var child_process = try std.ChildProcess.init(&args_buf, default_allocator);
+ var child_process = std.ChildProcess.init(&args_buf, default_allocator);
child_process.stderr_behavior = .Pipe;
child_process.stdin_behavior = .Ignore;
child_process.stdout_behavior = .Pipe;
@@ -311,14 +311,14 @@ pub const Editor = enum(u8) {
},
}
- spawned.child_process = try std.ChildProcess.init(args_buf[0..i], default_allocator);
+ spawned.child_process = std.ChildProcess.init(args_buf[0..i], default_allocator);
var thread = try std.Thread.spawn(.{}, autoClose, .{spawned});
thread.detach();
}
const SpawnedEditorContext = struct {
file_path_buf: [1024 + bun.MAX_PATH_BYTES]u8 = undefined,
buf: [10]string = undefined,
- child_process: *std.ChildProcess = undefined,
+ child_process: std.ChildProcess = undefined,
};
fn autoClose(spawned: *SpawnedEditorContext) void {
diff --git a/src/report.zig b/src/report.zig
index d2ec21703..4def423a8 100644
--- a/src/report.zig
+++ b/src/report.zig
@@ -295,7 +295,6 @@ pub noinline fn globalError(err: anyerror) noreturn {
"\n<r><red>SyntaxError<r><d>:<r> An error occurred while parsing code",
.{},
);
- Output.flush();
Global.exit(1);
},
error.OutOfMemory => {
@@ -304,7 +303,6 @@ pub noinline fn globalError(err: anyerror) noreturn {
.{},
);
printMetadata();
- Output.flush();
Global.exit(1);
},
error.CurrentWorkingDirectoryUnlinked => {
@@ -312,7 +310,6 @@ pub noinline fn globalError(err: anyerror) noreturn {
"\n<r><red>error: <r>The current working directory was deleted, so that command didn't work. Please cd into a different directory and try again.",
.{},
);
- Output.flush();
Global.exit(1);
},
error.BundleFailed => {
@@ -320,7 +317,6 @@ pub noinline fn globalError(err: anyerror) noreturn {
"\n<r><red>BundleFailed<r>",
.{},
);
- Output.flush();
Global.exit(1);
},
error.InvalidArgument, error.InstallFailed => {
@@ -382,11 +378,9 @@ pub noinline fn globalError(err: anyerror) noreturn {
}
}
- Output.flush();
Global.exit(1);
},
error.@"Invalid Bunfig" => {
- Output.flush();
Global.exit(1);
},
error.ProcessFdQuotaExceeded => {
@@ -449,7 +443,6 @@ pub noinline fn globalError(err: anyerror) noreturn {
}
}
- Output.flush();
Global.exit(1);
},
// The usage of `unreachable` in Zig's std.os may cause the file descriptor problem to show up as other errors
@@ -503,7 +496,6 @@ pub noinline fn globalError(err: anyerror) noreturn {
);
}
- Output.flush();
Global.exit(1);
}
},
@@ -532,7 +524,6 @@ pub noinline fn globalError(err: anyerror) noreturn {
"\n<r><red>error<r><d>:<r> <b>MissingPackageJSON<r>\nbun could not find a package.json file.\n",
.{},
);
- Output.flush();
Global.exit(1);
},
error.MissingValue => {
diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig
index febfae338..0a49e68a1 100644
--- a/src/resolver/resolver.zig
+++ b/src/resolver/resolver.zig
@@ -460,7 +460,6 @@ pub const Resolver = struct {
switch (err) {
error.ModuleNotFound => {
Output.prettyErrorln("<r><red>ResolveError<r> can't find framework: <b>\"{s}\"<r>.\n\nMaybe it's not installed? Try running this:\n\n <b>bun add -d {s}<r>\n <b>bun bun --use {s}<r>", .{ package, package, package });
- Output.flush();
Global.exit(1);
},
else => {
@@ -480,7 +479,6 @@ pub const Resolver = struct {
switch (err2) {
error.ModuleNotFound => {
Output.prettyErrorln("<r><red>ResolveError<r> can't find framework: <b>\"{s}\"<r>.\n\nMaybe it's not installed? Try running this:\n\n <b>bun add -d {s}\n <b>bun bun --use {s}<r>", .{ package, prefixed_name, package });
- Output.flush();
Global.exit(1);
},
else => {
@@ -500,8 +498,6 @@ pub const Resolver = struct {
switch (err) {
error.ModuleNotFound => {
Output.prettyError("<r><red>ResolveError<r> can't find local framework: <b>\"{s}\"<r>.", .{package});
-
- Output.flush();
Global.exit(1);
},
else => {
diff --git a/src/sha.zig b/src/sha.zig
index 415941fb4..354c1583b 100644
--- a/src/sha.zig
+++ b/src/sha.zig
@@ -228,11 +228,12 @@ pub fn main() anyerror!void {
}
}
-test "sha256" {
- const value: []const u8 = "hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world!";
- var hash: SHA256.Digest = undefined;
- var hash2: SHA256.Digest = undefined;
- SHA256.hash(value, &hash);
- std.crypto.hash.sha2.Sha256.hash(value, &hash2, .{});
- try std.testing.expectEqual(hash, hash2);
-}
+// TODO(sno2): update SHA256 test to include BoringSSL engine
+// test "sha256" {
+// const value: []const u8 = "hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world! hello, world!";
+// var hash: SHA256.Digest = undefined;
+// var hash2: SHA256.Digest = undefined;
+// SHA256.hash(value, &hash);
+// std.crypto.hash.sha2.Sha256.hash(value, &hash2, .{});
+// try std.testing.expectEqual(hash, hash2);
+// }
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index 8f347b047..479342025 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -16,11 +16,19 @@ pub inline fn contains(self: string, str: string) bool {
}
pub fn toUTF16Literal(comptime str: []const u8) []const u16 {
- const Static = struct {
- pub const literal = std.unicode.utf8ToUtf16LeStringLiteral(str);
- };
+ comptime {
+ comptime var output: [str.len]u16 = undefined;
+
+ for (str) |c, i| {
+ output[i] = c;
+ }
- return Static.literal;
+ const Static = struct {
+ pub const literal: []const u16 = output[0..];
+ };
+
+ return Static.literal;
+ }
}
const OptionalUsize = std.meta.Int(.unsigned, @bitSizeOf(usize) - 1);
@@ -2863,7 +2871,7 @@ test "decodeHexToBytes" {
var good: [4096]u8 = undefined;
var ours_buf: [4096]u8 = undefined;
var match = try std.fmt.hexToBytes(good[0..1024], hex);
- var ours = decodeHexToBytes(&ours_buf, hex);
+ var ours = decodeHexToBytes(&ours_buf, u8, hex);
try std.testing.expectEqualSlices(u8, match, ours_buf[0..ours]);
try std.testing.expectEqualSlices(u8, &buffer, ours_buf[0..ours]);
}
@@ -3016,7 +3024,7 @@ pub fn firstNonASCII16CheckMin(comptime Slice: type, slice: Slice, comptime chec
return null;
}
-/// Fast path for printing template literal strings
+/// Fast path for printing template literal strings
pub fn @"nextUTF16NonASCIIOr$`\\"(
comptime Slice: type,
slice: Slice,
diff --git a/src/tagged_pointer.zig b/src/tagged_pointer.zig
index 0b51dc36c..9e6fe1646 100644
--- a/src/tagged_pointer.zig
+++ b/src/tagged_pointer.zig
@@ -9,6 +9,7 @@ const MutableString = bun.MutableString;
const stringZ = bun.stringZ;
const default_allocator = bun.default_allocator;
const C = bun.C;
+const typeBaseName = @import("./meta.zig").typeBaseName;
const TagSize = u15;
const AddressableSize = u49;
@@ -58,7 +59,7 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
inline for (Types) |field, i| {
enumFields[i] = .{
- .name = @typeName(field),
+ .name = comptime typeBaseName(@typeName(field)),
.value = 1024 - i,
};
}
@@ -79,7 +80,7 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
inline for (Fields) |field, i| {
enumFields[i] = .{
- .name = @typeName(field.default_value.?),
+ .name = comptime typeBaseName(@typeName(field.default_value.?)),
.value = 1024 - i,
};
}
@@ -102,8 +103,9 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
const This = @This();
fn assert_type(comptime Type: type) void {
- if (!comptime @hasField(Tag, @typeName(Type))) {
- @compileError("TaggedPointerUnion does not have " ++ @typeName(Type) ++ ".");
+ var name = comptime typeBaseName(@typeName(Type));
+ if (!comptime @hasField(Tag, name)) {
+ @compileError("TaggedPointerUnion does not have " ++ name ++ ".");
}
}
pub inline fn get(this: This, comptime Type: anytype) ?*Type {
@@ -124,7 +126,7 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
pub inline fn is(this: This, comptime Type: type) bool {
comptime assert_type(Type);
- return this.repr.data == comptime @enumToInt(@field(Tag, @typeName(Type)));
+ return this.repr.data == comptime @enumToInt(@field(Tag, typeBaseName(@typeName(Type))));
}
pub inline fn isValidPtr(_ptr: ?*anyopaque) bool {
@@ -134,9 +136,9 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
pub inline fn isValid(this: This) bool {
return switch (this.repr.data) {
@enumToInt(
- @field(Tag, @typeName(Types[Types.len - 1])),
+ @field(Tag, typeBaseName(@typeName(Types[Types.len - 1]))),
)...@enumToInt(
- @field(Tag, @typeName(Types[0])),
+ @field(Tag, typeBaseName(@typeName(Types[0]))),
) => true,
else => false,
};
@@ -152,9 +154,10 @@ pub fn TaggedPointerUnion(comptime Types: anytype) type {
pub inline fn init(_ptr: anytype) This {
const Type = std.meta.Child(@TypeOf(_ptr));
+ const name = comptime typeBaseName(@typeName(Type));
// there will be a compiler error if the passed in type doesn't exist in the enum
- return This{ .repr = TaggedPointer.init(_ptr, @enumToInt(@field(Tag, @typeName(Type)))) };
+ return This{ .repr = TaggedPointer.init(_ptr, @enumToInt(@field(Tag, name))) };
}
};
}
diff --git a/src/zlib.zig b/src/zlib.zig
index 7603c9654..958454b6c 100644
--- a/src/zlib.zig
+++ b/src/zlib.zig
@@ -242,7 +242,7 @@ pub fn NewZlibReader(comptime Writer: type, comptime buffer_size: usize) type {
pub fn alloc(ctx: *anyopaque, items: uInt, len: uInt) callconv(.C) *anyopaque {
var this = @ptrCast(*ZlibReader, @alignCast(@alignOf(*ZlibReader), ctx));
- const buf = this.arena.allocator.alloc(u8, items * len) catch unreachable;
+ const buf = this.arena.allocator().alloc(u8, items * len) catch unreachable;
return buf.ptr;
}
diff --git a/test/apps/bun-create-next.sh b/test/apps/bun-create-next.sh
index 4f19e535d..eb523d223 100644
--- a/test/apps/bun-create-next.sh
+++ b/test/apps/bun-create-next.sh
@@ -1,24 +1,23 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
# The important part of this test: make sure that bun.js successfully loads
# The most likely reason for this test to fail is that something broke in the JavaScriptCore <> bun integration
-killall -9 $(basename $BUN_BIN) || echo ""
+killall -9 "$(basename "$BUN_BIN")" || echo ""
-rm -rf /tmp/next-app
-mkdir -p /tmp/next-app
-$BUN_BIN create next /tmp/next-app
+DIR=$(mktemp -d -t next-app)
+$BUN_BIN create next "$DIR"
if (($?)); then
echo "bun create failed"
exit 1
fi
-echo "hi!" >/tmp/next-app/public/file.txt
-echo "export default 'string';" >/tmp/next-app/file.js
+echo "hi!" >"$DIR/public/file.txt"
+echo "export default 'string';" >"$DIR/file.js"
-cd /tmp/next-app
+cd "$DIR"
BUN_CRASH_WITHOUT_JIT=1 $BUN_BIN dev --port 8087 &
sleep 0.1
curl --fail -Ss http://localhost:8087/
@@ -28,7 +27,7 @@ if [[ "$(curl --fail -sS http://localhost:8087/file.txt)" != "hi!" ]]; then
echo ""
echo ""
echo "ERR: Expected 'hi!', got '$(curl --fail -sS http://localhost:8087/file.txt)'"
- killall -9 $(basename $BUN_BIN) || echo ""
+ killall -9 "$(basename "$BUN_BIN")" || echo ""
exit 1
fi
@@ -37,12 +36,12 @@ if [[ "$(curl --fail -sS http://localhost:8087/file.js)" != *"string"* ]]; then
echo ""
echo ""
echo "ERR: Expected file to contain string got '$(curl --fail -sS http://localhost:8087/file.js)'"
- killall -9 $(basename $BUN_BIN) || echo ""
+ killall -9 "$(basename "$BUN_BIN")" || echo ""
exit 1
fi
# very simple HMR test
-echo "export default 'string';" >/tmp/next-app/file2.js
+echo "export default 'string';" >"$DIR/file2.js"
sleep 0.1
if [[ "$(curl --fail -sS http://localhost:8087/file2.js)" != *"string"* ]]; then
@@ -50,8 +49,8 @@ if [[ "$(curl --fail -sS http://localhost:8087/file2.js)" != *"string"* ]]; then
echo ""
echo ""
echo "ERR: Expected file to contain string got '$(curl --fail -sS http://localhost:8087/file2.js)'"
- killall -9 $(basename $BUN_BIN) || echo ""
+ killall -9 "$(basename "$BUN_BIN")" || echo ""
exit 1
fi
-killall -9 $(basename $BUN_BIN) || echo ""
+killall -9 "$(basename "$BUN_BIN")" || echo ""
diff --git a/test/apps/bun-create-react.sh b/test/apps/bun-create-react.sh
index 41552dee5..2997eb7b1 100644
--- a/test/apps/bun-create-react.sh
+++ b/test/apps/bun-create-react.sh
@@ -1,19 +1,20 @@
-#!/bin/bash
+#!/usr/bin/env bash
-killall -9 $(basename $BUN_BIN) || echo ""
+set -euo pipefail
-rm -rf /tmp/react-app
-mkdir -p /tmp/react-app
-$BUN_BIN create react /tmp/react-app
+killall -9 "$(basename "$BUN_BIN")" || echo ""
+
+DIR=$(mktemp -d -t react-app)
+$BUN_BIN create react "$DIR"
if (($?)); then
echo "bun create failed"
exit 1
fi
-cd /tmp/react-app
+cd "$DIR"
BUN_CRASH_WITHOUT_JIT=1 $BUN_BIN dev --port 8087 &
sleep 0.005
-curl --fail http://localhost:8087/ && curl --fail http://localhost:8087/src/index.jsx && killall -9 $(basename $BUN_BIN) && echo "✅ bun create react passed."
+curl --fail http://localhost:8087/ && curl --fail http://localhost:8087/src/index.jsx && killall -9 "$(basename "$BUN_BIN")" && echo "✅ bun create react passed."
exit $?
diff --git a/test/apps/bun-dev-index-html.sh b/test/apps/bun-dev-index-html.sh
index 01d99b71a..77891f0c7 100644
--- a/test/apps/bun-dev-index-html.sh
+++ b/test/apps/bun-dev-index-html.sh
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
-killall -9 $(basename $BUN_BIN) || echo ""
+killall -9 "$(basename "$BUN_BIN")" || echo ""
-dir=$(mktemp -d --suffix=bun-dev-check)
+DIR=$(mktemp -d -t bun-dev-check)
index_content="<html><body>index.html</body></html>"
bacon_content="<html><body>bacon.html</body></html>"
@@ -14,13 +14,13 @@ css_not_transpiled_content="@import url(/index.js); @import url(/i-dont-exist.cs
css_is_transpiled_import="*{background-color:red;}"
css_is_transpiled="@import url(./css_is_transpiled_import.css);"
-echo $index_content >"$dir/index.html"
-echo $js_content >"$dir/index.js"
-echo $bacon_content >"$dir/bacon.html"
-echo $static_content >"$dir/static.txt"
-echo $css_not_transpiled_content >"$dir/css_not_transpiled_content.css"
+echo $index_content >"$DIR/index.html"
+echo $js_content >"$DIR/index.js"
+echo $bacon_content >"$DIR/bacon.html"
+echo $static_content >"$DIR/static.txt"
+echo $css_not_transpiled_content >"$DIR/css_not_transpiled_content.css"
-cd $dir
+cd "$DIR"
$BUN_BIN dev --port 8087 &
sleep 0.005
@@ -65,5 +65,5 @@ if [[ "$(curl --fail -sS http://localhost:8087/bacon.html)" != "$bacon_content"
exit 1
fi
-killall -9 $(basename $BUN_BIN) || echo ""
+killall -9 "$(basename "$BUN_BIN")" || echo ""
echo "✅ bun dev index html check passed."
diff --git a/test/apps/bun-dev.sh b/test/apps/bun-dev.sh
index fd2447e93..77fb75be8 100644
--- a/test/apps/bun-dev.sh
+++ b/test/apps/bun-dev.sh
@@ -1,22 +1,22 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
-killall -9 $(basename $BUN_BIN) || echo ""
+killall -9 "$(basename "$BUN_BIN")" || echo ""
-dir=$(mktemp -d --suffix=bun-dev-check)
+DIR=$(mktemp -d -t bun-dev-check)
index_content="<html><body>index.html</body></html>"
bacon_content="<html><body>bacon.html</body></html>"
js_content="console.log('hi')"
-mkdir -p $dir/public
+mkdir -p "$DIR/public"
-echo $index_content >"$dir/public/index.html"
-echo $js_content >"$dir/index.js"
-echo $bacon_content >"$dir/public/bacon.html"
+echo $index_content >"$DIR/public/index.html"
+echo $js_content >"$DIR/index.js"
+echo $bacon_content >"$DIR/public/bacon.html"
-cd $dir
+cd "$DIR"
$BUN_BIN dev --port 8087 &
sleep 0.005
diff --git a/test/apps/bun-install-lockfile-status.sh b/test/apps/bun-install-lockfile-status.sh
index b23b4fc3c..5e168b8e2 100644
--- a/test/apps/bun-install-lockfile-status.sh
+++ b/test/apps/bun-install-lockfile-status.sh
@@ -1,12 +1,12 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
-killall -9 $(basename $BUN_BIN) || echo ""
+killall -9 "$(basename "$BUN_BIN")" || echo ""
-dir=$(mktemp -d --suffix=bun-lockfile)
+DIR=$(mktemp -d -t bun-lockfile)
-cd $dir
+cd "$DIR"
$BUN_BIN add react
diff --git a/test/apps/bun-install-utf8.sh b/test/apps/bun-install-utf8.sh
index 66783cb50..ca6858513 100644
--- a/test/apps/bun-install-utf8.sh
+++ b/test/apps/bun-install-utf8.sh
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
-killall -9 $(basename $BUN_BIN) || echo ""
+killall -9 "$(basename "$BUN_BIN")" || echo ""
-dir=$(mktemp -d --suffix=bun-ADD)
+DIR=$(mktemp -d -t bun-ADD)
-cd $dir
+cd "$DIR"
-# https://github.com/Jarred-Sumner/bun/issues/115
+# https://github.com/oven-sh/bun/issues/115
echo '{ "author": "Arnaud Barré (https://github.com/ArnaudBarre)" }' >package.json
$BUN_BIN add react
diff --git a/test/apps/bun-install.sh b/test/apps/bun-install.sh
index dd4083e33..c705a6b37 100644
--- a/test/apps/bun-install.sh
+++ b/test/apps/bun-install.sh
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
-dir=$(mktemp -d --suffix=bun-install-test-1)
+DIR=$(mktemp -d -t bun-install-test-1)
-cd $dir
+cd "$DIR"
${NPM_CLIENT:-$(which bun)} add react react-dom @types/react @babel/parser esbuild
echo "console.log(typeof require(\"react\").createElement);" >index.js
@@ -47,7 +47,7 @@ fi
${NPM_CLIENT:-$(which bun)} remove react-dom
if [ -d "node_modules/react-dom" ]; then
- echo "ERR: react-dom module still exists in $dir"
+ echo "ERR: react-dom module still exists in $DIR"
exit 1
fi
@@ -68,14 +68,14 @@ if echo "$yarn_dot_lock" | grep -q "@types/react"; then
fi
if echo "$yarn_dot_lock" | grep -q "@types/react"; then
- echo "ERR: @types/react module still exists in $dir"
+ echo "ERR: @types/react module still exists in $DIR"
exit 1
fi
${NPM_CLIENT:-$(which bun)} remove react
if [ -d "node_modules/react" ]; then
- echo "ERR: react module still exists in $dir"
+ echo "ERR: react module still exists in $DIR"
exit 1
fi
diff --git a/test/apps/bun-run-check.sh b/test/apps/bun-run-check.sh
index dca1db6ae..a904959e9 100644
--- a/test/apps/bun-run-check.sh
+++ b/test/apps/bun-run-check.sh
@@ -1,18 +1,19 @@
-#!/bin/bash
+#!/usr/bin/env bash
-(killall -9 $(basename $BUN_BIN) || echo "") >/dev/null 2>&1
+set -euo pipefail
-# https://github.com/Jarred-Sumner/bun/issues/40
+(killall -9 "$(basename "$BUN_BIN")" || echo "") >/dev/null 2>&1
+
+# https://github.com/oven-sh/bun/issues/40
# Define a function (details aren't important)
fn() { :; }
# The important bit: export the function
export -f fn
-rm -rf /tmp/bun-run-check
-mkdir -p /tmp/bun-run-check
+DIR=$(mktemp -d -t bun-run-check)
-cp ./bun-run-check-package.json /tmp/bun-run-check/package.json
-cd /tmp/bun-run-check
+cp ./bun-run-check-package.json "$DIR/package.json"
+cd "$DIR"
$BUN_BIN run bash -- -c ""
@@ -21,13 +22,13 @@ if (($?)); then
exit 1
fi
-# https://github.com/Jarred-Sumner/bun/issues/53
-rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1
+# https://github.com/oven-sh/bun/issues/53
+rm -f "$DIR/bun-run-out.expected.txt" "$DIR/bun-run-out.txt" >/dev/null 2>&1
-$BUN_BIN run --silent argv -- foo bar baz >/tmp/bun-run-out.txt
-npm run --silent argv -- foo bar baz >/tmp/bun-run-out.expected.txt
+$BUN_BIN run --silent argv -- foo bar baz > "$DIR/bun-run-out.txt"
+npm run --silent argv -- foo bar baz > "$DIR/bun-run-out.expected.txt"
-cmp -s /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt
+cmp -s "$DIR/bun-run-out.expected.txt" "$DIR/bun-run-out.txt"
if (($?)); then
echo "argv failed"
exit 1
diff --git a/test/bun.js/ffi.test.fixture.callback.c b/test/bun.js/ffi.test.fixture.callback.c
index d48ef6753..1a43a098c 100644
--- a/test/bun.js/ffi.test.fixture.callback.c
+++ b/test/bun.js/ffi.test.fixture.callback.c
@@ -1,7 +1,7 @@
#define IS_CALLBACK 1
// This file is part of Bun!
// You can find the original source:
-// https://github.com/Jarred-Sumner/bun/blob/main/src/bun.js/api/FFI.h#L2
+// https://github.com/oven-sh/bun/blob/main/src/bun.js/api/FFI.h#L2
//
// clang-format off
// This file is only compatible with 64 bit CPUs
diff --git a/test/bun.js/ffi.test.fixture.receiver.c b/test/bun.js/ffi.test.fixture.receiver.c
index 5bb51bda5..a6f647253 100644
--- a/test/bun.js/ffi.test.fixture.receiver.c
+++ b/test/bun.js/ffi.test.fixture.receiver.c
@@ -2,7 +2,7 @@
#define USES_FLOAT 1
// This file is part of Bun!
// You can find the original source:
-// https://github.com/Jarred-Sumner/bun/blob/main/src/bun.js/api/FFI.h#L2
+// https://github.com/oven-sh/bun/blob/main/src/bun.js/api/FFI.h#L2
//
// clang-format off
// This file is only compatible with 64 bit CPUs
diff --git a/test/bun.js/url.test.ts b/test/bun.js/url.test.ts
index 37ea2008b..87291a09c 100644
--- a/test/bun.js/url.test.ts
+++ b/test/bun.js/url.test.ts
@@ -9,11 +9,11 @@ describe("url", () => {
expect(
Bun.inspect(
new URL(
- "https://github.com/Jarred-Sumner/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night"
+ "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night"
)
)
).toBe(
- "https://github.com/Jarred-Sumner/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night"
+ "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night"
);
});
it("works", () => {
diff --git a/test/scripts/bun.lockb b/test/scripts/bun.lockb
index 2d9937d57..4d944995a 100755
--- a/test/scripts/bun.lockb
+++ b/test/scripts/bun.lockb
Binary files differ
diff --git a/test/scripts/package-lock.json b/test/scripts/package-lock.json
index a41b9bd92..10abe53e4 100644
--- a/test/scripts/package-lock.json
+++ b/test/scripts/package-lock.json
@@ -5,7 +5,7 @@
"packages": {
"": {
"dependencies": {
- "puppeteer": "^10.2.0"
+ "puppeteer": "^10.4.0"
}
},
"node_modules/@types/node": {
@@ -425,8 +425,10 @@
},
"node_modules/puppeteer": {
"version": "10.4.0",
+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-10.4.0.tgz",
+ "integrity": "sha512-2cP8mBoqnu5gzAVpbZ0fRaobBWZM8GEUF4I1F6WbgHrKV/rz7SX8PG2wMymZgD0wo0UBlg2FBPNxlF/xlqW6+w==",
+ "deprecated": "Version no longer supported. Upgrade to @latest",
"hasInstallScript": true,
- "license": "Apache-2.0",
"dependencies": {
"debug": "4.3.1",
"devtools-protocol": "0.0.901419",
@@ -804,6 +806,8 @@
},
"puppeteer": {
"version": "10.4.0",
+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-10.4.0.tgz",
+ "integrity": "sha512-2cP8mBoqnu5gzAVpbZ0fRaobBWZM8GEUF4I1F6WbgHrKV/rz7SX8PG2wMymZgD0wo0UBlg2FBPNxlF/xlqW6+w==",
"requires": {
"debug": "4.3.1",
"devtools-protocol": "0.0.901419",
diff --git a/test/scripts/package.json b/test/scripts/package.json
index b4637138b..bc5c1db22 100644
--- a/test/scripts/package.json
+++ b/test/scripts/package.json
@@ -1,5 +1,5 @@
{
"dependencies": {
- "puppeteer": "^10.2.0"
+ "puppeteer": "^10.4.0"
}
}
diff --git a/test/snapshots/array-args-with-default-values.hmr.js b/test/snapshots/array-args-with-default-values.hmr.js
index 3c8997b54..421272052 100644
--- a/test/snapshots/array-args-with-default-values.hmr.js
+++ b/test/snapshots/array-args-with-default-values.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(3474597122, "array-args-with-default-values.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(3022324119, "array-args-with-default-values.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var lines;
const data = () => lines.map(([a = null, b = null, c = null, d = null]) => ({
diff --git a/test/snapshots/bundled-entry-point.hmr.js b/test/snapshots/bundled-entry-point.hmr.js
index b4fb5e46f..4440f8f36 100644
--- a/test/snapshots/bundled-entry-point.hmr.js
+++ b/test/snapshots/bundled-entry-point.hmr.js
@@ -1,18 +1,18 @@
import {
__require as require
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js";
-var hmr = new FastHMR(3012834585, "bundled-entry-point.js", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var hmr = new FastHMR(2903293251, "bundled-entry-point.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
return testDone(import.meta.url);
@@ -30,4 +30,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/bundled-entry-point.js.map
+//# sourceMappingURL=http://localhost:8080/bundled-entry-point.js.map
diff --git a/test/snapshots/bundled-entry-point.js b/test/snapshots/bundled-entry-point.js
index 51562933f..4f5a59894 100644
--- a/test/snapshots/bundled-entry-point.js
+++ b/test/snapshots/bundled-entry-point.js
@@ -1,11 +1,9 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
export function test() {
return testDone(import.meta.url);
-
}
-
//# sourceMappingURL=http://localhost:8080/bundled-entry-point.js.map
diff --git a/test/snapshots/caught-require.hmr.js b/test/snapshots/caught-require.hmr.js
index 8a63f51a0..e1229ee3f 100644
--- a/test/snapshots/caught-require.hmr.js
+++ b/test/snapshots/caught-require.hmr.js
@@ -11,10 +11,12 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(2398506918, "caught-require.js", FastRefresh), exports = hmr.exports;
+var this_package_should_not_exist_f335_0 = (() => ({}));
+var this_package_should_not_exist_f335_1 = (() => ({}));
+var hmr = new FastHMR(2167781, "caught-require.js", FastRefresh), exports = hmr.exports;
await (hmr._load = async function() {
try {
- require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
+ require((() => { throw (new Error(`Cannot require module "this-package-should-not-exist"`)); } )());
} catch (exception) {
}
try {
@@ -26,7 +28,7 @@ await (hmr._load = async function() {
});
async function test() {
try {
- require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
+ require((() => { throw (new Error(`Cannot require module "this-package-should-not-exist"`)); } )());
} catch (exception) {
}
try {
diff --git a/test/snapshots/caught-require.js b/test/snapshots/caught-require.js
index 73608f8e3..7c356a21d 100644
--- a/test/snapshots/caught-require.js
+++ b/test/snapshots/caught-require.js
@@ -1,12 +1,12 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
+var this_package_should_not_exist_f335_0 = (() => ({}));
+var this_package_should_not_exist_f335_1 = (() => ({}));
try {
- require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
-
+ require((() => { throw (new Error(`Cannot require module "this-package-should-not-exist"`)); } )());
} catch (exception) {
}
-
try {
await import("this-package-should-not-exist");
} catch (exception) {
@@ -16,7 +16,7 @@ import("this-package-should-not-exist").then(() => {
});
export async function test() {
try {
- require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
+ require((() => { throw (new Error(`Cannot require module "this-package-should-not-exist"`)); } )());
} catch (exception) {
}
try {
diff --git a/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js b/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js
index b74b8c2b7..3d98612c6 100644
--- a/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js
+++ b/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.hmr.js
@@ -1,19 +1,19 @@
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-import _login from "http://localhost:3000/_login.js";
-import _auth from "http://localhost:3000/_auth.js";
-import * as _loginReally from "http://localhost:3000/_login.js";
-import * as _loginReally2 from "http://localhost:3000/_login.js";
-import * as _authReally from "http://localhost:3000/_auth.js";
-var hmr = new FastHMR(3878252498, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+import _login from "http://localhost:8080/_login.js";
+import _auth from "http://localhost:8080/_auth.js";
+import * as _loginReally from "http://localhost:8080/_login.js";
+import * as _loginReally2 from "http://localhost:8080/_login.js";
+import * as _authReally from "http://localhost:8080/_auth.js";
+var hmr = new FastHMR(2970650542, "cjs-transform-shouldnt-have-static-imports-in-cjs-function.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
return testDone(import.meta.url);
@@ -42,4 +42,4 @@ export {
$$hmr_bar as bar
};
-//# sourceMappingURL=http://localhost:3000/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js.map
+//# sourceMappingURL=http://localhost:8080/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js.map
diff --git a/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js b/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js
index 1bd6883d8..77e4fc695 100644
--- a/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js
+++ b/test/snapshots/cjs-transform-shouldnt-have-static-imports-in-cjs-function.js
@@ -5,7 +5,6 @@ import * as _loginReally2 from "http://localhost:8080/_login.js";
import * as _authReally from "http://localhost:8080/_auth.js";
export { _login as login };
-
export function test() {
return testDone(import.meta.url);
}
diff --git a/test/snapshots/code-simplification-neql-define.hmr.js b/test/snapshots/code-simplification-neql-define.hmr.js
index 6d521b01d..51111af01 100644
--- a/test/snapshots/code-simplification-neql-define.hmr.js
+++ b/test/snapshots/code-simplification-neql-define.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(726376257, "code-simplification-neql-define.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(3365801599, "code-simplification-neql-define.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var testFailed = false;
const invariant = () => {
diff --git a/test/snapshots/code-simplification-neql-define.js b/test/snapshots/code-simplification-neql-define.js
index 6c0e684df..bf526597c 100644
--- a/test/snapshots/code-simplification-neql-define.js
+++ b/test/snapshots/code-simplification-neql-define.js
@@ -11,7 +11,7 @@ export var $f332019d = $$m({
var RelayQueryResponseCache = function() {
var foo = function RelayQueryResponseCache(_ref) {
var size = _ref.size, ttl = _ref.ttl;
- !(size > 0) && invariant(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got " + "`%s`.", size);
+ !(size > 0) && invariant(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got `%s`.", size);
!(ttl > 0) && invariant(false, "RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.", ttl);
};
foo({ size: 100, ttl: 3600 });
diff --git a/test/snapshots/custom-emotion-jsx/file.hmr.jsx b/test/snapshots/custom-emotion-jsx/file.hmr.jsx
index d26b0a16d..d16266fd1 100644
--- a/test/snapshots/custom-emotion-jsx/file.hmr.jsx
+++ b/test/snapshots/custom-emotion-jsx/file.hmr.jsx
@@ -11,12 +11,12 @@ __require as require
import {
__FastRefreshModule as FastHMR
} from "http://localhost:8080/bun:wrap";
-import * as $72625799 from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js";
-var JSX = require($72625799);
+import * as $5bf278c5 from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.js";
+var JSX = require($5bf278c5);
var jsx = require(JSX).jsxDEV;
-import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js";
-var ReactDOM = require($5b3cea55);
-var hmr = new FastHMR(2497996991, "custom-emotion-jsx/file.jsx", FastRefresh), exports = hmr.exports;
+import * as $d2dc5006 from "http://localhost:8080/node_modules/react-dom/index.js";
+var ReactDOM = require($d2dc5006);
+var hmr = new FastHMR(1769322314, "custom-emotion-jsx/file.jsx", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var Foo = () => jsx("div", {
css: { content: '"it worked!"' }
diff --git a/test/snapshots/custom-emotion-jsx/file.jsx b/test/snapshots/custom-emotion-jsx/file.jsx
index 466cd4697..bef09a0c3 100644
--- a/test/snapshots/custom-emotion-jsx/file.jsx
+++ b/test/snapshots/custom-emotion-jsx/file.jsx
@@ -1,16 +1,14 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $72625799 from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js";
-var JSX = require($72625799);
+import * as $5bf278c5 from "http://localhost:8080/node_modules/@emotion/react/jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.cjs.js";
+var JSX = require($5bf278c5);
var jsx = require(JSX).jsxDEV;
-
-import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js";
-var ReactDOM = require($5b3cea55);
+import * as $d2dc5006 from "http://localhost:8080/node_modules/react-dom/index.js";
+var ReactDOM = require($d2dc5006);
export const Foo = () => jsx("div", {
css: { content: '"it worked!"' }
}, undefined, false, undefined, this);
-
export function test() {
const element = document.createElement("div");
element.id = "custom-emotion-jsx";
diff --git a/test/snapshots/export-default-module-hot.hmr.js b/test/snapshots/export-default-module-hot.hmr.js
index 3dadccd28..a1b5a69a2 100644
--- a/test/snapshots/export-default-module-hot.hmr.js
+++ b/test/snapshots/export-default-module-hot.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(2909748314, "export-default-module-hot.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(2744655916, "export-default-module-hot.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var export_default_module_hot_default = typeof module !== "undefined" && module.id;
function test() {
diff --git a/test/snapshots/export.hmr.js b/test/snapshots/export.hmr.js
index 73d6db2d4..2ec5e1a80 100644
--- a/test/snapshots/export.hmr.js
+++ b/test/snapshots/export.hmr.js
@@ -1,16 +1,16 @@
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-import what from "http://localhost:3000/_auth.js";
-import * as where from "http://localhost:3000/_auth.js";
-var hmr = new FastHMR(1879780259, "export.js", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+import what from "http://localhost:8080/_auth.js";
+import * as where from "http://localhost:8080/_auth.js";
+var hmr = new FastHMR(2026450590, "export.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var yoyoyo = "yoyoyo";
function hey() {
@@ -70,9 +70,9 @@ export {
$$hmr_booop as booop,
$$hmr_test as test
};
-export { default as auth } from "http://localhost:3000/_auth.js";
-export { default as login } from "http://localhost:3000/_login.js";
-export * from "http://localhost:3000/_bacon.js";
-export { } from "http://localhost:3000/_bacon.js";
+export { default as auth } from "http://localhost:8080/_auth.js";
+export { default as login } from "http://localhost:8080/_login.js";
+export * from "http://localhost:8080/_bacon.js";
+export { } from "http://localhost:8080/_bacon.js";
-//# sourceMappingURL=http://localhost:3000/export.js.map
+//# sourceMappingURL=http://localhost:8080/export.js.map
diff --git a/test/snapshots/export.js b/test/snapshots/export.js
index 986d3b45f..84fe5b8e9 100644
--- a/test/snapshots/export.js
+++ b/test/snapshots/export.js
@@ -1,6 +1,5 @@
import what from "http://localhost:8080/_auth.js";
export { default as auth } from "http://localhost:8080/_auth.js";
-
export { default as login } from "http://localhost:8080/_login.js";
export * from "http://localhost:8080/_bacon.js";
export let yoyoyo = "yoyoyo";
@@ -18,7 +17,6 @@ export { } from "http://localhost:8080/_bacon.js";
import * as where from "http://localhost:8080/_auth.js";
export { where };
-
export { bar as booop };
export function test() {
hey();
diff --git a/test/snapshots/forbid-in-is-correct.hmr.js b/test/snapshots/forbid-in-is-correct.hmr.js
index ae3714d04..fc01825b5 100644
--- a/test/snapshots/forbid-in-is-correct.hmr.js
+++ b/test/snapshots/forbid-in-is-correct.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(346837007, "forbid-in-is-correct.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(30801918, "forbid-in-is-correct.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var foo = () => {
var D = (i, r) => () => (r || i((r = { exports: {} }).exports, r), r.exports);
diff --git a/test/snapshots/global-is-remapped-to-globalThis.hmr.js b/test/snapshots/global-is-remapped-to-globalThis.hmr.js
index a0e28b60a..7db0c2ef9 100644
--- a/test/snapshots/global-is-remapped-to-globalThis.hmr.js
+++ b/test/snapshots/global-is-remapped-to-globalThis.hmr.js
@@ -1,14 +1,14 @@
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-var hmr = new FastHMR(713665787, "global-is-remapped-to-globalThis.js", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+var hmr = new FastHMR(997256900, "global-is-remapped-to-globalThis.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
console.assert(globalThis === globalThis);
@@ -27,4 +27,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/global-is-remapped-to-globalThis.js.map
+//# sourceMappingURL=http://localhost:8080/global-is-remapped-to-globalThis.js.map
diff --git a/test/snapshots/jsx-entities.hmr.jsx b/test/snapshots/jsx-entities.hmr.jsx
index 3bad6ca8d..cee60e53e 100644
--- a/test/snapshots/jsx-entities.hmr.jsx
+++ b/test/snapshots/jsx-entities.hmr.jsx
@@ -11,14 +11,14 @@ __require as require
import {
__FastRefreshModule as FastHMR
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
-import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js";
-var ReactDOM = require($1f6f0e67);
-var hmr = new FastHMR(817082122, "jsx-entities.jsx", FastRefresh), exports = hmr.exports;
+import * as $72f3f54c from "http://localhost:8080/node_modules/react-dom/server.browser.js";
+var ReactDOM = require($72f3f54c);
+var hmr = new FastHMR(2026553427, "jsx-entities.jsx", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
const elements = {
[ReactDOM.renderToString(jsx(JSXFrag, {
diff --git a/test/snapshots/jsx-entities.jsx b/test/snapshots/jsx-entities.jsx
index 9fd075bc6..e4f9a8745 100644
--- a/test/snapshots/jsx-entities.jsx
+++ b/test/snapshots/jsx-entities.jsx
@@ -1,14 +1,13 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
-
-import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js";
-var ReactDOM = require($1f6f0e67);
+import * as $72f3f54c from "http://localhost:8080/node_modules/react-dom/server.browser.js";
+var ReactDOM = require($72f3f54c);
const elements = {
[ReactDOM.renderToString(jsx(JSXFrag, {
children: '"'
@@ -2751,7 +2750,6 @@ const elements = {
children: "\u0294"
}, undefined, false, undefined, this))]: 660
};
-
export function test() {
for (let rawKey in elements) {
var key = rawKey;
diff --git a/test/snapshots/jsx-spacing.hmr.jsx b/test/snapshots/jsx-spacing.hmr.jsx
index 59287257b..b626bd920 100644
--- a/test/snapshots/jsx-spacing.hmr.jsx
+++ b/test/snapshots/jsx-spacing.hmr.jsx
@@ -11,12 +11,12 @@ __require as require
import {
__FastRefreshModule as FastHMR
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
var jsx = require(JSX).jsxDEV;
-import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js";
-var ReactDOM = require($1f6f0e67);
-var hmr = new FastHMR(3614189736, "jsx-spacing.jsx", FastRefresh), exports = hmr.exports;
+import * as $72f3f54c from "http://localhost:8080/node_modules/react-dom/server.browser.js";
+var ReactDOM = require($72f3f54c);
+var hmr = new FastHMR(1284217403, "jsx-spacing.jsx", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
const ReturnDescriptionAsString = ({ description }) => description;
function test() {
diff --git a/test/snapshots/jsx-spacing.jsx b/test/snapshots/jsx-spacing.jsx
index bfbcab92f..2d79ddee7 100644
--- a/test/snapshots/jsx-spacing.jsx
+++ b/test/snapshots/jsx-spacing.jsx
@@ -1,14 +1,12 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
var jsx = require(JSX).jsxDEV;
-
-import * as $1f6f0e67 from "http://localhost:8080/node_modules/react-dom/server.browser.js";
-var ReactDOM = require($1f6f0e67);
+import * as $72f3f54c from "http://localhost:8080/node_modules/react-dom/server.browser.js";
+var ReactDOM = require($72f3f54c);
const ReturnDescriptionAsString = ({ description }) => description;
-
export function test() {
const _bun = ReactDOM.renderToString(jsx(ReturnDescriptionAsString, {
description: `line1
diff --git a/test/snapshots/latin1-chars-in-regexp.hmr.js b/test/snapshots/latin1-chars-in-regexp.hmr.js
index afd3b813e..88183696a 100644
--- a/test/snapshots/latin1-chars-in-regexp.hmr.js
+++ b/test/snapshots/latin1-chars-in-regexp.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(1430071586, "latin1-chars-in-regexp.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(3684541220, "latin1-chars-in-regexp.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
var re_btou = new RegExp([
diff --git a/test/snapshots/lodash-regexp.hmr.js b/test/snapshots/lodash-regexp.hmr.js
index e5d6b9130..896ad287a 100644
--- a/test/snapshots/lodash-regexp.hmr.js
+++ b/test/snapshots/lodash-regexp.hmr.js
@@ -1,19 +1,19 @@
import {
__require as require
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-import * as $60f52dc2 from "http://localhost:3000/node_modules/lodash/lodash.js";
-var { shuffle} = require($60f52dc2);
-var hmr = new FastHMR(2158065009, "lodash-regexp.js", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+import * as $2f2e4966 from "http://localhost:8080/node_modules/lodash/lodash.js";
+var { shuffle} = require($2f2e4966);
+var hmr = new FastHMR(639488503, "lodash-regexp.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
const foo = [1, 2, 3, 4, 6];
@@ -42,4 +42,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/lodash-regexp.js.map
+//# sourceMappingURL=http://localhost:8080/lodash-regexp.js.map
diff --git a/test/snapshots/lodash-regexp.js b/test/snapshots/lodash-regexp.js
index b1566fb6d..5f3950b6a 100644
--- a/test/snapshots/lodash-regexp.js
+++ b/test/snapshots/lodash-regexp.js
@@ -1,11 +1,10 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $60f52dc2 from "http://localhost:8080/node_modules/lodash/lodash.js";
-var { shuffle} = require($60f52dc2);
+import * as $2f2e4966 from "http://localhost:8080/node_modules/lodash/lodash.js";
+var { shuffle} = require($2f2e4966);
export function test() {
const foo = [1, 2, 3, 4, 6];
-
const bar = shuffle(foo);
console.assert(bar !== foo);
console.assert(bar.length === foo.length);
@@ -19,5 +18,4 @@ export function test() {
return testDone(import.meta.url);
}
-
//# sourceMappingURL=http://localhost:8080/lodash-regexp.js.map
diff --git a/test/snapshots/multiple-imports.hmr.js b/test/snapshots/multiple-imports.hmr.js
index 59d620c07..4e42537f0 100644
--- a/test/snapshots/multiple-imports.hmr.js
+++ b/test/snapshots/multiple-imports.hmr.js
@@ -1,24 +1,24 @@
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__require as require
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
-import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+} from "http://localhost:8080/bun:wrap";
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
-var { default: React} = require($bbcd215f);
-var { default: React2} = require($bbcd215f);
-var hmr = new FastHMR(2165509932, "multiple-imports.js", FastRefresh), exports = hmr.exports;
+var { default: React} = require($45b81229);
+var { default: React2} = require($45b81229);
+var hmr = new FastHMR(2063938930, "multiple-imports.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
const bacon = React;
const bacon2 = jsx(JSXFrag, {
@@ -44,4 +44,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/multiple-imports.js.map
+//# sourceMappingURL=http://localhost:8080/multiple-imports.js.map
diff --git a/test/snapshots/multiple-imports.js b/test/snapshots/multiple-imports.js
index af9396b46..e8717b572 100644
--- a/test/snapshots/multiple-imports.js
+++ b/test/snapshots/multiple-imports.js
@@ -1,16 +1,14 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
-
-var { default: React} = require($bbcd215f);
-var { default: React2} = require($bbcd215f);
+var { default: React} = require($45b81229);
+var { default: React2} = require($45b81229);
const bacon = React;
-
const bacon2 = jsx(JSXFrag, {
children: "hello"
}, undefined, false, undefined, this);
diff --git a/test/snapshots/multiple-var.hmr.js b/test/snapshots/multiple-var.hmr.js
index 3acb5b8d3..940dbddad 100644
--- a/test/snapshots/multiple-var.hmr.js
+++ b/test/snapshots/multiple-var.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(2883558553, "multiple-var.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(1028067224, "multiple-var.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var foo = true;
globalThis.TRUE_BUT_WE_CANT_TREESHAKE_IT = true;
diff --git a/test/snapshots/number-literal-bug.hmr.js b/test/snapshots/number-literal-bug.hmr.js
index cdb63994d..18e3748fa 100644
--- a/test/snapshots/number-literal-bug.hmr.js
+++ b/test/snapshots/number-literal-bug.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(583570002, "number-literal-bug.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(3925211795, "number-literal-bug.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
const precision = 10;
diff --git a/test/snapshots/optional-chain-with-function.hmr.js b/test/snapshots/optional-chain-with-function.hmr.js
index e9a89a827..96b06cfe0 100644
--- a/test/snapshots/optional-chain-with-function.hmr.js
+++ b/test/snapshots/optional-chain-with-function.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(3608848620, "optional-chain-with-function.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(2063149784, "optional-chain-with-function.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
try {
diff --git a/test/snapshots/package-json-exports/index.hmr.js b/test/snapshots/package-json-exports/index.hmr.js
index 69efa5194..7220e2a6d 100644
--- a/test/snapshots/package-json-exports/index.hmr.js
+++ b/test/snapshots/package-json-exports/index.hmr.js
@@ -1,25 +1,25 @@
import {
__require as require
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-import * as $4068f25b from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/index.js";
-var InexactRoot = require($4068f25b);
-import * as $d2a171d2 from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/dir/file.js";
-var InexactFile = require($d2a171d2);
-import * as $522c6d1f from "http://localhost:3000/package-json-exports/node_modules/inexact/browser/foo.js";
-var ExactFile = require($522c6d1f);
-import * as $fce83cd7 from "http://localhost:3000/package-json-exports/node_modules/js-only-exports/browser/js-file.js";
-var JSFileExtensionOnly = require($fce83cd7);
-var hmr = new FastHMR(1953708113, "package-json-exports/index.js", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+import * as $147f6594 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/index.js";
+var InexactRoot = require($147f6594);
+import * as $f9f33cd5 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/dir/file.js";
+var InexactFile = require($f9f33cd5);
+import * as $efd1f056 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js";
+var ExactFile = require($efd1f056);
+import * as $3e697ad7 from "http://localhost:8080/package-json-exports/node_modules/js-only-exports/browser/js-file.js";
+var JSFileExtensionOnly = require($3e697ad7);
+var hmr = new FastHMR(2713515135, "package-json-exports/index.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
async function test() {
console.assert(InexactRoot.target === "browser");
@@ -41,4 +41,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/package-json-exports/index.js.map
+//# sourceMappingURL=http://localhost:8080/package-json-exports/index.js.map
diff --git a/test/snapshots/package-json-exports/index.js b/test/snapshots/package-json-exports/index.js
index 3d41a7985..7d9ad8b60 100644
--- a/test/snapshots/package-json-exports/index.js
+++ b/test/snapshots/package-json-exports/index.js
@@ -1,22 +1,20 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $4068f25b from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/index.js";
-var InexactRoot = require($4068f25b);
-import * as $d2a171d2 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/dir/file.js";
-var InexactFile = require($d2a171d2);
-import * as $522c6d1f from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js";
-var ExactFile = require($522c6d1f);
-import * as $fce83cd7 from "http://localhost:8080/package-json-exports/node_modules/js-only-exports/browser/js-file.js";
-var JSFileExtensionOnly = require($fce83cd7);
+import * as $147f6594 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/index.js";
+var InexactRoot = require($147f6594);
+import * as $f9f33cd5 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/dir/file.js";
+var InexactFile = require($f9f33cd5);
+import * as $efd1f056 from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js";
+var ExactFile = require($efd1f056);
+import * as $3e697ad7 from "http://localhost:8080/package-json-exports/node_modules/js-only-exports/browser/js-file.js";
+var JSFileExtensionOnly = require($3e697ad7);
export async function test() {
console.assert(InexactRoot.target === "browser");
-
console.assert(InexactFile.target === "browser");
console.assert(ExactFile.target === "browser");
console.assert(JSFileExtensionOnly.isJS === true);
return testDone(import.meta.url);
}
-
//# sourceMappingURL=http://localhost:8080/package-json-exports/index.js.map
diff --git a/test/snapshots/package-json-utf8.hmr.js b/test/snapshots/package-json-utf8.hmr.js
index 5676d6477..ba753af0e 100644
--- a/test/snapshots/package-json-utf8.hmr.js
+++ b/test/snapshots/package-json-utf8.hmr.js
@@ -9,7 +9,7 @@ import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
import pkg from "http://localhost:8080/utf8-package-json.json";
-var hmr = new FastHMR(4111115104, "package-json-utf8.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(1703475520, "package-json-utf8.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
console.assert(!!pkg.author);
diff --git a/test/snapshots/package-json-utf8.js b/test/snapshots/package-json-utf8.js
index 8845090f0..b08c3804d 100644
--- a/test/snapshots/package-json-utf8.js
+++ b/test/snapshots/package-json-utf8.js
@@ -1,9 +1,7 @@
import pkg from "http://localhost:8080/utf8-package-json.json";
export function test() {
console.assert(!!pkg.author);
-
return testDone(import.meta.url);
}
-
//# sourceMappingURL=http://localhost:8080/package-json-utf8.js.map
diff --git a/test/snapshots/react-context-value-func.hmr.tsx b/test/snapshots/react-context-value-func.hmr.tsx
index 0c751a7a9..3a11b4342 100644
--- a/test/snapshots/react-context-value-func.hmr.tsx
+++ b/test/snapshots/react-context-value-func.hmr.tsx
@@ -11,12 +11,12 @@ __require as require
import {
__FastRefreshModule as FastHMR
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
var jsx = require(JSX).jsxDEV;
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var { default: React} = require($bbcd215f);
-var hmr = new FastHMR(3514348331, "react-context-value-func.tsx", FastRefresh), exports = hmr.exports;
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var { default: React} = require($45b81229);
+var hmr = new FastHMR(2913325904, "react-context-value-func.tsx", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
const Context = React.createContext({});
const ContextProvider = ({ children }) => {
diff --git a/test/snapshots/react-context-value-func.tsx b/test/snapshots/react-context-value-func.tsx
index 71b5e5f60..faafc591a 100644
--- a/test/snapshots/react-context-value-func.tsx
+++ b/test/snapshots/react-context-value-func.tsx
@@ -1,14 +1,12 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
var jsx = require(JSX).jsxDEV;
-
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var { default: React} = require($bbcd215f);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var { default: React} = require($45b81229);
const Context = React.createContext({});
-
const ContextProvider = ({ children }) => {
const [cb, setCB] = React.useState(function() {
});
diff --git a/test/snapshots/spread_with_key.hmr.tsx b/test/snapshots/spread_with_key.hmr.tsx
index 37cb57b34..befb56390 100644
--- a/test/snapshots/spread_with_key.hmr.tsx
+++ b/test/snapshots/spread_with_key.hmr.tsx
@@ -11,13 +11,13 @@ __require as require
import {
__FastRefreshModule as FastHMR
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement;
-var { default: React} = require($bbcd215f);
-var hmr = new FastHMR(2717584935, "spread_with_key.tsx", FastRefresh), exports = hmr.exports;
+var { default: React} = require($45b81229);
+var hmr = new FastHMR(1528600417, "spread_with_key.tsx", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function SpreadWithTheKey({ className }) {
const rest = {};
diff --git a/test/snapshots/spread_with_key.tsx b/test/snapshots/spread_with_key.tsx
index e096a76c8..266ec96ea 100644
--- a/test/snapshots/spread_with_key.tsx
+++ b/test/snapshots/spread_with_key.tsx
@@ -1,16 +1,14 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, jsxEl = require(JSXClassic).createElement;
-
-var { default: React} = require($bbcd215f);
+var { default: React} = require($45b81229);
export function SpreadWithTheKey({ className }) {
const rest = {};
-
return jsxEl("div", {
className,
...rest,
@@ -18,7 +16,6 @@ export function SpreadWithTheKey({ className }) {
key: "spread-with-the-key"
}, "Rendered component containing warning");
}
-
export function test() {
console.assert(React.isValidElement(jsx(SpreadWithTheKey, {
className: "foo"
diff --git a/test/snapshots/string-escapes.hmr.js b/test/snapshots/string-escapes.hmr.js
index 5847bdf97..61adda87e 100644
--- a/test/snapshots/string-escapes.hmr.js
+++ b/test/snapshots/string-escapes.hmr.js
@@ -1,22 +1,22 @@
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__require as require
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
-import * as $2f488e5b from "http://localhost:3000/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:3000/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+} from "http://localhost:8080/bun:wrap";
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
-var hmr = new FastHMR(2482749838, "string-escapes.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(3888655093, "string-escapes.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var tab = "\t";
var f = "";
@@ -487,4 +487,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/string-escapes.js.map
+//# sourceMappingURL=http://localhost:8080/string-escapes.js.map
diff --git a/test/snapshots/string-escapes.js b/test/snapshots/string-escapes.js
index 9084bc362..82122d6a5 100644
--- a/test/snapshots/string-escapes.js
+++ b/test/snapshots/string-escapes.js
@@ -1,12 +1,11 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var JSXClassic = require($bbcd215f);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var JSXClassic = require($45b81229);
var jsx = require(JSX).jsxDEV, JSXFrag = require(JSXClassic).Fragment;
-
var tab = "\t";
var f = "";
var f = "\u2087";
diff --git a/test/snapshots/styledcomponents-output.hmr.js b/test/snapshots/styledcomponents-output.hmr.js
index b39adb87c..266a24ca1 100644
--- a/test/snapshots/styledcomponents-output.hmr.js
+++ b/test/snapshots/styledcomponents-output.hmr.js
@@ -11,16 +11,16 @@ __require as require
import {
__FastRefreshModule as FastHMR
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
var jsx = require(JSX).jsxDEV;
-import * as $d4051a2e from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js";
-var { default: styled} = require($d4051a2e);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var { default: React} = require($bbcd215f);
-import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js";
-var { default: ReactDOM} = require($5b3cea55);
-var hmr = new FastHMR(1290604342, "styledcomponents-output.js", FastRefresh), exports = hmr.exports;
+import * as $1dd97690 from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js";
+var { default: styled} = require($1dd97690);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var { default: React} = require($45b81229);
+import * as $d2dc5006 from "http://localhost:8080/node_modules/react-dom/index.js";
+var { default: ReactDOM} = require($d2dc5006);
+var hmr = new FastHMR(1833563982, "styledcomponents-output.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
const ErrorScreenRoot = styled.div`
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
diff --git a/test/snapshots/styledcomponents-output.js b/test/snapshots/styledcomponents-output.js
index f3a59d365..63bfc786d 100644
--- a/test/snapshots/styledcomponents-output.js
+++ b/test/snapshots/styledcomponents-output.js
@@ -1,16 +1,15 @@
import {
__require as require
} from "http://localhost:8080/bun:wrap";
-import * as $2f488e5b from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
-var JSX = require($2f488e5b);
+import * as $1407d117 from "http://localhost:8080/node_modules/react/jsx-dev-runtime.js";
+var JSX = require($1407d117);
var jsx = require(JSX).jsxDEV;
-
-import * as $d4051a2e from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js";
-var { default: styled} = require($d4051a2e);
-import * as $bbcd215f from "http://localhost:8080/node_modules/react/index.js";
-var { default: React} = require($bbcd215f);
-import * as $5b3cea55 from "http://localhost:8080/node_modules/react-dom/index.js";
-var { default: ReactDOM} = require($5b3cea55);
+import * as $1dd97690 from "http://localhost:8080/node_modules/styled-components/dist/styled-components.browser.esm.js";
+var { default: styled} = require($1dd97690);
+import * as $45b81229 from "http://localhost:8080/node_modules/react/index.js";
+var { default: React} = require($45b81229);
+import * as $d2dc5006 from "http://localhost:8080/node_modules/react-dom/index.js";
+var { default: ReactDOM} = require($d2dc5006);
const ErrorScreenRoot = styled.div`
font-family: "Muli", -apple-system, BlinkMacSystemFont, Helvetica, Arial,
sans-serif;
@@ -39,7 +38,6 @@ const ErrorScreenRoot = styled.div`
color: inherit;
}
`;
-
export function test() {
if (typeof window !== "undefined") {
const reactEl = document.createElement("div");
diff --git a/test/snapshots/template-literal.hmr.js b/test/snapshots/template-literal.hmr.js
index 0baee2be1..6d9c7b8ca 100644
--- a/test/snapshots/template-literal.hmr.js
+++ b/test/snapshots/template-literal.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(2201713056, "template-literal.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(929338545, "template-literal.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
const css = (templ) => templ.toString();
const fooNoBracesUTF8 = css`
diff --git a/test/snapshots/ts-fallback-rewrite-works.hmr.js b/test/snapshots/ts-fallback-rewrite-works.hmr.js
index 09f26c952..855c2d89f 100644
--- a/test/snapshots/ts-fallback-rewrite-works.hmr.js
+++ b/test/snapshots/ts-fallback-rewrite-works.hmr.js
@@ -1,11 +1,11 @@
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__HMRModule as HMR
-} from "http://localhost:3000/bun:wrap";
-var hmr = new HMR(421762902, "ts-fallback-rewrite-works.ts"), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+var hmr = new HMR(1227236257, "ts-fallback-rewrite-works.ts"), exports = hmr.exports;
(hmr._load = function() {
function test() {
return testDone(import.meta.url);
@@ -23,4 +23,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/ts-fallback-rewrite-works.js.map
+//# sourceMappingURL=http://localhost:8080/ts-fallback-rewrite-works.js.map
diff --git a/test/snapshots/tsx-fallback-rewrite-works.hmr.js b/test/snapshots/tsx-fallback-rewrite-works.hmr.js
index b33df25c4..20b6e7a21 100644
--- a/test/snapshots/tsx-fallback-rewrite-works.hmr.js
+++ b/test/snapshots/tsx-fallback-rewrite-works.hmr.js
@@ -1,14 +1,14 @@
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-var hmr = new FastHMR(2117426367, "tsx-fallback-rewrite-works.tsx", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+var hmr = new FastHMR(360033594, "tsx-fallback-rewrite-works.tsx", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
function test() {
return testDone(import.meta.url);
@@ -26,4 +26,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/tsx-fallback-rewrite-works.js.map
+//# sourceMappingURL=http://localhost:8080/tsx-fallback-rewrite-works.js.map
diff --git a/test/snapshots/type-only-imports.hmr.ts b/test/snapshots/type-only-imports.hmr.ts
index f732881b7..f4cb4c2b1 100644
--- a/test/snapshots/type-only-imports.hmr.ts
+++ b/test/snapshots/type-only-imports.hmr.ts
@@ -1,11 +1,11 @@
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__HMRModule as HMR
-} from "http://localhost:3000/bun:wrap";
-var hmr = new HMR(650094581, "type-only-imports.ts"), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+var hmr = new HMR(3679071858, "type-only-imports.ts"), exports = hmr.exports;
(hmr._load = function() {
var baconator = true;
var SilentSymbolCollisionsAreOkayInTypeScript = true;
@@ -33,4 +33,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/type-only-imports.ts.map
+//# sourceMappingURL=http://localhost:8080/type-only-imports.ts.map
diff --git a/test/snapshots/unicode-identifiers.hmr.js b/test/snapshots/unicode-identifiers.hmr.js
index be84e436e..af31ee68f 100644
--- a/test/snapshots/unicode-identifiers.hmr.js
+++ b/test/snapshots/unicode-identifiers.hmr.js
@@ -1,14 +1,14 @@
import {
__HMRClient as Bun
-} from "http://localhost:3000/bun:wrap";
-Bun.activate(true);
+} from "http://localhost:8080/bun:wrap";
+Bun.activate(false);
import {
__FastRefreshModule as FastHMR
-} from "http://localhost:3000/bun:wrap";
+} from "http://localhost:8080/bun:wrap";
import {
__FastRefreshRuntime as FastRefresh
-} from "http://localhost:3000/bun:wrap";
-var hmr = new FastHMR(1398361736, "unicode-identifiers.js", FastRefresh), exports = hmr.exports;
+} from "http://localhost:8080/bun:wrap";
+var hmr = new FastHMR(3104834253, "unicode-identifiers.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var ε = 0.000001;
var ε2 = ε * ε;
@@ -38,4 +38,4 @@ export {
$$hmr_test as test
};
-//# sourceMappingURL=http://localhost:3000/unicode-identifiers.js.map
+//# sourceMappingURL=http://localhost:8080/unicode-identifiers.js.map
diff --git a/test/snapshots/void-shouldnt-delete-call-expressions.hmr.js b/test/snapshots/void-shouldnt-delete-call-expressions.hmr.js
index f2a1dbf18..e1cef13fe 100644
--- a/test/snapshots/void-shouldnt-delete-call-expressions.hmr.js
+++ b/test/snapshots/void-shouldnt-delete-call-expressions.hmr.js
@@ -8,7 +8,7 @@ __FastRefreshModule as FastHMR
import {
__FastRefreshRuntime as FastRefresh
} from "http://localhost:8080/bun:wrap";
-var hmr = new FastHMR(635901064, "void-shouldnt-delete-call-expressions.js", FastRefresh), exports = hmr.exports;
+var hmr = new FastHMR(4057172107, "void-shouldnt-delete-call-expressions.js", FastRefresh), exports = hmr.exports;
(hmr._load = function() {
var was_called = false;
function thisShouldBeCalled() {
diff --git a/test/snippets/bun.lockb b/test/snippets/bun.lockb
index 127db7b6d..cc2676be1 100755
--- a/test/snippets/bun.lockb
+++ b/test/snippets/bun.lockb
Binary files differ
diff --git a/types/bun/bun.d.ts b/types/bun/bun.d.ts
index bb59e1c15..60e81212f 100644
--- a/types/bun/bun.d.ts
+++ b/types/bun/bun.d.ts
@@ -992,7 +992,7 @@ declare module "bun" {
*
* I don't know how to make this something Chrome or Safari can read.
*
- * If you have any ideas, please file an issue https://github.com/Jarred-Sumner/bun
+ * If you have any ideas, please file an issue https://github.com/oven-sh/bun
*/
interface HeapSnapshot {
/** "2" */
diff --git a/types/bun/bundle.ts b/types/bun/bundle.ts
index 0f4ea34bf..8ad66d974 100644
--- a/types/bun/bundle.ts
+++ b/types/bun/bundle.ts
@@ -47,7 +47,7 @@ const packageJSON = {
files: ["types.d.ts"],
private: false,
keywords: ["bun", "bun.js", "types"],
- repository: "https://github.com/Jarred-Sumner/bun",
+ repository: "https://github.com/oven-sh/bun",
homepage: "https://bun.sh",
};
diff --git a/types/bun/fs.d.ts b/types/bun/fs.d.ts
index dcca3ec2d..4710a953b 100644
--- a/types/bun/fs.d.ts
+++ b/types/bun/fs.d.ts
@@ -1263,7 +1263,7 @@ declare module "fs" {
* Use `fs.rm(path, { recursive: true, force: true })` instead.
*
* If `true`, perform a recursive directory removal. In
- * recursive mode soperations are retried on failure.
+ * recursive mode operations are retried on failure.
* @default false
*/
recursive?: boolean | undefined;
diff --git a/types/bun/header.txt b/types/bun/header.txt
index 5edb3390d..66bcde3a9 100644
--- a/types/bun/header.txt
+++ b/types/bun/header.txt
@@ -1,5 +1,5 @@
// Type definitions for bun 0.0
-// Project: https://github.com/Jarred-Sumner/bun
+// Project: https://github.com/oven-sh/bun
// Definitions by: Jarred Sumner <https://github.com/Jarred-Sumner>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference no-default-lib="true" />
diff --git a/types/bun/index.d.ts b/types/bun/index.d.ts
index a223f6a0c..2540d2639 100644
--- a/types/bun/index.d.ts
+++ b/types/bun/index.d.ts
@@ -1,5 +1,5 @@
// Type definitions for bun 0.0
-// Project: https://github.com/Jarred-Sumner/bun
+// Project: https://github.com/oven-sh/bun
// Definitions by: Jarred Sumner <https://github.com/Jarred-Sumner>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference no-default-lib="true" />
diff --git a/zig-build/release.sh b/zig-build/release.sh
index a3bd566ab..7cf8dfdb8 100644
--- a/zig-build/release.sh
+++ b/zig-build/release.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euxo pipefail