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

Update README (add ref to tslink) #285

Merged
merged 4 commits into from
Nov 22, 2023
Merged

Conversation

DmitryAstafyev
Copy link
Contributor

Hello, guys.

I have one suggestion for you and I'm doing it via PR ;)

Since I've been using node-bindgen for a long time already across a couple of projects I found missing TypeScript types a little annoying ).

That's just not comfortable from a testing and developing perspective.

You know, some small changes in data type on the native module side, and you shouldn't forget to update it on nodejs side too.

With TypeScript it is much easier. Imagine workflow:

  1. generate a native node module
  2. generate TypeScript types based on previous
  3. include into the end-project as a full-fledged npm package
  4. build (with TypeScript compiler) an end-project.

You see? If some changes happen on step 1, on the heights level (nodejs) TypeScript compiler will inform about any errors. It makes a solution more stable and helps with testing indeed.

I've developed crate tslink which generates *.d.ts, *.js and *.ts files and actually creates a full-fledged npm package.

As a bonus - code highlights on the IDE level as well.

What do you think about it?
If you are finding this useful for your users, let's add some remarks about it to your documentation.

P.S.
Combined usage tslink and node-bindgen is very much covered by tests, you can see it in repo of the project.

@DmitryAstafyev
Copy link
Contributor Author

Hello @sehz , would be nice to see your opinion about this PR and its subject

@DmitryAstafyev
Copy link
Contributor Author

you can try with example of combined usage node-bindgen and tslink, just do next:

git clone https://github.com/DmitryAstafyev/tslink.git
cd tslink/examples/node_bindgen
sh ./run_test.sh

@sehz
Copy link
Collaborator

sehz commented Nov 22, 2023

@morenol WDYT?

@DmitryAstafyev
Copy link
Contributor Author

@sehz @morenol I've extended a little an example in the suggested documentation change and added a responsibility note, which indeed should be included. @morenol waiting for your feedback ;)

Copy link
Contributor

@morenol morenol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Nice addition!

@sehz sehz added documentation Improvements or additions to documentation typescript labels Nov 22, 2023
@sehz sehz added this pull request to the merge queue Nov 22, 2023
Merged via the queue into infinyon:master with commit e92cfe7 Nov 22, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants