question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Better DX for making CLI

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ivan-aksamentovcommented, Aug 16, 2020

Make it possible to opt-out of dev/prod builds

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 and lib/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.

0reactions
agilgur5commented, Sep 14, 2020

You’re welcome to respond to previous comments. Otherwise, this issue is adding noise as a duplicate (and the comments are illustrative of that).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found