Expose CLI via bin / npx instead of requiring manual build in node_modules
Hi team, we’re using `oobee` as a NodeJS dependency and noticed the published package does not include its built output. This is from the documentation:
```bash
cd node_modules/@govtechsg/oobee
npm install
npm run build
cd ../../..
```
From a consumer perspective, this feels a bit unusual, as:
- `node_modules` is generally treated as immutable
- running `npm install` inside a dependency can lead to non-deterministic installs
- this pattern is hard to automate reliably in CI/CD pipelines
- package managers typically expect dependencies to be usable immediately after install
Currently, we rebuild Oobee during our own `postInstall` script.
Would it be possible to expose Oobee’s functionality via a CLI using the `bin` field in `package.json`?
For example:
- Build `dist` during publish (or CI)
- Include it via the `files` field
- Expose a CLI via `bin` for usage through `npx` (this will greatly help the usage of CLI programatically)
- usable via `npx oobee …` or `./node_modules/.bin/oobee`
This would:
- remove the need to manually build inside `node_modules`
- align with common npm package conventions
- make the package easier to integrate in CI and other projects
关闭于 2026-02-03 1 条评论