jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.26k stars 508 forks source link

Is it possible to run a script using TSDX? #749

Closed woss closed 4 years ago

woss commented 4 years ago

Apart from the single entry point i would like to have a demo of the library as well. Is is possible to use tsdx like ts-node?

PGA68 commented 4 years ago

\Projects>npx tsdx create try_02_tsdx npm ERR! code ETARGET npm ERR! notarget No matching version found for @babel/plugin-proposal-nullish-coalescing-operator@^7.10.4. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! notarget npm ERR! notarget It was specified as a dependency of '@babel/preset-env' npm ERR! notarget

npm ERR! A complete log of this run can be found in: npm ERR! ....\Roaming\npm-cache_logs\2020-06-30T14_31_06_175Z-debug.log Install for [ 'tsdx@latest' ] failed with code 1

agilgur5 commented 4 years ago

The issue template was removed here and the description is quite short, so it's difficult to tell what the intent here is.

Is your library a bin script? A demo wouldn't need to use ts-node as the library is already transpiled. Unless you're saying a demo of the app inside of a TypeScript application. In either case, it sounds like you'd want an example/ directory similar to the React template but modified for a script or a Node app instead.

This is outside the scope of TSDX the library but could be an idea for another template TSDX could have.

Is is possible to use tsdx like ts-node?

TSDX does not run your code per #478, it just builds the library (and can also test, lint, etc it). If you're looking to run a Node app instead of a Node library, then this would be a duplicate of #654 . It's unclear what the intent of that statement was, so I'm not sure how else to answer.

woss commented 4 years ago

@agilgur5 i think you answered perfectly. ✋ yes, the intent is to have something similar to the example folder, because so many time you want to test the lib before you actually build it. Thanks for your time