Skip to content

Phase 1: Separate CLI-only lockfile code from runtime public API #505

@FL4TLiN3

Description

@FL4TLiN3

Parent

Part of #504 — Make @perstack/runtime isomorphic

Problem

findLockfile() and loadLockfile() are exported from @perstack/runtime's public API but use Node.js-specific APIs:

  • readFileSync from node:fs
  • path.dirname, path.resolve, path.parse, path.join from node:path
  • process.cwd()

These functions are only consumed by @perstack/tui (start-handler, run-handler).

Current state

  • RunOptions.lockfile already exists — callers can pass a pre-resolved Lockfile object
  • findLockfile/loadLockfile are convenience helpers that resolve the lockfile from the filesystem

Goal

Remove findLockfile/loadLockfile from runtime's main export so that the core runtime package has no node:fs/node:path dependency for lockfile resolution. Determine the appropriate new home for these helpers (TUI layer, new utility package, or runtime sub-path export).

Files involved

  • apps/runtime/src/helpers/lockfile.ts
  • apps/runtime/src/index.ts
  • packages/tui/src/start-handler.ts
  • packages/tui/src/run-handler.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    @perstack/runtimeRuntime packagerefactorCode improvement without behavior change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions