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

Improve NPM experience #33

Closed
Meligy opened this issue Nov 6, 2017 · 7 comments
Closed

Improve NPM experience #33

Meligy opened this issue Nov 6, 2017 · 7 comments

Comments

@Meligy
Copy link
Contributor

Meligy commented Nov 6, 2017

Hello,
There are a few things that can make NPM usage (and TypeScript experience especially) a lot better.

  1. Adding a barrel. An src/index.ts file that exports all other files in that folder.
  2. Adding a main property in package.json that points to the compiled result of the barrel, ex: built/index.js
  3. Adding a types property in package.json that points to the TypeScript declaration of the barrel, ex: built/index.d.ts

That'll allow people to import * as appAuth from '@openid/appauth';, or have more specific imports, as they wish.

Documentation: TypeScript Docs: Publishing

P.S.

Thanks heaps for the great work on the library.

P.P.S.

If you agree with the concept, I can also create a PR for this.

@tikurahul
Copy link
Collaborator

Yes. I have been meaning to do this as well. Do you want to send me a PR ?

@tikurahul
Copy link
Collaborator

For information on what types to include in the barrel for web and node environments, please take a look at the app and node_app folders for reference.

@Meligy
Copy link
Contributor Author

Meligy commented Nov 6, 2017

Can I just export everything? This is kinda supported already now.

@Meligy
Copy link
Contributor Author

Meligy commented Nov 6, 2017

Also, since we include generated files in repo (OK for now), any particular commands you suggest before pushing? Run all the commands in readme in order?

Meligy added a commit to Meligy/AppAuth-JS that referenced this issue Nov 6, 2017
@Meligy
Copy link
Contributor Author

Meligy commented Nov 8, 2017

@tikurahul hey buddy. Have you had a chance to look at the Pull Request? (#34)

Sorry if being a little pushy. There's some great work in here, and would love to see it easily consumable.

Cheers,

@Meligy
Copy link
Contributor Author

Meligy commented Nov 8, 2017

Oops, my browser was cached or something. Didn't see reply there. Will continue discussion there, sorry.

Meligy added a commit to Meligy/AppAuth-JS that referenced this issue Nov 9, 2017
@tikurahul
Copy link
Collaborator

Thanks for the contribution. 👍

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

No branches or pull requests

2 participants