-
Notifications
You must be signed in to change notification settings - Fork 31
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
Tech/rewrite plop in typescript #868
Conversation
…n-typescript # Conflicts: # visualization/plopfile.js
|
Thanks @BridgeAR! I really googled and tried a lot, but I am not getting it to work. Do you mind having a very short try? |
…MaibornWolff/codecharta into tech/rewrite-plop-in-typescript
…n-typescript # Conflicts: # visualization/plop/templates/redux-subreducer/actions.ts.hbs # visualization/plop/templates/redux-subreducer/reducer.spec.ts.hbs # visualization/plop/templates/redux-subreducer/reducer.ts.hbs # visualization/plop/templates/redux-subreducer/splitter.ts.hbs # visualization/plopfile.js
…n-typescript # Conflicts: # visualization/plop/templates/redux/injector.spec.ts.hbs
Upgrading plop and removing the broken compiler options in the script call fixed the issue. However, I'm not a fan of compiling those files everytime you want to generate something. However, adding ts-node to the project
In order to fix this, you have to simply tell ts-node to compile it with another module. Using "commonjs" instead of "es2015" will make it work. Changing that in our |
|
…n-typescript # Conflicts: # visualization/package-lock.json
This is how TypeScript regularly works with Node.js. You first have to transpile it. It would of course also be possible to remove the file after execution. That way it would also "almost" be invisible without having to use |
@NearW thanks for the upgrading fix! I was now updating the script to move the compiled files into the |
@alschmut please rebase and is this still WIP or should this be ready? |
@BridgeAR in my opinion this is ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM
Tech/rewrite plop in typescript
As always with PRs from me, which I didn't communicate in advance, it's still everybody's responsibility to decide, if my proposed changes are relevant/useful and if they should be merged or not.
Description
I was wondering if it might be nice to split the plop generator into multiple files, each only responsible for one of the 4 major file changes (state, ui, util, redux) and if we could make use of typescript.
Issue to solve
Unfortunately plop doesn't run anymore since I changed the module declaration to make use of typescript as mentioned in the plop doc. When I undo using typescript, it says, imports are not allowed outside a module declaration.
=> Does anybody have an idea how we could solve this?
Definition of Done
A task/pull request will not be considered to be complete until all these items can be checked off.
master