lism-cli 0.3.0 → 0.3.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.
@@ -342,8 +342,8 @@ var messages = {
342
342
  },
343
343
  // skill check
344
344
  "skill.check.noneInstalled": {
345
- ja: "\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u307F\u306E\u30B9\u30AD\u30EB\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002`lism skill add` \u3067\u914D\u7F6E\u3067\u304D\u307E\u3059\u3002",
346
- en: "No installed skills found. Run `lism skill add` to deploy them."
345
+ ja: "\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u307F\u306E\u30B9\u30AD\u30EB\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002`{invoke} skill add` \u3067\u914D\u7F6E\u3067\u304D\u307E\u3059\u3002",
346
+ en: "No installed skills found. Run `{invoke} skill add` to deploy them."
347
347
  },
348
348
  "skill.check.fetching": {
349
349
  ja: "\u30EA\u30E2\u30FC\u30C8\u30B9\u30AD\u30EB\u3092\u53D6\u5F97\u4E2D\uFF08ref: {ref}\uFF09...",
@@ -358,8 +358,8 @@ var messages = {
358
358
  en: "All skills are up to date."
359
359
  },
360
360
  "skill.check.outdated": {
361
- ja: "{count} \u4EF6\u306E\u30C4\u30FC\u30EB\u306B\u5DEE\u5206\u304C\u3042\u308A\u307E\u3059\u3002`lism skill update` \u3067\u6700\u65B0\u306B\u66F4\u65B0\u3067\u304D\u307E\u3059\u3002",
362
- en: "{count} tools have changes. Run `lism skill update` to update them."
361
+ ja: "{count} \u4EF6\u306E\u30C4\u30FC\u30EB\u306B\u5DEE\u5206\u304C\u3042\u308A\u307E\u3059\u3002`{invoke} skill update` \u3067\u6700\u65B0\u306B\u66F4\u65B0\u3067\u304D\u307E\u3059\u3002",
362
+ en: "{count} tools have changes. Run `{invoke} skill update` to update them."
363
363
  },
364
364
  "skill.check.diffModified": {
365
365
  ja: "\u5909\u66F4 {count}",
@@ -377,8 +377,8 @@ var messages = {
377
377
  // config
378
378
  // ---------------------------------------------------------------------------
379
379
  "config.legacyWarning": {
380
- ja: '[deprecated] {filename} \u306F\u5EC3\u6B62\u4E88\u5B9A\u3067\u3059\u3002"lism ui init" \u3067 lism.config.js \u3078\u79FB\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002',
381
- en: '[deprecated] {filename} is deprecated. Run "lism ui init" to migrate to lism.config.js.'
380
+ ja: '[deprecated] {filename} \u306F\u5EC3\u6B62\u4E88\u5B9A\u3067\u3059\u3002"{invoke} ui init" \u3067 lism.config.js \u3078\u79FB\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002',
381
+ en: '[deprecated] {filename} is deprecated. Run "{invoke} ui init" to migrate to lism.config.js.'
382
382
  },
383
383
  "config.notFound": {
384
384
  ja: "lism.config.js / lism.config.mjs / lism-ui.json \u306E\u3044\u305A\u308C\u3082\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002",
@@ -490,12 +490,16 @@ var logger = {
490
490
  },
491
491
  log(msg) {
492
492
  console.log(msg);
493
+ },
494
+ heading(msg) {
495
+ console.log(pc.bold(pc.cyan(`
496
+ \u25B8 ${msg}`)));
493
497
  }
494
498
  };
495
499
 
496
500
  // src/version.ts
497
- var LISM_CSS_VERSION = "0.14.0" ? "0.14.0" : "unknown";
498
- var CLI_VERSION = "0.3.0" ? "0.3.0" : "unknown";
501
+ var LISM_CSS_VERSION = "0.16.0" ? "0.16.0" : "unknown";
502
+ var CLI_VERSION = "0.3.1" ? "0.3.1" : "unknown";
499
503
 
500
504
  // src/constants.ts
501
505
  var SOURCE_REPO = "lism-css/lism-css";
@@ -539,12 +543,12 @@ async function runCreate({ template, targetDir, force = false }) {
539
543
  });
540
544
  rewriteWorkspaceDeps(outDir);
541
545
  logger.success(t("create.created", { dir: outDir }));
542
- logger.log("");
543
- logger.log(t("create.nextSteps"));
546
+ logger.heading(t("create.nextSteps"));
544
547
  const rel = path.relative(process.cwd(), outDir) || ".";
545
548
  logger.log(` cd ${rel}`);
546
549
  logger.log(" npm install # or pnpm install / yarn");
547
550
  logger.log(" npm run dev");
551
+ logger.log("");
548
552
  }
549
553
  async function createCommand(targetDir, options) {
550
554
  await runCreate({ template: options.template, targetDir, force: options.force });
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  preScanLang,
14
14
  setLang,
15
15
  t
16
- } from "./chunk-5ULZ7QME.js";
16
+ } from "./chunk-3PSCUHIC.js";
17
17
 
