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

chore: add TS type declaration and pkg.json types entry #164

Merged
merged 2 commits into from
Feb 1, 2018

Conversation

alexsasharegan
Copy link
Contributor

@alexsasharegan alexsasharegan commented Feb 1, 2018

Convenience for TypeScript and vscode users.

image
image

@alexsasharegan alexsasharegan mentioned this pull request Feb 1, 2018
@skeggse
Copy link
Owner

skeggse commented Feb 1, 2018

Ah, thanks! I'm just now noticing that we didn't deprecate the callback function like we were going to - there isn't any async behavior anymore.

@alexsasharegan
Copy link
Contributor Author

Let me know if you want it documented differently, or if you update the API and would rather have me update the typings.

@skeggse
Copy link
Owner

skeggse commented Feb 1, 2018

I'm not familiar with typescript, but is there any reason to not follow hapijs' style guidelines in regards to semicolon usage and indentation?

@alexsasharegan
Copy link
Contributor Author

alexsasharegan commented Feb 1, 2018

I didn't catch that, sorry! I'll see about getting my formatter to cooperate. Do you guys have an .editorconfig?

@skeggse
Copy link
Owner

skeggse commented Feb 1, 2018

Let me know if you want it documented differently, or if you update the API and would rather have me update the typings.

I'll update the API and docs - can you update the ts definition to remove the optional callback? (I'm not at my computer right now but will be shortly)

@alexsasharegan
Copy link
Contributor Author

I just scanned the style guide briefly. Basically just switched to using spaces and semis. Also removed the callback param.

@skeggse
Copy link
Owner

skeggse commented Feb 1, 2018

Joi appears to be the only project that includes a .editorconfig. We use lab to validate adherence to our style guide. See also outmoded/hapi-contrib#38.

@skeggse skeggse merged commit e6450a5 into skeggse:master Feb 1, 2018
@skeggse
Copy link
Owner

skeggse commented Feb 1, 2018

Merged, thanks!

@alexsasharegan
Copy link
Contributor Author

Awesome! Do you have a set release cycle? When might this make it onto npm so I can remove my own typings?

@skeggse
Copy link
Owner

skeggse commented Feb 1, 2018

I'll go update the docs when I'm at my computer and release that together as 3.1.1. (so probably tonight)

@alexsasharegan
Copy link
Contributor Author

Cheers! Thank you!

@Marsup
Copy link
Contributor

Marsup commented Feb 1, 2018

@skeggse It's not going to be enough, .npmignore will drop it on publish.

@alexsasharegan
Copy link
Contributor Author

Doesn't .npmignore whitelist lib/*?

@skeggse
Copy link
Owner

skeggse commented Feb 1, 2018

Released in 3.1.1 (callback is just deprecated until 4.0.0). The npmignore does correctly whitelist lib/, though we could move that definition into the files array of the package.json instead.

@Marsup
Copy link
Contributor

Marsup commented Feb 2, 2018

My bad, all other hapi projects put it at the root, reflex :p

@alexsasharegan
Copy link
Contributor Author

True! I just followed what you guys had going. Didn't even realize I saved myself that faux pas!

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

Successfully merging this pull request may close these issues.

None yet

3 participants