refactor!: modernize toolchain and add search command#35
Merged
Conversation
- 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>
There was a problem hiding this comment.
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
searchcommand 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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