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

Addition of typescript type declarations #165

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

hackermd
Copy link
Member

@hackermd hackermd commented Feb 2, 2021

Addresses #163

@hackermd hackermd requested a review from pieper February 2, 2021 19:55
@hackermd
Copy link
Member Author

hackermd commented Feb 2, 2021

@WoonchanCho The sr namespace should be relatively completely. The data namespace is partially complete. All other parts of the package are still missing. Feel free to add additional type declarations via a pull request into the feature/types branch and publish the pull request (currently in draft status).

@hackermd hackermd linked an issue Feb 2, 2021 that may be closed by this pull request
@hackermd hackermd self-assigned this Feb 2, 2021
@pieper
Copy link
Collaborator

pieper commented Feb 2, 2021

Thanks for working on this 👍

Let's be sure to give the final PR commit line a semantic versioning prefix like feat(typescript) so it'll auto deploy to npm.

@hackermd
Copy link
Member Author

hackermd commented Feb 2, 2021

Let's be sure to give the final PR commit line a semantic versioning prefix like feat(typescript) so it'll auto deploy to npm.

Cool, I was not aware of this feature. All we would need to do is include this in the commit message?

@pieper
Copy link
Collaborator

pieper commented Feb 2, 2021

Yes, Danny set it up and I used it for the first time the other day:

#159 (comment)

@WoonchanCho
Copy link
Contributor

@hackermd, sure, I will try to do whatever remained and let @pieper to review.
Thank you so much both for moving forward.

@WoonchanCho
Copy link
Contributor

@pieper and @hackermd , I've completed an initial environment setup.
You can see the progress at the feature/types branch of the forked repo at https://github.com/WoonchanCho/dcmjs/tree/feature/types

As I said earlier, I'm trying to pursue two goals simultaneously:

  1. using a JsDoc to create an API doc.
  2. Automatically creating Typescript declaration files using the JsDoc comments.

This strategy would be great because this makes sure to keep sync among sources, docs, and TypeScript declarations, leading to the single source of truth .

My repo now has two new folders:
docs: the result produced by running "npm run build:doc"
types: the result produced by running "rpm run build:type"

You will peek the docs files by opening docs/index.html in the browser.
Once you open it, you can see the README file and you can click one of classes in the right side.
there are only three classes there (BufferStream...) now.
I temporarily set it to the README file for the main source repo but if you want, you can make a separate README file for the API doc site too.

I will continue to work when I have available time

Thank you

@pieper
Copy link
Collaborator

pieper commented Feb 3, 2021

@WoonchanCho this looks great! 💯 It'll be a huge help and will encourage us to add more comments.

@WoonchanCho
Copy link
Contributor

@hackermd, I'm getting error after merging your recent change:
[!] Error: 'VolumeSurface' is not exported by src/sr/contentItems.js, imported by src/sr/templates.js

It looks VolumeSurface you deleted is being used in src/sr/templates.js.
Kindly check this.

Thank you.

@Joeycho
Copy link

Joeycho commented Dec 26, 2023

Any update with this PR?

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

Successfully merging this pull request may close these issues.

JSDoc and typescript declaration file (*.d.ts)
4 participants