Skip to content

Feat/menu consolidation#16

Merged
jnerytech merged 9 commits intomainfrom
feat/menu-consolidation
Mar 1, 2026
Merged

Feat/menu consolidation#16
jnerytech merged 9 commits intomainfrom
feat/menu-consolidation

Conversation

@jnerytech
Copy link
Copy Markdown
Owner

No description provided.

jnerytech and others added 9 commits March 1, 2026 12:33
- Add nested 'Root Folder' submenu (clipsterMenu.copyRoot) so the 3
  root-folder commands collapse into a single entry instead of 3 slots
- Add contextual when clauses: folder-only commands (copyFolderStructure,
  copyFolderStructureAndContent) hidden when clicking files; file-only
  commands (copyFileContentWithHeader) hidden when clicking folders
- Remove two dead settings (showCopyFileContents, showInClipsterSubmenu)
  that were declared in package.json but never read by any code
- Update CLAUDE.md to reflect the cleaned-up settings table and menu
  architecture

Result: max ~7 visible items per context (down from ~12)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirrors copyFolderFilesWithLineNumbers but appends VS Code diagnostics
(errors/warnings) for each file. Appears in the Clipster submenu when
right-clicking a folder, alongside the line-numbers variant.

- Add copyFolderFilesWithDiagnostics to fileHelpers.ts (recursive
  traversal, size-limit guard, diagnostics via vscode.languages.getDiagnostics)
- Register clipster.copyFolderFilesWithDiagnostics in extension.ts
- Add command, setting (showCopyFolderFilesWithDiagnostics), and menu
  entry (when: explorerResourceIsFolder) to package.json
- Extend vscode mock with languages.getDiagnostics and DiagnosticSeverity
- Add 6 tests covering: no diagnostics, formatted issues, info message,
  size limit truncation, empty folder, clipboard write failure
- Update CLAUDE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduce a thin Platform interface so core logic (fileHelpers, directoryUtils,
pathUtils) has zero direct vscode imports and runs unchanged under both the VS
Code extension and a new Node.js CLI.

Key changes:
- src/platform.ts: Platform interface + initPlatform/getPlatform singleton
- src/platforms/vscode-platform.ts: VS Code implementation
- src/platforms/cli-platform.ts: CLI implementation (stdout clipboard, stderr messages)
- src/cli.ts: CLI entry point (process.argv → core functions, output to stdout)
- src/fileContent.ts: pure readFileContent/isFile — no vscode dependency
- src/fileHelpers.ts: remove vscode import; use getPlatform() for all messages
- src/directoryUtils.ts: use getPlatform().message.error instead of messageUtils
- src/pathUtils.ts: use getPlatform().message.error instead of messageUtils
- src/fileUtils.ts: re-exports readFileContent/isFile from fileContent.ts
- tsconfig.cli.json + package.json bin/build:cli for CLI compilation
- All tests updated to use mockPlatform instead of vscode mocks

CLI usage: node dist/src/cli.js structure src/ | clip

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document all CLI commands, examples, and platform-specific clipboard
pipe targets (clip/pbcopy/xclip). Also removes stale showInClipsterSubmenu
setting reference and adds build:cli to the scripts list.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add files field so npm includes dist/src/ in the package (dist/ is
gitignored so without this, the compiled cli.js was excluded). Add
prepack script to auto-build CLI before npm pack/publish/install.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace hand-rolled argv parsing with Commander for auto-generated help
text, typed subcommands, and -n/-d shorthand flags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ides

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jnerytech jnerytech merged commit 5dd0c4b into main Mar 1, 2026
2 checks passed
@jnerytech jnerytech deleted the feat/menu-consolidation branch March 1, 2026 17:58
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.

1 participant