-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
Add typescript support #248
base: master
Are you sure you want to change the base?
Changes from 1 commit
96279b1
abecec5
5d9afc8
22b02d6
13040eb
f1fb0a5
ecca77f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,7 +158,9 @@ function createApplication (name, dir) { | |
pkg.devDependencies['typescript'] = '~3.7.5' | ||
pkg.devDependencies['@types/node'] = '~13.7.0' | ||
pkg.devDependencies['@types/debug'] = '~4.1.5' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the types package version pach the debug package version? |
||
pkg.devDependencies['@types/express'] = '~4.17.2' | ||
pkg.devDependencies['@types/express'] = '~4.16.1' | ||
|
||
pkg.dependencies['tslib'] = '~1.10.0' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As current settings automatically add the helper codes (e.g. ES6+ polyfills) into every related output files, I added tslib so that code duplication can be avoided. |
||
} | ||
|
||
// JavaScript | ||
|
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.
Would this cause an issue when generated and used on an older node.js like, say 10.x?
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.
It should be safe on older node environment as the version of the generated codes are controlled via tsconfig.json (line 5, "target": "es5"). Currently it is set compiling codes down to ES5 to support most of the older node.js.
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.
Gotcha. I guess i mean typescript-wise. As in I assume that the node 13 types include definitions that do not apply/work on node 10, which then reduces the useful type checking that would prevent that?
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.
Yes, you are correct.
As the typing version of node is not one-to-one, perhaps we can adjust it to match the major version of current node.
However, during testing I found that node typing below v8 causes typing mismatch errors so that I suggest setting the minimum of @types/node to v8.