oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.25k stars 1.07k forks source link

will providing typescript type definition file in the plan? #169

Closed haiwen-shaw closed 5 years ago

haiwen-shaw commented 9 years ago

I think using javascript is not good for a complex project, and the typescript seems pretty awesome for handling it. but it need .d.ts file to call node-oracledb. will oracle provide typescript type definition file (.d.ts) ? thanks!

Bigous commented 8 years ago

I have just added a pull request to DefinitelyTyped/DefinitelyTyped#7697 to add oracle.d.ts []s

cjbj commented 8 years ago

@Bigous Nice one!

Bigous commented 8 years ago

Pull was merged... I think we could close this one.

cjbj commented 8 years ago

Now, where should this be documented?!

Bigous commented 8 years ago

DefinetlyTyped is a facilitator only. It holds files .d.ts that original projects do not release or maintain. I think that if it's gonna be there, we could only mention it on README.md. Something like:

Instalation:

$ npm install -g tsd
$ tsd init
$ tsd query oracledb --resolve --action install --save

If we choose to bring it to oracledb itself on next release, we should add an index.d.ts at the root of package with the content of oracledb.d.ts. Then I think we should mention it on o README.md and improve it with the content of API.md (complete the code documentation). In this case, no other installation is necessary... just the npm install oracledb. But I don't know about the dependency (it uses node.d.ts because our Lob object inherits stream.Duplex... with tsd the --resolve gets the dependency and installs it together).

Bigous commented 8 years ago

Found out (angular2 project is an example) that we can have a typings directory inside our repo and install tsd dependencies on it, like node.d.ts, and have it all packaged here... @cjbj If you'd like, I could move the definitions to this repo ... it occurred with angular2 too... definitions until version alfa-something is on tsd and after that is on main angular2 repo... So, we could have the definitions for version 1.5 at tsd, and after that, here. What do you think?

cjbj commented 8 years ago

@Bigous I don't see a problem with adding it to node-oracledb. Submit a PR?

Overall, we need to find a way to machine-generate API doc. I know @dmcghan was enthused today by http://documentation.js.org/

dmcghan commented 8 years ago

Yes, @jed let me know about it today! I like that it covers the C/C++ and JavaScript (ES6).

@sagiegurari what do you think? You use JSDoc to Markdown, right? documentationjs seems to use the same syntax...

@cjbj mentioned having both reference docs and user guides. This could help automate the reference docs.

wallride commented 8 years ago

definitions for oracledb module on DefinitelyTyped are for version 1.5, though the actual module version is 1.10 (supporting promises etc). Will the actual typescript definitions be mantained by oracle?

cjbj commented 8 years ago

@wallride I'd be happy for someone in the community to look after typescript definitions

Bigous commented 8 years ago

Hi @wallride,

The actual one I've submitted. But it clearly needs an update. This week I'm with my agenda full, if you can, you could update it, but i'll try to update it next week.

[]'s

Bigous commented 8 years ago

Sorry about the delay, but today I've submitted an updated pull request to definitely typed repo.

As soon as it is accepted, version 1.10.x is now supported.

Bigous commented 8 years ago

Added to typings registry too. TSD is deprecated in favor of typings so, typings is the recommended way to install .d.ts The pull (typings/registry#561) was already accepted, so it's available. To use it:

typings install oracledb --save
typings install env~node --save --global

[]'s

Bigous commented 8 years ago

Updated typescript definitions on typings registry to v1.11.0

cjbj commented 8 years ago

Thanks @Bigous

Bigous commented 7 years ago

All right, now that Typescript 2.0 was released, they have standardized the npm registry as the main source of typescript definitions. One should make a PR to the types-2.0 branch of DefinitelyTyped and it automagically goes to npm @types/XXXXX . I'll keep my repository to update the definitions Bigous/typed-oracledb, but you can publish updates directly to DefinitelyTyped (at branch types-2.0). So, I've published the last version to DefinitelyTyped and it is now available at npm here. If you want to use it, just do

npm install @types/oracledb

and you are ready to go.

[]'s

aleung commented 7 years ago

@Bigous I guess I should make PR to the master branch now. According to https://github.com/DefinitelyTyped/DefinitelyTyped#what-exactly-is-the-relationship-between-this-repository-and-the-types-packages-on-npm

The master branch is automatically published to the @types scope on NPM thanks to types-publisher. This usually happens within an hour of changes being merged.

cjbj commented 5 years ago

A link from @connorjayfitzgerald via the Slack channel: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/35127

cjbj commented 5 years ago

And the typescript update for node-oracledb 3.1 was published and is available https://www.npmjs.com/package/@types/oracledb Thanks @connorjayfitzgerald !

connorjayfitzgerald commented 5 years ago

No problem 👍🏻

cjbj commented 5 years ago

I will close this old issue. @connorjayfitzgerald has been doing a great job of maintaining the typescript definitions. See https://github.com/oracle/node-oracledb/issues/1136