Skip to content

Release v0.7.0#127

Merged
vlavrynovych merged 24 commits into
masterfrom
release/0.7.0
Dec 13, 2025
Merged

Release v0.7.0#127
vlavrynovych merged 24 commits into
masterfrom
release/0.7.0

Conversation

@vlavrynovych
Copy link
Copy Markdown
Member

No description provided.

- Installed Husky and configured pre-commit hook
- Hook runs ESLint, full test suite, and coverage verification
- Added prepare script for automatic hook installation
- Updated development documentation with hook usage and bypass instructions
- Removed GitHub-style callouts from README.md (NPM incompatible)
…Loader

BREAKING CHANGE: Constructor now takes single parameter with config moved into dependencies object.

Key changes:
- Created IExecutorOptions and IConfigLoader interfaces
- ConfigLoader now generic and instance-based for adapter extensibility
- Updated constructor: `new MigrationScriptExecutor({ handler }, config)` → `new MigrationScriptExecutor({ handler, config })`
- All tests updated and passing (1226 tests, 100% coverage)
- Added v0.6-to-v0.7 migration guide

Benefits:
- Better adapter ergonomics with consolidated dependencies
- Extensible config loading via configLoader parameter
- Cleaner interface design with IExecutorOptions separation
Extracted complex workflows from MigrationScriptExecutor into 6 specialized
orchestrator services, reducing executor from 1030 to 218 lines.

New orchestrators:
- MigrationWorkflowOrchestrator - Coordinates migration workflow
- MigrationValidationOrchestrator - Validation and integrity checks
- MigrationReportingOrchestrator - Rendering and logging
- MigrationErrorHandler - Error recovery and rollback
- MigrationHookExecutor - Lifecycle hook execution
- MigrationRollbackManager - Rollback operations

Changes:
- Created 6 orchestrator interfaces and implementations
- Refactored executor to delegate to orchestrators
- Updated tests to use public API, maintained 100% coverage
- Added orchestrator pattern documentation with UML diagrams
- Restructured version migration sidemenu

No breaking changes - public API unchanged.
Implemented Facade and Factory patterns to reduce complexity and improve maintainability.

Services grouped into 4 logical facades (core, execution, output, orchestration).
Initialization logic extracted to MigrationServicesFactory.
Constructor reduced from 142 lines to 23 lines (83% reduction).
Fields reduced from 21 to 7 protected facades.
Moved executeBeforeMigrate to MigrationWorkflowOrchestrator.

Breaking changes: Service properties removed, use public API methods.
Protected facades enable adapter extensibility.
Created standalone EnvVarParser utility that automatically parses environment
variables into any config object using reflection. Eliminates manual mapping
for adapters.

Changes:
- EnvVarParser utility with automatic type detection and coercion
- Refactored ConfigLoader to delegate to EnvVarParser
- Added 24 tests, all 1252 tests passing with 100% coverage
- Updated documentation with usage examples

Benefits: Zero manual mapping, type-safe, reusable, framework-agnostic
@vlavrynovych vlavrynovych self-assigned this Dec 9, 2025
Replaced internal EnvVarParser with auto-envparse@1.1.0 npm package.

Key changes:
- Added auto-envparse@^1.1.0 as production dependency
- Updated ConfigLoader to import parse() from auto-envparse
- Deleted src/util/EnvVarParser.ts (now provided by package)
- Removed EnvVarParser from public exports
- Fixed test prefixes: TEST_DB → TESTDB (auto-envparse requires uppercase letters/numbers only)
- Updated documentation to reference standalone package

Breaking change: EnvVarParser no longer exported from src/util/index.ts
Changed glob pattern from test/**/*.ts to test/**/*.test.ts in the
test:mocha:report script to exclude helper files and only run actual test files.

This fixes CircleCI failure where mocha was trying to run helper files like
TestConfig.ts and TestUtils.ts as tests, causing "Unknown file extension .ts"
errors and incomplete coverage
- Created .github/workflows/test.yml to run tests on push and PRs
- Tests run on Node.js 16.x, 18.x, and 20.x
- Workflow runs lint, tests, and coverage
- Added test status badge to README.md
Removed Node 16 (EOL) from test matrix due to ESLint 9 incompatibility
(structuredClone not available in Node 16).
Removed Node 18 due to ts-node/mocha module loading incompatibility.
Focus on actively maintained LTS versions (20.x, 22.x).
- Changed from npm install to npm ci for reproducible builds
- Updated cache key to v2 and base on package-lock.json checksum
- Aligns CircleCI behavior with GitHub Actions
- Bumped CircleCI cache key to v3 to force fresh node_modules install
- Added "engines": {"node": ">=20.0.0"} to package.json (required by auto-envparse)
- This should resolve the TypeScript module loading issue in CircleCI
Added node-option to .mocharc.json to explicitly require ts-node/register
at Node level. Fixes "Unknown file extension .ts" error in CircleCI.
Removed test/**/*.test.ts argument from test:mocha:report script.
Now mocha uses the spec pattern from .mocharc.json, which allows
ts-node to properly register in Node 20+ environments.
- Added ts-node section to tsconfig.json with explicit commonjs module
- Added NODE_OPTIONS environment variable to CircleCI test step
- Ensures ts-node registers before mocha attempts to load .ts files
- Updated auto-envparse from 1.1.0 to 1.1.1
- New version provides CommonJS build (index.cjs) as main entry
- Removed ts-node section from tsconfig.json
- Removed node-option from .mocharc.json
- Removed NODE_OPTIONS from CircleCI test step

These workarounds were added to fix "Unknown file extension .ts" errors
when auto-envparse was ESM-only. Now that auto-envparse@1.1.1 provides
proper CommonJS build (index.cjs), these are no longer needed.
Implemented CLI functionality using Commander.js v12 with createCLI() factory.

Built-in Commands:
- migrate (up), list, down (rollback), validate, backup (create/restore/delete)

Key Features:
- Configuration waterfall: defaults → file → env → options → CLI flags
- extendCLI callback for type-safe custom commands (no casting needed)
- Generic type parameter TExecutor enables full type inference
- Common CLI flags: --config-file, --folder, --logger, --dry-run, etc.
- Exit codes 0-7 for different scenarios

Testing & Documentation:
- 100% coverage maintained (1400 tests, added 102 CLI tests)
- Comprehensive CLI Adapter Development Guide (400+ lines)
- Updated all relevant docs and examples to demonstrate extendCLI
…tion

Created 4 new guides (CLI vs API, production deployment, CI/CD integration, Docker/Kubernetes) with decision matrices, security best practices, and
platform-specific examples.

Updated getting-started.md and index.md with production warnings emphasizing CLI for production, API for development only.
Upgraded to v2.1.0 with new ParseOptions API: AutoEnvParse.parse(config, { prefix, overrides, sources })
Added config.envFileSources property enabling multi-source .env file loading (.env.local, .env.production, etc.) with priority control.
Updated ConfigLoader, 12 tests, and 11 documentation files.
@vlavrynovych vlavrynovych added this to the v0.7.0 milestone Dec 13, 2025
Fixed 4 tests to specify error type and validate error messages.

- cli/createCLI.test.ts - validates version string
- ChecksumService.test.ts - validates filename and EISDIR code
- ConfigLoader.test.ts - validates filename
@sonarqubecloud
Copy link
Copy Markdown

@vlavrynovych vlavrynovych merged commit f49d684 into master Dec 13, 2025
7 checks passed
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