Skip to content

Bug: tsup config doesn't build the CLI binaries declared in package.json — acars-decoder / acars-decoder-test are broken after npm install #500

Description

@kevinelliott

Summary

package.json publishes two CLI entry points:

"bin": {
  "acars-decoder": "./dist/bin/acars-decoder.js",
  "acars-decoder-test": "./dist/bin/acars-decoder-test.js"
},
"files": ["dist"],

but tsup.config.ts only lists entry: ['index.ts'], so npm run build emits dist/index.{js,mjs,d.ts} and never compiles the lib/bin/*.ts sources. Since files: ["dist"] scopes the tarball to dist/, the CLI symlinks installed globally point at files that don't exist.

Location

  • tsup.config.ts:4entry: ['index.ts']
  • package.json:11-14bin declaration
  • package.json:8-10files: ["dist"]

Reproduction

npm pack
tar tf airframes-acars-decoder-1.9.0.tgz | grep bin/   # -> no matches
npm install -g @airframes/acars-decoder
acars-decoder 44 'POS02,N38338W121179,GRD,KMHR,KPDX,0807,0003,0112,005.1'
# -> Error: Cannot find module '/…/dist/bin/acars-decoder.js'

Impact

Publish-time silent breakage of a public interface — every published version since the bin block was added has shipped dangling CLI links.

Suggested fix

Either build the CLIs (and drop them into dist/bin/):

// tsup.config.ts
entry: ['index.ts', 'lib/bin/acars-decoder.ts', 'lib/bin/acars-decoder-test.ts'],

…and adjust the tsup output layout so the dist/bin/ paths in package.json line up; or remove the bin block from package.json if the CLIs are not intended to ship.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions