-
Notifications
You must be signed in to change notification settings - Fork 3
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
Typescript support for @stamp/xxx
packages.
#59
Comments
Yeah! This package is a great target to be ported to TS! :) That would be amazing. :) Feel free to do it. |
I'll start a Typescript branch after most of the other issues are cleared:
|
A bit of a hack, but I've found that this works in {
"dependencies: {
"@stamp/it": "^1.1.0"
},
"devDependencies": {
"@types/stampit": "^4.3.1",
"@types/stamp__it": "./node_modules/@types/stampit"
}
} |
Or new and more elegant notation: {
"dependencies": {
"@stamp/it": "=1.1.0",
"@types/stamp__it": "npm:@types/stampit@=4.3.2"
}
|
In order to offer users proper Typescript support, two options are available:
.d.ts
files for each published package.js
source code to Typescript (with incremental build and automatic generation of source maps and.d.ts
filesFirst option might be faster but implies to maintain
.js
source and.d.ts
in sync as code base evolve.Second option would take longer to achieve but should be easier to maintain in the long run. Caveats is that source code no longer is JavaScript but Typescript. Final code being transpiled (using Typescript or Babel) thus making fine control of the code (slightly) less possible. On the other hand, source Typescript code can benefit from the latest ESnext syntax while still producing JavaScript code compatible with the minimal supported version(es5, es2015, etc.)
The text was updated successfully, but these errors were encountered: