02-02-2019 07:00 - edited 02-02-2019 07:03
02-02-2019 07:00 - edited 02-02-2019 07:03
TL;DR;
npx fitbit-sdk-types apply
That's it. More details on https://github.com/SergioMorchon/fitbit-sdk-types#-automatic-configuration.
If you find any problem or have any question, don't be shy and open an issue!
Explanation
I was tired of manually renaming files to .ts, installing the fitbit-sdk-types module and updating the CLI generated tsconfig.json.
So this script just executes automatically the same steps that the developer needed to manually perform.
What I tried before
I tried to fork and change the Fitbit projects, but found some stoppers a bit frustrating for me:
I'm new on the Create-Cool-Project toolings, and that may be the reason why I found this overcomplicated.
My conclusion
Instead of opening PRs, I found more easy to just create a script to run after the official CLI starter steps. So it doesn't get so coupled: just take the output project generated by Fitbit tools and do the same tweaks to make it a TypeScript project.
02-03-2019 12:53
02-03-2019 12:53
Anyway to reverse this process? I removed all the tsconfig files and converted all the files back to js but now I'm getting a weird error.
[15:51:17][error][app] TypeError: Cannot read property 'minify' of undefined
02-03-2019 12:59
02-03-2019 12:59
I think that's an unrelated problem. There's something about it in discord.
02-03-2019 13:12
02-03-2019 13:12
Thanks! Yep it looks like a dependency "terser" pushed a bad update Friday. To reverse the Typescript apply I wiped node_modules and reinstalled which got that update and caused the "minify" issue. Thanks for pointing me in the right direction! I just manually added "terser" as a devDependancy at an earlier version to fix.