Skip to content

refactor!: modernize toolchain and add search command#35

Merged
nitaking merged 11 commits into
masterfrom
feature/upgrade
May 14, 2026
Merged

refactor!: modernize toolchain and add search command#35
nitaking merged 11 commits into
masterfrom
feature/upgrade

Conversation

@nitaking
Copy link
Copy Markdown
Owner

@nitaking nitaking commented May 14, 2026

Summary

  • pnpm 移行: yarn → pnpm、Node.js >= 20 に引き上げ
  • フレームワーク刷新: oclif v1 → v4、TypeScript 3 → 5、ESM 化(inquirer v9, execa v9)
  • リンター移行: tslint → eslint (flat config)
  • テスト移行: mocha/chai/nyc → vitest(10 tests passing)
  • CI 移行: CircleCI → GitHub Actions(Node 20/22 マトリクス)
  • セキュリティ: pnpm audit 脆弱性ゼロ
  • 新機能: gitmoji search コマンド追加(引数あり: 静的検索、引数なし: インタラクティブ)

BREAKING CHANGE

Node.js >= 20 が必須になりました。

Test plan

  • pnpm install && pnpm build が成功すること
  • pnpm test で 10 テストが全パスすること
  • pnpm audit が脆弱性ゼロであること
  • ./bin/run list でgitmoji一覧が表示されること
  • ./bin/run search bug で静的検索が動作すること
  • ./bin/run search でインタラクティブ検索が動作すること
  • ./bin/run commit でインタラクティブコミットが動作すること

🤖 Generated with Claude Code

nitaking and others added 5 commits May 14, 2026 22:50
- Replace yarn with pnpm, set engines to Node >= 20
- Upgrade oclif v1 (@oclif/command) to v4 (@oclif/core)
- Upgrade TypeScript 3 to 5, replace tslint with eslint
- Convert to ESM (type: module, inquirer v9, execa v9)
- Resolve all security vulnerabilities (pnpm audit clean)

BREAKING CHANGE: requires Node.js >= 20

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove mocha, chai, nyc and related config
- Add vitest with utils, prompt, and list command tests
- 10 tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove .circleci/config.yml (Node 8/10 targets)
- Add GitHub Actions workflow with Node 20/22 matrix
- Include build, test, audit, and CLI smoke test steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- `gitmoji search <query>` for static keyword search
- `gitmoji search` for interactive autocomplete search

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 14, 2026 13:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the gitmoji-c CLI’s toolchain (Node 20+, pnpm, TypeScript 5, ESM, oclif v4), migrates linting/testing/CI, and adds a new gitmoji search command (static search with args, interactive without args).

Changes:

  • Migrates CLI framework and runtime to oclif v4 + ESM (including updated bin entrypoint) and updates TypeScript target/module settings.
  • Replaces the legacy test setup with Vitest and adds new unit/integration tests for utils/prompt and list/search commands.
  • Adds a new search command and updates gitmoji data fetch URL.

Reviewed changes

Copilot reviewed 21 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
yarn.lock Removed Yarn lockfile as part of pnpm migration.
pnpm-lock.yaml pnpm lockfile is now the dependency source of truth.
package.json Updates dependencies (oclif v4, TS5, Vitest, ESLint), sets ESM/module type, Node >= 20, and adds pnpm metadata/scripts.
tsconfig.json Updates TS module/target for modern Node/ESM output and adds stricter consistency options.
eslint.config.mjs Adds ESLint flat config with TypeScript rules.
vitest.config.ts Adds Vitest configuration (globals + timeout).
bin/run Switches CLI entrypoint to oclif v4 execute() in ESM.
src/index.ts Updates exported run entry to @oclif/core.
src/utils.ts Updates remote gitmoji JSON path and simplifies axios client config.
src/prompt.ts Refactors prompt question definitions for ESM + cleaner filtering/choice mapping.
src/commands/list.ts Migrates list command to oclif v4 args/flags parsing and simplifies printing/search.
src/commands/search.ts Adds new search command with static and interactive (autocomplete) modes.
src/commands/commit.ts Migrates commit command to oclif v4 + ESM and updates inquirer/autocomplete usage.
test/utils.test.ts Adds Vitest tests for gitmojis() (currently network-backed).
test/prompt.test.ts Adds Vitest tests for prompt question behavior (currently network-backed via gitmojis()).
test/commands/list.test.ts Adds integration tests executing CLI for list behavior (currently network-backed).
test/commands/search.test.ts Adds integration tests executing CLI for search behavior (currently network-backed).
test/commands/hello.test.ts Removes legacy oclif v1 hello command test.
src/commands/hello.ts Removes legacy hidden hello command.
.github/workflows/ci.yml Adds GitHub Actions CI (Node 20/22) with pnpm + build/test/audit steps.
.circleci/config.yml Removes CircleCI configuration.
tslint.json Removes TSLint config as part of ESLint migration.
test/mocha.opts Removes Mocha options as part of Vitest migration.
test/tsconfig.json Removes test TS project config (no longer used by Mocha/TSLint flow).
.node-version Adds Node version pin (20).
.gitignore Ignores tsconfig.tsbuildinfo from TS build mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/search.ts
Comment thread test/utils.test.ts Outdated
Comment thread test/prompt.test.ts
Comment thread test/commands/list.test.ts
Comment thread test/commands/search.test.ts
nitaking and others added 6 commits May 14, 2026 23:05
Include code and emoji in search text for list and search commands,
matching the interactive autocomplete behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gitmoji data is cached at ~/.gitmoji/gitmojis.json after first fetch.
`gitmoji update` refreshes the cache from remote.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mock homedir for utils cache tests, mock gitmojis() for prompt tests,
and add a fixture file for deterministic test data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nitaking nitaking merged commit 7717845 into master May 14, 2026
2 checks passed
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.

2 participants