-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Labels
Milestone
Description
@raszi while Typescript may be a valid candidate for node-tmp, it is not a candidate for refactoring the existing sources.
RATIONALE
- packaging and build process is far more complicated
- dev dependencies increase a manifold
- and believe you me 😬
syuilo and tukusejssirsjimmywarting
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-]Swjt[/-][+]Discussion: Switching to Typescript[/+]silkentrance commentedon Nov 27, 2017
my humble proposal would be to provide typescript typings, e.g .
*.d.ts
, for the general Typescript community, e.g. /tmp/index.d.ts instead of moving everything to typescript.raszi commentedon Nov 28, 2017
That is an option of course, but switching to TypeScript would solve other problems too. When I was doing the switch I've found a couple of issues which were reported later.
So it has other benefits too.
silkentrance commentedon Nov 28, 2017
@raszi I am open to that change. I am currently learning typescript and also have a setup here for gulp (also using typescript here) and mocha test cases implemented in typescript and so on...
silkentrance commentedon Nov 28, 2017
@raszi Please have a look at the branch https://github.com/raszi/node-tmp/tree/gulp-ts. Here you can find the dependencies and scripts that I use for my typescript based projects including gulp for the build process, working coverage reports and mocha based tests.
This still needs more work and must be further customised for node-tmp.
jmendiara commentedon Dec 1, 2017
My2cents: From my own experience, making manual
.d.ts
files is a hard task, error prone and adds more (hard!) maintenance. For small codebases, once you decide you want to gots
is better making a full port.Also, a
gulp/grunt/*
based workflow adds lots of boilerplate and devDependencies code that can be done simply usingnpm scripts
Did you hear about https://github.com/TypeStrong/ts-node ?
silkentrance commentedon Dec 1, 2017
@jmendiara I hear you. However, I think I have reduced the required dependencies to a minimum. In addition, the gulp tasks themselves are simple and maintainable and once realised, would not need any further maintenance work unless, of course, gulp finally manages to get 4.x out.
Of course, the above dependencies have a lot of other dev dependencies, but I myself can live with that. (maven/npm downloading the internet again, have a beer 🥂 ).
And with the latest updates to npm, the download of these dependencies is no longer a PITA as it had been.
[-]Discussion: Switching to Typescript[/-][+]Switching to Typescript[/+]silkentrance commentedon Apr 30, 2018
@raszi from what I have learned, we have to provide a complete set of typings for the tmp api, regardless of whether the code base is pure javascript or transpiled typescript. Either way, the provisioning of the typings and leaving the source as is would seem to be the best choice for an initial migration towards typescript.
silkentrance commentedon Mar 20, 2019
Now that I have gained confidence in TypeScript and I see that others already have provided typings for node-tmp under the hood of the DefinitelyTyped project on github, I am also open to switch to TypeScript as a whole. However, we still need to provide the typings since we will transpile to standard JS and publish the package as such.
And while we do not have to switch to TypeScript at all, we might want to provide these type declarations as part of the node-tmp package.
Yet, and since the package will not change any more unless we come up with some clever scheme of how doing things differently, I also see no urgent need in doing so.
@raszi Your call.
raszi commentedon Mar 20, 2019
I believe it would be better to switch to TypeScript all together. The last time I've checked the provided type definitions those were not easy to use and were not entirely correct.
silkentrance commentedon Mar 20, 2019
Ok, well then it is TypeScript. Will you make the necessary changes?
silkentrance commentedon Mar 20, 2019
I think that we need to move lib/tmp.js to src/tmp.ts and distribute it via dist/tmp.js. The typings should then reside in a dist/tmp.d.ts, copied over from typings/tmp.d.ts or something like that.
What do you think or do you already have a plan for making this work?
18 remaining items