Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 0 additions & 97 deletions .changeset/normalized-audit-schema.md

This file was deleted.

22 changes: 0 additions & 22 deletions .changeset/update-readmes.md

This file was deleted.

107 changes: 107 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,112 @@
# @effect-migrate/cli

## 0.4.0

### Minor Changes

- [#41](https://github.com/aridyckovsky/effect-migrate/pull/41) [`f22c2dd`](https://github.com/aridyckovsky/effect-migrate/commit/f22c2dd9e1872c4147cced57b22545bc8a48bc95) Thanks [@aridyckovsky](https://github.com/aridyckovsky)! - Add normalized schema for 40-70% audit.json size reduction and move business logic to core

**Breaking Changes:**
1. **Schema version 0.1.0 → 0.2.0** (audit.json - no backwards compatibility)
- Replace `byFile`/`byRule` with deduplicated `rules[]`, `files[]`, `results[]` arrays
- Add index-based groupings in `groups` field for O(1) lookup
- Implement deterministic ordering (sorted rules/files) for reproducible output
- Add stable content-based keys for cross-checkpoint delta computation
- Compact range representation using tuples instead of objects
- Add separate `info` counter to FindingsSummary (previously counted as warnings)
2. **CLI loaders removed** - business logic moved to @effect-migrate/core
- ❌ Removed `@effect-migrate/cli/loaders/config` - use `@effect-migrate/core` exports instead
- ❌ Removed `@effect-migrate/cli/loaders/presets` - use `PresetLoader` service instead

**New @effect-migrate/core exports:**

Config utilities:
- `mergeConfig(defaults, userConfig)` - Merge preset defaults with user config
- `deepMerge(target, source)` - Deep merge plain objects (arrays replaced, not concatenated)
- `isPlainObject(value)` - Type guard for plain objects

Preset loading:
- `PresetLoader` - Context.Tag for preset loading service
- `PresetLoaderService` - Service interface
- `PresetLoaderNpmLive` - Default Layer for npm-based preset resolution
- `PresetLoadError` - Tagged error for preset loading failures
- `Preset` - Preset type (rules + optional defaults)
- `LoadPresetsResult` - Result of loading multiple presets

Rule construction:
- `rulesFromConfig(config)` - Build rules from config (pattern + boundary)

Schema enhancements:
- Config now supports `presets?: string[]` field for preset names

Normalizer utilities:
- `normalizeResults(results, config, threads?)` - Convert to normalized schema
- `expandResult(normalized)` - Convert back to flat format
- `deriveResultKey(result)` - Generate stable content-based key

**@effect-migrate/cli changes:**

New workspace-aware preset resolution:
- `PresetLoaderWorkspaceLive` - Layer that tries workspace path first, falls back to npm
- Supports monorepo development with automatic workspace preset detection
- Windows-compatible file URL handling with `pathToFileURL()`

Refactored loaders:
- `loadRulesAndConfig()` now orchestrates core services instead of implementing logic
- Uses `Effect.catchTag("PresetLoadError")` for precise error handling
- Reduced CLI code by ~1291 lines (60% reduction in loaders)

**Build improvements:**
- Implement TypeScript Project References (src/test separation) for proper type checking
- Fix NodeNext module resolution (.js extension requirements)
- Consolidate test organization (all tests in `test/` directories)
- Fix barrel import violations (use direct imports from @effect/platform)
- Remove duplicate utils folder (merged util/ into utils/)

**Migration guide:**

If you were importing from CLI loaders:

```typescript
// Before
import { loadConfig } from "@effect-migrate/cli/loaders/config"
import { loadPresets } from "@effect-migrate/cli/loaders/presets"

// After
import { loadConfig, PresetLoader } from "@effect-migrate/core"

const config = yield * loadConfig(configPath)
const loader = yield * PresetLoader
const { rules, defaults } = yield * loader.loadPresets(config.presets ?? [])
```

**Test coverage:**
- 50 new tests for core utilities (config merge, preset loading, rule builders)
- 6 new tests for CLI workspace preset resolution
- 40+ tests for normalized schema
- Total: 308 tests passing

### Patch Changes

- [#41](https://github.com/aridyckovsky/effect-migrate/pull/41) [`cbd8eb9`](https://github.com/aridyckovsky/effect-migrate/commit/cbd8eb9f44505ca2bfeff235cdd6cf5c90a9bc74) Thanks [@aridyckovsky](https://github.com/aridyckovsky)! - Update all READMEs to reflect current architecture and published usage

**Documentation improvements:**
- Root README: Accurate CLI commands, output schemas (index.json, audit.json, metrics.json, threads.json), real rule examples, proper roadmap
- CLI README: Complete options documentation (--strict, --log-level, --amp-out), troubleshooting guide, local development instructions
- Core README: Comprehensive exported API documentation, service architecture, Layer patterns, real rule examples from preset-basic

**Key updates:**
- Reflect dogfooding status and unstable API warnings across all packages
- Document complementary relationship with @effect/language-service
- Add proper roadmap with planned features (SQLite, Polars, OpenTelemetry, MCP server, workflow orchestration)
- User-focused: Published npm usage as primary, local development as secondary
- Real examples from actual codebase (patterns.ts, boundaries.ts)

Resolves #24

- Updated dependencies [[`f22c2dd`](https://github.com/aridyckovsky/effect-migrate/commit/f22c2dd9e1872c4147cced57b22545bc8a48bc95), [`cbd8eb9`](https://github.com/aridyckovsky/effect-migrate/commit/cbd8eb9f44505ca2bfeff235cdd6cf5c90a9bc74)]:
- @effect-migrate/core@0.4.0

## 0.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@effect-migrate/cli",
"version": "0.3.0",
"version": "0.4.0",
"description": "CLI tool for Effect migration",
"license": "MIT",
"repository": {
Expand Down
104 changes: 104 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,109 @@
# @effect-migrate/core

## 0.4.0

### Minor Changes

- [#41](https://github.com/aridyckovsky/effect-migrate/pull/41) [`f22c2dd`](https://github.com/aridyckovsky/effect-migrate/commit/f22c2dd9e1872c4147cced57b22545bc8a48bc95) Thanks [@aridyckovsky](https://github.com/aridyckovsky)! - Add normalized schema for 40-70% audit.json size reduction and move business logic to core

**Breaking Changes:**
1. **Schema version 0.1.0 → 0.2.0** (audit.json - no backwards compatibility)
- Replace `byFile`/`byRule` with deduplicated `rules[]`, `files[]`, `results[]` arrays
- Add index-based groupings in `groups` field for O(1) lookup
- Implement deterministic ordering (sorted rules/files) for reproducible output
- Add stable content-based keys for cross-checkpoint delta computation
- Compact range representation using tuples instead of objects
- Add separate `info` counter to FindingsSummary (previously counted as warnings)
2. **CLI loaders removed** - business logic moved to @effect-migrate/core
- ❌ Removed `@effect-migrate/cli/loaders/config` - use `@effect-migrate/core` exports instead
- ❌ Removed `@effect-migrate/cli/loaders/presets` - use `PresetLoader` service instead

**New @effect-migrate/core exports:**

Config utilities:
- `mergeConfig(defaults, userConfig)` - Merge preset defaults with user config
- `deepMerge(target, source)` - Deep merge plain objects (arrays replaced, not concatenated)
- `isPlainObject(value)` - Type guard for plain objects

Preset loading:
- `PresetLoader` - Context.Tag for preset loading service
- `PresetLoaderService` - Service interface
- `PresetLoaderNpmLive` - Default Layer for npm-based preset resolution
- `PresetLoadError` - Tagged error for preset loading failures
- `Preset` - Preset type (rules + optional defaults)
- `LoadPresetsResult` - Result of loading multiple presets

Rule construction:
- `rulesFromConfig(config)` - Build rules from config (pattern + boundary)

Schema enhancements:
- Config now supports `presets?: string[]` field for preset names

Normalizer utilities:
- `normalizeResults(results, config, threads?)` - Convert to normalized schema
- `expandResult(normalized)` - Convert back to flat format
- `deriveResultKey(result)` - Generate stable content-based key

**@effect-migrate/cli changes:**

New workspace-aware preset resolution:
- `PresetLoaderWorkspaceLive` - Layer that tries workspace path first, falls back to npm
- Supports monorepo development with automatic workspace preset detection
- Windows-compatible file URL handling with `pathToFileURL()`

Refactored loaders:
- `loadRulesAndConfig()` now orchestrates core services instead of implementing logic
- Uses `Effect.catchTag("PresetLoadError")` for precise error handling
- Reduced CLI code by ~1291 lines (60% reduction in loaders)

**Build improvements:**
- Implement TypeScript Project References (src/test separation) for proper type checking
- Fix NodeNext module resolution (.js extension requirements)
- Consolidate test organization (all tests in `test/` directories)
- Fix barrel import violations (use direct imports from @effect/platform)
- Remove duplicate utils folder (merged util/ into utils/)

**Migration guide:**

If you were importing from CLI loaders:

```typescript
// Before
import { loadConfig } from "@effect-migrate/cli/loaders/config"
import { loadPresets } from "@effect-migrate/cli/loaders/presets"

// After
import { loadConfig, PresetLoader } from "@effect-migrate/core"

const config = yield * loadConfig(configPath)
const loader = yield * PresetLoader
const { rules, defaults } = yield * loader.loadPresets(config.presets ?? [])
```

**Test coverage:**
- 50 new tests for core utilities (config merge, preset loading, rule builders)
- 6 new tests for CLI workspace preset resolution
- 40+ tests for normalized schema
- Total: 308 tests passing

### Patch Changes

- [#41](https://github.com/aridyckovsky/effect-migrate/pull/41) [`cbd8eb9`](https://github.com/aridyckovsky/effect-migrate/commit/cbd8eb9f44505ca2bfeff235cdd6cf5c90a9bc74) Thanks [@aridyckovsky](https://github.com/aridyckovsky)! - Update all READMEs to reflect current architecture and published usage

**Documentation improvements:**
- Root README: Accurate CLI commands, output schemas (index.json, audit.json, metrics.json, threads.json), real rule examples, proper roadmap
- CLI README: Complete options documentation (--strict, --log-level, --amp-out), troubleshooting guide, local development instructions
- Core README: Comprehensive exported API documentation, service architecture, Layer patterns, real rule examples from preset-basic

**Key updates:**
- Reflect dogfooding status and unstable API warnings across all packages
- Document complementary relationship with @effect/language-service
- Add proper roadmap with planned features (SQLite, Polars, OpenTelemetry, MCP server, workflow orchestration)
- User-focused: Published npm usage as primary, local development as secondary
- Real examples from actual codebase (patterns.ts, boundaries.ts)

Resolves #24

## 0.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@effect-migrate/core",
"version": "0.3.0",
"version": "0.4.0",
"description": "Core engine for Effect migration tooling",
"license": "MIT",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions packages/preset-basic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @effect-migrate/preset-basic

## 0.3.1

### Patch Changes

- Updated dependencies [[`f22c2dd`](https://github.com/aridyckovsky/effect-migrate/commit/f22c2dd9e1872c4147cced57b22545bc8a48bc95), [`cbd8eb9`](https://github.com/aridyckovsky/effect-migrate/commit/cbd8eb9f44505ca2bfeff235cdd6cf5c90a9bc74)]:
- @effect-migrate/core@0.4.0

## 0.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/preset-basic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@effect-migrate/preset-basic",
"version": "0.3.0",
"version": "0.3.1",
"description": "Basic preset for Effect migration patterns",
"license": "MIT",
"repository": {
Expand Down