-
Notifications
You must be signed in to change notification settings - Fork 961
fix(global-config): respect XDG_CONFIG_HOME on all platforms #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Prioritize XDG_CONFIG_HOME on Windows to fix test environment overrides. Previously, Windows would always use APPDATA regardless of XDG_CONFIG_HOME, causing tests to fail. Now XDG_CONFIG_HOME is checked first on all platforms before falling back to platform-specific defaults. Also update the Windows APPDATA test to explicitly clear XDG_CONFIG_HOME when testing the fallback behavior.
WalkthroughThe pull request consolidates XDG_CONFIG_HOME environment variable handling into a single cross-platform check in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10–15 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)src/core/global-config.ts (1)
🔇 Additional comments (5)
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. Comment |
* fix(global-config): respect XDG_CONFIG_HOME on all platforms (Fission-AI#378) Prioritize XDG_CONFIG_HOME on Windows to fix test environment overrides. Previously, Windows would always use APPDATA regardless of XDG_CONFIG_HOME, causing tests to fail. Now XDG_CONFIG_HOME is checked first on all platforms before falling back to platform-specific defaults. Also update the Windows APPDATA test to explicitly clear XDG_CONFIG_HOME when testing the fallback behavior. * fix(cli): prevent hang in pre-commit hooks by using dynamic imports (Fission-AI#380) Fixes Fission-AI#367 The CLI was hanging when run as a pre-commit hook because @inquirer/prompts was statically imported at module load time. Even when prompts were never called (e.g., `openspec validate --specs --no-interactive`), the import itself could set up stdin references that prevented clean process exit when stdin was piped. Changes: - Convert all static `@inquirer/prompts` imports to dynamic imports - Dynamically import `InitCommand` (which uses `@inquirer/core`) - Update `isInteractive()` to accept options object with both `noInteractive` and Commander's negated `interactive` property - Handle empty validation queue with proper exit code Now when running in non-interactive mode, the inquirer modules are never loaded, allowing the process to exit cleanly after completion. * feat(cli): add plx command alias and rebrand as OpenSplx (OpenSplx-#1) - Add `plx` as an alias command alongside `openspec` - Create OpenSplx pixel art logo assets (light/dark themes) - Update README with fork notice and Quick Start section - Make CLI command name dynamic based on invocation - Update completion system to support both command names - Add command-name utility for detecting invoked command * feat(cli): add external issue tracking support - Add YAML frontmatter parsing for tracked issues in proposal.md - Display issue identifiers in `openspec list` output - Include trackedIssues in `openspec show --json` output - Report tracked issues when archiving changes - Add External Issue Tracking section to AGENTS.md template - Add TrackedIssue schema and type exports * fix(cli): address PR review feedback and archive external issue tracking - Fix list.ts alignment to include issue display in width calculation - Fix command-name.ts to handle Windows extensions and cross-platform paths - Fix postinstall.js to install completions for both openspec and plx - Fix change.ts issue display format (after title in long format) - Add comprehensive unit tests for all fixes - Archive add-external-issue-tracking change with spec updates --------- Co-authored-by: Tabish Bidiwale <30385142+TabishB@users.noreply.github.com>
* fix(global-config): respect XDG_CONFIG_HOME on all platforms (Fission-AI#378) Prioritize XDG_CONFIG_HOME on Windows to fix test environment overrides. Previously, Windows would always use APPDATA regardless of XDG_CONFIG_HOME, causing tests to fail. Now XDG_CONFIG_HOME is checked first on all platforms before falling back to platform-specific defaults. Also update the Windows APPDATA test to explicitly clear XDG_CONFIG_HOME when testing the fallback behavior. * fix(cli): prevent hang in pre-commit hooks by using dynamic imports (Fission-AI#380) Fixes Fission-AI#367 The CLI was hanging when run as a pre-commit hook because @inquirer/prompts was statically imported at module load time. Even when prompts were never called (e.g., `openspec validate --specs --no-interactive`), the import itself could set up stdin references that prevented clean process exit when stdin was piped. Changes: - Convert all static `@inquirer/prompts` imports to dynamic imports - Dynamically import `InitCommand` (which uses `@inquirer/core`) - Update `isInteractive()` to accept options object with both `noInteractive` and Commander's negated `interactive` property - Handle empty validation queue with proper exit code Now when running in non-interactive mode, the inquirer modules are never loaded, allowing the process to exit cleanly after completion. * feat(cli): add plx command alias and rebrand as OpenSplx (OpenSplx-#1) - Add `plx` as an alias command alongside `openspec` - Create OpenSplx pixel art logo assets (light/dark themes) - Update README with fork notice and Quick Start section - Make CLI command name dynamic based on invocation - Update completion system to support both command names - Add command-name utility for detecting invoked command * feat(cli): add external issue tracking support - Add YAML frontmatter parsing for tracked issues in proposal.md - Display issue identifiers in `openspec list` output - Include trackedIssues in `openspec show --json` output - Report tracked issues when archiving changes - Add External Issue Tracking section to AGENTS.md template - Add TrackedIssue schema and type exports * fix(cli): address PR review feedback and archive external issue tracking - Fix list.ts alignment to include issue display in width calculation - Fix command-name.ts to handle Windows extensions and cross-platform paths - Fix postinstall.js to install completions for both openspec and plx - Fix change.ts issue display format (after title in long format) - Add comprehensive unit tests for all fixes - Archive add-external-issue-tracking change with spec updates --------- Co-authored-by: Tabish Bidiwale <30385142+TabishB@users.noreply.github.com>
Prioritize XDG_CONFIG_HOME on Windows to fix test environment overrides. Previously, Windows would always use APPDATA regardless of XDG_CONFIG_HOME, causing tests to fail. Now XDG_CONFIG_HOME is checked first on all platforms before falling back to platform-specific defaults. The Windows APPDATA test is updated to explicitly clear XDG_CONFIG_HOME when testing the fallback behavior.
Fixes failing Windows tests in test/core/global-config.test.ts.
Summary by CodeRabbit
Bug Fixes
XDG_CONFIG_HOMEenvironment variable across all platforms with appropriate platform-specific fallbacks.Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.