Coder Social home page Coder Social logo

Comments (20)

roddeh avatar roddeh commented on September 4, 2024

I am unlikely to be able to get to this any time soon. I would be happy to review a PR.

from i18njs.

 avatar commented on September 4, 2024

I can provide ones, but looks like you have no Typescript files yet to make definitions for.

from i18njs.

gregBerthelot avatar gregBerthelot commented on September 4, 2024

Yes looks like you should PR the TS files as well

from i18njs.

vishnuvardhana avatar vishnuvardhana commented on September 4, 2024

@kaliinmtrx PR for typescript files are also needed , let me know if I can assist .. not fully aware of the process of creating definitions, happy to learn.

from i18njs.

roddeh avatar roddeh commented on September 4, 2024

Does setting up a definition file require the project to be converted to TS?

Or is it possible to leave the library code as is and simply provide a definition file that describes the interfaces of what exists in JS?

I am not opposed to converting the project to TS, just wanting to reduce the scope of the initial PR to get it working nicely with TS.

from i18njs.

vishnuvardhana avatar vishnuvardhana commented on September 4, 2024

We are ok with having definitions separately need not convert entire library, type definitions @types/roddeh-i18n will be great .

from i18njs.

vishnuvardhana avatar vishnuvardhana commented on September 4, 2024

I am sure we can set up types without converting the project.

from i18njs.

gregBerthelot avatar gregBerthelot commented on September 4, 2024

This should help https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package

from i18njs.

roddeh avatar roddeh commented on September 4, 2024

Ok, cool. Thanks for clarifying. @vishnuvardhana @kaliinmtrx are either of you able to setup the definitions as a PR?

from i18njs.

gregBerthelot avatar gregBerthelot commented on September 4, 2024

@kaliinmtrx do you need help?

from i18njs.

Gesh4o avatar Gesh4o commented on September 4, 2024

Hey guys, do you still need help on this one?

from i18njs.

gregBerthelot avatar gregBerthelot commented on September 4, 2024

@Gesh4o seems that nobody has move forward yet. I need it but I am not in position to help on this. @vishnuvardhana I am sure can help if needed

from i18njs.

Gesh4o avatar Gesh4o commented on September 4, 2024

I will look at your docs and file a PR, would that be ok?

from i18njs.

gregBerthelot avatar gregBerthelot commented on September 4, 2024

That would be great 👍

from i18njs.

vishnuvardhana avatar vishnuvardhana commented on September 4, 2024

@Gesh4o thank you once you start I will be able to help you.

from i18njs.

Gesh4o avatar Gesh4o commented on September 4, 2024

I was about to open a PR today but I guess it doesn't matter now :/

from i18njs.

roddeh avatar roddeh commented on September 4, 2024

@evilarceus thanks for submitting the PR. It looks good to me. But @vishnuvardhana @Gesh4o, perhaps you could also take a look given you have more experience with TS definitions.

from i18njs.

Gesh4o avatar Gesh4o commented on September 4, 2024

I think @evilarceus has done a good job. However I cannot give my recommendations about the typescript definitions themselves but here are several improvements that could be made:

  1. Create tslint.config and index.spec.ts (generally ts definitions come as 4 files - look at: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express)

  2. Include two new commands: lint:definitions and test:definitions (could be named differently ofc) and include them in your CI flow. You will have to maintain that piece of code so make sure to avoid regressions as much as possible.

  3. Keep an eye for private methods - they should not be included in definitions.

from i18njs.

entriphy avatar entriphy commented on September 4, 2024

I added the changes for testing and linting to the pull request. Currently, it uses dtslint, unfortunately meaning that it can't do linting only: lint:typings does both linting and testing, and test:typings only does testing. The scripts might need to be renamed or combined to make it more accurate. If we wanted, we could use tslint for linting only and then use dtslint for testing (or use a different testing system, though we are still only testing types, which is why I personally prefer to use dtslint).

Private methods were not included in the definitions, assuming all functions below translator.translateHash() (excluding create(), that's included in the definitions) are private.

As for CI flow: I don't believe this project has CI integration.

from i18njs.

roddeh avatar roddeh commented on September 4, 2024

Thanks for the contributions @evilarceus. Merged ;)

from i18njs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.