When writing the entire source code in TypeScript, types are checked throughout the entire code. That can be helpful at times, but more often than not it results in unneeded code complexity and build errors that slow down the development and maintenance of the Octokit source code. I estimate that the introduction of TypeScript slows down code develepoment by a factor of 4x-5x. I think separating the source code from the types will bring it down to 2x-3x, as only the types for the public APIs need to be defined and tested.
Solution: Rewrite the TypeScript source files into native JavaScript and add the .d.ts declaration files into the source code. Besides testing the code, add tests for types.
Benefits: Removes all build steps. We currently use @pika/pack which is now unmaintained. The source code in the GitHub repositories is 1:1 what is used in production. The runtime code will be easier to read, debug, and contribute to. Source code is production code. Easier to debug and contribute to.
When writing the entire source code in TypeScript, types are checked throughout the entire code. That can be helpful at times, but more often than not it results in unneeded code complexity and build errors that slow down the development and maintenance of the Octokit source code. I estimate that the introduction of TypeScript slows down code develepoment by a factor of 4x-5x. I think separating the source code from the types will bring it down to 2x-3x, as only the types for the public APIs need to be defined and tested.
Solution: Rewrite the TypeScript source files into native JavaScript and add the .d.ts declaration files into the source code. Besides testing the code, add tests for types.
Benefits: Removes all build steps. We currently use @pika/pack which is now unmaintained. The source code in the GitHub repositories is 1:1 what is used in production. The runtime code will be easier to read, debug, and contribute to. Source code is production code. Easier to debug and contribute to.