Convert gluegun source to TypeScript
See original GitHub issueI’m about 80% through a major refactor, which includes converting over to TypeScript. So I’m filing this issue to track some of the items.
- I’m using
ts-node
right now, and it works pretty well. However, my assumption is that we should keep this as a devDependency and compile a JS bundle … when other CLIs importgluegun
, they get the JS bundle. Is that right, or can we assumets-node
as a full dependency and call it good? - If we do compile a JS bundle, we lose some of the debugging capability in the wild, because we won’t get reasonable line numbers.
- If we do compile, we could conceivably target/support older versions of node. Should we?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
infinitered/gluegun: A delightful toolkit for building ... - GitHub
Gluegun. Gluegun is a delightful toolkit for building Node-based command-line interfaces (CLIs) in TypeScript or modern JavaScript, with support for:.
Read more >Documentation - Migrating from JavaScript - TypeScript
Converting a JavaScript codebase over to TypeScript is, while somewhat tedious ... '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
Read more >gluegun - npm
A delightful toolkit for building Node-powered CLIs.. Latest version: 5.1.2, last published: 8 months ago. Start using gluegun in your ...
Read more >How to build a CLI with Node.js - Twilio
oclif a framework for building extensible CLIs by Heroku ( gluegun as an alternative). Additionally there are many convenient ways to consume ...
Read more >ts-migrate: A Tool for Migrating to TypeScript at Scale - Medium
Take a JavaScript or partial TypeScript project and convert it ... the file extensions of the source code files from .js/.jsx to .ts/.tsx...
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
ts-node
is great for dev but not for shipping. TypeScript isn’t really a bundler so it won’t pack up dependencies. It just turns our source into a different source. There will be a build step required for shipping. AddoutDir: dist
to thetsconfig.json
(for example) then runtsc -p .
and we’re done.sourceMaps: true
in our config will emit these. With the righttarget
setting, the output of ts is remarkably human. Not like Babel. In practice this isn’t a big deal. Being a superset of js is an advantage here. 🥇I also recommend going the bundle route on top of all this. Multi-format would be great to give more flexibility to our downstream.
rollup
can do all of this. And providing instructions to clis on how to do this too would be way above & beyond. 🏆Supporting older versions of NODE!? Woah! epic!