From bd67c4fbabe86406a1b6e467fdaee8522f5d3497 Mon Sep 17 00:00:00 2001 From: lunadogbot Date: Sun, 17 May 2026 03:20:22 +0000 Subject: [PATCH 1/2] docs: clarify deno x JSR entry points --- runtime/reference/cli/x.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/runtime/reference/cli/x.md b/runtime/reference/cli/x.md index 507697ea1..734d54022 100644 --- a/runtime/reference/cli/x.md +++ b/runtime/reference/cli/x.md @@ -1,5 +1,5 @@ --- -last_modified: 2025-12-10 +last_modified: 2026-05-17 title: "deno x" command: x openGraphLayout: "/open_graph/cli-commands.jsx" @@ -52,6 +52,37 @@ resolves the package's binary entry point, and executes it. The package is not added to your project's [`deno.json`](/runtime/fundamentals/configuration/) or `package.json`. +### JSR executable entry points + +JSR packages do not use the `package.json` `bin` field. When you run +`deno x jsr:`, Deno resolves the JSR specifier through the package's +`exports` field in [`deno.json`](/runtime/fundamentals/configuration/) or +`jsr.json`, then runs the resolved module. + +To make a JSR package runnable with `deno x`, publish a module that can run as a +script and expose it from `exports`: + +```json title="deno.json" +{ + "name": "@scope/tool", + "version": "1.0.0", + "exports": { + ".": "./mod.ts", + "./cli": "./cli.ts" + } +} +``` + +With this configuration, users run the CLI entry point with: + +```sh +deno x jsr:@scope/tool/cli +``` + +If the package is only meant to be used as a command, point the root export at +the CLI module instead, for example `"exports": "./cli.ts"`, so +`deno x jsr:@scope/tool` runs that module. + ## Permissions The executed package runs with the permissions you specify: From f7b1e1535292aa38edc2693e544afdd9fb8724bb Mon Sep 17 00:00:00 2001 From: lunadogbot Date: Sun, 17 May 2026 07:48:42 +0000 Subject: [PATCH 2/2] Revert "docs: clarify deno x JSR entry points" This reverts commit bd67c4fbabe86406a1b6e467fdaee8522f5d3497. --- runtime/reference/cli/x.md | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/runtime/reference/cli/x.md b/runtime/reference/cli/x.md index 734d54022..507697ea1 100644 --- a/runtime/reference/cli/x.md +++ b/runtime/reference/cli/x.md @@ -1,5 +1,5 @@ --- -last_modified: 2026-05-17 +last_modified: 2025-12-10 title: "deno x" command: x openGraphLayout: "/open_graph/cli-commands.jsx" @@ -52,37 +52,6 @@ resolves the package's binary entry point, and executes it. The package is not added to your project's [`deno.json`](/runtime/fundamentals/configuration/) or `package.json`. -### JSR executable entry points - -JSR packages do not use the `package.json` `bin` field. When you run -`deno x jsr:`, Deno resolves the JSR specifier through the package's -`exports` field in [`deno.json`](/runtime/fundamentals/configuration/) or -`jsr.json`, then runs the resolved module. - -To make a JSR package runnable with `deno x`, publish a module that can run as a -script and expose it from `exports`: - -```json title="deno.json" -{ - "name": "@scope/tool", - "version": "1.0.0", - "exports": { - ".": "./mod.ts", - "./cli": "./cli.ts" - } -} -``` - -With this configuration, users run the CLI entry point with: - -```sh -deno x jsr:@scope/tool/cli -``` - -If the package is only meant to be used as a command, point the root export at -the CLI module instead, for example `"exports": "./cli.ts"`, so -`deno x jsr:@scope/tool` runs that module. - ## Permissions The executed package runs with the permissions you specify: