diff --git a/docs/cli/init.md b/docs/cli/init.md index 0253333b73..8b419ae37d 100644 --- a/docs/cli/init.md +++ b/docs/cli/init.md @@ -2,20 +2,29 @@ Scaffold an empty Bun project with the interactive `bun init` command. ```bash $ bun init -bun init helps you get started with a minimal project and tries to -guess sensible defaults. Press ^C anytime to quit. -package name (quickstart): -entry point (index.ts): +? Select a project template - Press return to submit. +❯ Blank + React + Library -Done! A package.json file was saved in the current directory. - + index.ts - + .gitignore - + tsconfig.json (for editor auto-complete) - + README.md +✓ Select a project template: Blank + ++ .gitignore ++ index.ts ++ tsconfig.json (for editor autocomplete) ++ README.md To get started, run: - bun run index.ts + + bun run index.ts + +bun install v$BUN_LATEST_VERSION + ++ @types/bun@$BUN_LATEST_VERSION ++ typescript@5.9.2 + +7 packages installed ``` Press `enter` to accept the default answer for each prompt, or pass the `-y` flag to auto-accept the defaults. diff --git a/docs/quickstart.md b/docs/quickstart.md index 2cf48aa4eb..8ded324e82 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -9,20 +9,29 @@ Run `bun init` to scaffold a new project. It's an interactive tool; for this tut ```bash $ bun init -bun init helps you get started with a minimal project and tries to -guess sensible defaults. Press ^C anytime to quit. -package name (quickstart): -entry point (index.ts): +? Select a project template - Press return to submit. +❯ Blank + React + Library -Done! A package.json file was saved in the current directory. - + index.ts - + .gitignore - + tsconfig.json (for editor auto-complete) - + README.md +✓ Select a project template: Blank + ++ .gitignore ++ index.ts ++ tsconfig.json (for editor autocomplete) ++ README.md To get started, run: - bun run index.ts + + bun run index.ts + +bun install v$BUN_LATEST_VERSION + ++ @types/bun@$BUN_LATEST_VERSION ++ typescript@5.9.2 + +7 packages installed ``` Since our entry point is a `*.ts` file, Bun generates a `tsconfig.json` for you. If you're using plain JavaScript, it will generate a [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) instead. @@ -88,11 +97,15 @@ Bun can also execute `"scripts"` from your `package.json`. Add the following scr "name": "quickstart", "module": "index.ts", "type": "module", + "private": true, + "scripts": { + "start": "bun run index.ts" + }, "devDependencies": { "@types/bun": "latest" + }, + "peerDependencies": { + "typescript": "^5" } } ```