Add file migration system with CLI and comprehensive test coverage#3
Merged
Add file migration system with CLI and comprehensive test coverage#3
Conversation
Bundle the CLI into a self-contained CommonJS file using esbuild to ensure reliable execution when installed globally. This resolves runtime dependency resolution issues by: - Bundling all dependencies into a single file (dist/cli.cjs) - Injecting the version at build time via esbuild defines - Using .cjs extension to ensure Node treats it as CommonJS in an ESM package Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Merged linting/prettier setup from main while keeping esbuild bundling changes. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Test that builds the CLI and verifies all commands execute correctly: - Binary execution with help and version output - status command showing pending/applied migrations - up command applying migrations and dry-run mode - create command generating migration files - Error handling with proper exit codes - Custom migrations directory support Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Build scripts use Node.js globals (console) that ESLint doesn't recognize without additional configuration. Simplest fix is to exclude them. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The bundled CLI couldn't load TypeScript migration files in plain Node.js environments because Node.js doesn't natively understand .ts files. Changes: - Update loader to support .ts, .mjs, and .js migration file extensions - Update CLI tests to use .mjs files which work in all Node.js environments - Add tests for the new extension support Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document `npm run format` in CLAUDE.md and clarify auto-fix commands in the final-review skill. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add explicit tests that verify .mjs and .js migration files work correctly with the bundled CLI. These tests clear NODE_OPTIONS to simulate a clean environment without TypeScript loaders. Background: The CI failure occurred because Node.js 20 (used in CI) cannot natively import .ts files, while Node.js 24 (used locally) has experimental TypeScript support. The tests document this behavior and ensure .mjs/.js files work across all Node versions. Co-Authored-By: Claude Opus 4.5 <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
status,up, andcreateCLI commands for managing migrationsChanges
.historyfilestatus,up(with--dry-run),createTest Plan
npm test🤖 Generated with Claude Code