RFC: Better DX for making CLI
See original GitHub issueCurrent Behavior
TSDX doesn’t really support building CLI’s well.
- The preserve-shebang plugin doesn’t actually work (#109) because we insert a CJS entry file that doesn’t know about it. Thus, you actually can’t create a CLI package without manually inserting
#!/usr/bin/env node
in front of./dist/index.js
. I recently did this in a lil postbuild script. Not bad, but also not great. - Dev/prod doesn’t matter to CLI’s, neither does esm or umd.
Desired Behavior
Building CLI’s should be seamless and intuitive
Suggested Solution
- Make it possible to opt-out of dev/prod builds
- Explore https://github.com/vercel/ncc and how it inlines all dependencies into a single file. Evaluate whether we take its best ideas or just document how to integrate it as a recipe
- Create a CLI template
- Explore Gluegun’s test setup
Who does this impact? Who is this for?
- Me, advanced users
Describe alternatives you’ve considered
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Other RFC, creating (CLI) - AMS Advanced Onboarding Guide
This example shows how to request a change that none of the available CTs address, by using the Management | Other | Other...
Read more >RFC Reference Last Updated December 13, 2022 - TechDocs
RFC Number RFC Name RFC Description
RFC1286 RFC1286‑MIB Definitions of Managed Objects for Bridges.
RFC1493 BRIDGE‑MIB Definitions of Managed Objects for Bridges.
RFC1474 PPP‑BRIDGE‑NCP‑MIB Definitions of...
Read more >RFC 7681: Email Exchange of Secondary School Transcripts
Use the signing key pair to create and digitally sign transcripts for individual ... Sending a paper transcript sealed in a postal envelope...
Read more >The Ember Times - Issue No. 107
flexible imports with Ember Auto Import ⏬, learn how to make an Electron app with Ember 🖥️, and last, but not least, improving...
Read more >ArubaOS 8.3.0.x CLI Reference Guide - Aruba Networks
When you make configuration changes via the CLI, those changes affect the current running ... Configures the RFC 3576 server. ... RFC 4869...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should be careful here. Many CLI projects would also ship a programmatic interface, that is the “classic” tsdx package + CLI, not just CLI.
For example, I want to ship
bin/my-cli
executable andlib/index.js
module, and I would love to use tsdx right now, however:right now it’s a module only => cannot use it 🔴
okay, I can fiddle around and make it CLI-only => still cannot use it 🔴
if there would be a module + CLI setup => ✔️
If there would be a simple way to setup and build module+CLI packages, I am sure many lazy developers (like myself) would ship way more cool stuff. Right now the boilerplate barrier is too high.
You’re welcome to respond to previous comments. Otherwise, this issue is adding noise as a duplicate (and the comments are illustrative of that).