This PR is the first step in converting the existing codebsae over to TypeScript. It isn't a large change. Currently only src/models has been converted, and only partially at that. The main purpose of this PR was to get the typescript setup and working, so the changes made to the files in models were just enough to get it to successfully compile, and nothing else.
There are some new commands in package.json. Compile and lint. Lint doesn't currently add any value or probably even work, and is more of a placeholder for when linting does get setup.
There are also a few oddities in the current TS files. Names that we are doing imports a bit odd by importing .js instead of just the module itself
import ActiveModel from "models/ActiveModel.js" instead of import ActiveModel from "models/ActiveModel"
That is an ugly temp hack that has something to do with the resolver.mjs loader. There is probably some way we can modify that to allow the preferred import style of not specifying an extension for TS modules.
Last note, it doesn't look like this codebase has any kind of testing (probably something that should be looked into). So I did some manual smoke tests and I think things are working, but I would recommend that being verified that before accepting this PR.
Oh, also. I don't know if there are any specific git practices being followed, so if I need to cleanup the commits then that is fine. Just let me know. Otherwise you could just do a squash/merge.
This PR is the first step in converting the existing codebsae over to TypeScript. It isn't a large change. Currently only
src/models
has been converted, and only partially at that. The main purpose of this PR was to get the typescript setup and working, so the changes made to the files in models were just enough to get it to successfully compile, and nothing else.There are some new commands in package.json. Compile and lint. Lint doesn't currently add any value or probably even work, and is more of a placeholder for when linting does get setup.
There are also a few oddities in the current TS files. Names that we are doing imports a bit odd by importing.js instead of just the module itself
import ActiveModel from "models/ActiveModel.js"
instead ofimport ActiveModel from "models/ActiveModel"
That is an ugly temp hack that has something to do with the resolver.mjs loader. There is probably some way we can modify that to allow the preferred import style of not specifying an extension for TS modules.
Last note, it doesn't look like this codebase has any kind of testing (probably something that should be looked into). So I did some manual smoke tests and I think things are working, but I would recommend that being verified that before accepting this PR.
Oh, also. I don't know if there are any specific git practices being followed, so if I need to cleanup the commits then that is fine. Just let me know. Otherwise you could just do a squash/merge.