18
18
  // src/createProgram.ts
19
19
  import { Command as Command3 } from "commander";
@@ -30,6 +30,45 @@ import { confirm, select as select2 } from "@inquirer/prompts";
30
30
  import fs from "fs";
31
31
  import path from "path";
32
32
  import { createJiti } from "jiti";
33
+
34
+ // src/invokeCommand.ts
35
+ function getInvokeCommand() {
36
+ const scriptPath = process.argv[1] ?? "";
37
+ const userAgent = process.env.npm_config_user_agent ?? "";
38
+ const normalizedScriptPath = normalizePath(scriptPath);
39
+ const inDlxCache = /\/_npx\//.test(normalizedScriptPath) || /\/pnpm(?:-cache)?\/(?:[^/]+\/)*dlx-[^/]+\//.test(normalizedScriptPath) || /\/\.yarn\/berry\/cache\//.test(normalizedScriptPath) || /\/\.bun\/install\/cache\//.test(normalizedScriptPath);
40
+ const inLocalDependency = isInProjectNodeModules(normalizedScriptPath) && (/\/node_modules\/\.bin\/lism(?:\.(?:cmd|ps1))?$/.test(normalizedScriptPath) || /\/node_modules\/lism-cli\/bin\/lism\.mjs$/.test(normalizedScriptPath));
41
+ if (inDlxCache) return getDlxInvokeCommand(userAgent);
42
+ if (inLocalDependency) return getLocalInvokeCommand(userAgent);
43
+ return "lism";
44
+ }
45
+ function getDlxInvokeCommand(userAgent) {
46
+ if (userAgent.startsWith("pnpm/")) return "pnpm dlx lism-cli";
47
+ if (userAgent.startsWith("yarn/")) return "yarn dlx lism-cli";
48
+ if (userAgent.startsWith("bun/")) return "bunx lism-cli";
49
+ return "npx lism-cli";
50
+ }
51
+ function getLocalInvokeCommand(userAgent) {
52
+ if (userAgent.startsWith("pnpm/")) return "pnpm exec lism";
53
+ if (userAgent.startsWith("yarn/")) return "yarn lism";
54
+ if (userAgent.startsWith("bun/")) return "bun run lism";
55
+ return "npx lism-cli";
56
+ }
57
+ function isInProjectNodeModules(scriptPath) {
58
+ let dir = normalizePath(process.cwd());
59
+ while (dir) {
60
+ if (scriptPath.startsWith(`${dir}/node_modules/`)) return true;
61
+ const parent = dir.slice(0, dir.lastIndexOf("/"));
62
+ if (parent === dir) break;
63
+ dir = parent;
64
+ }
65
+ return false;
66
+ }
67
+ function normalizePath(value) {
68
+ return value.replaceAll("\\", "/").replace(/\/+$/, "");
69
+ }
70
+
71
+ // src/config.ts
33
72
  var LEGACY_CONFIG_FILE = "lism-ui.json";
34
73
  var CONFIG_SEARCH = ["lism.config.js", "lism.config.mjs"];
