Skip to content

Conversation

@SiyaoIsTraveling
Copy link

I created tsconfig.json so that If you run tsc command, it will generate type declaration files .d.ts and source map files .d.ts.map in the folder dist/lib/. Therefore, our package.json needs to point main to lib/index.js and types to dist/lib/index.d.ts.

I also transformed the files in auth folder to clear most of the typescript errors. It mostly involves refactoring es5 classes to es6 classes.

I tested this config with GitHub private npm registry. I published the package privately and tested with a typescript client project. I confirm the type hints and IDE support is working fine for me.

To consider in the future:

  1. License headers?
  2. Bundling?

@SiyaoIsHiding
Copy link
Collaborator

Closing because we want to migrate to TypeScript entirely: #435

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.

2 participants