lism-cli 0.4.0 → 0.4.2

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
@@ -9,9 +9,9 @@
9
9
  ## コマンド体系
10
10
 
11
11
  ```
12
- lism create [targetDir] [--template <name>] # templates から新規プロジェクト
13
- lism ui { init | add <names...> | list } # Lism UI コンポーネントの追加
14
- lism skill { add | check | update } # AI エージェント向け SKILL.md 配置
12
+ lism create [targetDir] [--template <name|category>] # templates から新規プロジェクト
13
+ lism ui { init | add <names...> | list } # Lism UI コンポーネントの追加
14
+ lism skill { add | check | update } # AI エージェント向け SKILL.md 配置
15
15
  ```
16
16
 
17
17
  ## 使い方
@@ -24,6 +24,9 @@ pnpm dlx lism-cli create
24
24
 
25
25
  # テンプレート名・出力先を指定
26
26
  pnpm dlx lism-cli create --template minimal-astro ./my-app
27
+
28
+ # カテゴリ名を指定(stack 以下の選択を対話で続行)
29
+ pnpm dlx lism-cli create --template minimal ./my-app
27
30
  ```
28
31
 
29
32
  同じ動作は `pnpm create lism` / `npm create lism@latest` でも呼び出せます(`create-lism` パッケージ経由)。
@@ -21,8 +21,8 @@ var messages = {
21
21
  en: "Target directory"
22
22
  },
23
23
  "cli.create.opt.template": {
24
- ja: "\u4F7F\u7528\u3059\u308B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u540D\uFF08\u4F8B: minimal-astro\uFF09",
25
- en: "Template name to use (e.g. minimal-astro)"
24
+ ja: "\u4F7F\u7528\u3059\u308B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u540D\u307E\u305F\u306F\u30AB\u30C6\u30B4\u30EA\u540D\uFF08\u4F8B: minimal-astro / minimal\uFF09",
25
+ en: "Template or category name to use (e.g. minimal-astro / minimal)"
26
26
  },
27
27
  "cli.create.opt.force": {
28
28
  ja: "\u65E2\u5B58\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5F37\u5236\u4E0A\u66F8\u304D",
@@ -130,8 +130,8 @@ var messages = {
130
130
  en: "Select a variant ({count} options):"
131
131
  },
132
132
  "create.promptSelectVariant.blog": {
133
- ja: "\u6A5F\u80FD\u30EC\u30D9\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08{count}\u4EF6\uFF09:",
134
- en: "Select a feature level ({count} options):"
133
+ ja: "\u30BF\u30A4\u30D7\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08{count}\u4EF6\uFF09:",
134
+ en: "Select a type ({count} options):"
135
135
  },
136
136
  "create.promptSelectVariant.lp": {
137
137
  ja: "\u696D\u7A2E\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08{count}\u4EF6\uFF09:",
@@ -547,8 +547,8 @@ var logger = {
547
547
  };
548
548
 
549
549
  // src/version.ts
550
- var LISM_CSS_VERSION = "0.18.0" ? "0.18.0" : "unknown";
551
- var CLI_VERSION = "0.4.0" ? "0.4.0" : "unknown";
550
+ var LISM_CSS_VERSION = "0.20.0" ? "0.20.0" : "unknown";
551
+ var CLI_VERSION = "0.4.2" ? "0.4.2" : "unknown";
552
552
 
553
553
  // src/constants.ts
554
554
  var SOURCE_REPO = "lism-css/lism-css";
@@ -584,28 +584,46 @@ var TEMPLATES = [
584
584
  previewUrl: "https://lism-minimal-vite.pages.dev/"
585
585
  },
586
586
  {
587
- slug: "blog-astro-simple",
587
+ slug: "blog-astro-minimal",
588
588
  kind: "project",
589
589
  category: "blog",
590
- variant: "simple",
591
- variantLabel: { ja: "Simple", en: "Simple" },
590
+ variant: "minimal",
591
+ variantLabel: { ja: "Minimal", en: "Minimal" },
592
592
  stack: "astro",
593
- sourcePath: "blog/astro/simple",
594
- title: { ja: "Blog Astro Simple", en: "Blog Astro Simple" },
595
- description: { ja: "\u30BF\u30B0\u306E\u307F\u306E\u30B7\u30F3\u30D7\u30EB\u306A Astro \u30D6\u30ED\u30B0", en: "Simple Astro blog with tags" },
596
- draft: true
593
+ sourcePath: "blog/astro/minimal",
594
+ title: { ja: "Blog Minimal", en: "Blog Minimal" },
595
+ description: { ja: "\u8A18\u4E8B\u4E00\u89A7 / \u8A73\u7D30 / Tags \u306E\u307F\u306E\u6700\u5C0F\u69CB\u6210\u306E Astro \u30D6\u30ED\u30B0", en: "Minimal Astro blog with posts and tags only" },
596
+ previewUrl: "https://lism-blog-astro-minimal.pages.dev/"
597
597
  },
598
598
  {
599
- slug: "blog-astro-full",
599
+ slug: "blog-astro-personal",
600
600
  kind: "project",
601
601
  category: "blog",
602
- variant: "full",
603
- variantLabel: { ja: "Full", en: "Full" },
602
+ variant: "personal",
603
+ variantLabel: { ja: "Personal", en: "Personal" },
604
604
  stack: "astro",
605
- sourcePath: "blog/astro/full",
606
- title: { ja: "Blog Astro Full", en: "Blog Astro Full" },
607
- description: { ja: "\u30AB\u30C6\u30B4\u30EA\u30FB\u76EE\u6B21\u3064\u304D\u306E Astro \u30D6\u30ED\u30B0", en: "Astro blog with categories and table of contents" },
608
- draft: true
605
+ sourcePath: "blog/astro/personal",
606
+ title: { ja: "Blog Personal", en: "Blog Personal" },
607
+ description: {
608
+ ja: "\u500B\u4EBA\u30D6\u30ED\u30B0\u30FB\u30A8\u30C3\u30BB\u30A4\u5411\u3051\u3002\u5E74\u6708\u30A2\u30FC\u30AB\u30A4\u30D6\u3064\u304D\u306E\u843D\u3061\u7740\u3044\u305F Astro \u30D6\u30ED\u30B0",
609
+ en: "Personal / essay-style Astro blog with monthly archives"
610
+ },
611
+ previewUrl: "https://lism-blog-astro-personal.pages.dev/"
612
+ },
613
+ {
614
+ slug: "blog-astro-techlog",
615
+ kind: "project",
616
+ category: "blog",
617
+ variant: "techlog",
618
+ variantLabel: { ja: "Tech Log", en: "Tech Log" },
619
+ stack: "astro",
620
+ sourcePath: "blog/astro/techlog",
621
+ title: { ja: "Blog Tech Log", en: "Blog Tech Log" },
622
+ description: {
623
+ ja: "\u6280\u8853\u30D6\u30ED\u30B0\u5411\u3051\u3002\u30B3\u30FC\u30C9\u30CF\u30A4\u30E9\u30A4\u30C8\u30FB\u30AB\u30C6\u30B4\u30EA\u30FB\u30BF\u30B0\u30FBTOC\u30FB\u5E74\u6708\u30A2\u30FC\u30AB\u30A4\u30D6\u30FB\u691C\u7D22\u3092\u88C5\u5099\u3057\u305F Astro \u30D6\u30ED\u30B0",
624
+ en: "Tech blog with code highlighting, categories, tags, TOC, monthly archives and search"
625
+ },
626
+ previewUrl: "https://lism-blog-astro-techlog.pages.dev/"
609
627
  },
610
628
  {
611
629
  slug: "lp-astro-minimal",
@@ -704,10 +722,13 @@ async function createCommand(targetDir, options) {
704
722
  async function resolveTemplate(requested, templates) {
705
723
  if (requested) {
706
724
  const found = templates.find((t2) => t2.slug === requested);
707
- if (!found) {
708
- throw new Error(t("create.templateNotFound", { name: requested, list: templates.map((x) => x.slug).join(", ") }));
725
+ if (found) return found;
726
+ const matchedCategory = CATEGORIES.find((category2) => category2.id === requested);
727
+ const categoryTemplates = matchedCategory ? templates.filter((tpl) => tpl.category === matchedCategory.id) : [];
728
+ if (matchedCategory && categoryTemplates.length > 0) {
729
+ return resolveFromCategory(matchedCategory.id, categoryTemplates);
709
730
  }
710
- return found;
731
+ throw new Error(t("create.templateNotFound", { name: requested, list: templates.map((x) => x.slug).join(", ") }));
711
732
  }
712
733
  const category = await select({
713
734
  message: t("create.promptSelectCategory"),
@@ -716,7 +737,12 @@ async function resolveTemplate(requested, templates) {
716
737
  value: category2.id
717
738
  }))
718
739
  });
719
- const categoryTemplates = templates.filter((tpl) => tpl.category === category);
740
+ return resolveFromCategory(
741
+ category,
742
+ templates.filter((tpl) => tpl.category === category)
743
+ );
744
+ }
745
+ async function resolveFromCategory(category, categoryTemplates) {
720
746
  const stack = await resolveStack(categoryTemplates);
721
747
  const stackTemplates = categoryTemplates.filter((tpl) => tpl.stack === stack);
722
748
  const variant = await resolveVariant(category, stackTemplates);
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  preScanLang,
14
14
  setLang,
15
15
  t
16
- } from "./chunk-ZSHT6RXM.js";
16
+ } from "./chunk-J2T5ZPMR.js";
17
17
 
18
18
  // src/createProgram.ts
19
19
  import { Command as Command3 } from "commander";
package/dist/lib.d.ts CHANGED
@@ -37,8 +37,8 @@ declare const messages: {
37
37
  readonly en: "Target directory";
38
38
  };
39
39
  readonly 'cli.create.opt.template': {
40
- readonly ja: "使用するテンプレート名(例: minimal-astro)";
41
- readonly en: "Template name to use (e.g. minimal-astro)";
40
+ readonly ja: "使用するテンプレート名またはカテゴリ名(例: minimal-astro / minimal)";
41
+ readonly en: "Template or category name to use (e.g. minimal-astro / minimal)";
42
42
  };
43
43
  readonly 'cli.create.opt.force': {
44
44
  readonly ja: "既存ディレクトリを強制上書き";
@@ -141,8 +141,8 @@ declare const messages: {
141
141
  readonly en: "Select a variant ({count} options):";
142
142
  };
143
143
  readonly 'create.promptSelectVariant.blog': {
144
- readonly ja: "機能レベルを選択してください({count}件):";
145
- readonly en: "Select a feature level ({count} options):";
144
+ readonly ja: "タイプを選択してください({count}件):";
145
+ readonly en: "Select a type ({count} options):";
146
146
  };
147
147
  readonly 'create.promptSelectVariant.lp': {
148
148
  readonly ja: "業種を選択してください({count}件):";
package/dist/lib.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  setLang,
4
4
  t,
5
5
  tOf
6
- } from "./chunk-ZSHT6RXM.js";
6
+ } from "./chunk-J2T5ZPMR.js";
7
7
  export {
8
8
  runCreate,
9
9
  setLang,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lism-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "CLI for scaffolding projects and adding UI components for Lism CSS / Lism UI.",
5
5
  "author": {
6
6
  "name": "ddryo",