From ebad3d15eca80d1e0b352fb1d70af86e09d607da Mon Sep 17 00:00:00 2001 From: dswbx Date: Sat, 25 Oct 2025 10:34:24 +0200 Subject: [PATCH] Enhance Deno integration documentation with installation instructions and versioning options --- .../integration/(runtimes)/deno.mdx | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/docs/content/docs/(documentation)/integration/(runtimes)/deno.mdx b/docs/content/docs/(documentation)/integration/(runtimes)/deno.mdx index a26ada2..dbebcaa 100644 --- a/docs/content/docs/(documentation)/integration/(runtimes)/deno.mdx +++ b/docs/content/docs/(documentation)/integration/(runtimes)/deno.mdx @@ -4,6 +4,20 @@ description: "Run bknd inside Deno" tags: ["documentation"] --- +## Installation + +To get started with Deno and bknd you can either install the package manually, and follow the descriptions below, or use the CLI starter: + +### CLI Starter + +Create a new Deno CLI starter project by running the following command: + +```sh +deno run npm:bknd create -i deno +``` + +### Manual + Deno is fully supported as a runtime for bknd. If you plan to solely use the API, the setup is pretty straightforward. ```ts title="main.ts" @@ -24,7 +38,7 @@ export default { In order to also serve the static assets of the admin UI, you have 3 choices: -1. Use the `serveStaticViaImport` function to serve the static assets from the `bknd` package directly (requires unstable `raw-imports`). +1. Use the `serveStaticViaImport` function to serve the static assets from the `bknd` package directly. Requires unstable `raw-imports`, but it's the easiest way to serve the static assets. 2. Copy the static assets to your local project and use Hono's `serveStatic` middleware. 3. Use the `adminOptions.assetsPath` property to point to a remote address with the static assets. @@ -55,6 +69,28 @@ export default { }; ``` +In case you don't want to point your bknd dependency to the latest version, either add an `imports` section to your `deno.json` file: + +```json title="deno.json" +{ + "imports": { + "bknd": "npm:bknd@" // [!code highlight] + } +} +``` + +Or specify the package with the version specified to the `serveStaticViaImport` function: + +```ts +const app = await createRuntimeApp({ + serveStatic: serveStaticViaImport({ + package: "bknd@", // [!code highlight] + }), +}); +``` + +Replace `` with the version you want to use. + ### `serveStatic` from local files You can also serve the static assets from your local project by using Hono's `serveStatic` middleware. You can do so by copying the static assets to your local project and using the `serveStatic` middleware. First, you have to copy the static assets, by running the following command: