Skip to content

NODEJS-680: Update and Automate TypeScript Support - 1. config and auth#431

Closed
SiyaoIsTraveling wants to merge 5 commits intoapache:typescriptfrom
SiyaoIsTraveling:typescript
Closed

NODEJS-680: Update and Automate TypeScript Support - 1. config and auth#431
SiyaoIsTraveling wants to merge 5 commits intoapache:typescriptfrom
SiyaoIsTraveling:typescript

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
Contributor

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