From 9cbe1ec3002aaa10be68963ccf70b4552592c592 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 25 Nov 2024 00:12:28 -0800 Subject: [PATCH] Include `docs/` folder in bun-types (#15398) --- docs/{ => contributing}/upgrading-webkit.md | 0 docs/troubleshooting.md | 67 --------------------- packages/bun-types/.gitignore | 4 +- packages/bun-types/package.json | 9 ++- 4 files changed, 9 insertions(+), 71 deletions(-) rename docs/{ => contributing}/upgrading-webkit.md (100%) delete mode 100644 docs/troubleshooting.md diff --git a/docs/upgrading-webkit.md b/docs/contributing/upgrading-webkit.md similarity index 100% rename from docs/upgrading-webkit.md rename to docs/contributing/upgrading-webkit.md diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md deleted file mode 100644 index 07303bff33e908..00000000000000 --- a/docs/troubleshooting.md +++ /dev/null @@ -1,67 +0,0 @@ -## Troubleshooting - -### Bun not running on an M1 (or Apple Silicon) - -If you see a message like this - -> [1] 28447 killed bun create next ./test - -It most likely means you’re running Bun’s x64 version on Apple Silicon. This happens if Bun is running via Rosetta. Rosetta is unable to emulate AVX2 instructions, which Bun indirectly uses. - -The fix is to ensure you installed a version of Bun built for Apple Silicon. - -### error: Unexpected - -If you see an error like this: - -![image](https://user-images.githubusercontent.com/709451/141210854-89434678-d21b-42f4-b65a-7df3b785f7b9.png) - -It usually means the max number of open file descriptors is being explicitly set to a low number. By default, Bun requests the max number of file descriptors available (which on macOS, is something like 32,000). But, if you previously ran into ulimit issues with, e.g., Chokidar, someone on The Internet may have advised you to run `ulimit -n 8192`. - -That advice unfortunately **lowers** the hard limit to `8192`. This can be a problem in large repositories or projects with lots of dependencies. Chokidar (and other watchers) don’t seem to call `setrlimit`, which means they’re reliant on the (much lower) soft limit. - -To fix this issue: - -1. Remove any scripts that call `ulimit -n` and restart your shell. -2. Try again, and if the error still occurs, try setting `ulimit -n` to an absurdly high number, such as `ulimit -n 2147483646` -3. Try again, and if that still doesn’t fix it, open an issue - -### Unzip is required - -Unzip is required to install Bun on Linux. You can use one of the following commands to install `unzip`: - -#### Debian / Ubuntu / Mint - -```sh -$ sudo apt install unzip -``` - -#### RedHat / CentOS / Fedora - -```sh -$ sudo dnf install unzip -``` - -#### Arch / Manjaro - -```sh -$ sudo pacman -S unzip -``` - -#### OpenSUSE - -```sh -$ sudo zypper install unzip -``` - -### bun install is stuck - -Please run `bun install --verbose 2> logs.txt` and send them to me in Bun's discord. If you're on Linux, it would also be helpful if you run `sudo perf trace bun install --silent` and attach the logs. - -### Uninstalling - -Bun's binary and install cache is located in `~/.bun` by default. To uninstall bun, delete this directory and edit your shell config (`.bashrc`, `.zshrc`, or similar) to remove `~/.bun/bin` from the `$PATH` variable. - -```sh -$ rm -rf ~/.bun # make sure to remove ~/.bun/bin from $PATH -``` diff --git a/packages/bun-types/.gitignore b/packages/bun-types/.gitignore index 04c01ba7ba0830..324bb917687e57 100644 --- a/packages/bun-types/.gitignore +++ b/packages/bun-types/.gitignore @@ -1,2 +1,4 @@ node_modules/ -dist/ \ No newline at end of file +dist/ +docs/ +*.tgz \ No newline at end of file diff --git a/packages/bun-types/package.json b/packages/bun-types/package.json index 3d406b2c925a2c..5cf34ddc8e63fc 100644 --- a/packages/bun-types/package.json +++ b/packages/bun-types/package.json @@ -3,14 +3,16 @@ "license": "MIT", "main": "", "types": "index.d.ts", - "description": "Type definitions for Bun, an incredibly fast JavaScript runtime", + "description": "Type definitions and documentation for Bun, an incredibly fast JavaScript runtime", "repository": { "type": "git", "url": "https://github.com/oven-sh/bun", "directory": "packages/bun-types" }, "files": [ - "*.d.ts" + "*.d.ts", + "docs/**/*.md", + "docs/*.md" ], "homepage": "https://bun.sh", "dependencies": { @@ -25,7 +27,8 @@ }, "scripts": { "prebuild": "echo $(pwd)", - "build": "bun scripts/build.ts && bun run fmt", + "copy-docs": "rm -rf docs && cp -r ../../docs/ ./docs", + "build": "bun run copy-docs && bun scripts/build.ts && bun run fmt", "test": "tsc", "fmt": "echo $(which biome) && biome format --write ." },