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

Change package main to dist/webauthn.min.js #2

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

mattmazzola
Copy link
Contributor

The current package.json is reference src/index.ts

"main": "src/index.ts",

I don't think packages should reference .ts files. Especially if they are intended to be used in a browser environment which doesn't natively compile typescript.
I think it should be referencing dist/webauthn.min.js

@dagnelies
Copy link
Collaborator

Ok, I'll do that. I'm actually not that familiar with package.json configuration for publishing libs. Will the typescript autocompletion and so on work correctly if the dist/webauthn.min.js is imported rather than the sources?

I took a look at vue to get a grasp how they do it, and there it looks like this https://github.com/vuejs/core/blob/main/packages/vue/package.json

"main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js",
"types": "dist/vue.d.ts",
"unpkg": "dist/vue.global.js",
"jsdelivr": "dist/vue.global.js",

...I guess I should produce the types file too to get proper TS support.

@dagnelies dagnelies merged commit 2c838e8 into passwordless-id:main Nov 1, 2022
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

2 participants