Skip to content

refactor: ESmoduleにすべて統一。バージョンが古いと新しいバージョンありますと表示する機能を追加 - #26

Merged
otusoa merged 6 commits into
mainfrom
otusoa/issue24
May 2, 2026
Merged

refactor: ESmoduleにすべて統一。バージョンが古いと新しいバージョンありますと表示する機能を追加#26
otusoa merged 6 commits into
mainfrom
otusoa/issue24

Conversation

@otusoa

@otusoa otusoa commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

リリースノート

  • 新機能

    • check コマンドが Nuxt プロジェクトの依存関係検出に対応し、より正確な診断を提供
  • ドキュメント

    • CLI ドキュメントに check コマンドの詳細説明と検証項目を追加
  • テスト

    • CLI ラッパーユーティリティの網羅的なテストを実装
  • リファクタリング

    • npm 公開フローを非同期処理に対応
    • CLI 環境初期化ロジックを改善

@otusoa otusoa self-assigned this May 2, 2026
@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@otusoa has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 37 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 33228784-93fe-4a05-af12-3d592c1ecdf3

📥 Commits

Reviewing files that changed from the base of the PR and between b79cff7 and 6c39581.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • apps/cli/package.json
  • apps/cli/scripts/publish-npm.js
  • apps/cli/wrapper.js
📝 Walkthrough

Walkthrough

lism-ui-vue CLIの機能向上を目的とした複数領域の改善。チェックコマンドはNuxt対応のバリデーション追加、ラッパースクリプトと発行スクリプトは非同期化と新規ユーティリティ関数の抽出、update-notifierの統合を実施。ドキュメント、Go・Node.jsの各層で対応。

Changes

CLI機能拡張と発行フロー改善

Layer / File(s) Summary
ドキュメント・マニフェスト更新
apps/cli/README.md, apps/cli/package.json
checkコマンドのドキュメント追加(Nuxt検出と@lism-ui-vue/nuxtの確認を含む)。update-notifierdevDependenciesに追加。
検査ロジック改善
apps/cli/cmd/check.go
Nuxt検出をより早い段階で行い、lism-ui-vue不在時のNuxt対応分岐を追加。Nuxt環境かつ@lism-ui-vue/nuxtが存在する場合はスキップ警告を出力。
ルートコマンド設定
apps/cli/cmd/root.go
LISM_VUE_CLI_NAME環境変数を読み込み、cobra.CommandDisplayNameAnnotationに設定する流れに変更(従来のrootCmd.Use直接設定から移行)。
ラッパーユーティリティ抽出
apps/cli/wrapper-utils.js
プラットフォーム別パッケージ名、バイナリ名、CLI環境変数生成のための3つのユーティリティ関数を新規作成。
ラッパー統合・更新通知
apps/cli/wrapper.js
新規ユーティリティ関数を使用してオプション依存パッケージ解決をESM化。update-notifierを初期化し、グローバル・遅延通知を設定。CLI環境変数はcreateCliEnv(process.env)で生成。
発行スクリプト非同期化
apps/cli/scripts/publish-npm.js
同期型spawnSyncから非同期spawnに移行。ターゲット別のパッケージ準備と発行タスクをPromise.allSettledで並行実行。
テスト
apps/cli/wrapper.test.js
ラッパーユーティリティ関数の動作確認テストを追加(プラットフォーム別パッケージ名、Windows向け.exe拡張子、LISM_VUE_CLI_NAMEフォールバック)。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #22: CLI関連の基盤コード(apps/cli/wrapper.jsapps/cli/scripts/publish-npm.jsなど)を導入・更新した先行PR。今回の変更はこの基盤の上で発行フロー最適化と機能拡張を実施。
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning PRのタイトルは、ESModuleへの統一とバージョン更新通知機能の追加という2つの主要な変更を含んでいます。変更内容と部分的に関連していますが、バージョン更新通知機能の実装は実際の変更にはなく、またESModuleへの統一が部分的な実装にとどまっています。 タイトルを「refactor: CLIのESModule化とチェックコマンドの改善」など、実装された主要な変更をより正確に反映したものに修正してください。
Out of Scope Changes check ⚠️ Warning wrapper.jsのアップデート通知機能(update-notifier)の実装はissue #24の要件に記載されていない機能であり、スコープ外の変更です。その他の変更は全てCLI機能の拡張・改善に関連しています。 update-notifierの実装と関連する変更を別のPRに分離するか、issue #24にこの要件を明示的に追加してください
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed PR #26はissue #24の目標である雛形作成、診断コマンドの実装・改善を実現しており、チェックコマンドの強化、Nuxt対応、ESModule化などの改善が含まれています。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch otusoa/issue24

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 16 minutes and 37 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
apps/cli/README.md (1)

