Comments (20)
I am unlikely to be able to get to this any time soon. I would be happy to review a PR.
from i18njs.
I can provide ones, but looks like you have no Typescript files yet to make definitions for.
from i18njs.
Yes looks like you should PR the TS files as well
from i18njs.
@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.
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.
We are ok with having definitions separately need not convert entire library, type definitions @types/roddeh-i18n will be great .
from i18njs.
I am sure we can set up types without converting the project.
from i18njs.
This should help https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package
from i18njs.
Ok, cool. Thanks for clarifying. @vishnuvardhana @kaliinmtrx are either of you able to setup the definitions as a PR?
from i18njs.
@kaliinmtrx do you need help?
from i18njs.
Hey guys, do you still need help on this one?
from i18njs.
@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.
I will look at your docs and file a PR, would that be ok?
from i18njs.
That would be great 👍
from i18njs.
@Gesh4o thank you once you start I will be able to help you.
from i18njs.
I was about to open a PR today but I guess it doesn't matter now :/
from i18njs.
@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.
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:
-
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)
-
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.
-
Keep an eye for private methods - they should not be included in definitions.
from i18njs.
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.
Thanks for the contributions @evilarceus. Merged ;)
from i18njs.
Related Issues (20)
- AMD compliant version of i18n.js does not work on IE8 HOT 4
- i18njs as NPM package HOT 3
- License unclear HOT 1
- [Idea] Support for num eq null HOT 2
- [Idea] Publish as npm package HOT 1
- [Idea] Release in GitHub
- Pluralization rules HOT 5
- [Idea] Move Tests to Mocha + Chai HOT 5
- [Idea] Linter HOT 1
- [Idea] CI with Travis HOT 2
- [Idea] Tool to work with i18n files HOT 7
- The file on i18njs.com is not latest version
- Contexts not working? HOT 3
- What about object notation? HOT 1
- [Idea][Standardization] JSON Schema HOT 1
- Lots of eslint errors (+140) HOT 1
- Package in NPM is outdated (missing TS typings) HOT 3
- No maintaince
- Method extend does not exist on return value of i18n.create
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18njs.