create-riebeckite 0.0.4 → 0.0.5

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.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # create-riebeckite
2
2
 
3
- Create a new Riebeckite site from the official starter template.
3
+ Create a new Riebeckite site from an official starter preset.
4
4
 
5
5
  ## Usage
6
6
 
@@ -11,9 +11,67 @@ npm install
11
11
  npx riebeckite build
12
12
  ```
13
13
 
14
- Pass `--force` to scaffold into a non-empty directory.
14
+ ## Options
15
+
16
+ | Option | Description |
17
+ | --- | --- |
18
+ | `[directory]` | Directory to scaffold into (default: the current directory) |
19
+ | `--preset <name>` | Starter composition, e.g. `rich` (default: `starter`) |
20
+ | `--force` | Scaffold even when the target directory is not empty |
21
+ | `--list-presets` | Print the available presets and their descriptions, then exit |
22
+
23
+ For example, scaffold with the `rich` preset:
24
+
25
+ ```sh
26
+ npx create-riebeckite my-site --preset rich
27
+ ```
28
+
29
+ ## Presets
30
+
31
+ List the available presets with `--list-presets`:
32
+
33
+ ```sh
34
+ npx create-riebeckite --list-presets
35
+ ```
36
+
37
+ Every preset is a self-contained starter description. From smallest to
38
+ largest:
39
+
40
+ | Preset | Theme | Plugins | Content pages |
41
+ | ------- | ------------ | ------- | ---------------------------------------------------- |
42
+ | `empty` | none | none | none (static index) |
43
+ | `minimal` | minimal | 1 | index |
44
+ | `starter` | default | 3 | index (7 languages) |
45
+ | `rich` | default | 8 | index, framework/plugins, framework/themes (7 languages) |
46
+ | `full` | default | 23 | rich + guide |
47
+ | `max` | default | 46 | full + examples |
48
+ | `ultra` | default | 52 | max + reference/plugins, reference/themes |
49
+
50
+ Each preset has a one-line description, shown by `--list-presets`:
51
+
52
+ - `empty` — A blank application shell: no plugins, theme, content, or components.
53
+ - `minimal` — The smallest useful site: Obsidian Markdown, the minimal theme, one page.
54
+ - `starter` — The default starter: Obsidian Markdown, color mode, seven languages, and a site header.
55
+ - `rich` — Publishing and reading plugins plus guided ecosystem tour pages in seven languages.
56
+ - `full` — A ready blog: discovery, media, and reading plugins plus a build guide.
57
+ - `max` — Diagram and knowledge plugins on top of `full`, with showcase example pages.
58
+ - `ultra` — The full plugin catalog and theme reference pages — everything the ecosystem offers.
59
+
60
+ Presets are defined in `@riebeckite/honox` and can be imported into your own
61
+ tooling:
62
+
63
+ ```ts
64
+ import { scaffoldRiebeckiteSite, rich } from "@riebeckite/honox";
65
+
66
+ await scaffoldRiebeckiteSite({
67
+ targetDirectory: "./my-site",
68
+ preset: rich,
69
+ });
70
+ ```
71
+
72
+ ## Further reading
15
73
 
16
74
  Riebeckite is an extensible framework for publishing Markdown and
17
75
  Obsidian-oriented notes on the web. See the
18
76
  [Riebeckite documentation](https://github.com/Rerurate514/riebeckite#readme)
19
- for configuration and plugin guidance.
77
+ for configuration and plugin guidance.
package/README_ja.md ADDED
@@ -0,0 +1,65 @@
1
+ # create-riebeckite
2
+
3
+ 公式スターターテンプレートから、新しい Riebeckite サイトを作成するための
4
+ CLI ツールです。
5
+
6
+ [English](./README.md)
7
+
8
+ ## 使い方
9
+
10
+ ```sh
11
+ npx create-riebeckite my-site
12
+ cd my-site
13
+ npm install
14
+ npx riebeckite build
15
+ ```
16
+
17
+ ## オプション
18
+
19
+ | オプション | 説明 |
20
+ | --- | --- |
21
+ | `[directory]` | 生成先ディレクトリ(既定はカレントディレクトリ) |
22
+ | `--preset <name>` | 使用するスターター構成(既定は `starter`) |
23
+ | `--force` | 空でないディレクトリにも展開する |
24
+ | `--list-presets` | 利用可能な preset と説明を一覧表示して終了する |
25
+
26
+ たとえば、`rich` preset で生成する場合は次のようにします。
27
+
28
+ ```sh
29
+ npx create-riebeckite my-site --preset rich
30
+ ```
31
+
32
+ ## Preset
33
+
34
+ 利用可能な preset は `--list-presets` で確認できます。
35
+
36
+ ```sh
37
+ npx create-riebeckite --list-presets
38
+ ```
39
+
40
+ すべての preset は自己完結のスターターで、小さいものから順に次のとおりです。
41
+
42
+ | Preset | Theme | Plugins | コンテンツページ |
43
+ | --- | --- | --- | --- |
44
+ | `empty` | なし | なし | なし(静的インデックスのみ) |
45
+ | `minimal` | minimal | 1 | index |
46
+ | `starter` | default | 3 | index(7 言語) |
47
+ | `rich` | default | 8 | index、framework/plugins、framework/themes(7 言語) |
48
+ | `full` | default | 23 | rich + guide |
49
+ | `max` | default | 46 | full + examples |
50
+ | `ultra` | default | 52 | max + reference/plugins、reference/themes |
51
+
52
+ 各 preset の説明は次のとおりです(`--list-presets` で表示される内容と同じです)。
53
+
54
+ - `empty` — 空のアプリケーションシェル(Plugin・Theme・コンテンツ・コンポーネントなし)
55
+ - `minimal` — 最小構成のサイト(Obsidian Markdown、minimal Theme、1 ページ)
56
+ - `starter` — 標準のスターター(Obsidian Markdown、カラーモード、7 言語、サイトヘッダー)
57
+ - `rich` — 公開・閲覧向け Plugin と、エコシステムを紹介するページ(7 言語)
58
+ - `full` — ブログ一式(検索・メディア・関連記事などの Plugin とビルドガイド)
59
+ - `max` — `full` に図表・ナレッジ系 Plugin とサンプルページを追加
60
+ - `ultra` — 全 Plugin カタログと Theme リファレンスページ(エコシステムの一式)
61
+
62
+ Riebeckite は、Markdown や Obsidian 由来のノートを Web で公開するための
63
+ 拡張可能なフレームワークです。設定方法やプラグインについては
64
+ [Riebeckite ドキュメント](https://github.com/Rerurate514/riebeckite#readme)
65
+ を参照してください。
@@ -1,5 +1,8 @@
1
+ import { type ScaffoldPresetName } from "@riebeckite/honox";
1
2
  export type CreateRiebeckiteOptions = {
2
3
  readonly directory: string;
3
4
  readonly force: boolean;
5
+ readonly preset: ScaffoldPresetName;
6
+ readonly listPresets: boolean;
4
7
  };
5
8
  export declare function runCreateRiebeckite(arguments_: readonly string[]): Promise<void>;
package/dist/src/index.js CHANGED
@@ -1,6 +1,12 @@
1
1
  // src/index.ts
2
2
  import path from "node:path";
3
- import { ScaffoldSiteError, scaffoldRiebeckiteSite } from "@riebeckite/honox";
3
+ import {
4
+ isScaffoldPresetName,
5
+ SCAFFOLD_PRESET_NAMES,
6
+ ScaffoldSiteError,
7
+ scaffoldPresets,
8
+ scaffoldRiebeckiteSite
9
+ } from "@riebeckite/honox";
4
10
  async function runCreateRiebeckite(arguments_) {
5
11
  let options;
6
12
  try {
@@ -10,14 +16,19 @@ async function runCreateRiebeckite(arguments_) {
10
16
  process.exitCode = 1;
11
17
  return;
12
18
  }
19
+ if (options.listPresets) {
20
+ printPresets();
21
+ return;
22
+ }
13
23
  const targetDirectory = path.resolve(process.cwd(), options.directory);
14
24
  try {
15
25
  const result = await scaffoldRiebeckiteSite({
16
26
  targetDirectory,
17
- overwrite: options.force
27
+ overwrite: options.force,
28
+ preset: options.preset
18
29
  });
19
30
  const relative = path.relative(process.cwd(), result.targetDirectory) || ".";
20
- console.log(`Created a Riebeckite site in ${relative}`);
31
+ console.log(`Created a ${options.preset} Riebeckite site in ${relative}`);
21
32
  console.log("");
22
33
  console.log("Next steps:");
23
34
  if (relative !== ".") console.log(` cd ${relative}`);
@@ -36,20 +47,52 @@ async function runCreateRiebeckite(arguments_) {
36
47
  function parseArguments(arguments_) {
37
48
  let directory;
38
49
  let force = false;
39
- for (const argument of arguments_) {
50
+ let preset;
51
+ let listPresets = false;
52
+ for (let index = 0; index < arguments_.length; index += 1) {
53
+ const argument = arguments_[index];
40
54
  if (argument === "--force") {
41
55
  force = true;
42
56
  continue;
43
57
  }
58
+ if (argument === "--list-presets") {
59
+ listPresets = true;
60
+ continue;
61
+ }
62
+ if (argument === "--preset") {
63
+ const value = arguments_[index + 1];
64
+ if (value === void 0 || !isScaffoldPresetName(value)) {
65
+ throw new Error(
66
+ `Unknown preset: ${value ?? "(missing)"}. Available presets: ${SCAFFOLD_PRESET_NAMES.join(", ")}.`
67
+ );
68
+ }
69
+ preset = value;
70
+ index += 1;
71
+ continue;
72
+ }
44
73
  if (argument.startsWith("-")) {
45
74
  throw new Error(`Unknown option: ${argument}`);
46
75
  }
47
76
  if (directory !== void 0) {
48
- throw new Error("Usage: create-riebeckite [directory] [--force]");
77
+ throw new Error(
78
+ "Usage: create-riebeckite [directory] [--preset <name>] [--force]"
79
+ );
49
80
  }
50
81
  directory = argument;
51
82
  }
52
- return { directory: directory ?? ".", force };
83
+ return {
84
+ directory: directory ?? ".",
85
+ force,
86
+ preset: preset ?? "starter",
87
+ listPresets
88
+ };
89
+ }
90
+ function printPresets() {
91
+ console.log("Available presets:");
92
+ console.log("");
93
+ for (const name of SCAFFOLD_PRESET_NAMES) {
94
+ console.log(` ${name}: ${scaffoldPresets[name].description}`);
95
+ }
53
96
  }
54
97
  export {
55
98
  runCreateRiebeckite
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-riebeckite",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -19,6 +19,7 @@
19
19
  "files": [
20
20
  "LICENSE",
21
21
  "README.md",
22
+ "README_ja.md",
22
23
  "bin",
23
24
  "dist"
24
25
  ],
@@ -26,7 +27,7 @@
26
27
  "access": "public"
27
28
  },
28
29
  "dependencies": {
29
- "@riebeckite/honox": "0.0.4"
30
+ "@riebeckite/honox": "0.0.5"
30
31
  },
31
32
  "repository": {
32
33
  "type": "git",