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

Added Paynow Module support for projects built entirely in typescript #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Feb 3, 2021

Your module couldn't be imported into a node project written in Typescript as you were not emitting type declarations during your build using tsc. So, I made the following changes to cater for programmers who would like to use your module whilst still writing their code in Typescript

  1. I set the declaration flag to true in your tsconfig.json file
  2. I set the declaration output directory to "dist/declarations" in your tsconfig.json file
  3. I then set the "types" key to "dist/declarations/index.d.ts" in package.json (so Typescript could find the types when your module is imported in a Typescript Project)
  4. I built the module and then tested it in a MyEAN Stack Web Application written entirely in Typescript and it worked like a charm
  5. I edited READMe.md to include a pointer on how to import your module in a typescript project. That is, I included the statement : import { Paynow } from "paynow";

NB: Now your module can now be imported in both Typescript projects and regular es6 projects

Added typescript support by
- setting the declaration flag to true in tsconfig.json
- setting the type declaration output directory to dist/declarations to avoid confusion (there's already another folder called "types") in dist
- pointing to the typescript declarations in package.json
-building and testing the module locally
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.

1 participant