-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TS] [PLOP 3] Improve documentation for TS usage #296
Comments
Are you running |
No I don't, and from the pr updating the typescript example (linked in the changelog), I thought it wasn't a needed step |
Ahh, gotcha. FWIW that PR is incomplete, but we do need better docs. I'm gonna go ahead and make a GH issue for future v4 baked-in no-compiling-needed support, but if possible, let's go ahead and change this issue to read something like: "Improve TS usage documentation" and highlight adding a mention of a compilation step |
Added issue for supporting without compile step: |
Got it ! I got this impression from this : #192 (comment) and I must say I spend some days trying to setup typescript without too much issue (path need to be adapted to be from the tsc output and not the ts source for example). I'll modify the issue to reflect this instead then ! :) Thanks for the quick response, and for plop, it's a amazing software |
I have a similar problem when doing the upgrade to 3.0. With 2.x I was using a shebang script with ts-node to kick-off plop. With 3.0 it's a whole slew of problems.
it throws
After some digging I have solved the 1) by:
which lead me to TypeStrong/ts-node#1007 and https://dev.to/asteinarson/typescript-nodejs-and-es6-esm-modules-18ea I have solved 2) with:
I'm able to run Plop 3.0 now, but I'm getting experimental flag warnings:
Apart from taking a good chunk of my day to figure out what is going on, the result is less than ideal. Any input on how to make it better, will be appreciated |
Unfortunately, due to the state of ESM in TS today (and, by extension, ts-node), there's not a ton we can do in terms of making that process too much better @gustaff-weldon without some dev lift on our end. We're tracking some thoughts on #297 to make this possible and a lot better (namely #297 (comment)), but that might be a couple of months out. I wish the situation was better, but this is an unfortunate inherent result of supporting ESM (which was a requirement to patch out some "moderate" vulns in deps) |
@crutchcorn understood. Fingers crossed for the #297 getting implemented, it looks promising :) |
This issue is really two things:
Since # 1 is the main topic of discussion in this particular issue, I will be closing it in favor of #297 for # 2 |
What's the recommended setup for typescript support? Is it not supported right now? Hard to find an answer across the GitHub issues. The typescript guidance from the docs lead me to the error reported in this issue. |
i already downgrade version from 3. to 2. :D |
I am not following what's supposed to be done here. I have typescript already running fine in our app, I added the plopfile.ts based on the docs and just get the error I looked at the example above and it's just got typescript with a standard tsconfig (we have the same required settings) and nothing else? Not sure what I'm missing here |
Same. I ended up just doing
|
From the docs, you need
ts-node
installed, typescript and it should just works ✨However, it doesn't work for me, I created a reproduction repo, it's like the typescript example, without the .js file
Expected output
It works !
Result
It won't work at all
Reproduction : https://github.com/beaussan/plop-reproduction
The text was updated successfully, but these errors were encountered: