create-riebeckite 0.0.9 → 0.0.12

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
@@ -21,6 +21,10 @@ npm exec riebeckite build
21
21
  | `--preset <name>` | Starter composition, e.g. `rich` (default: `starter`) |
22
22
  | `--force` | Scaffold even when the target directory is not empty |
23
23
  | `--list-presets` | Print the available presets and their descriptions, then exit |
24
+ | `--github-actions` | Generate the Cloudflare deployment workflow |
25
+ | `--content-repository <owner/repository>` | Check out this repository into `content/` during deployment (requires `--github-actions`) |
26
+ | `--site-repository <owner/repository>` | Site repository notified by the generated content workflow |
27
+ | `--notify-on-content-push` | Generate `github/notify-site.yml` for the content repository (requires Actions, content, and site repositories) |
24
28
 
25
29
  For example, scaffold with the `rich` preset:
26
30
 
@@ -28,6 +32,21 @@ For example, scaffold with the `rich` preset:
28
32
  npx create-riebeckite my-site --preset rich
29
33
  ```
30
34
 
35
+ To use a separate content repository and deploy after its `main` branch is
36
+ pushed, generate the common workflow once (the preset does not affect it):
37
+
38
+ ```sh
39
+ npx create-riebeckite my-site --github-actions \
40
+ --content-repository OWNER/notes \
41
+ --site-repository OWNER/my-site \
42
+ --notify-on-content-push
43
+ ```
44
+
45
+ Set `content.directory` to `"content"`, add the documented repository secrets,
46
+ then copy `github/notify-site.yml` into the content repository as
47
+ `.github/workflows/notify-site.yml`. See the [separate-content deployment
48
+ guide](../../templates/cloudflare/README_en.md).
49
+
31
50
  ## Presets
32
51
 
33
52
  List the available presets with `--list-presets`:
@@ -76,4 +95,4 @@ await scaffoldRiebeckiteSite({
76
95
  Riebeckite is an extensible framework for publishing Markdown and
77
96
  Obsidian-oriented notes on the web. See the
78
97
  [Riebeckite documentation](https://github.com/Rerurate514/riebeckite#readme)
79
- for configuration and plugin guidance.
98
+ for configuration and plugin guidance.
package/README_ja.md CHANGED
@@ -22,6 +22,10 @@ npm exec riebeckite build
22
22
  | `--preset <name>` | 使用するスターター構成(既定は `starter`) |
23
23
  | `--force` | 空でないディレクトリにも展開する |
24
24
  | `--list-presets` | 利用可能な preset と説明を一覧表示して終了する |
25
+ | `--github-actions` | Cloudflare へのデプロイ workflow を生成する |
26
+ | `--content-repository <owner/repository>` | デプロイ時にこのリポジトリを `content/` へ checkout する(`--github-actions` が必要) |
27
+ | `--site-repository <owner/repository>` | 生成する記事通知 workflow が通知する site リポジトリ |
28
+ | `--notify-on-content-push` | 記事リポジトリ用の `github/notify-site.yml` を生成する(Actions、記事・site リポジトリが必要) |
25
29
 
26
30
  たとえば、`rich` preset で生成する場合は次のようにします。
27
31
 
@@ -29,6 +33,21 @@ npm exec riebeckite build
29
33
  npx create-riebeckite my-site --preset rich
30
34
  ```
31
35
 
36
+ 別の記事リポジトリを使い、その `main` への push でデプロイする場合は、共通の
37
+ workflow を一度だけ生成します。preset による違いはありません。
38
+
39
+ ```sh
40
+ npx create-riebeckite my-site --github-actions \
41
+ --content-repository OWNER/notes \
42
+ --site-repository OWNER/my-site \
43
+ --notify-on-content-push
44
+ ```
45
+
46
+ `content.directory` は `"content"` にし、必要な repository Secret を登録した後、
47
+ `github/notify-site.yml` を記事リポジトリの
48
+ `.github/workflows/notify-site.yml` にコピーします。詳細は[別記事リポジトリの
49
+ デプロイガイド](../../templates/cloudflare/README_ja.md)を参照してください。
50
+
32
51
  ## Preset
33
52
 
34
53
  利用可能な preset は `--list-presets` で確認できます。
@@ -62,4 +81,4 @@ npx create-riebeckite --list-presets
62
81
  Riebeckite は、Markdown や Obsidian 由来のノートを Web で公開するための
63
82
  拡張可能なフレームワークです。設定方法やプラグインについては
