Releases: t1mmen/srtd
v1.0.0
Major Changes
-
8776e40: # srtd 1.0.0 - One Year, 100 Stars
Happy New Year! 365 days since srtd's first public release. What started as a tool to scratch a two-year itch is now solid enough for day-to-day use.
What's New
Architecture
- Dropped React/Ink - Zero React version conflicts
- Non-TTY compatible - Works in CI and with LLM automation
Features
srtd doctor- Diagnose setup issues--jsonflag - Machine-readable output (NDJSON for watch)@depends-on- Template dependency ordering--bundle- Combine templates into single migration- Custom filenames -
$timestamp,$migrationName,$prefixvariables
DX
- Actionable Postgres error hints
- Claude Code integration
- Refreshed CLI with better formatting
- Watch mode: press
bto build
Stability
- Race condition fixes
- Build log validation
- Cross-platform line endings
- Security fixes
- 528+ tests passing
Thanks to everyone who starred and provided feedback!
Minor Changes
-
79f8254: Add
srtd doctorcommand for diagnosing setup issuesNew diagnostic command that validates your SRTD configuration:
- Checks config file exists and schema is valid
- Verifies template and migration directories exist and have correct permissions
- Validates build log integrity
- Tests database connectivity
- Confirms templates are present
Run
srtd doctorto quickly identify setup problems. -
162ba2e: Add customizable migration filename templates with
migrationFilenameconfig optionYou can now customize how migration files are named and organized using template variables:
$timestamp- The migration timestamp (e.g.,20240101123456)$migrationName- The template name (e.g.,create_users)$prefix- The migration prefix with trailing dash (e.g.,srtd-)
Example configurations:
// Default (current behavior) { "migrationFilename": "$timestamp_$prefix$migrationName.sql" } // → migrations/20240101123456_srtd-create_users.sql // Directory-based organization (Issue #41) { "migrationFilename": "$migrationName/migrate.sql" } // → migrations/create_users/migrate.sql // Timestamp subdirectories { "migrationFilename": "$timestamp/$migrationName.sql" } // → migrations/20240101123456/create_users.sql
This enables projects with existing migration directory structures to use srtd without post-processing scripts.
-
28f61fc: Drop React/Ink dependency in favor of Commander.js
Why this change:
-
Dependency isolation: srtd previously depended on React and Ink, which caused conflicts when installed in projects using different React versions. The CLI now has zero React dependencies, eliminating version conflicts entirely.
-
Non-TTY compatibility: Improved support for running srtd in non-interactive environments (CI pipelines, LLM-driven automation like Claude Code). Commands now provide clear error messages when TTY is required, with flag-based alternatives for scripted usage.
-
Architectural cleanup: Internal rewrite from a monolithic design to a service-oriented architecture. This is transparent to users but improves reliability and maintainability.
New in this release:
build --bundle(-b): Bundle all templates into a single migration file. Useful for deploying multiple related changes atomically.
No breaking changes: All commands, flags, and configuration options remain identical. Existing
srtd.config.jsonand.buildlog.jsonfiles work without modification. -
-
7387771: Add actionable hints for Postgres errors
When SQL templates fail, cryptic Postgres error codes now get translated into actionable hints. Instead of just seeing
42P01, users see: "Table or view does not exist. Ensure the migration that creates it has run first."- Maps 17 common Postgres error codes (42xxx, 23xxx, 25xxx, 40xxx, 53xxx, 57xxx, 08xxx) to plain-English hints
- Pattern-based fallback for connection/permission/timeout errors
- Hints display in cyan after error messages across all commands
-
085985b: Add
--jsonflag to all commands for machine-readable output- Batch commands (
build,apply,register,promote,clear,init): Output single JSON object with command-specific structure - Streaming commands (
watch): Output NDJSON (newline-delimited JSON) with events for template changes, applies, and errors - All commands share base envelope:
{ success, command, timestamp }with command-specific fields - Useful for CI/CD pipelines, LLM integrations, and programmatic consumption
- Batch commands (
-
29d0d0e: Add dependency ordering for SQL templates via @depends-on comments
Templates can now declare dependencies on other templates using comments:
-- @depends-on: users_table.sql, roles.sql CREATE VIEW active_users AS ...
Features:
- Templates sorted so dependencies apply/build first
- Circular dependencies detected and reported
- Case-insensitive filename matching
- Multiple @depends-on comments supported
Use
--no-depsflag to disable if needed:srtd apply --no-deps srtd build --no-deps
-
ae15bc5: Complete CLI UI refresh with unified data model and improved developer experience:
Unified Type System
- New
TemplateResulttype unifies build, apply, and watch displays - Distinct statuses:
success,built,unchanged,skipped,error,changed RenderContextprovides command-aware rendering
Visual Improvements
- Arrow format display:
template.sql → migration.sql - WIP templates show "(wip)" indicator and are properly skipped in build
- Log-style ordering: oldest at top, newest at bottom (chronological)
- Color-coded status: green (success/built), yellow (skipped), red (error), dim (unchanged)
Watch Mode Enhancements
- Press
bto trigger build without leaving watch mode - "Pending build" section shows templates needing build with reasons
- Historic activity loaded from build log on startup
- Stacked events collapse consecutive changes (e.g., "changed, applied")
- buildOutdated annotation when changes invalidate previous builds
Error Display
- SQL context with line numbers around error location
- Caret positioning for precise error indication
- Inline error context in watch mode activity log
New Utilities
formatPath: Smart path truncation (…/parent/file.sql), filename extractionformatTime: Relative time ("5m ago") and timestamp formattingerrorContext: Shared gutter-style error rendering
Dead Code Cleanup
- Removed legacy
badge.ts(stat badges) - Removed legacy
results.ts(old rendering) - Replaced with unified
resultsTable.ts
Testing
- Added
StateService.getRecentActivitytests - 13+ new UI component test files
- Expanded command integration tests
- New
Patch Changes
-
7a7eeb8: Consistent color semantics across CLI output (green=success, dim=unchanged, yellow=WIP, red=error).
-
e2fd499: fix: resolve MigrationBuilder configuration bug
Fix MigrationBuilder.fromConfig() passing undefined values that overwrote constructor defaults. This caused migrations to use undefined values instead of the intended defaults when optional config fields were not set.
- Use conditional spread to only include defined config values
- Add ResolvedMigrationBuilderConfig type to eliminate non-null assertions
-
229bf6f: chore: fix security vulnerabilities
- Remove task-master-ai dev dependency (source of 4 vulnerabilities including high-severity CVEs in @anthropic-ai/claude-code and jsondiffpatch)
- Update transitive dependencies via npm audit fix (fixes jws, @modelcontextprotocol/sdk, body-parser, brace-expansion vulnerabilities)
Resolves all 12 Dependabot security alerts (9 high, 1 moderate, 2 low → 0 vulnerabilities).
-
be7a6e3: fix: correct menu command invocation to not include command name in args
When using standalone Commander.js commands, the command already knows its name.
Passing['node', 'srtd', 'init']caused "too many arguments" error.
Fixed to use['node', 'srtd']for all menu command invocations. -
27e3031: Add warning when template directory does not exist. Previously
getConfigwould silently continue if the configured template directory was missing, which could lead to confusing "no templates found" errors later. Now a clear warning is returned inConfigResult.warningsthat consumers can display or handle appropriately. -
e2fd499: fix: declare --non-interactive flag in CLI
The --non-interactive flag was being checked but never declared in Commander.js, causing it to be silently ignored. Now properly declared as a global option.
- Add --non-interactive option to main program
- Fix exit code to preserve command status (was always 0 in non-interactive mode)
-
005682e: Fix race conditions in signal handlers and auto-save error handling:
- Remove duplicate SIGINT/SIGTERM handlers from DatabaseService that caused race conditions during shutdown
- Fix silent auto-save failures in StateService that could cause unhandled promise rejections
-
2c80386: Normalize line endings before hash calculation for cross-platform consistency
Template hash values are now consistent across Windows (CRLF) and Unix/macOS (LF) environments. This prevents unnecessary migration rebuilds when the same template is processed on dif...
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
Minor Changes
- e96e857: Allow clearning local, common logs, and resetting of config.
- e96e857: Greatly improve watch mode stability, while reducing and simplifying the implementation. Add tests.
- e96e857: Load templates created while
watchis already running. Restarting no longer necessary
Patch Changes
v0.3.0
Minor Changes
-
fbe4240: Hopefully fix watch mode performance issues, tweak UI feedback, etc.
(There does seem to be some timeout/hangup issues for apply/build, but shipping this anyway to fix the breaking bugs)