35
74
  function resolvePath(filename) {
@@ -57,7 +96,7 @@ async function readConfig() {
57
96
  throw new Error(t("config.notFound"));
58
97
  }
59
98
  if (found.kind === "legacy-json") {
60
- logger.warn(t("config.legacyWarning", { filename: LEGACY_CONFIG_FILE }));
99
+ logger.warn(t("config.legacyWarning", { filename: LEGACY_CONFIG_FILE, invoke: getInvokeCommand() }));
61
100
  const raw = fs.readFileSync(found.path, "utf-8");
62
101
  const parsed = JSON.parse(raw);
63
102
  return parsed;
@@ -798,7 +837,7 @@ async function skillCheckCommand(options = {}) {
798
837
  const cwd = process.cwd();
799
838
  const installed = ALL_SKILL_TOOLS.filter((tool) => fs6.existsSync(path7.join(cwd, SKILL_PATHS[tool], "SKILL.md")));
800
839
  if (installed.length === 0) {
801
- logger.info(t("skill.check.noneInstalled"));
840
+ logger.info(t("skill.check.noneInstalled", { invoke: getInvokeCommand() }));
802
841
  return;
803
842
  }
804
843
  const ref = options.ref ?? DEFAULT_SKILL_REF;
@@ -823,7 +862,7 @@ async function skillCheckCommand(options = {}) {
823
862
  if (outdatedCount === 0) {
824
863
  logger.success(t("skill.check.allLatest"));
825
864
  } else {
826
- logger.info(t("skill.check.outdated", { count: outdatedCount }));
865
+ logger.info(t("skill.check.outdated", { count: outdatedCount, invoke: getInvokeCommand() }));
827
866
  }
828
867
  } finally {
829
868
  cleanupTempDir(remoteDir);
package/dist/lib.d.ts CHANGED
@@ -341,8 +341,8 @@ declare const messages: {
341
341
  readonly en: " Deployed: {tool} → {path}";
342
342
  };
343
343
  readonly 'skill.check.noneInstalled': {
344
- readonly ja: "インストール済みのスキルは見つかりませんでした。`lism skill add` で配置できます。";
345
- readonly en: "No installed skills found. Run `lism skill add` to deploy them.";
344
+ readonly ja: "インストール済みのスキルは見つかりませんでした。`{invoke} skill add` で配置できます。";
345
+ readonly en: "No installed skills found. Run `{invoke} skill add` to deploy them.";
346
346
  };
347
347
  readonly 'skill.check.fetching': {
348
348
  readonly ja: "リモートスキルを取得中(ref: {ref})...";
@@ -357,8 +357,8 @@ declare const messages: {
357
357
  readonly en: "All skills are up to date.";
358
358
  };
359
359
  readonly 'skill.check.outdated': {
360
- readonly ja: "{count} 件のツールに差分があります。`lism skill update` で最新に更新できます。";
361
- readonly en: "{count} tools have changes. Run `lism skill update` to update them.";
360
+ readonly ja: "{count} 件のツールに差分があります。`{invoke} skill update` で最新に更新できます。";
361
+ readonly en: "{count} tools have changes. Run `{invoke} skill update` to update them.";
362
362
  };
363
363
  readonly 'skill.check.diffModified': {
364
364
  readonly ja: "変更 {count}";
@@ -373,8 +373,8 @@ declare const messages: {
373
373
  readonly en: "deleted {count}";
374
374
  };
375
375
  readonly 'config.legacyWarning': {
376
- readonly ja: "[deprecated] {filename} は廃止予定です。\"lism ui init\" で lism.config.js へ移行してください。";
377
- readonly en: "[deprecated] {filename} is deprecated. Run \"lism ui init\" to migrate to lism.config.js.";
376
+ readonly ja: "[deprecated] {filename} は廃止予定です。\"{invoke} ui init\" で lism.config.js へ移行してください。";
377
+ readonly en: "[deprecated] {filename} is deprecated. Run \"{invoke} ui init\" to migrate to lism.config.js.";
378
378
  };
379
379
  readonly 'config.notFound': {
380
380
  readonly ja: "lism.config.js / lism.config.mjs / lism-ui.json のいずれも見つかりません。";
package/dist/lib.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  setLang,
4
4
  t,
5
5
  tOf
6
- } from "./chunk-5ULZ7QME.js";
6
+ } from "./chunk-3PSCUHIC.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.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "CLI for scaffolding projects and adding UI components for Lism CSS / Lism UI.",
5
5
  "author": {
6
6
  "name": "ddryo",