64
83
  [Riebeckite ドキュメント](https://github.com/Rerurate514/riebeckite#readme)
65
- を参照してください。
84
+ を参照してください。
@@ -4,5 +4,9 @@ export type CreateRiebeckiteOptions = {
4
4
  readonly force: boolean;
5
5
  readonly preset: ScaffoldPresetName;
6
6
  readonly listPresets: boolean;
7
+ readonly githubActions: boolean;
8
+ readonly contentRepository?: string;
9
+ readonly siteRepository?: string;
10
+ readonly notifyOnContentPush: boolean;
7
11
  };
8
12
  export declare function runCreateRiebeckite(arguments_: readonly string[]): Promise<void>;
package/dist/src/index.js CHANGED
@@ -26,12 +26,22 @@ async function runCreateRiebeckite(arguments_) {
26
26
  const result = await scaffoldRiebeckiteSite({
27
27
  targetDirectory,
28
28
  overwrite: options.force,
29
- preset: options.preset
29
+ preset: options.preset,
30
+ githubActions: options.githubActions,
31
+ contentRepository: options.contentRepository,
32
+ siteRepository: options.siteRepository,
33
+ notifyOnContentPush: options.notifyOnContentPush
30
34
  });
31
35
  const relative = path.relative(process.cwd(), result.targetDirectory) || ".";
32
36
  console.log(`Created a ${options.preset} Riebeckite site in ${relative}`);
33
37
  console.log("");
34
38
  console.log(formatScaffoldNextSteps(relative));
39
+ if (options.notifyOnContentPush) {
40
+ console.log("");
41
+ console.log(
42
+ "Copy github/notify-site.yml to the content repository as .github/workflows/notify-site.yml."
43
+ );
44
+ }
35
45
  } catch (error) {
36
46
  if (error instanceof ScaffoldSiteError) {
37
47
  console.error(error.message);
@@ -46,6 +56,10 @@ function parseArguments(arguments_) {
46
56
  let force = false;
47
57
  let preset;
48
58
  let listPresets = false;
59
+ let githubActions = false;
60
+ let contentRepository;
61
+ let siteRepository;
62
+ let notifyOnContentPush = false;
49
63
  for (let index = 0; index < arguments_.length; index += 1) {
50
64
  const argument = arguments_[index];
51
65
  if (argument === "--force") {
@@ -56,6 +70,24 @@ function parseArguments(arguments_) {
56
70
  listPresets = true;
57
71
  continue;
58
72
  }
73
+ if (argument === "--github-actions") {
74
+ githubActions = true;
75
+ continue;
76
+ }
77
+ if (argument === "--notify-on-content-push") {
78
+ notifyOnContentPush = true;
79
+ continue;
80
+ }
81
+ if (argument === "--content-repository" || argument === "--site-repository") {
82
+ const value = arguments_[index + 1];
83
+ if (value === void 0 || value.startsWith("-")) {
84
+ throw new Error(`${argument} requires an owner/repository value.`);
85
+ }
86
+ if (argument === "--content-repository") contentRepository = value;
87
+ else siteRepository = value;
88
+ index += 1;
89
+ continue;
90
+ }
59
91
  if (argument === "--preset") {
60
92
  const value = arguments_[index + 1];
61
93
  if (value === void 0 || !isScaffoldPresetName(value)) {
@@ -72,7 +104,7 @@ function parseArguments(arguments_) {
72
104
  }
73
105
  if (directory !== void 0) {
74
106
  throw new Error(
75
- "Usage: create-riebeckite [directory] [--preset <name>] [--force]"
107
+ "Usage: create-riebeckite [directory] [--preset <name>] [--github-actions] [--content-repository <owner/repository>] [--site-repository <owner/repository>] [--notify-on-content-push] [--force]"
76
108
  );
77
109
  }
78
110
  directory = argument;
@@ -81,7 +113,11 @@ function parseArguments(arguments_) {
81
113
  directory: directory ?? ".",
82
114
  force,
83
115
  preset: preset ?? "starter",
84
- listPresets
116
+ listPresets,
117
+ githubActions,
118
+ contentRepository,
119
+ siteRepository,
120
+ notifyOnContentPush
85
121
  };
86
122
  }
87
123
  function printPresets() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-riebeckite",
3
- "version": "0.0.9",
3
+ "version": "0.0.12",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -27,7 +27,7 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@riebeckite/honox": "0.0.9"
30
+ "@riebeckite/honox": "0.0.12"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",