hono-decks 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +5 -3
- package/README.md +6 -4
- package/dist/bin.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/{init-vite-F2gLT72s.js → init-vite-abCCwOcl.js} +5 -3
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -9,7 +9,7 @@ Hono と Cloudflare Workers 上で MDX のスライドを配信するための
|
|
|
9
9
|
既存のアプリに `hono-decks` をインストールし、構成に合わせて初期設定します。
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install hono-decks
|
|
12
|
+
npm install hono-decks@latest
|
|
13
13
|
|
|
14
14
|
# Hono+Vite
|
|
15
15
|
npx hono-decks init --framework hono
|
|
@@ -22,6 +22,8 @@ npm run dev
|
|
|
22
22
|
npm run build
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
新規導入では`@latest`で現在の公開版を選びます。同じ環境を再現する場合は、動作確認したバージョンを明示してください。
|
|
26
|
+
|
|
25
27
|
どちらも、既存の Vite 設定を保持して自動コンパイルを登録し、
|
|
26
28
|
`hono-decks.config.ts`、`src/decks.ts`、サンプルの
|
|
27
29
|
`decks/welcome/deck.mdx` を作ります。生成ファイルがない状態からでも
|
|
@@ -70,11 +72,11 @@ npm run build
|
|
|
70
72
|
```
|
|
71
73
|
|
|
72
74
|
この連携には standalone compiler/client export を持つアダプターが必要です。
|
|
73
|
-
新規インストールの既定値は `void-plugin-hono-jsx@^0.
|
|
75
|
+
新規インストールの既定値は `void-plugin-hono-jsx@^0.7.0` です。
|
|
74
76
|
`--install` は、インストール済みの互換アダプターを維持します。
|
|
75
77
|
`--install` を省略する場合は、Markdown 用の任意 peer も必要です:
|
|
76
78
|
`markdown-exit@^1.3.0 yaml@^2.9.1 markdown-it-container@^4.0.0 shiki@^4.5.0 @shikijs/transformers@^4.5.0`。
|
|
77
|
-
動作確認した組み合わせは Void 1.1
|
|
79
|
+
動作確認した組み合わせは Node >=24.22.1 <25、Void 1.2.1、Vite 8.3.4、Hono 4.13.13 です。既存のVoid 1.1.11アプリでは互換性のある0.6アダプターを維持し、未導入の場合も0.6を選択します。0.7では[Void/Cloudflare依存の既知リスク](https://github.com/ts-76/void-plugin-hono-jsx/blob/v0.7.0/docs/dependency-security.md)が残ります。
|
|
78
80
|
|
|
79
81
|
`--install` は npm/pnpm/Yarn/Bun を packageManager または lockfile から判定し、
|
|
80
82
|
不足する依存だけを追加します。互換性のない既存バージョンは自動更新せずエラーにします。
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ hono-decks serves MDX slide decks from Hono applications and Cloudflare Workers.
|
|
|
9
9
|
Install hono-decks in an existing app and choose its integration:
|
|
10
10
|
|
|
11
11
|
~~~sh
|
|
12
|
-
npm install hono-decks
|
|
12
|
+
npm install hono-decks@latest
|
|
13
13
|
|
|
14
14
|
# Hono + Vite
|
|
15
15
|
npx hono-decks init --framework hono
|
|
@@ -22,6 +22,8 @@ npm run dev
|
|
|
22
22
|
npm run build
|
|
23
23
|
~~~
|
|
24
24
|
|
|
25
|
+
For a new app, `@latest` selects the current published release. To reproduce a setup, replace it with the exact version you have verified.
|
|
26
|
+
|
|
25
27
|
Both modes preserve the existing Vite config while adding automatic compilation,
|
|
26
28
|
create `hono-decks.config.ts`, `src/decks.ts`, and a sample
|
|
27
29
|
`decks/welcome/deck.mdx`. Generated code stays in Vite virtual modules and is not written to disk.
|
|
@@ -69,10 +71,10 @@ npm run build
|
|
|
69
71
|
~~~
|
|
70
72
|
|
|
71
73
|
This integration requires an adapter with the `/markdown/compiler` and
|
|
72
|
-
`/markdown/client` exports. New installations default to `void-plugin-hono-jsx@^0.
|
|
74
|
+
`/markdown/client` exports. New installations default to `void-plugin-hono-jsx@^0.7.0`;
|
|
73
75
|
`--install` preserves an already installed compatible adapter. Without `--install`, also install the optional Markdown peers:
|
|
74
76
|
`markdown-exit@^1.3.0 yaml@^2.9.1 markdown-it-container@^4.0.0 shiki@^4.5.0 @shikijs/transformers@^4.5.0`.
|
|
75
|
-
The verified host versions are Void 1.1
|
|
77
|
+
The verified host versions are Void 1.2.1, Vite 8.3.4, and Hono 4.13.13 on Node >=24.22.1 <25. Existing Void 1.1.11 apps keep their compatible 0.6 adapter; if it is missing, init selects 0.6 rather than forcing a host upgrade. Adapter 0.7 retains the documented [Void/Cloudflare dependency risks](https://github.com/ts-76/void-plugin-hono-jsx/blob/v0.7.0/docs/dependency-security.md).
|
|
76
78
|
|
|
77
79
|
`--install` selects npm/pnpm/Yarn/Bun from packageManager or lockfiles and installs
|
|
78
80
|
missing dependencies. Incompatible installed versions require an explicit update;
|
|
@@ -465,7 +467,7 @@ At this level, the application owns the mount path, source policy, and option me
|
|
|
465
467
|
## Void Hono Markdown
|
|
466
468
|
|
|
467
469
|
Set `build.markdown: "void"` in `hono-decks.config.ts` to opt into `.md` decks
|
|
468
|
-
alongside MDX. This requires `void-plugin-hono-jsx@^0.
|
|
470
|
+
alongside MDX. This requires `void-plugin-hono-jsx@^0.7.0` with its standalone compiler and client exports.
|
|
469
471
|
See the [Void consumer fixture](https://github.com/ts-76/hono-decks/tree/main/fixtures/void-markdown)
|
|
470
472
|
for package verification, Void middleware hosting, supported syntax and limitations.
|
|
471
473
|
|
package/dist/bin.js
CHANGED
|
@@ -2350,7 +2350,7 @@ async function runInitCommand(input, args, stdout, stderr) {
|
|
|
2350
2350
|
return { exitCode: 1 };
|
|
2351
2351
|
}
|
|
2352
2352
|
if (parsed.options.framework) try {
|
|
2353
|
-
const { initializeVite } = await import("./init-vite-
|
|
2353
|
+
const { initializeVite } = await import("./init-vite-abCCwOcl.js");
|
|
2354
2354
|
const sampleSlug = await initializeVite(input.cwd, parsed.options.framework, parsed.options.configFile, parsed.options.entry, parsed.options.install ? { adapter: parsed.options.adapter } : void 0);
|
|
2355
2355
|
stdout(`Initialized ${parsed.options.framework} decks at /slides/${sampleSlug}. Run your usual dev or build command; no manual compile is needed.`);
|
|
2356
2356
|
return { exitCode: 0 };
|
package/dist/cli.js
CHANGED
|
@@ -2349,7 +2349,7 @@ async function runInitCommand(input, args, stdout, stderr) {
|
|
|
2349
2349
|
return { exitCode: 1 };
|
|
2350
2350
|
}
|
|
2351
2351
|
if (parsed.options.framework) try {
|
|
2352
|
-
const { initializeVite } = await import("./init-vite-
|
|
2352
|
+
const { initializeVite } = await import("./init-vite-abCCwOcl.js");
|
|
2353
2353
|
const sampleSlug = await initializeVite(input.cwd, parsed.options.framework, parsed.options.configFile, parsed.options.entry, parsed.options.install ? { adapter: parsed.options.adapter } : void 0);
|
|
2354
2354
|
stdout(`Initialized ${parsed.options.framework} decks at /slides/${sampleSlug}. Run your usual dev or build command; no manual compile is needed.`);
|
|
2355
2355
|
return { exitCode: 0 };
|
|
@@ -9,7 +9,7 @@ import { execFile } from "node:child_process";
|
|
|
9
9
|
//#region src/adapters/void.ts
|
|
10
10
|
/** Dependency policy of the Void preset, outside the deck compiler. */
|
|
11
11
|
const voidDependencies = [
|
|
12
|
-
["void", "void@>=1.1
|
|
12
|
+
["void", "void@>=1.2.1 <1.3.0"],
|
|
13
13
|
["vite", "vite@^8.0.16"],
|
|
14
14
|
["hono", "hono@^4.13.13"],
|
|
15
15
|
["markdown-exit", "markdown-exit@^1.3.0"],
|
|
@@ -47,6 +47,7 @@ async function installVoidDependencies(cwd, options = {}) {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
const required = voidDependencies;
|
|
50
|
+
let legacyVoid = false;
|
|
50
51
|
for (const [id, spec] of required) {
|
|
51
52
|
if (missing(id)) continue;
|
|
52
53
|
const version = await installedVersion(require.resolve(id), id);
|
|
@@ -55,7 +56,8 @@ async function installVoidDependencies(cwd, options = {}) {
|
|
|
55
56
|
const value = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
|
|
56
57
|
const min = minimum.slice(1).map(Number);
|
|
57
58
|
const current = value?.slice(1).map(Number);
|
|
58
|
-
if (!current || current[0] !== min[0] || id === "void"
|
|
59
|
+
if (!current || current[0] !== min[0] || (id === "void" ? !(current[1] === 1 && current[2] >= 11 || current[1] === 2 && current[2] >= 1) : compare(current, min) < 0)) throw new Error(`Installed ${id}@${version} is incompatible with ${spec}. Update it explicitly before --install.`);
|
|
60
|
+
if (id === "void") legacyVoid = current[1] === 1;
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
const specs = required.filter(([id]) => missing(id)).map(([, spec]) => spec);
|
|
@@ -81,7 +83,7 @@ async function installVoidDependencies(cwd, options = {}) {
|
|
|
81
83
|
specs.push(`hono-decks@${requested}`);
|
|
82
84
|
}
|
|
83
85
|
if (options.adapter || missing("void-plugin-hono-jsx/markdown/compiler")) {
|
|
84
|
-
let adapter = options.adapter ??
|
|
86
|
+
let adapter = options.adapter ?? `void-plugin-hono-jsx@${legacyVoid ? "^0.6.0" : "^0.7.0"}`;
|
|
85
87
|
if (/^\d+\./.test(adapter)) adapter = "void-plugin-hono-jsx@" + adapter;
|
|
86
88
|
else if (modernYarn && (adapter.endsWith(".tgz") || adapter.startsWith("file:"))) adapter = "void-plugin-hono-jsx@file:" + resolve(cwd, adapter.replace(/^file:/, ""));
|
|
87
89
|
specs.push(adapter);
|