From 19f3246f7348e7a7d56571ed0ac81b853c22f88b Mon Sep 17 00:00:00 2001 From: Eamon Heffernan Date: Fri, 8 Sep 2023 20:10:03 +1000 Subject: [PATCH 1/9] Bun Adapter --- packages/docs/public/ecosystem/bun.svg | 26 +++ .../src/routes/(ecosystem)/ecosystem.json | 5 + .../api/qwik-city-vite-bun-server/api.json | 5 + .../api/qwik-city-vite-bun-server/index.md | 5 + .../docs/(qwikcity)/middleware/index.mdx | 2 +- .../src/routes/docs/deployments/bun/index.mdx | 44 +++++ packages/docs/src/routes/docs/menu.md | 1 + packages/qwik-city/adapters/bun-server/api.md | 23 +++ .../bun-server/vite/api-extractor.json | 19 ++ .../adapters/bun-server/vite/index.ts | 39 ++++ .../middleware/bun/api-extractor.json | 15 ++ packages/qwik-city/middleware/bun/api.md | 39 ++++ packages/qwik-city/middleware/bun/index.ts | 167 ++++++++++++++++++ packages/qwik-city/package.json | 7 + packages/qwik-city/static/index.ts | 9 +- packages/qwik/src/optimizer/src/platform.ts | 5 + packages/qwik/src/optimizer/src/types.ts | 2 +- scripts/api.ts | 10 ++ scripts/qwik-city.ts | 55 ++++++ starters/adapters/bun/README.md | 9 + .../adapters/bun/adapters/bun/vite.config.ts | 23 +++ starters/adapters/bun/package.json | 24 +++ starters/adapters/bun/src/entry.bun.ts | 48 +++++ tsconfig.json | 3 +- 24 files changed, 580 insertions(+), 5 deletions(-) create mode 100644 packages/docs/public/ecosystem/bun.svg create mode 100644 packages/docs/src/routes/api/qwik-city-vite-bun-server/api.json create mode 100644 packages/docs/src/routes/api/qwik-city-vite-bun-server/index.md create mode 100644 packages/docs/src/routes/docs/deployments/bun/index.mdx create mode 100644 packages/qwik-city/adapters/bun-server/api.md create mode 100644 packages/qwik-city/adapters/bun-server/vite/api-extractor.json create mode 100644 packages/qwik-city/adapters/bun-server/vite/index.ts create mode 100644 packages/qwik-city/middleware/bun/api-extractor.json create mode 100644 packages/qwik-city/middleware/bun/api.md create mode 100644 packages/qwik-city/middleware/bun/index.ts create mode 100644 starters/adapters/bun/README.md create mode 100644 starters/adapters/bun/adapters/bun/vite.config.ts create mode 100644 starters/adapters/bun/package.json create mode 100644 starters/adapters/bun/src/entry.bun.ts diff --git a/packages/docs/public/ecosystem/bun.svg b/packages/docs/public/ecosystem/bun.svg new file mode 100644 index 00000000000..531b2b73b4c --- /dev/null +++ b/packages/docs/public/ecosystem/bun.svg @@ -0,0 +1,26 @@ + + + bun + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/docs/src/routes/(ecosystem)/ecosystem.json b/packages/docs/src/routes/(ecosystem)/ecosystem.json index 11905bb22a0..20c340ce483 100644 --- a/packages/docs/src/routes/(ecosystem)/ecosystem.json +++ b/packages/docs/src/routes/(ecosystem)/ecosystem.json @@ -92,6 +92,11 @@ "href": "/docs/deployments/deno/", "imgSrc": "/ecosystem/deno.svg" }, + { + "title": "Bun", + "href": "/docs/deployments/bun/", + "imgSrc": "/ecosystem/bun.svg" + }, { "title": "Firebase", "href": "/docs/deployments/firebase/", diff --git a/packages/docs/src/routes/api/qwik-city-vite-bun-server/api.json b/packages/docs/src/routes/api/qwik-city-vite-bun-server/api.json new file mode 100644 index 00000000000..aa6825cb586 --- /dev/null +++ b/packages/docs/src/routes/api/qwik-city-vite-bun-server/api.json @@ -0,0 +1,5 @@ +{ + "id": "qwik-city-vite-bun-server", + "package": "@builder.io/qwik-city/vite/bun-server", + "members": [] +} \ No newline at end of file diff --git a/packages/docs/src/routes/api/qwik-city-vite-bun-server/index.md b/packages/docs/src/routes/api/qwik-city-vite-bun-server/index.md new file mode 100644 index 00000000000..f78c6971459 --- /dev/null +++ b/packages/docs/src/routes/api/qwik-city-vite-bun-server/index.md @@ -0,0 +1,5 @@ +--- +title: \@builder.io/qwik-city/vite/bun-server API Reference +--- + +# [API](/api) › @builder.io/qwik-city/vite/bun-server diff --git a/packages/docs/src/routes/docs/(qwikcity)/middleware/index.mdx b/packages/docs/src/routes/docs/(qwikcity)/middleware/index.mdx index 86415e3a0cc..f2873acb8b2 100644 --- a/packages/docs/src/routes/docs/(qwikcity)/middleware/index.mdx +++ b/packages/docs/src/routes/docs/(qwikcity)/middleware/index.mdx @@ -394,7 +394,7 @@ export const onGet: RequestHandler = async ({ ### `platform` -Deployment platform (Azure, Cloudflare, Deno, Google Cloud Run, Netlify, Node.js, Vercel, etc...) specific API. +Deployment platform (Azure, Bun, Cloudflare, Deno, Google Cloud Run, Netlify, Node.js, Vercel, etc...) specific API. ```tsx diff --git a/packages/docs/src/routes/docs/deployments/bun/index.mdx b/packages/docs/src/routes/docs/deployments/bun/index.mdx new file mode 100644 index 00000000000..87ad00191e1 --- /dev/null +++ b/packages/docs/src/routes/docs/deployments/bun/index.mdx @@ -0,0 +1,44 @@ +--- +title: Bun Middleware | Deployments +contributors: + - EamonHeffernan +--- + +# Bun Middleware + +Qwik City Bun middleware allows you to hook up Qwik City to a Bun server which uses the Bun Http API. + +## Installation + +There currently is an issue with using `bun` as the package manager. Please use `npm install`. + +To integrate the `bun` adapter, use the `add` command: + +- For the [integrated HTTP server](https://bun.sh/docs/api/http): + +```shell +npm run qwik add bun +``` + +## Production build + +To build the application for production, use the `build` command, this command will automatically run `bun run build.server` and `bun run build.client`: + +```shell +bun run build +``` + +## Serve + +To start the Bun server after a build: + +```shell +bun run serve +``` + +## Production deploy + +Since you are choosing Bun, here you are in your own, after running `bun run build`: + +- The `dist` folder will be created including all the static files. +- The `server` folder will be created including all node server files. diff --git a/packages/docs/src/routes/docs/menu.md b/packages/docs/src/routes/docs/menu.md index e294db69579..17f17ae72bb 100644 --- a/packages/docs/src/routes/docs/menu.md +++ b/packages/docs/src/routes/docs/menu.md @@ -74,6 +74,7 @@ - [Google Cloud Run](deployments/gcp-cloud-run/index.mdx) - [Cloudflare Pages](deployments/cloudflare-pages/index.mdx) - [Deno](deployments/deno/index.mdx) +- [Bun](deployments/bun/index.mdx) - [Netlify Edge](deployments/netlify-edge/index.mdx) - [Node](deployments/node/index.mdx) - [Vercel Edge](deployments/vercel-edge/index.mdx) diff --git a/packages/qwik-city/adapters/bun-server/api.md b/packages/qwik-city/adapters/bun-server/api.md new file mode 100644 index 00000000000..054a3308268 --- /dev/null +++ b/packages/qwik-city/adapters/bun-server/api.md @@ -0,0 +1,23 @@ +## API Report File for "@builder.io/qwik-city" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { ServerAdapterOptions } from '../../shared/vite'; +import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static'; + +// @alpha (undocumented) +export function bunServerAdapter(opts?: bunServerAdapterOptions): any; + +// @alpha (undocumented) +export interface bunServerAdapterOptions extends ServerAdapterOptions { + // (undocumented) + name?: string; +} + +export { StaticGenerateRenderOptions } + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/qwik-city/adapters/bun-server/vite/api-extractor.json b/packages/qwik-city/adapters/bun-server/vite/api-extractor.json new file mode 100644 index 00000000000..7ab782febfa --- /dev/null +++ b/packages/qwik-city/adapters/bun-server/vite/api-extractor.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "../../../api-extractor.json", + "mainEntryPointFilePath": "/dist-dev/dts-out/packages/qwik-city/adapters/bun-server/vite/index.d.ts", + "apiReport": { + "enabled": true, + "reportFileName": "api.md", + "reportFolder": "/packages/qwik-city/adapters/bun-server/", + "reportTempFolder": "/dist-dev/api-extractor/qwik-city/adapters/bun-server" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "/packages/qwik-city/lib/adapters/bun-server/vite/index.d.ts" + }, + "docModel": { + "enabled": true, + "apiJsonFilePath": "/dist-dev/api/qwik-city/vite/bun-server/docs.api.json" + } +} diff --git a/packages/qwik-city/adapters/bun-server/vite/index.ts b/packages/qwik-city/adapters/bun-server/vite/index.ts new file mode 100644 index 00000000000..55d38e7b2bb --- /dev/null +++ b/packages/qwik-city/adapters/bun-server/vite/index.ts @@ -0,0 +1,39 @@ +import type { StaticGenerateRenderOptions } from '@builder.io/qwik-city/static'; +import { viteAdapter, type ServerAdapterOptions } from '../../shared/vite'; + +/** + * @alpha + */ +export function bunServerAdapter(opts: bunServerAdapterOptions = {}): any { + const env = process?.env; + return viteAdapter({ + name: opts.name || 'bun-server', + origin: env?.ORIGIN ?? env?.URL ?? 'https://yoursitename.qwik.builder.io', + ssg: opts.ssg, + cleanStaticGenerated: true, + + config() { + return { + ssr: { + target: 'node', + }, + build: { + ssr: true, + }, + publicDir: false, + }; + }, + }); +} + +/** + * @alpha + */ +export interface bunServerAdapterOptions extends ServerAdapterOptions { + name?: string; +} + +/** + * @alpha + */ +export type { StaticGenerateRenderOptions }; diff --git a/packages/qwik-city/middleware/bun/api-extractor.json b/packages/qwik-city/middleware/bun/api-extractor.json new file mode 100644 index 00000000000..1d0bf5de8f6 --- /dev/null +++ b/packages/qwik-city/middleware/bun/api-extractor.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-dev/dts-out/packages/qwik-city/middleware/bun/index.d.ts", + "apiReport": { + "enabled": true, + "reportFileName": "api.md", + "reportFolder": "/packages/qwik-city/middleware/bun/", + "reportTempFolder": "/dist-dev/api-extractor/qwik-city/middleware/bun" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "/packages/qwik-city/lib/middleware/bun/index.d.ts" + } +} diff --git a/packages/qwik-city/middleware/bun/api.md b/packages/qwik-city/middleware/bun/api.md new file mode 100644 index 00000000000..be1dd612989 --- /dev/null +++ b/packages/qwik-city/middleware/bun/api.md @@ -0,0 +1,39 @@ +## API Report File for "@builder.io/qwik-city" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { ClientConn } from '@builder.io/qwik-city/middleware/request-handler'; +import type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler'; + +// @public (undocumented) +export interface Addr { + // (undocumented) + hostname: string; + // (undocumented) + port: number; + // (undocumented) + transport: 'tcp' | 'udp'; +} + +// @public (undocumented) +export function createQwikCity(opts: QwikCityBunOptions): { + router: (request: Request) => Promise; + notFound: (request: Request) => Promise; + staticFile: (request: Request) => Promise; +}; + +// @public (undocumented) +export interface QwikCityBunOptions extends ServerRenderOptions { + // (undocumented) + getClientConn?: (request: Request) => ClientConn; + static?: { + root?: string; + cacheControl?: string; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/qwik-city/middleware/bun/index.ts b/packages/qwik-city/middleware/bun/index.ts new file mode 100644 index 00000000000..bbbd365e0b2 --- /dev/null +++ b/packages/qwik-city/middleware/bun/index.ts @@ -0,0 +1,167 @@ +import type { + ServerRenderOptions, + ServerRequestEvent, + ClientConn, +} from '@builder.io/qwik-city/middleware/request-handler'; +import { + mergeHeadersCookies, + requestHandler, +} from '@builder.io/qwik-city/middleware/request-handler'; +import { getNotFound } from '@qwik-city-not-found-paths'; +import { isStaticPath } from '@qwik-city-static-paths'; +import { _deserializeData, _serializeData, _verifySerializable } from '@builder.io/qwik'; +import { setServerPlatform } from '@builder.io/qwik/server'; +import { MIME_TYPES } from '../request-handler/mime-types'; +import { join, extname } from 'node:path'; + +// @builder.io/qwik-city/middleware/bun + +/** + * @public + */ +export function createQwikCity(opts: QwikCityBunOptions) { + const qwikSerializer = { + _deserializeData, + _serializeData, + _verifySerializable, + }; + if (opts.manifest) { + setServerPlatform(opts.manifest); + } + + const staticFolder = + opts.static?.root ?? join(Bun.fileURLToPath(import.meta.url), '..', '..', 'dist'); + + async function router(request: Request) { + try { + const url = new URL(request.url); + + const serverRequestEv: ServerRequestEvent = { + mode: 'server', + locale: undefined, + url, + env: Bun.env, + request, + getWritableStream: (status, headers, cookies, resolve) => { + const { readable, writable } = new TransformStream(); + const response = new Response(readable, { + status, + headers: mergeHeadersCookies(headers, cookies), + }); + resolve(response); + return writable; + }, + platform: { + ssr: true, + }, + getClientConn: () => { + return opts.getClientConn ? opts.getClientConn(request) : {}; + }, + }; + + // send request to qwik city request handler + const handledResponse = await requestHandler(serverRequestEv, opts, qwikSerializer); + if (handledResponse) { + handledResponse.completion.then((v) => { + if (v) { + console.error(v); + } + }); + const response = await handledResponse.response; + if (response) { + return response; + } + } + + // qwik city did not have a route for this request + return null; + } catch (e: any) { + console.error(e); + return new Response(String(e || 'Error'), { + status: 500, + headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'bun-server' }, + }); + } + } + + const notFound = async (request: Request) => { + try { + const url = new URL(request.url); + const notFoundHtml = getNotFound(url.pathname); + return new Response(notFoundHtml, { + status: 404, + headers: { 'Content-Type': 'text/html; charset=utf-8', 'X-Not-Found': url.pathname }, + }); + } catch (e) { + console.error(e); + return new Response(String(e || 'Error'), { + status: 500, + headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'bun-server' }, + }); + } + }; + + const openStaticFile = async (url: URL) => { + const pathname = url.pathname; + const fileName = pathname.slice(url.pathname.lastIndexOf('/')); + let filePath: string; + if (fileName.includes('.')) { + filePath = join(staticFolder, pathname); + } else if (opts.qwikCityPlan.trailingSlash) { + filePath = join(staticFolder, pathname + 'index.html'); + } else { + filePath = join(staticFolder, pathname, 'index.html'); + } + return { + filePath, + content: Bun.file(filePath), + }; + }; + + const staticFile = async (request: Request) => { + try { + const url = new URL(request.url); + + if (isStaticPath(request.method || 'GET', url)) { + const { filePath, content } = await openStaticFile(url); + const ext = extname(filePath).replace(/^\./, ''); + + return new Response(await content.stream(), { + status: 200, + headers: { + 'content-type': MIME_TYPES[ext] || 'text/plain; charset=utf-8', + 'Cache-Control': opts.static?.cacheControl || 'max-age=3600', + }, + }); + } + + return null; + } catch (e) { + console.error(e); + return new Response(String(e || 'Error'), { + status: 500, + headers: { 'Content-Type': 'text/plain; charset=utf-8', 'X-Error': 'bun-server' }, + }); + } + }; + + return { + router, + notFound, + staticFile, + }; +} + +/** + * @public + */ +export interface QwikCityBunOptions extends ServerRenderOptions { + /** Options for serving static files */ + static?: { + /** The root folder for statics files. Defaults to /dist */ + root?: string; + /** Set the Cache-Control header for all static files */ + cacheControl?: string; + }; + getClientConn?: (request: Request) => ClientConn; +} diff --git a/packages/qwik-city/package.json b/packages/qwik-city/package.json index feda91f7ee7..9c1ae2c259e 100644 --- a/packages/qwik-city/package.json +++ b/packages/qwik-city/package.json @@ -63,6 +63,10 @@ "import": "./lib/adapters/cloud-run/vite/index.mjs", "require": "./lib/adapters/cloud-run/vite/index.cjs" }, + "./adapters/bun-server/vite": { + "import": "./lib/adapters/bun-server/vite/index.mjs", + "require": "./lib/adapters/bun-server/vite/index.cjs" + }, "./adapters/deno-server/vite": { "import": "./lib/adapters/deno-server/vite/index.mjs", "require": "./lib/adapters/deno-server/vite/index.cjs" @@ -96,6 +100,9 @@ "./middleware/deno": { "import": "./lib/middleware/deno/index.mjs" }, + "./middleware/bun": { + "import": "./lib/middleware/bun/index.mjs" + }, "./middleware/netlify-edge": { "import": "./lib/middleware/netlify-edge/index.mjs" }, diff --git a/packages/qwik-city/static/index.ts b/packages/qwik-city/static/index.ts index 6599956eb29..660e429be07 100644 --- a/packages/qwik-city/static/index.ts +++ b/packages/qwik-city/static/index.ts @@ -23,7 +23,7 @@ function getEntryModulePath() { if (isDeno()) { return './deno.mjs'; } - if (isNode()) { + if (isNode() || isBun()) { if (isCjs()) { return './node.cjs'; } @@ -44,8 +44,12 @@ function isDeno() { return typeof Deno !== 'undefined'; } +function isBun() { + return typeof Bun !== 'undefined'; +} + function isNode() { - return !isDeno() && typeof process !== 'undefined' && !!process.versions?.node; + return !isBun() && !isDeno() && typeof process !== 'undefined' && !!process.versions?.node; } function isCjs() { @@ -54,3 +58,4 @@ function isCjs() { } declare const Deno: any; +declare const Bun: any; diff --git a/packages/qwik/src/optimizer/src/platform.ts b/packages/qwik/src/optimizer/src/platform.ts index ee1dd80a89d..e21e7bbdf7c 100644 --- a/packages/qwik/src/optimizer/src/platform.ts +++ b/packages/qwik/src/optimizer/src/platform.ts @@ -265,6 +265,10 @@ const getEnv = (): SystemEnvironment => { return 'deno'; } + if (typeof Bun !== 'undefined') { + return 'bun'; + } + if ( typeof process !== 'undefined' && typeof global !== 'undefined' && @@ -310,3 +314,4 @@ const extensions: { [ext: string]: boolean } = { declare const globalThis: { IS_CJS: boolean; IS_ESM: boolean; [key: string]: any }; declare const WorkerGlobalScope: any; declare const Deno: any; +declare const Bun: any; diff --git a/packages/qwik/src/optimizer/src/types.ts b/packages/qwik/src/optimizer/src/types.ts index a16abc1be31..23317b635a4 100644 --- a/packages/qwik/src/optimizer/src/types.ts +++ b/packages/qwik/src/optimizer/src/types.ts @@ -53,7 +53,7 @@ export interface OptimizerSystem { /** * @public */ -export type SystemEnvironment = 'node' | 'deno' | 'webworker' | 'browsermain' | 'unknown'; +export type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown'; // OPTIONS *************** diff --git a/scripts/api.ts b/scripts/api.ts index b8a11c2ac98..035985d3f09 100644 --- a/scripts/api.ts +++ b/scripts/api.ts @@ -96,6 +96,11 @@ export async function apiExtractor(config: BuildConfig) { join(config.packagesDir, 'qwik-city', 'adapters', 'deno-server', 'vite'), join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'deno-server', 'vite', 'index.d.ts') ); + createTypesApi( + config, + join(config.packagesDir, 'qwik-city', 'adapters', 'bun-server', 'vite'), + join(config.packagesDir, 'qwik-city', 'lib', 'adapters', 'bun-server', 'vite', 'index.d.ts') + ); createTypesApi( config, join(config.packagesDir, 'qwik-city', 'adapters', 'node-server', 'vite'), @@ -131,6 +136,11 @@ export async function apiExtractor(config: BuildConfig) { join(config.packagesDir, 'qwik-city', 'middleware', 'cloudflare-pages'), join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'cloudflare-pages', 'index.d.ts') ); + createTypesApi( + config, + join(config.packagesDir, 'qwik-city', 'middleware', 'bun'), + join(config.packagesDir, 'qwik-city', 'lib', 'middleware', 'bun', 'index.d.ts') + ); createTypesApi( config, join(config.packagesDir, 'qwik-city', 'middleware', 'deno'), diff --git a/scripts/qwik-city.ts b/scripts/qwik-city.ts index 466afc6c937..af378ab423a 100644 --- a/scripts/qwik-city.ts +++ b/scripts/qwik-city.ts @@ -25,6 +25,7 @@ export async function buildQwikCity(config: BuildConfig) { buildAdapterCloudflarePagesVite(config), buildAdapterCloudRunVite(config), buildAdapterDenoVite(config), + buildAdapterBunVite(config), buildAdapterNodeServerVite(config), buildAdapterNetlifyEdgeVite(config), buildAdapterSharedVite(config), @@ -34,6 +35,7 @@ export async function buildQwikCity(config: BuildConfig) { buildMiddlewareNetlifyEdge(config), buildMiddlewareAzureSwa(config), buildMiddlewareDeno(config), + buildMiddlewareBun(config), buildMiddlewareNode(config), buildMiddlewareRequestHandler(config), buildMiddlewareVercelEdge(config), @@ -75,6 +77,11 @@ export async function buildQwikCity(config: BuildConfig) { import: './adapters/cloud-run/vite/index.mjs', require: './adapters/cloud-run/vite/index.cjs', }, + './adapters/bun-server/vite': { + types: './adapters/bun-server/vite/index.d.ts', + import: './adapters/bun-server/vite/index.mjs', + require: './adapters/bun-server/vite/index.cjs', + }, './adapters/deno-server/vite': { types: './adapters/deno-server/vite/index.d.ts', import: './adapters/deno-server/vite/index.mjs', @@ -121,6 +128,10 @@ export async function buildQwikCity(config: BuildConfig) { types: './middleware/deno/index.d.ts', import: './middleware/deno/index.mjs', }, + './middleware/bun': { + types: './middleware/bun/index.d.ts', + import: './middleware/bun/index.mjs', + }, './middleware/netlify-edge': { types: './middleware/netlify-edge/index.d.ts', import: './middleware/netlify-edge/index.mjs', @@ -386,6 +397,35 @@ async function buildAdapterCloudRunVite(config: BuildConfig) { }); } +async function buildAdapterBunVite(config: BuildConfig) { + const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'bun-server', 'vite', 'index.ts')]; + + await build({ + entryPoints, + outfile: join(config.distQwikCityPkgDir, 'adapters', 'bun-server', 'vite', 'index.mjs'), + bundle: true, + platform: 'node', + target: nodeTarget, + format: 'esm', + external: ADAPTER_EXTERNALS, + plugins: [resolveAdapterShared('../../shared/vite/index.mjs')], + }); + + await build({ + entryPoints, + outfile: join(config.distQwikCityPkgDir, 'adapters', 'bun-server', 'vite', 'index.cjs'), + bundle: true, + platform: 'node', + target: nodeTarget, + format: 'cjs', + external: ADAPTER_EXTERNALS, + plugins: [ + resolveAdapterShared('../../shared/vite/index.cjs'), + resolveRequestHandler('../../../middleware/request-handler/index.cjs'), + ], + }); +} + async function buildAdapterDenoVite(config: BuildConfig) { const entryPoints = [join(config.srcQwikCityDir, 'adapters', 'deno-server', 'vite', 'index.ts')]; @@ -584,6 +624,21 @@ async function buildMiddlewareCloudflarePages(config: BuildConfig) { }); } +async function buildMiddlewareBun(config: BuildConfig) { + const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'bun', 'index.ts')]; + + await build({ + entryPoints, + outfile: join(config.distQwikCityPkgDir, 'middleware', 'bun', 'index.mjs'), + bundle: true, + platform: 'node', + target: nodeTarget, + format: 'esm', + external: MIDDLEWARE_EXTERNALS, + plugins: [resolveRequestHandler('../request-handler/index.mjs')], + }); +} + async function buildMiddlewareDeno(config: BuildConfig) { const entryPoints = [join(config.srcQwikCityDir, 'middleware', 'deno', 'index.ts')]; diff --git a/starters/adapters/bun/README.md b/starters/adapters/bun/README.md new file mode 100644 index 00000000000..e841ed779d3 --- /dev/null +++ b/starters/adapters/bun/README.md @@ -0,0 +1,9 @@ +## Bun Server + +This app has a minimal [Bun server](https://bun.sh/docs/api/http) implementation. After running a full build, you can preview the build using the command: + +``` +bun run serve +``` + +Then visit [http://localhost:3000/](http://localhost:3000/) diff --git a/starters/adapters/bun/adapters/bun/vite.config.ts b/starters/adapters/bun/adapters/bun/vite.config.ts new file mode 100644 index 00000000000..4ba9c1d2452 --- /dev/null +++ b/starters/adapters/bun/adapters/bun/vite.config.ts @@ -0,0 +1,23 @@ +import { bunServerAdapter } from "@builder.io/qwik-city/adapters/bun-server/vite"; +import { extendConfig } from "@builder.io/qwik-city/vite"; +import baseConfig from "../../vite.config"; + +export default extendConfig(baseConfig, () => { + return { + build: { + ssr: true, + rollupOptions: { + input: ["src/entry.bun.ts", "@qwik-city-plan"], + }, + minify: false, + }, + plugins: [ + bunServerAdapter({ + ssg: { + include: ["/*"], + origin: "https://yoursite.dev", + }, + }), + ], + }; +}); diff --git a/starters/adapters/bun/package.json b/starters/adapters/bun/package.json new file mode 100644 index 00000000000..5f1145065ac --- /dev/null +++ b/starters/adapters/bun/package.json @@ -0,0 +1,24 @@ +{ + "description": "Bun server", + "scripts": { + "build.server": "vite build -c adapters/bun/vite.config.ts", + "serve": "bun server/entry.bun.js" + }, + "__qwik__": { + "priority": 20, + "displayName": "Adapter: Bun Server", + "docs": [ + "https://qwik.builder.io/deployments/bun/", + "https://bun.sh/docs/api/http" + ], + "nextSteps": { + "title": "Next Steps", + "lines": [ + " Now you can build a production-ready Bun app:", + "", + " - bun run build: production build", + " - bun run serve: runs the production server locally" + ] + } + } +} diff --git a/starters/adapters/bun/src/entry.bun.ts b/starters/adapters/bun/src/entry.bun.ts new file mode 100644 index 00000000000..e821c564703 --- /dev/null +++ b/starters/adapters/bun/src/entry.bun.ts @@ -0,0 +1,48 @@ +/* + * WHAT IS THIS FILE? + * + * It's the entry point for the Bun HTTP server when building for production. + * + * Learn more about the Bun integration here: + * - https://qwik.builder.io/docs/deployments/bun/ + * - https://bun.sh/docs/api/http + * + */ +import { createQwikCity } from "@builder.io/qwik-city/middleware/bun"; +import qwikCityPlan from "@qwik-city-plan"; +import { manifest } from "@qwik-client-manifest"; +import render from "./entry.ssr"; + +// Create the Qwik City Bun middleware +const { router, notFound, staticFile } = createQwikCity({ + render, + qwikCityPlan, + manifest, +}); + +// Allow for dynamic port +const port = Number(Bun.env.PORT ?? 3000); + +/* eslint-disable */ +console.log(`Server started: http://localhost:${port}/`); + +Bun.serve({ + async fetch(request: Request) { + const staticResponse = await staticFile(request); + if (staticResponse) { + return staticResponse; + } + + // Server-side render this request with Qwik City + const qwikCityResponse = await router(request); + if (qwikCityResponse) { + return qwikCityResponse; + } + + // Path not found + return notFound(request); + }, + port, +}); + +declare const Bun: any; diff --git a/tsconfig.json b/tsconfig.json index 609b13572c4..901ebf5eae0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -97,7 +97,8 @@ "starters/apps/qwikcity-test/**/*", "starters/dev-server.ts", "packages/qwik-react/vite", - "@types/deno.d.ts" + "@types/deno.d.ts", + "@types/bun.d.ts" ], "exclude": [ "packages/create-qwik/dist", From 646a268846e9677c3387056fec124f50e6832869 Mon Sep 17 00:00:00 2001 From: Eamon Heffernan Date: Fri, 8 Sep 2023 21:51:18 +1000 Subject: [PATCH 2/9] Bun types --- @types/bun.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 @types/bun.d.ts diff --git a/@types/bun.d.ts b/@types/bun.d.ts new file mode 100644 index 00000000000..bf48a53239f --- /dev/null +++ b/@types/bun.d.ts @@ -0,0 +1,8 @@ +declare const Bun: { + fileURLToPath: (url: string) => string; + env: any; + file: (path: string) => { + text: () => Promise; + stream: () => Promise>; + }; +}; From bc434415b8ad66e94af3eae887b3e1a6d45af06d Mon Sep 17 00:00:00 2001 From: Eamon Heffernan Date: Fri, 8 Sep 2023 21:54:30 +1000 Subject: [PATCH 3/9] Update docs --- packages/docs/src/routes/api/qwik-optimizer/api.json | 2 +- packages/docs/src/routes/api/qwik-optimizer/index.md | 1 + packages/qwik-city/middleware/bun/api.md | 10 ---------- packages/qwik/src/optimizer/src/api.md | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/docs/src/routes/api/qwik-optimizer/api.json b/packages/docs/src/routes/api/qwik-optimizer/api.json index 5adb9b3becd..53595cd9dcc 100644 --- a/packages/docs/src/routes/api/qwik-optimizer/api.json +++ b/packages/docs/src/routes/api/qwik-optimizer/api.json @@ -644,7 +644,7 @@ } ], "kind": "TypeAlias", - "content": "```typescript\nexport type SystemEnvironment = 'node' | 'deno' | 'webworker' | 'browsermain' | 'unknown';\n```", + "content": "```typescript\nexport type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown';\n```", "editUrl": "https://github.com/BuilderIO/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts", "mdFile": "qwik.systemenvironment.md" }, diff --git a/packages/docs/src/routes/api/qwik-optimizer/index.md b/packages/docs/src/routes/api/qwik-optimizer/index.md index d82e7b1781e..e9573ddab73 100644 --- a/packages/docs/src/routes/api/qwik-optimizer/index.md +++ b/packages/docs/src/routes/api/qwik-optimizer/index.md @@ -645,6 +645,7 @@ export type SymbolMapperFn = ( export type SystemEnvironment = | "node" | "deno" + | "bun" | "webworker" | "browsermain" | "unknown"; diff --git a/packages/qwik-city/middleware/bun/api.md b/packages/qwik-city/middleware/bun/api.md index be1dd612989..43f2e407cf1 100644 --- a/packages/qwik-city/middleware/bun/api.md +++ b/packages/qwik-city/middleware/bun/api.md @@ -7,16 +7,6 @@ import type { ClientConn } from '@builder.io/qwik-city/middleware/request-handler'; import type { ServerRenderOptions } from '@builder.io/qwik-city/middleware/request-handler'; -// @public (undocumented) -export interface Addr { - // (undocumented) - hostname: string; - // (undocumented) - port: number; - // (undocumented) - transport: 'tcp' | 'udp'; -} - // @public (undocumented) export function createQwikCity(opts: QwikCityBunOptions): { router: (request: Request) => Promise; diff --git a/packages/qwik/src/optimizer/src/api.md b/packages/qwik/src/optimizer/src/api.md index ff5b42a8643..f8fdc7fab5d 100644 --- a/packages/qwik/src/optimizer/src/api.md +++ b/packages/qwik/src/optimizer/src/api.md @@ -369,7 +369,7 @@ export type SymbolMapper = Record readonly [symbol: string, chunk: string] | undefined; // @public (undocumented) -export type SystemEnvironment = 'node' | 'deno' | 'webworker' | 'browsermain' | 'unknown'; +export type SystemEnvironment = 'node' | 'deno' | 'bun' | 'webworker' | 'browsermain' | 'unknown'; // @public (undocumented) export interface TransformFsOptions extends TransformOptions { From 69591c4942c5bc42438eadf46052bedbbc9d502f Mon Sep 17 00:00:00 2001 From: Eamon Heffernan Date: Wed, 13 Sep 2023 02:40:07 +1000 Subject: [PATCH 4/9] Improved installation instructions for bun --- .../docs/src/routes/docs/deployments/bun/index.mdx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/docs/src/routes/docs/deployments/bun/index.mdx b/packages/docs/src/routes/docs/deployments/bun/index.mdx index 87ad00191e1..4168de7ab18 100644 --- a/packages/docs/src/routes/docs/deployments/bun/index.mdx +++ b/packages/docs/src/routes/docs/deployments/bun/index.mdx @@ -10,14 +10,23 @@ Qwik City Bun middleware allows you to hook up Qwik City to a Bun server which u ## Installation -There currently is an issue with using `bun` as the package manager. Please use `npm install`. +To install `bun` on Linux, OSX or WSL run the following command in your terminal + +```shell +curl -fsSL https://bun.sh/install | bash +``` + +For other platforms or if you run into issues with installation, up to date `bun` installation instructions can be found [on the bun website](https://bun.sh/docs/installation). + +There currently is an issue with using `bun` as the package manager. Please use `npm install`. After dependencies are installed with `npm install`, `bun dev`, `bun run build` and other scripts from package.json can be executed with `bun`. +This issue is currently being tracked [on the bun repository](https://github.com/oven-sh/bun/issues/3783). To integrate the `bun` adapter, use the `add` command: - For the [integrated HTTP server](https://bun.sh/docs/api/http): ```shell -npm run qwik add bun +bun run qwik add bun ``` ## Production build From 139a0272396ba03c67d3f0bcf86ddad4b5650824 Mon Sep 17 00:00:00 2001 From: Roman Zanettin Date: Sat, 16 Sep 2023 21:24:48 +0200 Subject: [PATCH 5/9] cli cleanup --- package.json | 2 +- packages/create-qwik/package.json | 2 +- .../qwik/src/cli/add/run-add-interactive.ts | 19 ++--- packages/qwik/src/cli/utils/log.ts | 4 +- packages/qwik/src/cli/utils/utils.ts | 61 +++++++++++---- pnpm-lock.yaml | 78 +++++++++---------- starters/adapters/azure-swa/package.json | 6 +- starters/adapters/bun/package.json | 6 +- starters/adapters/cloud-run/package.json | 6 +- .../adapters/cloudflare-pages/package.json | 6 +- starters/adapters/deno/package.json | 6 +- starters/adapters/express/package.json | 6 +- starters/adapters/fastify/package.json | 6 +- starters/adapters/firebase/package.json | 3 +- starters/adapters/netlify-edge/package.json | 6 +- starters/adapters/node-server/package.json | 6 +- starters/adapters/static/package.json | 4 +- starters/adapters/vercel-edge/package.json | 6 +- 18 files changed, 132 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index 434b5d5df24..1241727be87 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@builder.io/partytown": "^0.8.0", - "@clack/prompts": "^0.6.3", + "@clack/prompts": "^0.7.0", "@microsoft/api-documenter": "^7.22.30", "@microsoft/api-extractor": "7.36.3", "@napi-rs/cli": "2.12.1", diff --git a/packages/create-qwik/package.json b/packages/create-qwik/package.json index 9b93de92b55..7cb2eede201 100644 --- a/packages/create-qwik/package.json +++ b/packages/create-qwik/package.json @@ -6,7 +6,7 @@ "bin": "./create-qwik.cjs", "bugs": "https://github.com/BuilderIO/qwik/issues", "devDependencies": { - "@clack/prompts": "^0.6.3", + "@clack/prompts": "^0.7.0", "@types/yargs": "17.0.24", "kleur": "4.1.5", "yargs": "17.7.2" diff --git a/packages/qwik/src/cli/add/run-add-interactive.ts b/packages/qwik/src/cli/add/run-add-interactive.ts index 071cc41eb9c..67a7acde221 100644 --- a/packages/qwik/src/cli/add/run-add-interactive.ts +++ b/packages/qwik/src/cli/add/run-add-interactive.ts @@ -1,14 +1,15 @@ +import type { IntegrationData, UpdateAppResult } from '../types'; +import { bgBlue, bgMagenta, blue, bold, cyan, magenta } from 'kleur/colors'; +import { bye, getPackageManager, note, panic, printHeader } from '../utils/utils'; +import { intro, isCancel, log, outro, select, spinner } from '@clack/prompts'; +import { loadIntegrations, sortIntegrationsAndReturnAsClackOptions } from '../utils/integrations'; + /* eslint-disable no-console */ import type { AppCommand } from '../utils/app-command'; -import { loadIntegrations, sortIntegrationsAndReturnAsClackOptions } from '../utils/integrations'; -import { bgBlue, bold, magenta, cyan, bgMagenta, green } from 'kleur/colors'; -import { bye, getPackageManager, panic, printHeader, note } from '../utils/utils'; -import { updateApp } from './update-app'; -import type { IntegrationData, UpdateAppResult } from '../types'; -import { relative } from 'node:path'; import { logNextStep } from '../utils/log'; +import { relative } from 'node:path'; import { runInPkg } from '../utils/install-deps'; -import { intro, isCancel, select, log, spinner, outro } from '@clack/prompts'; +import { updateApp } from './update-app'; export async function runAddInteractive(app: AppCommand, id: string | undefined) { const pkgManager = getPackageManager(); @@ -167,9 +168,9 @@ async function logUpdateAppResult(pkgManager: string, result: UpdateAppResult) { function logUpdateAppCommitResult(result: UpdateAppResult, pkgManager: string) { if (result.updates.installedScripts.length > 0) { - const prefix = pkgManager === 'npm' ? 'npm run' : pkgManager; + const prefix = pkgManager === 'npm' || pkgManager === 'bun' ? `${pkgManager} run` : pkgManager; const message = result.updates.installedScripts - .map((script) => ` - ${prefix} ${green(script)}`) + .map((script) => `- ${prefix} ${blue(script)}`) .join('\n'); note(message, 'New scripts added'); } diff --git a/packages/qwik/src/cli/utils/log.ts b/packages/qwik/src/cli/utils/log.ts index 9815da8d358..dfa8c5bae28 100644 --- a/packages/qwik/src/cli/utils/log.ts +++ b/packages/qwik/src/cli/utils/log.ts @@ -1,5 +1,5 @@ -import { cyan } from 'kleur/colors'; import type { NextSteps } from '../types'; +import { cyan } from 'kleur/colors'; export function logSuccessFooter(docs: string[]) { const outString = []; @@ -26,7 +26,7 @@ export function logNextStep(nextSteps: NextSteps | undefined, packageManager: st const outString: string[] = []; if (nextSteps) { nextSteps.lines.forEach((step) => - outString.push(` ${step.replace(/\bpnpm\b/g, packageManager)}`) + outString.push(`${step.replace(/\bpnpm\b/g, packageManager)}`) ); } return outString.join('\n'); diff --git a/packages/qwik/src/cli/utils/utils.ts b/packages/qwik/src/cli/utils/utils.ts index 42ea6fae0c5..104cf66e1c1 100644 --- a/packages/qwik/src/cli/utils/utils.ts +++ b/packages/qwik/src/cli/utils/utils.ts @@ -1,11 +1,12 @@ -import fs from 'node:fs'; -import { join } from 'node:path'; -import { red, blue, magenta, white, gray, reset, green } from 'kleur/colors'; +import { blue, gray, green, magenta, red, reset, white } from 'kleur/colors'; import { log, outro } from '@clack/prompts'; -import spawn from 'cross-spawn'; + import type { ChildProcess } from 'node:child_process'; -import detectPackageManager from 'which-pm-runs'; import type { IntegrationPackageJson } from '../types'; +import detectPackageManager from 'which-pm-runs'; +import fs from 'node:fs'; +import { join } from 'node:path'; +import spawn from 'cross-spawn'; export function runCommand(cmd: string, args: string[], cwd: string) { let child: ChildProcess; @@ -182,7 +183,35 @@ export async function getFilesDeep(root: string) { return files; } +// Used from https://github.com/sindresorhus/is-unicode-supported/blob/main/index.js +export default function isUnicodeSupported() { + if (process.platform !== 'win32') { + return process.env.TERM !== 'linux'; // Linux console (kernel) + } + + return ( + Boolean(process.env.CI) || + Boolean(process.env.WT_SESSION) || // Windows Terminal + Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27) + process.env.ConEmuTask === '{cmd::Cmder}' || // ConEmu and cmder + process.env.TERM_PROGRAM === 'Terminus-Sublime' || + process.env.TERM_PROGRAM === 'vscode' || + process.env.TERM === 'xterm-256color' || + process.env.TERM === 'alacritty' || + process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm' + ); +} + // Used from https://github.com/natemoo-re/clack/blob/main/packages/prompts/src/index.ts +const unicode = isUnicodeSupported(); +const s = (c: string, fallback: string) => (unicode ? c : fallback); +const S_BAR = s('│', '|'); +const S_BAR_H = s('─', '-'); +const S_CORNER_TOP_RIGHT = s('╮', '+'); +const S_CONNECT_LEFT = s('├', '+'); +const S_CORNER_BOTTOM_RIGHT = s('╯', '+'); +const S_STEP_SUBMIT = s('◇', 'o'); + function ansiRegex() { const pattern = [ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', @@ -192,23 +221,25 @@ function ansiRegex() { return new RegExp(pattern, 'g'); } -const bar = '│'; const strip = (str: string) => str.replace(ansiRegex(), ''); - export const note = (message = '', title = '') => { const lines = `\n${message}\n`.split('\n'); + const titleLen = strip(title).length; const len = - lines.reduce((sum, ln) => { - ln = strip(ln); - return ln.length > sum ? ln.length : sum; - }, 0) + 2; + Math.max( + lines.reduce((sum, ln) => { + ln = strip(ln); + return ln.length > sum ? ln.length : sum; + }, 0), + titleLen + ) + 2; const msg = lines - .map((ln) => `${gray(bar)} ${white(ln)}${' '.repeat(len - strip(ln).length)}${gray(bar)}`) + .map((ln) => `${gray(S_BAR)} ${white(ln)}${' '.repeat(len - strip(ln).length)}${gray(S_BAR)}`) .join('\n'); process.stdout.write( - `${gray(bar)}\n${green('○')} ${reset(title)} ${gray( - '─'.repeat(len - title.length - 1) + '╮' - )}\n${msg}\n${gray('├' + '─'.repeat(len + 2) + '╯')}\n` + `${gray(S_BAR)}\n${green(S_STEP_SUBMIT)} ${reset(title)} ${gray( + S_BAR_H.repeat(Math.max(len - titleLen - 1, 1)) + S_CORNER_TOP_RIGHT + )}\n${msg}\n${gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\n` ); }; // End of used code from clack diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1dbdaf25507..644fd950e96 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,8 +19,8 @@ importers: specifier: ^0.8.0 version: 0.8.0 '@clack/prompts': - specifier: ^0.6.3 - version: 0.6.3 + specifier: ^0.7.0 + version: 0.7.0 '@microsoft/api-documenter': specifier: ^7.22.30 version: 7.22.30(@types/node@20.4.5) @@ -196,8 +196,8 @@ importers: packages/create-qwik: devDependencies: '@clack/prompts': - specifier: ^0.6.3 - version: 0.6.3 + specifier: ^0.7.0 + version: 0.7.0 '@types/yargs': specifier: 17.0.24 version: 17.0.24 @@ -221,19 +221,19 @@ importers: version: 0.8.0 '@builder.io/qwik': specifier: github:BuilderIo/qwik-build#main - version: github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1) + version: github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) '@builder.io/qwik-city': specifier: github:BuilderIo/qwik-city-build#main - version: github.com/BuilderIo/qwik-city-build/5bd84238e9d94736ff2075b77cbd1c49f8af8de7(rollup@3.26.3) + version: github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414(rollup@3.26.3) '@builder.io/qwik-labs': specifier: github:BuilderIo/qwik-labs-build#a487845dd5039e3e178f69755f603cbc2edef2c2 version: github.com/BuilderIo/qwik-labs-build/a487845dd5039e3e178f69755f603cbc2edef2c2 '@builder.io/qwik-react': specifier: 0.5.0 - version: 0.5.0(@builder.io/qwik@1.2.10)(@types/react-dom@18.2.7)(@types/react@18.2.17)(react-dom@18.2.0)(react@18.2.0) + version: 0.5.0(@builder.io/qwik@1.2.11)(@types/react-dom@18.2.7)(@types/react@18.2.17)(react-dom@18.2.0)(react@18.2.0) '@builder.io/sdk-qwik': specifier: ^0.4.5 - version: 0.4.5(@builder.io/qwik@1.2.10) + version: 0.4.5(@builder.io/qwik@1.2.11) '@docsearch/css': specifier: 3.3.4 version: 3.3.4 @@ -245,7 +245,7 @@ importers: version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.17)(react@18.2.0) '@modular-forms/qwik': specifier: ^0.12.0 - version: 0.12.0(@builder.io/qwik-city@1.2.10-dev20230903073808)(@builder.io/qwik@1.2.10) + version: 0.12.0(@builder.io/qwik-city@1.2.11-dev20230915194738)(@builder.io/qwik@1.2.11) '@mui/material': specifier: ^5.13.0 version: 5.13.0(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.17)(react-dom@18.2.0)(react@18.2.0) @@ -269,7 +269,7 @@ importers: version: 0.0.28 '@unpic/qwik': specifier: ^0.0.24 - version: 0.0.24(@builder.io/qwik@1.2.10) + version: 0.0.24(@builder.io/qwik@1.2.11) algoliasearch: specifier: 4.16.0 version: 4.16.0 @@ -372,13 +372,13 @@ importers: version: 0.7.1 '@builder.io/qwik-auth': specifier: 0.1.0 - version: 0.1.0(@auth/core@0.7.1)(@builder.io/qwik-city@1.2.10-dev20230903073808)(@builder.io/qwik@1.2.10) + version: 0.1.0(@auth/core@0.7.1)(@builder.io/qwik-city@1.2.11-dev20230915194738)(@builder.io/qwik@1.2.11) '@libsql/client': specifier: ^0.3.1 version: 0.3.1 '@modular-forms/qwik': specifier: ^0.12.0 - version: 0.12.0(@builder.io/qwik-city@1.2.10-dev20230903073808)(@builder.io/qwik@1.2.10) + version: 0.12.0(@builder.io/qwik-city@1.2.11-dev20230915194738)(@builder.io/qwik@1.2.11) '@typescript/analyze-trace': specifier: ^0.10.0 version: 0.10.0 @@ -400,10 +400,10 @@ importers: devDependencies: '@builder.io/qwik': specifier: github:BuilderIo/qwik-build#main - version: github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1) + version: github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) '@builder.io/qwik-city': specifier: github:BuilderIo/qwik-city-build#main - version: github.com/BuilderIo/qwik-city-build/5bd84238e9d94736ff2075b77cbd1c49f8af8de7(rollup@3.26.3) + version: github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414(rollup@3.26.3) '@builder.io/qwik-labs': specifier: workspace:* version: link:../qwik-labs @@ -1317,7 +1317,7 @@ packages: hasBin: true dev: true - /@builder.io/qwik-auth@0.1.0(@auth/core@0.7.1)(@builder.io/qwik-city@1.2.10-dev20230903073808)(@builder.io/qwik@1.2.10): + /@builder.io/qwik-auth@0.1.0(@auth/core@0.7.1)(@builder.io/qwik-city@1.2.11-dev20230915194738)(@builder.io/qwik@1.2.11): resolution: {integrity: sha512-uwwVbam6yQs9evtmof/+SpRT7DzoxD+2DSwsndGcm9JBU4Sh1xMyzll6F9QbivKVboglx+4X05OzJG7QTttWMQ==} engines: {node: '>=16.8.0 <18.0.0 || >=18.11'} peerDependencies: @@ -1326,8 +1326,8 @@ packages: '@builder.io/qwik-city': '>=0.6.0' dependencies: '@auth/core': 0.7.1 - '@builder.io/qwik': github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1) - '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/5bd84238e9d94736ff2075b77cbd1c49f8af8de7(rollup@3.26.3) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) + '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414(rollup@3.26.3) dev: false /@builder.io/qwik-city@1.2.10(rollup@3.26.3): @@ -1346,7 +1346,7 @@ packages: - supports-color dev: true - /@builder.io/qwik-react@0.5.0(@builder.io/qwik@1.2.10)(@types/react-dom@18.2.7)(@types/react@18.2.17)(react-dom@18.2.0)(react@18.2.0): + /@builder.io/qwik-react@0.5.0(@builder.io/qwik@1.2.11)(@types/react-dom@18.2.7)(@types/react@18.2.17)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-JdJWQWOJGv7ddQqEZwzR8wPh0IoCQZwD9qo75+reiQaLp6eH+Pjsm/kn1LaMQt6u72pCCNjnj5kEn/bnbfnIjQ==} engines: {node: '>=16'} peerDependencies: @@ -1356,7 +1356,7 @@ packages: react: '>=18.0.0' react-dom: '>=18.0.0' dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) '@types/react': 18.2.17 '@types/react-dom': 18.2.7 react: 18.2.0 @@ -1385,12 +1385,12 @@ packages: undici: 5.22.1 dev: true - /@builder.io/sdk-qwik@0.4.5(@builder.io/qwik@1.2.10): + /@builder.io/sdk-qwik@0.4.5(@builder.io/qwik@1.2.11): resolution: {integrity: sha512-JBHOowt0D2344zSq4kIcz2qnz0LxIZMy5KkYHhWVc9wgM5DMoO5N9YgzUqkQo209NPO58oyLv2BBWHLr+v//QQ==} peerDependencies: '@builder.io/qwik': '>=1.0.0' dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) dev: true /@builder.io/vite-plugin-macro@0.0.7(@types/node@20.4.5)(rollup@3.26.3)(terser@5.19.2): @@ -1412,17 +1412,17 @@ packages: - terser dev: true - /@clack/core@0.3.2: - resolution: {integrity: sha512-FZnsNynwGDIDktx6PEZK1EuCkFpY4ldEX6VYvfl0dqeoLPb9Jpw1xoUXaVcGR8ExmYNm1w2vdGdJkEUYD/2pqg==} + /@clack/core@0.3.3: + resolution: {integrity: sha512-5ZGyb75BUBjlll6eOa1m/IZBxwk91dooBWhPSL67sWcLS0zt9SnswRL0l26TVdBhb0wnWORRxUn//uH6n4z7+A==} dependencies: picocolors: 1.0.0 sisteransi: 1.0.5 dev: true - /@clack/prompts@0.6.3: - resolution: {integrity: sha512-AM+kFmAHawpUQv2q9+mcB6jLKxXGjgu/r2EQjEwujgpCdzrST6BJqYw00GRn56/L/Izw5U7ImoLmy00X/r80Pw==} + /@clack/prompts@0.7.0: + resolution: {integrity: sha512-0MhX9/B4iL6Re04jPrttDm+BsP8y6mS7byuv0BvXgdXhbV5PdlsHt55dvNsuBCPZ7xq1oTAOOuotR9NFbQyMSA==} dependencies: - '@clack/core': 0.3.2 + '@clack/core': 0.3.3 picocolors: 1.0.0 sisteransi: 1.0.5 dev: true @@ -2739,14 +2739,14 @@ packages: resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} dev: true - /@modular-forms/qwik@0.12.0(@builder.io/qwik-city@1.2.10-dev20230903073808)(@builder.io/qwik@1.2.10): + /@modular-forms/qwik@0.12.0(@builder.io/qwik-city@1.2.11-dev20230915194738)(@builder.io/qwik@1.2.11): resolution: {integrity: sha512-IJi5Uvm1Z1tJZLOpYM8jWza40Viac6tblnMre0pdrslVv7tW3MnXFgQgO539YksooOsn1Jn1KjVUVmhiMuXXuA==} peerDependencies: '@builder.io/qwik': ^1.0.0 '@builder.io/qwik-city': ^1.0.0 dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1) - '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/5bd84238e9d94736ff2075b77cbd1c49f8af8de7(rollup@3.26.3) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) + '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414(rollup@3.26.3) /@mui/base@5.0.0-beta.0(@types/react@18.2.17)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-ap+juKvt8R8n3cBqd/pGtZydQ4v2I/hgJKnvJRGjpSh3RvsvnDHO4rXov8MHQlH6VqpOekwgilFLGxMZjNTucA==} @@ -5547,13 +5547,13 @@ packages: unpic: 3.9.0 dev: true - /@unpic/qwik@0.0.24(@builder.io/qwik@1.2.10): + /@unpic/qwik@0.0.24(@builder.io/qwik@1.2.11): resolution: {integrity: sha512-i8BWq6Tj325bH8a5HlNW4CKTt+kN09y3d6uJztrJWha5SLdrDESrFBPNqosWcuF8p8GjL2L0Em7Lnvr6f1+/9w==} engines: {node: '>=15.0.0'} peerDependencies: '@builder.io/qwik': '*' dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) dev: true /@vercel/nft@0.22.6(supports-color@9.4.0): @@ -19011,11 +19011,11 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef(undici@5.22.1): - resolution: {tarball: https://codeload.github.com/BuilderIo/qwik-build/tar.gz/a22f5ecae8dd8eb125f96f59edb8431c08f446ef} - id: github.com/BuilderIo/qwik-build/a22f5ecae8dd8eb125f96f59edb8431c08f446ef + github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1): + resolution: {tarball: https://codeload.github.com/BuilderIo/qwik-build/tar.gz/48c1524f9b8dc7a356b1694e5468d389aee7daca} + id: github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca name: '@builder.io/qwik' - version: 1.2.10 + version: 1.2.11 engines: {node: '>=16.8.0 <18.0.0 || >=18.11'} hasBin: true peerDependencies: @@ -19024,11 +19024,11 @@ packages: csstype: 3.1.2 undici: 5.22.1 - github.com/BuilderIo/qwik-city-build/5bd84238e9d94736ff2075b77cbd1c49f8af8de7(rollup@3.26.3): - resolution: {tarball: https://codeload.github.com/BuilderIo/qwik-city-build/tar.gz/5bd84238e9d94736ff2075b77cbd1c49f8af8de7} - id: github.com/BuilderIo/qwik-city-build/5bd84238e9d94736ff2075b77cbd1c49f8af8de7 + github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414(rollup@3.26.3): + resolution: {tarball: https://codeload.github.com/BuilderIo/qwik-city-build/tar.gz/80b973155c27bf23f16aaf6430aa6bc3170ce414} + id: github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414 name: '@builder.io/qwik-city' - version: 1.2.10-dev20230903073808 + version: 1.2.11-dev20230915194738 engines: {node: '>=16.8.0 <18.0.0 || >=18.11'} dependencies: '@mdx-js/mdx': 2.3.0 diff --git a/starters/adapters/azure-swa/package.json b/starters/adapters/azure-swa/package.json index 0b74e851ad3..fbfaf1ba93c 100644 --- a/starters/adapters/azure-swa/package.json +++ b/starters/adapters/azure-swa/package.json @@ -18,10 +18,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build and deploy to Azure with:", + "Now you can build and deploy to Azure with:", "", - " - pnpm run build: production build for Azure SWA", - " - pnpm run deploy: it will use the SWA CLI to deploy your site" + "- pnpm run build: production build for Azure SWA", + "- pnpm run deploy: it will use the SWA CLI to deploy your site" ] } } diff --git a/starters/adapters/bun/package.json b/starters/adapters/bun/package.json index 5f1145065ac..e636517e84b 100644 --- a/starters/adapters/bun/package.json +++ b/starters/adapters/bun/package.json @@ -14,10 +14,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build a production-ready Bun app:", + "Now you can build a production-ready Bun app:", "", - " - bun run build: production build", - " - bun run serve: runs the production server locally" + "- bun run build: production build", + "- bun run serve: runs the production server locally" ] } } diff --git a/starters/adapters/cloud-run/package.json b/starters/adapters/cloud-run/package.json index b6905313544..aa9e1950b23 100644 --- a/starters/adapters/cloud-run/package.json +++ b/starters/adapters/cloud-run/package.json @@ -14,10 +14,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build and deploy to Google Cloud Run with:", + "Now you can build and deploy to Google Cloud Run with:", "", - " - pnpm run build: production build for Cloud Run", - " - pnpm run deploy: it will use the gcloud CLI to deploy your site" + "- pnpm run build: production build for Cloud Run", + "- pnpm run deploy: it will use the gcloud CLI to deploy your site" ] } } diff --git a/starters/adapters/cloudflare-pages/package.json b/starters/adapters/cloudflare-pages/package.json index 4076e346332..d06e1ed403a 100644 --- a/starters/adapters/cloudflare-pages/package.json +++ b/starters/adapters/cloudflare-pages/package.json @@ -18,10 +18,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build and deploy to Cloudflare Pages with:", + "Now you can build and deploy to Cloudflare Pages with:", "", - " - pnpm run build: production build for Cloudflare", - " - pnpm run deploy: it will use the Cloudflare CLI to deploy your site" + "- pnpm run build: production build for Cloudflare", + "- pnpm run deploy: it will use the Cloudflare CLI to deploy your site" ] } } diff --git a/starters/adapters/deno/package.json b/starters/adapters/deno/package.json index af302ef02e6..7f4b29dff10 100644 --- a/starters/adapters/deno/package.json +++ b/starters/adapters/deno/package.json @@ -14,10 +14,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build a production-ready Deno app:", + "Now you can build a production-ready Deno app:", "", - " - pnpm run build: production build", - " - pnpm run serve: runs the production server locally" + "- pnpm run build: production build", + "- pnpm run serve: runs the production server locally" ] } } diff --git a/starters/adapters/express/package.json b/starters/adapters/express/package.json index 9828a9c081e..8366724a47f 100644 --- a/starters/adapters/express/package.json +++ b/starters/adapters/express/package.json @@ -20,10 +20,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build a production-ready Express app:", + "Now you can build a production-ready Express app:", "", - " - pnpm run build: production build", - " - pnpm run serve: runs the production server locally" + "- pnpm run build: production build", + "- pnpm run serve: runs the production server locally" ] } } diff --git a/starters/adapters/fastify/package.json b/starters/adapters/fastify/package.json index 572a8710fe2..da95051dd0b 100644 --- a/starters/adapters/fastify/package.json +++ b/starters/adapters/fastify/package.json @@ -20,10 +20,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build a production-ready Fastify app:", + "Now you can build a production-ready Fastify app:", "", - " - pnpm run build: production build for Fastify", - " - pnpm run serve: runs the production server locally" + "- pnpm run build: production build for Fastify", + "- pnpm run serve: runs the production server locally" ] } } diff --git a/starters/adapters/firebase/package.json b/starters/adapters/firebase/package.json index af8e438765e..689ed5d21d9 100755 --- a/starters/adapters/firebase/package.json +++ b/starters/adapters/firebase/package.json @@ -17,8 +17,7 @@ "nextSteps": { "title": "Next Steps", "lines": [ - "", - " - cd functions && pnpm i" + "- cd functions && pnpm i" ] } } diff --git a/starters/adapters/netlify-edge/package.json b/starters/adapters/netlify-edge/package.json index f951b96ead5..9503228d59e 100644 --- a/starters/adapters/netlify-edge/package.json +++ b/starters/adapters/netlify-edge/package.json @@ -19,10 +19,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build and deploy to Netlify with:", + "Now you can build and deploy to Netlify with:", "", - " - pnpm run build: production build for Netlify", - " - pnpm run deploy: it will use the netlify CLI to deploy your site" + "- pnpm run build: production build for Netlify", + "- pnpm run deploy: it will use the netlify CLI to deploy your site" ] } } diff --git a/starters/adapters/node-server/package.json b/starters/adapters/node-server/package.json index 1336051c279..96669094de7 100644 --- a/starters/adapters/node-server/package.json +++ b/starters/adapters/node-server/package.json @@ -13,10 +13,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build a production-ready node app:", + "Now you can build a production-ready node app:", "", - " - pnpm run build: production build", - " - pnpm run serve: runs the production server locally" + "- pnpm run build: production build", + "- pnpm run serve: runs the production server locally" ] } } diff --git a/starters/adapters/static/package.json b/starters/adapters/static/package.json index 44dde557d11..998a086f062 100644 --- a/starters/adapters/static/package.json +++ b/starters/adapters/static/package.json @@ -11,8 +11,8 @@ ], "nextSteps": { "lines": [ - " You must change the 'origin' url under staticAdapter", - " inside 'vite.config.ts'" + "You must change the 'origin' url under staticAdapter", + "inside 'vite.config.ts'" ] } } diff --git a/starters/adapters/vercel-edge/package.json b/starters/adapters/vercel-edge/package.json index 8e405504bda..a8e34929749 100644 --- a/starters/adapters/vercel-edge/package.json +++ b/starters/adapters/vercel-edge/package.json @@ -18,10 +18,10 @@ "nextSteps": { "title": "Next Steps", "lines": [ - " Now you can build and deploy to Vercel with:", + "Now you can build and deploy to Vercel with:", "", - " - pnpm run build: production build for Vercel", - " - pnpm run deploy: it will use the Vercel CLI to deploy your site" + "- pnpm run build: production build for Vercel", + "- pnpm run deploy: it will use the Vercel CLI to deploy your site" ] } } From f0ab3c522d0400ee967db09d5690fdb74a0d902d Mon Sep 17 00:00:00 2001 From: Roman Zanettin Date: Sat, 16 Sep 2023 21:31:41 +0200 Subject: [PATCH 6/9] =?UTF-8?q?=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-lock.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a6555996f1..644fd950e96 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1326,8 +1326,8 @@ packages: '@builder.io/qwik-city': '>=0.6.0' dependencies: '@auth/core': 0.7.1 - '@builder.io/qwik': github.com/BuilderIo/qwik-build/4d4509af4baf2ef88a99c4280ba24dd22d2a7110(undici@5.22.1) - '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/da90f34fa48e1ed2f846120997f86310480c4c22(rollup@3.26.3) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) + '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414(rollup@3.26.3) dev: false /@builder.io/qwik-city@1.2.10(rollup@3.26.3): @@ -1356,7 +1356,7 @@ packages: react: '>=18.0.0' react-dom: '>=18.0.0' dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/4d4509af4baf2ef88a99c4280ba24dd22d2a7110(undici@5.22.1) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) '@types/react': 18.2.17 '@types/react-dom': 18.2.7 react: 18.2.0 @@ -1390,7 +1390,7 @@ packages: peerDependencies: '@builder.io/qwik': '>=1.0.0' dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/4d4509af4baf2ef88a99c4280ba24dd22d2a7110(undici@5.22.1) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) dev: true /@builder.io/vite-plugin-macro@0.0.7(@types/node@20.4.5)(rollup@3.26.3)(terser@5.19.2): @@ -2745,8 +2745,8 @@ packages: '@builder.io/qwik': ^1.0.0 '@builder.io/qwik-city': ^1.0.0 dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/4d4509af4baf2ef88a99c4280ba24dd22d2a7110(undici@5.22.1) - '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/da90f34fa48e1ed2f846120997f86310480c4c22(rollup@3.26.3) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) + '@builder.io/qwik-city': github.com/BuilderIo/qwik-city-build/80b973155c27bf23f16aaf6430aa6bc3170ce414(rollup@3.26.3) /@mui/base@5.0.0-beta.0(@types/react@18.2.17)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-ap+juKvt8R8n3cBqd/pGtZydQ4v2I/hgJKnvJRGjpSh3RvsvnDHO4rXov8MHQlH6VqpOekwgilFLGxMZjNTucA==} @@ -5553,7 +5553,7 @@ packages: peerDependencies: '@builder.io/qwik': '*' dependencies: - '@builder.io/qwik': github.com/BuilderIo/qwik-build/4d4509af4baf2ef88a99c4280ba24dd22d2a7110(undici@5.22.1) + '@builder.io/qwik': github.com/BuilderIo/qwik-build/48c1524f9b8dc7a356b1694e5468d389aee7daca(undici@5.22.1) dev: true /@vercel/nft@0.22.6(supports-color@9.4.0): From eb82650afcc4c03c495fba5a4a9ed189a2cd128d Mon Sep 17 00:00:00 2001 From: Eamon Heffernan Date: Sun, 17 Sep 2023 18:16:36 +0000 Subject: [PATCH 7/9] Match the changes in the other pr --- .../docs/src/routes/docs/deployments/bun/index.mdx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/docs/src/routes/docs/deployments/bun/index.mdx b/packages/docs/src/routes/docs/deployments/bun/index.mdx index 4168de7ab18..f5244eafa60 100644 --- a/packages/docs/src/routes/docs/deployments/bun/index.mdx +++ b/packages/docs/src/routes/docs/deployments/bun/index.mdx @@ -18,7 +18,13 @@ curl -fsSL https://bun.sh/install | bash For other platforms or if you run into issues with installation, up to date `bun` installation instructions can be found [on the bun website](https://bun.sh/docs/installation). -There currently is an issue with using `bun` as the package manager. Please use `npm install`. After dependencies are installed with `npm install`, `bun dev`, `bun run build` and other scripts from package.json can be executed with `bun`. +There currently is an issue with using `bun` as the package manager. If you run into issues using `bun install`, please add the following lines to your package.json file. +```json +"trustedDependencies": [ + "sharp" +] +``` +Then remove the node_modules folder and any lockfiles such as bun.lockb or package-lock.json. You may then run `bun install`. This issue is currently being tracked [on the bun repository](https://github.com/oven-sh/bun/issues/3783). To integrate the `bun` adapter, use the `add` command: @@ -50,4 +56,4 @@ bun run serve Since you are choosing Bun, here you are in your own, after running `bun run build`: - The `dist` folder will be created including all the static files. -- The `server` folder will be created including all node server files. +- The `server` folder will be created including all node server files. \ No newline at end of file From 54cf7906fca54ce51eef88643e19a1d929299c5c Mon Sep 17 00:00:00 2001 From: Eamon Heffernan <16983388+EamonHeffernan@users.noreply.github.com> Date: Mon, 18 Sep 2023 04:21:15 +1000 Subject: [PATCH 8/9] Update index.mdx --- packages/docs/src/routes/docs/deployments/bun/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/docs/src/routes/docs/deployments/bun/index.mdx b/packages/docs/src/routes/docs/deployments/bun/index.mdx index f5244eafa60..9b637d84f99 100644 --- a/packages/docs/src/routes/docs/deployments/bun/index.mdx +++ b/packages/docs/src/routes/docs/deployments/bun/index.mdx @@ -56,4 +56,4 @@ bun run serve Since you are choosing Bun, here you are in your own, after running `bun run build`: - The `dist` folder will be created including all the static files. -- The `server` folder will be created including all node server files. \ No newline at end of file +- The `server` folder will be created including all bun server files. From 44a4c844551d3b4975fca1493e1991d17f795135 Mon Sep 17 00:00:00 2001 From: Eamon Heffernan <16983388+EamonHeffernan@users.noreply.github.com> Date: Tue, 19 Sep 2023 04:23:25 +1000 Subject: [PATCH 9/9] Update index.mdx --- packages/docs/src/routes/docs/deployments/bun/index.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/docs/src/routes/docs/deployments/bun/index.mdx b/packages/docs/src/routes/docs/deployments/bun/index.mdx index 9b637d84f99..546ef6869b4 100644 --- a/packages/docs/src/routes/docs/deployments/bun/index.mdx +++ b/packages/docs/src/routes/docs/deployments/bun/index.mdx @@ -18,13 +18,14 @@ curl -fsSL https://bun.sh/install | bash For other platforms or if you run into issues with installation, up to date `bun` installation instructions can be found [on the bun website](https://bun.sh/docs/installation). -There currently is an issue with using `bun` as the package manager. If you run into issues using `bun install`, please add the following lines to your package.json file. +There currently is an issue with using `bun` as the package manager. +If you see the error `Something went wrong installing the "sharp" module` when using `bun` add the following code to your package.json, then remove the node_modules folder and any lockfiles such as bun.lockb or package-lock.json. You may then run `bun install`. + ```json "trustedDependencies": [ "sharp" ] ``` -Then remove the node_modules folder and any lockfiles such as bun.lockb or package-lock.json. You may then run `bun install`. This issue is currently being tracked [on the bun repository](https://github.com/oven-sh/bun/issues/3783). To integrate the `bun` adapter, use the `add` command: