From 0934c932d70bb75f64ab06d6bc2c81ba29ff8a8d Mon Sep 17 00:00:00 2001 From: Sleeyax Date: Mon, 7 Oct 2024 14:55:59 +0200 Subject: [PATCH 1/7] fix: typo in README.md (#151) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9eb81822..b7cb61de 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Here are some tips to get the most out of Bolt.new: ## FAQs -**Where do sign up for a paid plan?** +**Where do I sign up for a paid plan?** Bolt.new is free to get started. If you need more AI tokens or want private projects, you can purchase a paid subscription in your [Bolt.new](https://bolt.new) settings, in the lower left hand corner of the application. **What happens if I hit the free usage limit?** From efcb93d6d8d4a79f74b2541244981d6a79dcc77b Mon Sep 17 00:00:00 2001 From: Sam Denty Date: Mon, 7 Oct 2024 15:51:16 +0200 Subject: [PATCH 2/7] fix(npm): fix hanging shells (#153) --- app/utils/shell.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/utils/shell.ts b/app/utils/shell.ts index 1c5c834d..c5ad7798 100644 --- a/app/utils/shell.ts +++ b/app/utils/shell.ts @@ -11,6 +11,7 @@ export async function newShellProcess(webcontainer: WebContainer, terminal: ITer cols: terminal.cols ?? 80, rows: terminal.rows ?? 15, }, + env: { npm_config_yes: true }, }); const input = process.input.getWriter(); From d0828e4c86ff44eefeae68b34aaa66a27eb45c7c Mon Sep 17 00:00:00 2001 From: Sam Denty Date: Mon, 7 Oct 2024 16:20:42 +0200 Subject: [PATCH 3/7] fix(chrome-129): show issue page (#157) --- package.json | 2 +- vite.config.ts | 29 ++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4f0061f1..55834556 100644 --- a/package.json +++ b/package.json @@ -71,9 +71,9 @@ "rehype-raw": "^7.0.0", "rehype-sanitize": "^6.0.0", "remark-gfm": "^4.0.0", + "remix-island": "^0.2.0", "remix-utils": "^7.6.0", "shiki": "^1.9.1", - "remix-island": "^0.2.0", "unist-util-visit": "^5.0.0" }, "devDependencies": { diff --git a/vite.config.ts b/vite.config.ts index 15cd0357..58e76cde 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,6 @@ import { cloudflareDevProxyVitePlugin as remixCloudflareDevProxy, vitePlugin as remixVitePlugin } from '@remix-run/dev'; import UnoCSS from 'unocss/vite'; -import { defineConfig } from 'vite'; +import { defineConfig, type ViteDevServer } from 'vite'; import { nodePolyfills } from 'vite-plugin-node-polyfills'; import { optimizeCssModules } from 'vite-plugin-optimize-css-modules'; import tsconfigPaths from 'vite-tsconfig-paths'; @@ -24,7 +24,34 @@ export default defineConfig((config) => { }), UnoCSS(), tsconfigPaths(), + chrome129IssuePlugin(), config.mode === 'production' && optimizeCssModules({ apply: 'build' }), ], }; }); + +function chrome129IssuePlugin() { + return { + name: 'chrome129IssuePlugin', + configureServer(server: ViteDevServer) { + server.middlewares.use((req, res, next) => { + const raw = req.headers['user-agent']?.match(/Chrom(e|ium)\/([0-9]+)\./); + + if (raw) { + const version = parseInt(raw[2], 10); + + if (version === 129) { + res.setHeader('content-type', 'text/html'); + res.end( + '

Please use Chrome Canary for testing.

Chrome 129 has an issue with JavaScript modules & Vite local development, see for more information.

Note: This only impacts local development. `pnpm run build` and `pnpm run start` will work fine in this browser.

', + ); + + return; + } + } + + next(); + }); + }, + }; +} From 31c07c06cbf80317140603c5a11ff3d0d158f6b8 Mon Sep 17 00:00:00 2001 From: Sam Denty Date: Mon, 7 Oct 2024 16:24:29 +0200 Subject: [PATCH 4/7] fix(npm): fix hanging shells (#159) --- app/lib/runtime/action-runner.ts | 4 +++- app/utils/shell.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/lib/runtime/action-runner.ts b/app/lib/runtime/action-runner.ts index cb65f87f..e2ea6a22 100644 --- a/app/lib/runtime/action-runner.ts +++ b/app/lib/runtime/action-runner.ts @@ -128,7 +128,9 @@ export class ActionRunner { const webcontainer = await this.#webcontainer; - const process = await webcontainer.spawn('jsh', ['-c', action.content]); + const process = await webcontainer.spawn('jsh', ['-c', action.content], { + env: { npm_config_yes: true }, + }); action.abortSignal.addEventListener('abort', () => { process.kill(); diff --git a/app/utils/shell.ts b/app/utils/shell.ts index c5ad7798..1c5c834d 100644 --- a/app/utils/shell.ts +++ b/app/utils/shell.ts @@ -11,7 +11,6 @@ export async function newShellProcess(webcontainer: WebContainer, terminal: ITer cols: terminal.cols ?? 80, rows: terminal.rows ?? 15, }, - env: { npm_config_yes: true }, }); const input = process.input.getWriter(); From bd2efecf21a77c2e89008db7d5c0209b79963033 Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 7 Oct 2024 19:58:22 +0530 Subject: [PATCH 5/7] docs: fix typo in CONTRIBUTING.md (#158) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33bae8c9..d2c124b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ [![Bolt Open Source Codebase](./public/social_preview_index.jpg)](https://bolt.new) -> Welcome to the **Bolt** open-source codebase! This repo cpontains a simple example app using the core components from bolt.new to help you get started building **AI-powered software development tools** powered by StackBlitz’s **WebContainer API**. +> Welcome to the **Bolt** open-source codebase! This repo contains a simple example app using the core components from bolt.new to help you get started building **AI-powered software development tools** powered by StackBlitz’s **WebContainer API**. ### Why Build with Bolt + WebContainer API From 41afd48b7ba6996b6c9ab29a6c61b858b5e1c19f Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Mon, 7 Oct 2024 20:28:13 +0300 Subject: [PATCH 6/7] fix: typos in CONTRIBUTING.md (#165) --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d2c124b3..ef4141cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ ### Why Build with Bolt + WebContainer API -By building with the Bolt + WebContainer API you can create browser-based applications that let users **prompt, run, edit, and deploy** full-stack web apps directly in the browser, without the need for virtual machines. With WebContainer API, you can build apps that give AI direct access and full control over a **Node.js server**, **filesystem**, **package manager** and **dev terminal** inside your users browser tab. This powerful combination allows you to create a new class of development tools that support all major javascript libraries and node packages right out of the box, all without remote environments or local installs. +By building with the Bolt + WebContainer API you can create browser-based applications that let users **prompt, run, edit, and deploy** full-stack web apps directly in the browser, without the need for virtual machines. With WebContainer API, you can build apps that give AI direct access and full control over a **Node.js server**, **filesystem**, **package manager** and **dev terminal** inside your users browser tab. This powerful combination allows you to create a new class of development tools that support all major JavaScript libraries and Node packages right out of the box, all without remote environments or local installs. ### What’s the Difference Between Bolt (This Repo) and [Bolt.new](https://bolt.new)? @@ -76,7 +76,7 @@ VITE_LOG_LEVEL=debug - `pnpm run build`: Builds the project. - `pnpm run start`: Runs the built application locally using Wrangler Pages. This script uses `bindings.sh` to set up necessary bindings so you don't have to duplicate environment variables. - `pnpm run preview`: Builds the project and then starts it locally, useful for testing the production build. Note, HTTP streaming currently doesn't work as expected with `wrangler pages dev`. -- `pnpm test:` Runs the test suite using Vitest. +- `pnpm test`: Runs the test suite using Vitest. - `pnpm run typecheck`: Runs TypeScript type checking. - `pnpm run typegen`: Generates TypeScript types using Wrangler. - `pnpm run deploy`: Builds the project and deploys it to Cloudflare Pages. From ffa9f113603ea1a0b00beaf301cf6f551081687e Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Mon, 7 Oct 2024 20:29:44 +0300 Subject: [PATCH 7/7] docs: fix typos in README.md (#164) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b7cb61de..f4ca2f74 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Bolt.new: AI-Powered Full-Stack Web Development in the Browser -Bolt.new is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md) +Bolt.new is an AI-powered web development agent that allows you to prompt, run, edit, and deploy full-stack applications directly from your browser—no local setup required. If you're here to build your own AI-powered web dev agent using the Bolt open source codebase, [click here to get started!](./CONTRIBUTING.md) ## What Makes Bolt.new Different @@ -11,7 +11,7 @@ Claude, v0, etc are incredible- but you can't install packages, run backends or - **Full-Stack in the Browser**: Bolt.new integrates cutting-edge AI models with an in-browser development environment powered by **StackBlitz’s WebContainers**. This allows you to: - Install and run npm tools and libraries (like Vite, Next.js, and more) - Run Node.js servers - - Interact with 3rd party APIs + - Interact with third-party APIs - Deploy to production from chat - Share your work via a URL @@ -25,7 +25,7 @@ For developers interested in building their own AI-powered development tools wit Here are some tips to get the most out of Bolt.new: -- **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular Javacsript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly. +- **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly. - **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting. @@ -36,7 +36,7 @@ Here are some tips to get the most out of Bolt.new: ## FAQs **Where do I sign up for a paid plan?** -Bolt.new is free to get started. If you need more AI tokens or want private projects, you can purchase a paid subscription in your [Bolt.new](https://bolt.new) settings, in the lower left hand corner of the application. +Bolt.new is free to get started. If you need more AI tokens or want private projects, you can purchase a paid subscription in your [Bolt.new](https://bolt.new) settings, in the lower-left hand corner of the application. **What happens if I hit the free usage limit?** Once your free daily token limit is reached, AI interactions are paused until the next day or until you upgrade your plan. @@ -48,7 +48,7 @@ Yes, Bolt.new is in beta, and we are actively improving it based on feedback. Check out the [Issues section](https://github.com/bolt.new/issues) to report an issue or request a new feature. Please use the search feature to check if someone else has already submitted the same issue/request. **What frameworks/libraries currently work on Bolt?** -Bolt.new supports most popular javascript frameworks and libraries. If it runs on StackBlitz, it will run on Bolt.new as well. +Bolt.new supports most popular JavaScript frameworks and libraries. If it runs on StackBlitz, it will run on Bolt.new as well. **How can I add make sure my framework/project works well in bolt?** -We are excited to work with the javascript ecosystem to improve functionality in Bolt. Reach out to us via [hello@stackblitz.com](mailto:hello@stackblitz.com) to discuss how we can partner! +We are excited to work with the JavaScript ecosystem to improve functionality in Bolt. Reach out to us via [hello@stackblitz.com](mailto:hello@stackblitz.com) to discuss how we can partner!