Skip to content

fix: declare runtime dependencies (@flatten-js/core, math-utils, solver-utils) - #101

Open
yasdhf wants to merge 1 commit into
tscircuit:mainfrom
yasdhf:fix/declare-runtime-dependencies
Open

fix: declare runtime dependencies (@flatten-js/core, math-utils, solver-utils)#101
yasdhf wants to merge 1 commit into
tscircuit:mainfrom
yasdhf:fix/declare-runtime-dependencies

Conversation

@yasdhf

@yasdhf yasdhf commented Jul 1, 2026

Copy link
Copy Markdown

Problem

A clean install can't import the package:

mkdir t && cd t && bun init -y
bun add calculate-packing
echo 'import * as m from "calculate-packing"' > s.ts && bun s.ts
# error: Cannot find module '@flatten-js/core'

Build is tsup-node (no bundling — imports stay external), but three packages the shipped dist imports were declared only in devDependencies, so consumers never received them. Real runtime imports in lib/: @tscircuit/math-utils ×21, @tscircuit/solver-utils ×4, @flatten-js/core ×3.

Fix

Following this repo's dependency-check (internal_lib): external packages go in dependencies, internal @tscircuit/* in peerDependencies ("*").

  • @flatten-js/coredependencies
  • @tscircuit/math-utils, @tscircuit/solver-utilspeerDependencies ("*"), kept pinned in devDependencies

bunx @tscircuit/dependency-check passes; format-check / test / type-check green.

Verification

Built, packed, installed the tarball in a clean project — @flatten-js/core resolves and the internal peers auto-install. (A full end-to-end import also needs the circuit-json@0.0.443 root fix, tscircuit/circuit-json#633, which ships the same defect.)

Same class as tscircuit/dsn-converter#514, tscircuit/matchpack#150, tscircuit/checks#164.

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
calculate-packing Ready Ready Preview, Comment Jul 1, 2026 11:55pm

Request Review

Build is tsup-node (no bundling). The shipped dist imports @flatten-js/core,
@tscircuit/math-utils and @tscircuit/solver-utils while they sat only in
devDependencies, so a clean `bun add calculate-packing` + import throws
"Cannot find module '@flatten-js/core'".

Per the repo's dependency-check (internal_lib): external deps go in
dependencies, internal @tscircuit/* modules in peerDependencies ("*").
So: @flatten-js/core -> dependencies; math-utils + solver-utils -> peerDependencies.
`bunx @tscircuit/dependency-check` now passes.
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