Skip to content

refactor: extract perstack-toml package and move config resolution to app layer#517

Merged
FL4TLiN3 merged 4 commits intomainfrom
refactor/extract-perstack-toml-package
Feb 15, 2026
Merged

refactor: extract perstack-toml package and move config resolution to app layer#517
FL4TLiN3 merged 4 commits intomainfrom
refactor/extract-perstack-toml-package

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Feb 15, 2026

Summary

  • Extract @perstack/perstack-toml package for TOML config and lockfile operations
  • Move getPerstackConfig, findLockfile, loadLockfile calls from library packages (@perstack/tui, @perstack/installer) to .action() handlers in apps/perstack and apps/create-expert
  • Make perstackConfig required in resolveRunContext, startHandler, runHandler, installHandler — libraries receive pre-resolved config
  • Fix create-expert module-level config loading that could break --help when perstack.toml is missing
  • Remove @perstack/perstack-toml and memfs dependencies from @perstack/tui

Motivation

Config resolution (file lookup, TOML parsing) is an application-level concern. Having it inside library packages (@perstack/tui, @perstack/installer) caused:

  1. smol-toml dependency scattered across 3 packages
  2. Libraries performing I/O they shouldn't own
  3. create-expert --help failing when perstack.toml is absent (module-level parse)
  4. Unnecessary coupling between packages

Test plan

  • pnpm typecheck — 22/22 pass
  • pnpm test — 100 files, 1093 tests pass
  • pnpm build — 22/22 pass
  • pnpm format-and-lint — clean (pre-existing warnings only)
  • pnpm run validate:changeset — pass

🤖 Generated with Claude Code

@FL4TLiN3 FL4TLiN3 changed the title refactor: extract @perstack/perstack-toml package refactor: extract perstack-toml package and move config resolution to app layer Feb 15, 2026
@FL4TLiN3 FL4TLiN3 enabled auto-merge (squash) February 15, 2026 10:40
FL4TLiN3 and others added 4 commits February 15, 2026 10:40
… lockfile operations

Consolidate perstack.toml parsing, config resolution, and lockfile management
into a single dedicated package, eliminating code duplication across tui,
installer, and create-expert.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… layer

Config resolution (getPerstackConfig, findLockfile, loadLockfile) is an
application concern, not a library concern. Move it to .action() handlers
in apps/perstack and apps/create-expert so that --help works without a
valid perstack.toml and library packages receive pre-resolved config.

- Make perstackConfig required in resolveRunContext, startHandler, runHandler
- Add RunHandlerOptions with perstackConfig and lockfile
- Make installHandler receive configPath and perstackConfig as parameters
- Remove @perstack/perstack-toml and memfs dependencies from @perstack/tui
- Update context tests to pass PerstackConfig directly instead of TOML files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 force-pushed the refactor/extract-perstack-toml-package branch from bba9e02 to a5d96d3 Compare February 15, 2026 10:40
@FL4TLiN3 FL4TLiN3 merged commit 4eae2f6 into main Feb 15, 2026
10 checks passed
@FL4TLiN3 FL4TLiN3 mentioned this pull request Feb 15, 2026
@FL4TLiN3 FL4TLiN3 deleted the refactor/extract-perstack-toml-package branch February 25, 2026 13:36
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