43-43: ⚡ Quick win

ドキュメント内のフレームワーク表記を統一してください

Line [43] の LismUI-Vue は、ドキュメント規約上 LismCSS に統一が必要です。

As per coding guidelines, **/*.{md,markdown,txt}: In documentation, use the capitalized name 'LismCSS' when referring to the framework.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cli/README.md` at line 43, Replace the framework name string
"LismUI-Vue" with the standardized, capitalized name "LismCSS" in the README
content (the occurrence shown in the diff); ensure any other instances in this
document use "LismCSS" to comply with the docs naming convention for files
matching **/*.{md,markdown,txt}.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/cli/cmd/check.go`:
- Around line 73-75: The branch that detects Nuxt (isNuxt &&
pkg.Dependencies["@lism-ui-vue/nuxt"] != "" ||
pkg.DevDependencies["@lism-ui-vue/nuxt"] != "") logs a skip via
pterm.Warning.Println but then incorrectly sets allPassed = false; remove or
stop setting allPassed to false in this skip branch so the overall check remains
successful when skipped (leave allPassed unchanged or explicitly set to true),
keeping the skip message and behavior in the same conditional referencing
isNuxt, pkg.Dependencies/DevDependencies and pterm.Warning.Println.

In `@apps/cli/package.json`:
- Around line 29-30: The package.json currently lists "update-notifier" under
devDependencies which causes ERR_MODULE_NOT_FOUND at runtime when
apps/cli/wrapper.js imports it; move the "update-notifier" entry from
devDependencies into dependencies in the package.json so it is installed for end
users, then run npm/yarn install and verify apps/cli/wrapper.js can import
update-notifier without error.

In `@apps/cli/scripts/publish-npm.js`:
- Around line 77-80: The current loop silently skips missing binaries by
checking fs.existsSync(binaryPath) and continuing, which can lead to publishing
the root package while subpackages are missing; instead, collect missing
binaryFileName entries during the loop (using binaryPath/binaryFileName as
identified), and before performing the root publish step, if the missing list is
non-empty log an error listing the missing binaries and abort (throw or
process.exit(1)) to prevent the root publish; ensure the check runs prior to the
code that does the root publish so the script fails fast when any subpackage
binary is missing.

In `@apps/cli/wrapper.js`:
- Around line 35-37: import.meta.resolve() が返す URL 文字列をそのまま
path.dirname()/path.join() に渡しているためファイルパスが壊れています。pkgJsonPath を
fileURLToPath(import.meta.resolve(`${pkgName}/package.json`)) のように変換してから使用し、以降の
pkgDir = path.dirname(pkgJsonPath) と binPath = path.join(pkgDir,
getBinaryFileName(platform)) が正しいファイルパスを参照するように修正してください(参照シンボル:
import.meta.resolve, fileURLToPath, pkgJsonPath, pkgDir, binPath,
getBinaryFileName)。
- Line 7: The JSON import line using "import pkg from './package.json' with {
type: 'json' }" is not stable on supported Node targets; either update
package.json "engines.node" to ">=23.1.0" to allow that syntax, or replace the
import in wrapper.js with a runtime read/parse: synchronously read
'./package.json' (e.g., using fs.readFileSync) and JSON.parse it into the
existing pkg variable; ensure references to pkg continue to work and remove the
experimental import form.

---

Nitpick comments:
In `@apps/cli/README.md`:
- Line 43: Replace the framework name string "LismUI-Vue" with the standardized,
capitalized name "LismCSS" in the README content (the occurrence shown in the
diff); ensure any other instances in this document use "LismCSS" to comply with
the docs naming convention for files matching **/*.{md,markdown,txt}.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b57725c0-310e-43be-abc8-d164a28b7166

📥 Commits

Reviewing files that changed from the base of the PR and between 7094ad0 and b79cff7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • apps/cli/README.md
  • apps/cli/cmd/check.go
  • apps/cli/cmd/root.go
  • apps/cli/package.json
  • apps/cli/scripts/publish-npm.js
  • apps/cli/wrapper-utils.js
  • apps/cli/wrapper.js
  • apps/cli/wrapper.test.js

Comment thread apps/cli/cmd/check.go
Comment thread apps/cli/package.json Outdated
Comment thread apps/cli/scripts/publish-npm.js
Comment thread apps/cli/wrapper.js
Comment thread apps/cli/wrapper.js Outdated
…をリファクタリング

Co-authored-by: Copilot <copilot@github.com>
@otusoa
otusoa merged commit 0883ea5 into main May 2, 2026
4 checks passed
@otusoa
otusoa deleted the otusoa/issue24 branch May 2, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(CLI): CLIの機能を拡張、改善する。

1 participant