feat: completion plugin - #219
Conversation
WalkthroughThis update introduces a comprehensive CLI completion plugin with configuration and runtime support, adds localization utilities and tests, and refactors core CLI logic to unify entry command handling and option defaults. It includes new example and test files, updates TypeScript types, adds exports, and adjusts build and configuration files for improved extensibility and integration. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI (Gunshi)
participant CompletionPlugin
participant Shell
User->>CLI (Gunshi): Run CLI with completion command
CLI (Gunshi)->>CompletionPlugin: Register completion extension
CompletionPlugin->>CLI (Gunshi): Add root and subcommands for completion
User->>Shell: Request completion (e.g., TAB)
Shell->>CLI (Gunshi): Invoke completion command
CLI (Gunshi)->>CompletionPlugin: Generate suggestions
CompletionPlugin-->>Shell: Return completion suggestions
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying gunshi with
|
| Latest commit: |
55e5a98
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://34af5670.gunshi.pages.dev |
| Branch Preview URL: | https://feat-completion.gunshi.pages.dev |
@gunshi/bone
@gunshi/definition
gunshi
@gunshi/plugin
@gunshi/plugin-completion
@gunshi/plugin-dryrun
@gunshi/plugin-global
@gunshi/plugin-i18n
@gunshi/plugin-renderer
@gunshi/resources
@gunshi/shared
commit: |
…n-i18n need more improvemnt for multiple command context env) This reverts commit e3d2635.
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (4)
packages/plugin-global/src/decorator.ts (1)
24-26: Computed-property destructuring looks correct but double-check runtime keyThe computed property
[Global]correctly matches the plugin-id constant, so type safety is preserved. Just make surepluginIdis aconststring literal (orunique symbol) and not a runtime generated value; otherwise destructuring will fail if the value differs at runtime.If
pluginIdis dynamic, switch to safe access (extensions?.[Global]) or add an early guard.packages/plugin-completion/src/utils.ts (1)
6-25: Remove commented out codeThe extensive commented out code should be removed to improve code cleanliness. If this code might be needed in the future, consider creating a separate issue to track it.
-// NOTE(kazupon): comment out, because it is not used yet. -// import { CLI_OPTIONS_DEFAULT, createCommandContext as _createCommandContext } from '@gunshi/plugin' -// -// import type { Args, Command, CommandContext, LazyCommand } from '@gunshi/plugin' -// -// async function createCommandContext(cmd: Command | LazyCommand): Promise<CommandContext> { -// return await _createCommandContext({ -// args: cmd.args || (Object.create(null) as Args), -// values: Object.create(null), -// positionals: [], -// rest: [], -// argv: [], -// tokens: [], -// omitted: false, -// callMode: cmd.entry ? 'entry' : 'subCommand', -// command: cmd, -// extensions: Object.create(null), -// cliOptions: CLI_OPTIONS_DEFAULT -// }) -// }packages/plugin-completion/src/types.ts (1)
26-26: Replace empty interface with type aliasThe empty interface should be replaced with a type alias as recommended by the static analysis tool.
-export interface CompletionCommandContext {} +export type CompletionCommandContext = Record<string, never>packages/plugin-completion/src/index.ts (1)
24-25: Consider cleaning up i18n-related commented code.There are many TODO comments and commented-out code blocks related to i18n support. Consider either:
- Removing the commented code and keeping only the TODO comments
- Moving the commented code to a separate tracking issue
This would improve code readability while still tracking the future i18n work.
Also applies to: 40-41, 91-92, 101-107, 115-116, 131-132, 147-148, 156-158, 165-166, 181-182
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
packages/gunshi/src/__snapshots__/cli.test.ts.snapis excluded by!**/*.snappackages/plugin-completion/src/__snapshots__/index.test.ts.snapis excluded by!**/*.snappnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
eslint.config.ts(1 hunks)package.json(1 hunks)packages/gunshi/src/cli.test.ts(3 hunks)packages/gunshi/src/cli/core.ts(5 hunks)packages/gunshi/src/constants.ts(1 hunks)packages/gunshi/src/context.ts(2 hunks)packages/gunshi/src/definition.ts(1 hunks)packages/gunshi/src/plugin.ts(1 hunks)packages/gunshi/src/types.ts(1 hunks)packages/gunshi/src/utils.ts(2 hunks)packages/plugin-completion/examples/demo.node.ts(1 hunks)packages/plugin-completion/package.json(1 hunks)packages/plugin-completion/src/index.test.ts(1 hunks)packages/plugin-completion/src/index.ts(1 hunks)packages/plugin-completion/src/types.ts(1 hunks)packages/plugin-completion/src/utils.ts(1 hunks)packages/plugin-completion/tsdown.config.ts(1 hunks)packages/plugin-global/src/decorator.ts(2 hunks)packages/plugin-i18n/src/types.ts(2 hunks)packages/plugin-renderer/src/index.ts(3 hunks)packages/plugin-renderer/src/types.ts(2 hunks)packages/plugin-renderer/src/usage.ts(1 hunks)packages/shared/jsr.json(1 hunks)packages/shared/src/index.ts(1 hunks)packages/shared/src/localize.test.ts(1 hunks)packages/shared/src/localize.ts(1 hunks)packages/shared/src/types.ts(2 hunks)packages/shared/src/utils.ts(2 hunks)scripts/jsr.ts(2 hunks)tsconfig.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
`packages/gunshi/src/**/*.ts`: All source code is in TypeScript with strict mode...
packages/gunshi/src/**/*.ts: All source code is in TypeScript with strict mode enabled
Ensure changes work across Node.js, Deno, and Bun
Type safety is a core feature - maintain strict TypeScript types throughout
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/gunshi/src/context.tspackages/gunshi/src/constants.tspackages/gunshi/src/types.tspackages/gunshi/src/definition.tspackages/gunshi/src/plugin.tspackages/gunshi/src/cli.test.tspackages/gunshi/src/utils.tspackages/gunshi/src/cli/core.ts
`**/*.{js,ts,tsx,mjs}`: Use ES modules throughout the codebase
**/*.{js,ts,tsx,mjs}: Use ES modules throughout the codebase
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/gunshi/src/context.tseslint.config.tspackages/gunshi/src/constants.tspackages/plugin-global/src/decorator.tspackages/gunshi/src/types.tspackages/plugin-renderer/src/usage.tspackages/shared/src/index.tspackages/gunshi/src/definition.tspackages/plugin-completion/tsdown.config.tspackages/gunshi/src/plugin.tspackages/plugin-renderer/src/types.tsscripts/jsr.tspackages/shared/src/types.tspackages/plugin-completion/src/utils.tspackages/plugin-renderer/src/index.tspackages/plugin-completion/src/index.test.tspackages/shared/src/localize.test.tspackages/gunshi/src/cli.test.tspackages/shared/src/utils.tspackages/gunshi/src/utils.tspackages/plugin-completion/src/types.tspackages/plugin-i18n/src/types.tspackages/plugin-completion/examples/demo.node.tspackages/shared/src/localize.tspackages/plugin-completion/src/index.tspackages/gunshi/src/cli/core.ts
`**/*.{js,ts,tsx}`: Follow existing code style (enforced by ESLint and Prettier)
**/*.{js,ts,tsx}: Follow existing code style (enforced by ESLint and Prettier)
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/gunshi/src/context.tseslint.config.tspackages/gunshi/src/constants.tspackages/plugin-global/src/decorator.tspackages/gunshi/src/types.tspackages/plugin-renderer/src/usage.tspackages/shared/src/index.tspackages/gunshi/src/definition.tspackages/plugin-completion/tsdown.config.tspackages/gunshi/src/plugin.tspackages/plugin-renderer/src/types.tsscripts/jsr.tspackages/shared/src/types.tspackages/plugin-completion/src/utils.tspackages/plugin-renderer/src/index.tspackages/plugin-completion/src/index.test.tspackages/shared/src/localize.test.tspackages/gunshi/src/cli.test.tspackages/shared/src/utils.tspackages/gunshi/src/utils.tspackages/plugin-completion/src/types.tspackages/plugin-i18n/src/types.tspackages/plugin-completion/examples/demo.node.tspackages/shared/src/localize.tspackages/plugin-completion/src/index.tspackages/gunshi/src/cli/core.ts
🧠 Learnings (30)
packages/gunshi/src/context.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
eslint.config.ts (8)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
packages/gunshi/src/constants.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
packages/plugin-global/src/decorator.ts (6)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
packages/shared/jsr.json (8)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/gunshi/src/types.ts (4)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
packages/plugin-renderer/src/usage.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
tsconfig.json (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
packages/shared/src/index.ts (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/gunshi/src/definition.ts (2)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-completion/tsdown.config.ts (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
package.json (4)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/gunshi/src/plugin.ts (6)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
packages/plugin-renderer/src/types.ts (4)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
scripts/jsr.ts (9)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
packages/plugin-completion/package.json (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx,mjs} : Use ES modules throughout the codebase
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to **/*.{js,ts,tsx} : Follow existing code style (enforced by ESLint and Prettier)
packages/shared/src/types.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/plugin-completion/src/utils.ts (2)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-renderer/src/index.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
packages/plugin-completion/src/index.test.ts (6)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
packages/shared/src/localize.test.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/gunshi/src/cli.test.ts (8)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
packages/shared/src/utils.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
packages/gunshi/src/utils.ts (7)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Mock external dependencies when needed in tests
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : The project uses snapshot testing for renderer output - update snapshots when renderer behavior changes
packages/plugin-completion/src/types.ts (2)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-i18n/src/types.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
packages/plugin-completion/examples/demo.node.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Use 'describe' and 'it' blocks for test organization
packages/shared/src/localize.ts (3)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
packages/plugin-completion/src/index.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
packages/gunshi/src/cli/core.ts (5)
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Ensure changes work across Node.js, Deno, and Bun
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : All source code is in TypeScript with strict mode enabled
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/src/**/*.ts : Type safety is a core feature - maintain strict TypeScript types throughout
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Add tests for new features in the corresponding test file
Learnt from: CR
PR: kazupon/gunshi#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-04T11:05:35.037Z
Learning: Applies to packages/gunshi/test/**/*.test.ts : Test files are in 'packages/gunshi/test/' with '.test.ts' extension
🧬 Code Graph Analysis (8)
packages/gunshi/src/context.ts (3)
packages/gunshi/src/utils.ts (1)
create(76-78)packages/gunshi/src/types.ts (1)
CommandEnvironment(87-179)packages/gunshi/src/constants.ts (1)
CLI_OPTIONS_DEFAULT(12-27)
packages/gunshi/src/constants.ts (1)
packages/gunshi/src/types.ts (2)
CliOptions(185-266)DefaultGunshiParams(47-47)
packages/plugin-renderer/src/types.ts (2)
packages/shared/src/localize.ts (1)
Localization(17-26)packages/shared/src/types.ts (1)
CommandBuiltinKeys(59-62)
packages/gunshi/src/cli.test.ts (2)
packages/gunshi/src/cli/builtin.ts (1)
cli(74-81)packages/gunshi/src/cli/bone.ts (1)
cli(71-77)
packages/shared/src/utils.ts (1)
packages/gunshi/src/utils.ts (1)
kebabnize(14-14)
packages/plugin-completion/src/types.ts (3)
packages/shared/src/types.ts (1)
GenerateNamespacedKey(34-37)packages/shared/src/constants.ts (1)
PLUGIN_PREFIX(8-8)packages/shared/src/utils.ts (1)
namespacedId(49-53)
packages/plugin-i18n/src/types.ts (1)
packages/shared/src/types.ts (2)
Translation(76-85)CommandBuiltinKeys(59-62)
packages/gunshi/src/cli/core.ts (4)
packages/gunshi/src/types.ts (5)
Command(380-423)CommandRunner(465-467)LazyCommand(430-439)CliOptions(185-266)GunshiParamsConstraint(55-55)packages/gunshi/src/plugin/context.ts (1)
subCommands(157-159)packages/gunshi/src/utils.ts (2)
isLazyCommand(16-20)create(76-78)packages/gunshi/src/constants.ts (2)
CLI_OPTIONS_DEFAULT(12-27)ANONYMOUS_COMMAND_NAME(8-8)
🪛 Biome (1.9.4)
packages/plugin-completion/src/types.ts
[error] 26-26: An empty interface is equivalent to {}.
Safe fix: Use a type alias instead.
(lint/suspicious/noEmptyInterface)
🪛 GitHub Actions: CI
packages/plugin-completion/src/types.ts
[error] 8-8: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.
packages/plugin-completion/examples/demo.node.ts
[warning] 1-1: Knip reported unused file: packages/plugin-completion/examples/demo.node.ts
packages/plugin-completion/src/index.ts
[error] 6-6: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.
[error] 12-12: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.
🔇 Additional comments (57)
packages/gunshi/src/constants.ts (2)
12-27: Consider freezing /as constfor a truly read-only default object
CLI_OPTIONS_DEFAULTis intended to be used as a canonical default.
Declaring itconstalone does not prevent accidental mutation at run-time. Two lightweight options:-export const CLI_OPTIONS_DEFAULT: CliOptions<DefaultGunshiParams> = { +export const CLI_OPTIONS_DEFAULT = Object.freeze({ /* … */ - plugins: undefined -} + plugins: undefined +} as const) satisfies CliOptions<DefaultGunshiParams>Either
Object.freezeor a plainas const satisfies CliOptions<…>guards consumers (incl. plugins) from mutating defaults and preserves literal type information without sacrificing ergonomics.
[ suggest_optional_refactor ]
17-24: Omit explicitlyundefinedoptional fields for clarityAll listed properties are optional in
CliOptions, therefore assigningundefinedis redundant (and still emits the key).
Removing them keeps the object terse and avoids surprisingObject.keys(CLI_OPTIONS_DEFAULT)results.- description: undefined, - version: undefined, - cwd: undefined, usageSilent: false, - subCommands: undefined, leftMargin: 2, middleMargin: 10, usageOptionType: false, usageOptionValue: true, - renderHeader: undefined, - renderUsage: undefined, - renderValidationErrors: undefined, - plugins: undefined[ suggest_nitpick ]
eslint.config.ts (1)
36-37: LGTM – example sources correctly excluded from lint commentsAdding
./packages/**/examples/**matches the pattern used elsewhere (publish excludes etc.) and avoids false positives on illustrative code.
[ approve_code_changes ]packages/shared/jsr.json (1)
10-12: LGTM – keep examples out of published artifactThe new exclude keeps the npm/JSR bundle lean and avoids shipping non-prod material.
[ approve_code_changes ]packages/shared/src/index.ts (1)
8-10: Check for possible re-export cycles
localize.tspulls utilities fromutils.ts, whileindex.tsnow re-exports both modules. Circular references are unlikely but worth a quick check (especially for CJS interop in Node ≤16).
If any runtime issues emerge, consider using explicit export lists or a barrel abstraction that groups pure types only.
[ request_verification ]package.json (1)
33-34: Script naming stays consistent – no further action
build:plugin:completionfollows the existing pattern (build:plugin:*). Confirmed that the package name matches workspace filter@gunshi/plugin-completion.
[ approve_code_changes ]packages/gunshi/src/context.ts (1)
18-18: LGTM: Consistent constant renaming applied correctly.The renaming from
COMMAND_OPTIONS_DEFAULTtoCLI_OPTIONS_DEFAULTimproves naming clarity and is consistently applied across both the import and usage.Also applies to: 151-151
tsconfig.json (1)
47-47: LGTM: Standard package path mapping addition.The new path mapping for
@gunshi/plugin-completionfollows the established pattern and enables proper module resolution for the completion plugin package.packages/gunshi/src/types.ts (1)
417-422: Confirmed:entryproperty is properly integrated across the codebaseAll references to the new
entryflag—assignments inpackages/gunshi/src/definition.tsandutils.ts, initialization inpackages/gunshi/src/cli/core.ts, and its use inplugin-completionutilities—have been verified. No missing handlers or checks were found.packages/gunshi/src/plugin.ts (1)
26-27: LGTM: Appropriate plugin API enhancements.Adding
CLI_OPTIONS_DEFAULTandcreateCommandContextexports enhances the plugin API by providing access to default CLI options and context creation functionality, which are valuable for plugin development.packages/gunshi/src/definition.ts (1)
172-172: LGTM: Consistent property copying for lazy commands.The addition of
entryproperty assignment follows the established pattern of copying command properties to lazy commands, ensuring consistent behavior between regular and lazy commands.packages/plugin-completion/tsdown.config.ts (1)
10-10: LGTM - Proper bundling configuration for completion dependency.The
noExternalconfiguration correctly ensures that the@bombsh/tabcompletion library is bundled with the plugin rather than treated as an external dependency. This is the right approach for a specialized completion utility.packages/plugin-completion/package.json (2)
58-58: LGTM - Proper Deno compatibility enhancement.Adding the import map to the Deno typecheck script correctly supports the project's goal of ensuring changes work across Node.js, Deno, and Bun.
65-66: LGTM - Proper workspace and catalog dependency usage.The additions of
@gunshi/sharedas a workspace dependency and@types/nodefrom the catalog follow the monorepo patterns and support the completion plugin development workflow.packages/plugin-renderer/src/usage.ts (1)
11-11: LGTM - Good refactoring to use shared utility.Moving from a local implementation to importing
makeShortLongOptionPairfrom@gunshi/sharedeliminates code duplication and promotes consistency across packages. This aligns with the broader modularization effort in this PR.packages/gunshi/src/utils.ts (2)
34-36: LGTM - Proper extension of lazy command resolution for entry property.The addition of the
entryproperty to the base command object correctly extends the lazy command resolution to support entry command identification, which is essential for the completion plugin functionality.
56-56: LGTM - Consistent entry property handling in command loading.Properly preserves the
entryproperty when loading from resolved lazy commands, maintaining consistency with the command interface and supporting completion plugin requirements.packages/gunshi/src/cli.test.ts (3)
393-396: LGTM - Proper test metadata for CLI context.The
metaobject correctly provides test context for CLI naming and header rendering configuration, ensuring the usage generation tests exercise the enhanced CLI functionality properly.
405-405: LGTM - Explicit command naming supports entry identification.Adding an explicit
nameproperty to the entry command aligns with the broader changes that enhance entry command identification, which is essential for the completion plugin functionality.
425-428: LGTM - Consistent test invocation with metadata.The updated CLI calls properly spread the
metaobject to include CLI naming and header configuration, ensuring the tests validate the enhanced usage generation features while maintaining snapshot consistency.scripts/jsr.ts (1)
50-62: LGTM: Dependency update aligns with localization refactoring.The move of
'packages/plugin-completion'to include both'@gunshi/plugin'and'@gunshi/shared'dependencies correctly reflects the plugin's new requirement for shared localization utilities.packages/plugin-renderer/src/types.ts (2)
9-9: LGTM: Proper import for shared localization type.The import of
Localizationtype from@gunshi/sharedis correctly added to support the type abstraction.
31-31: LGTM: Type abstraction improves consistency.Replacing the explicit function signature with
Localization<CommandBuiltinKeys, G>centralizes the localization type definition and improves consistency across the codebase.packages/shared/src/utils.ts (3)
6-6: LGTM: Proper import for kebab-case conversion utility.The import of
kebabnizefromgunshi/utilsis correctly added to support the new option formatting function.
11-11: LGTM: Type import for function parameter.The
ArgSchematype import is properly added for the new utility function's parameter typing.
55-67: LGTM: Well-implemented utility function for option formatting.The
makeShortLongOptionPairfunction correctly:
- Handles kebab-case conversion based on schema or parameter
- Formats option pairs with proper prefixes and separators
- Maintains clean, readable logic
- Centralizes option formatting logic from the renderer plugin
packages/shared/src/localize.test.ts (4)
1-11: LGTM: Proper test setup with mock data.The test file imports and language resources setup are correctly structured for testing localization functionality.
12-48: LGTM: Comprehensive test setup function.The
setupfunction properly creates:
- A command definition with various argument types
- A command context with all required properties
- Good coverage of different argument scenarios including negatable options
50-63: LGTM: Translation function test with proper mocking.The test correctly:
- Mocks the translation function with vi.fn()
- Tests both existing and non-existent keys
- Verifies fallback behavior for missing translations
65-101: LGTM: Comprehensive test coverage for localization without translation.The test suite thoroughly covers:
- Built-in keys with proper resolution
- Argument keys including negatable options
- Fallback behavior for non-existent keys
- Edge cases like description and examples keys
packages/plugin-completion/src/index.test.ts (5)
4-14: LGTM: Proper utility function for command execution.The
runCommandfunction correctly:
- Uses Promise-based async execution
- Handles both success and error cases
- Properly rejects with stderr on error
16-21: LGTM: Basic completion test with snapshot verification.The test correctly uses the demo script path and verifies output with snapshots.
23-53: LGTM: Comprehensive default command completion tests.The test suite thoroughly covers:
- Basic option suggestion
- Long option completion
- Duplicate option handling
- Option value suggestions
- Short option completion
55-105: LGTM: Thorough subcommand completion testing.The test suite covers:
- Command-only completion
- Option suggestion for subcommands
- Long and short option completion
- Unknown option handling
- Option value resolution
- Edge cases with equals signs and partial inputs
The TODO test is acceptable for future implementation.
107-122: LGTM: Complete positional argument testing.The test suite covers:
- Multiple positional arguments
- Partial input completion
- Single positional argument scenarios
packages/plugin-completion/examples/demo.node.ts (1)
1-127: Example file appropriately demonstrates completion plugin usageThe example effectively showcases the completion plugin with comprehensive configuration for root arguments and subcommands. The pipeline failure reporting this as unused is expected for example files.
packages/shared/src/types.ts (2)
8-8: LGTM - Proper extension of imports for enhanced type safetyThe additional imports from 'gunshi' support the new Translation interface and maintain strict TypeScript types throughout the codebase.
73-85: Well-designed Translation interface with appropriate generic constraintsThe interface effectively handles localization keys and values with proper TypeScript generics. The eslint-disable for
anytype is acceptable given the generic nature of translation functions.packages/plugin-completion/src/utils.ts (1)
27-41: LGTM - Proper runtime detection with necessary type ignoresThe runtime detection function correctly identifies Node.js, Deno, and Bun environments. The @ts-ignore comments are necessary for cross-runtime compatibility as mentioned in the retrieved learnings.
packages/plugin-renderer/src/index.ts (2)
33-33: LGTM - Proper import of shared localization utilitiesThe import of
localizablefrom@gunshi/sharedaligns with the refactoring to use centralized localization logic.
107-107: Excellent refactoring to use shared localization utilitiesThe change from custom
textfunction to sharedlocalizablefunction improves code maintainability and consistency across the codebase while maintaining type safety.packages/plugin-completion/src/types.ts (2)
14-15: LGTM - Proper plugin ID generation using shared utilitiesThe plugin ID is correctly generated using the shared
namespacedIdfunction with appropriate typing.
31-50: Well-structured configuration interfacesThe
CompletionConfigandCompletionOptionsinterfaces provide a clear and flexible structure for configuring completion handlers.packages/plugin-i18n/src/types.ts (6)
16-16: Good import consolidation.Consolidating multiple imports from the same module into a single import statement follows ES module best practices and improves code readability.
22-24: Necessary type imports added.The addition of
RemovedIndexandTranslationtypes supports the centralization of type definitions across the codebase.
54-54: Excellent type centralization.Using the shared
Translationtype improves consistency and maintainability across the codebase while preserving the same type safety guarantees.
16-16: LGTM: Import consolidation improves readability.The consolidation of imports from
@gunshi/sharedinto a single import statement is a good practice that improves code readability and maintainability.
22-24: LGTM: Good addition of shared types.The import of
RemovedIndexandTranslationtypes from the shared package promotes type consistency across the codebase and follows the standardization effort mentioned in the AI summary.
54-54: LGTM: Excellent type refactoring using shared definition.The replacement of the inline generic function signature with the shared
Translation<CommandBuiltinKeys, G>type alias is a significant improvement that:
- Promotes type consistency across the codebase
- Reduces code duplication
- Makes the interface more maintainable
- Aligns with the broader localization standardization effort
The shared
Translationinterface (frompackages/shared/src/types.ts) provides the same functionality as the previous inline definition while ensuring consistency with other parts of the codebase.packages/gunshi/src/cli/core.ts (5)
7-7: Consistent constant naming.The rename to
CLI_OPTIONS_DEFAULTbetter reflects that these are CLI-level options rather than command-specific options.
134-145: Well-implemented entry command handling.The logic correctly handles all command types and properly sets the
entryflag, ensuring entry commands are included in the subcommands map when appropriate.
158-158: Consistent constant usage.Correctly uses the renamed
CLI_OPTIONS_DEFAULTconstant.
212-212: Proper entry flag for inline commands.Setting
entry: truefor inline command runners ensures consistent behavior across all command types.
254-260: Robust entry name resolution.The function properly handles both
CommandandLazyCommandtypes with appropriate type guards and fallback logic.packages/plugin-completion/src/index.ts (1)
30-141: Well-structured completion plugin implementation.The plugin provides comprehensive shell completion support with:
- Proper command and option handling
- Recursive subcommand processing
- Clean separation of concerns
- Appropriate filtering of internal/entry commands
The architecture is solid and extensible.
packages/shared/src/localize.ts (2)
17-26: Well-designed localization interface.The
Localizationinterface properly defines an async localization function with flexible generic types, enabling type-safe localization across different contexts.
28-68: Excellent localization implementation.The
localizablefunction provides comprehensive handling for:
- Built-in resource keys with proper prefix checking
- Argument keys with negatable boolean support
- Special keys like 'description' and 'examples'
- Graceful fallbacks when translation isn't available
The implementation is robust and well-thought-out.
| */ | ||
|
|
||
| import { pluginId as I18n } from './types.ts' | ||
| import { pluginId as Global } from './types.ts' |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Check alias naming for clarity & search for stale I18n usages
Renaming the alias from I18n to Global is fine type-wise, but the very generic identifier Global can be mistaken for the built-in global object in several runtimes. Consider using a more explicit name (globalPluginId or similar) to avoid mental clashes.
Also verify that no other files still reference the old I18n key; a stray reference will cause a runtime undefined destructuring error.
🏁 Script executed:
#!/bin/bash
# Ensure no stale `[I18n]` destructuring remains
rg -n "\[I18n\]" --glob "*.ts"Length of output: 32
🏁 Script executed:
#!/bin/bash
# Verify no remaining import alias or identifier named I18n across the TS codebase
# 1. Check for any residual import alias: `pluginId as I18n`
rg -n "pluginId as I18n" --glob "*.ts"
# 2. Look for any standalone references to the old `I18n` identifier
rg -n "\bI18n\b" --glob "*.ts"Length of output: 195
Rename Global alias for clarity & confirm no stale I18n references
The generic alias Global can be mistaken for the built-in global object at runtime. Please rename it to a more explicit identifier (for example, globalPluginId) to avoid confusion.
A code-wide search found no remaining uses of the old I18n identifier (aside from a comment in packages/plugin-i18n/src/types.ts), so there are no stale references that would cause runtime errors.
Files to update:
- packages/plugin-global/src/decorator.ts (line 6:
import { pluginId as Global } from './types.ts')
🤖 Prompt for AI Agents
In packages/plugin-global/src/decorator.ts at line 6, rename the imported alias
from `Global` to a more explicit name like `globalPluginId` to avoid confusion
with the built-in global object. Update the import statement accordingly to
`import { pluginId as globalPluginId } from './types.ts'`. Also, verify that all
references in this file use the new alias name to maintain consistency.
|
|
||
| import { namespacedId, PLUGIN_PREFIX } from '@gunshi/shared' | ||
|
|
||
| import type { Handler } from '@bombsh/tab' |
There was a problem hiding this comment.
Add type declaration for '@bombsh/tab' dependency
The TypeScript compiler cannot find a declaration file for the '@bombsh/tab' module. This needs to be resolved for proper type safety.
Add a type declaration file or install the types package:
// Option 1: Create a declaration file (e.g., types/bombsh-tab.d.ts)
declare module '@bombsh/tab' {
export interface Handler {
// Define the Handler interface based on bombsh/tab documentation
}
}
// Option 2: Install types if available
// npm install --save-dev @types/tab🧰 Tools
🪛 GitHub Actions: CI
[error] 8-8: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.
🤖 Prompt for AI Agents
In packages/plugin-completion/src/types.ts at line 8, the TypeScript compiler
cannot find type declarations for the '@bombsh/tab' module. To fix this, either
create a custom declaration file (e.g., types/bombsh-tab.d.ts) defining the
Handler interface according to the module's documentation, or check if a types
package exists and install it using npm (e.g., npm install --save-dev
@types/tab) to provide proper type safety.
| extension: (_ctx, _cmd): CompletionCommandContext => { | ||
| return {} as CompletionCommandContext | ||
| }, |
There was a problem hiding this comment.
Incomplete extension implementation.
The extension function returns an empty object cast to CompletionCommandContext. This appears to be placeholder code that should either be properly implemented or removed if extensions aren't needed for this plugin.
Do you want me to help implement the proper extension context or remove it if it's not needed?
🤖 Prompt for AI Agents
In packages/plugin-completion/src/index.ts at lines 80 to 82, the extension
function returns an empty object cast as CompletionCommandContext, which is
incomplete. You should either implement the extension function to return a
properly constructed CompletionCommandContext object with the necessary
properties and methods or remove the extension function entirely if this plugin
does not require any extension context.
| * @license MIT | ||
| */ | ||
|
|
||
| import { Completion, script } from '@bombsh/tab' |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Missing TypeScript declarations for '@bombsh/tab'.
The pipeline is failing because TypeScript cannot find type declarations for the '@bombsh/tab' module.
Either:
- Install type definitions if available:
npm install --save-dev @types/bombsh__tab - Or create a local declaration file
types/bombsh-tab.d.ts:
declare module '@bombsh/tab' {
export interface Handler {
(args: string[]): string[]
}
export class Completion {
addCommand(name: string, description: string, args: any[], handler: Handler): string
addOption(command: string, option: string, description: string, handler: Handler, short?: string): void
parse(args: string[]): Promise<void>
}
export function script(shell: string, name: string, exec: string): void
}Also applies to: 12-12
🏁 Script executed:
#!/bin/bash
# Display dependencies in root package.json
jq '{dependencies: .dependencies, devDependencies: .devDependencies}' package.json || true
# Search for any existing TypeScript declaration files or references for '@bombsh/tab'
rg "bombsh/tab" -g "*.d.ts" -g "*.ts" -g "*.json" || trueLength of output: 1946
Add TypeScript declarations for ‘@bombsh/tab’ in plugin-completion
The build is failing because the git-sourced package ‘@bombsh/tab’ doesn’t expose any .d.ts files. You have two options:
-
Upstream fix:
- In the
bombshell-dev/tabrepo, add atypesfield in itspackage.jsonpointing to declaration files (e.g."types": "dist/index.d.ts"), and commit the generated.d.tsoutputs. - Re-publish or push tags so that the git URL carries the declarations.
- In the
-
Local workaround:
- Create an ambient declaration under your plugin:
- File:
packages/plugin-completion/types/bombsh-tab.d.ts
declare module '@bombsh/tab' { export type Handler = (args: string[]) => string[]; export class Completion { addCommand( name: string, description: string, args: unknown[], handler: Handler ): string; addOption( command: string, option: string, description: string, handler: Handler, short?: string ): void; parse(args: string[]): Promise<void>; } export function script(shell: string, name: string, exec: string): void; }
- File:
- Update
packages/plugin-completion/tsconfig.jsonto include your types folder:{ "compilerOptions": { // …existing options… "typeRoots": ["./types", "../node_modules/@types"] } }
- Create an ambient declaration under your plugin:
Either approach will satisfy the imports in packages/plugin-completion/src/index.ts (lines 6 & 12) and restore type-checking.
🧰 Tools
🪛 GitHub Actions: CI
[error] 6-6: TypeCheckError: Could not find a declaration file for module '@bombsh/tab'. Try npm i --save-dev @types/tab or add a declaration file with declare module '@bombsh/tab';.
🤖 Prompt for AI Agents
In packages/plugin-completion/src/index.ts at line 6, the import from
'@bombsh/tab' fails due to missing TypeScript declarations. To fix this, either
update the upstream 'bombshell-dev/tab' repo to include and publish proper .d.ts
files with a "types" field in package.json, or locally create an ambient
declaration file at packages/plugin-completion/types/bombsh-tab.d.ts with the
necessary type definitions. Then, update
packages/plugin-completion/tsconfig.json to include the new types folder in
"typeRoots" so the compiler recognizes these declarations and restores
type-checking.
Description
Linked Issues
Additional context
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Tests
Chores