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

fix: type declarations don’t depend on internal typings #129

Merged
merged 1 commit into from
Jul 11, 2021

Conversation

geigerzaehler
Copy link
Contributor

We prevent typescript from generating declarations that reference the @paypal/sdk-constants package. This package does not provide types, instead we use our own type declarations in ./src/types.d.ts. These declarations are not available to users of the library.

Fixes #125

@geigerzaehler geigerzaehler requested a review from a team as a code owner July 10, 2021 10:49
src/index.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 10, 2021

Codecov Report

Merging #129 (89a3dbb) into main (e5caf02) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #129   +/-   ##
=======================================
  Coverage   94.37%   94.37%           
=======================================
  Files           4        4           
  Lines         160      160           
  Branches       56       56           
=======================================
  Hits          151      151           
  Misses          9        9           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5caf02...89a3dbb. Read the comment docs.

@gregjopa
Copy link
Contributor

Awesome work @geigerzaehler! 💯 🥇 👍

I tested locally and the generated types no longer reference sdk-constants. Here's what I get for index.d.ts:

export * from "./components/PayPalButtons";
export * from "./components/PayPalMarks";
export * from "./components/PayPalMessages";
export * from "./ScriptContext";
export declare const FUNDING: Record<string, string>;

PR looks great! I appreciate you leaving a comment in the code explaining what's going on. There's one change request for a typo fix. After that's fixed, I'll merge it up.

We prevent typescript from generating declarations that reference the
`@paypal/sdk-constants` package. This package does not provide types,
instead we use our own type declarations in `./src/types.d.ts`. These
declarations are not available to users of the library.

Fixes paypal#125
@gregjopa gregjopa merged commit 76a3b9f into paypal:main Jul 11, 2021
@geigerzaehler geigerzaehler deleted the fix-external-types branch July 12, 2021 08:04
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.

TypeScript declaration files don’t type check
2 participants