Skip to content
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

Add type-check and type-emit steps for type annotation code to the current js code #199

Open
mrchrisadams opened this issue Mar 15, 2024 · 2 comments · May be fixed by #200
Open

Add type-check and type-emit steps for type annotation code to the current js code #199

mrchrisadams opened this issue Mar 15, 2024 · 2 comments · May be fixed by #200

Comments

@mrchrisadams
Copy link
Member

Earlier this week, @sfishel18 proposed the following as a way to improve support for typescript style annotations, while keeping the code accessible to people who aren't familiar with typescript:

what i would propose is:

  1. as much as possible, leave the source code exactly as-is. the files continue to be .js and jsdoc comments are used to declare types. introducing .d.ts files is a last resort for very complex types.
  2. add a "type check" step to the CI process that checks to make sure the code itself matches the types that are declared
  3. add a "type emit" step to the npm publish process that generates a full set of .d.ts files from the declared types and includes that in the published artifacts

Source: Introduce just enough typescript · Issue #77 · thegreenwebfoundation/co2.js by @github

This sounds good, and this issue is exists as a place to link future PRs that implement the various steps outlined above.

I'm going to be on annual leave for a few weeks, and there are a few other demands on @fershad's time as a maintainer.

@sfishel18 - if you're able to lead on this one, we'd be grateful.

@sfishel18
Copy link
Contributor

sfishel18 commented Mar 16, 2024

@mrchrisadams sounds great, i'm on it! enjoy your leave!

i'll try to get some proof-of-concept level code into a branch soon, and create a draft PR linked to this issue so others can see what i'm up to

@sfishel18
Copy link
Contributor

my PR is ready for an initial look when one of you has a chance. though @fershad it occurs to me that if there are already a lot of demands on you as a maintainer, a large PR to review probably doesn't help with that :) any other ways i can contribute here (issue triage, writing tests, writing docs, etc)? i'm up for anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants