overengineeringstudio / overengineeringstudio/effect-utils

Extract a shared pnpm install contract factory (core and contrib hand-write the same object)

Open
#1,090 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
82
Forks
2
Avg merge
1d 8h
Merged PRs (30d)
121

Description

Problem

pnpm-install-contract.json.genie.ts is hand-written independently in two repos, with structurally identical bodies:

  • livestorejs/livestorepnpm-install-contract.json.genie.ts (~89 lines)
  • livestorejs/livestore-contribpnpm-install-contract.json.genie.ts (~64 lines)

Both build the same shape in the same field order: contract, packageManager, storeContract, dependencyGraphContract, installPolicy (the same 11 keys), workspaceManifestContract, and dependencyMaterializationProfile.identityInputs (the same 5 entries). The only genuine difference is the contract name string.

effect-utils today exports only the storage portion — pnpmInstallStorageContractV2 (genie/external.ts) — so each consumer hand-writes the surrounding object.

Why it matters

The drift has already started: contrib's copy omits core's metadata block and its supportedTraits / nativeBuildPolicyInputs / buck2Boundary extensions, with no comment recording whether that is deliberate. A reader cannot tell intent from divergence.

Because identityInputs drives install-drift classification, a field silently present in one repo and absent in the other means the two repos classify install drift differently — which is exactly the kind of divergence the shared pnpm task module exists to prevent.

Proposed

Export a factory alongside the existing storage helper:

buildPnpmInstallContract({
  contract,          // 'livestore/pnpm-install-contract' | 'livestore-contrib/…'
  workspaceData,     // the generated pnpm-workspace.yaml data
  packageManager,    // parsed from the root manifest
  extra?,            // repo-specific additions (core's metadata, buck2Boundary, …)
})

Both repos then call it, and repo-specific fields become an explicit, visible extra rather than an unexplained omission.

Notes

Found during a redundancy review of livestorejs/livestore-contrib#40. Not fixable from contrib alone: contrib composes effect-utils at a pinned revision, so this needs to land here first, then reach consumers via a pin bump.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in genie/external.ts, then compare the pnpm-install-contract.json.genie.ts files in livestore and livestore-contrib to identify the shared object shape and repo-specific additions. Add and export the proposed factory, then update both consumers to use it. Done means the shared fields are produced consistently and differences are explicit through extra.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.