lism-cli 0.4.0 → 0.4.1

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",
@@ -548,7 +548,7 @@ var logger = {
548
548
 
549
549
  // src/version.ts
550
550
  var LISM_CSS_VERSION = "0.18.0" ? "0.18.0" : "unknown";
551
- var CLI_VERSION = "0.4.0" ? "0.4.0" : "unknown";
551
+ var CLI_VERSION = "0.4.1" ? "0.4.1" : "unknown";
552
552
 
553
553
  // src/constants.ts
554
554
  var SOURCE_REPO = "lism-css/lism-css";
@@ -704,10 +704,13 @@ async function createCommand(targetDir, options) {
704
704
  async function resolveTemplate(requested, templates) {
705
705
  if (requested) {
706
706
  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(", ") }));
707
+ if (found) return found;
708
+ const matchedCategory = CATEGORIES.find((category2) => category2.id === requested);
709
+ const categoryTemplates = matchedCategory ? templates.filter((tpl) => tpl.category === matchedCategory.id) : [];
710
+ if (matchedCategory && categoryTemplates.length > 0) {
711
+ return resolveFromCategory(matchedCategory.id, categoryTemplates);
709
712
  }
710
- return found;
713
+ throw new Error(t("create.templateNotFound", { name: requested, list: templates.map((x) => x.slug).join(", ") }));
711
714
  }
712
715
  const category = await select({
713
716
  message: t("create.promptSelectCategory"),
@@ -716,7 +719,12 @@ async function resolveTemplate(requested, templates) {
716
719
  value: category2.id
717
720
  }))
718
721
  });
719
- const categoryTemplates = templates.filter((tpl) => tpl.category === category);
722
+ return resolveFromCategory(
723
+ category,
724
+ templates.filter((tpl) => tpl.category === category)
725
+ );
726
+ }
727
+ async function resolveFromCategory(category, categoryTemplates) {
720
728
  const stack = await resolveStack(categoryTemplates);
721
729
  const stackTemplates = categoryTemplates.filter((tpl) => tpl.stack === stack);
722
730
  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-VMIN57OF.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: "既存ディレクトリを強制上書き";
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-VMIN57OF.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.1",
4
4
  "description": "CLI for scaffolding projects and adding UI components for Lism CSS / Lism UI.",
5
5
  "author": {
6
6
  "name": "ddryo",