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

add exports to package.json #45

Merged
merged 3 commits into from
May 29, 2023
Merged

add exports to package.json #45

merged 3 commits into from
May 29, 2023

Conversation

diegoalzate
Copy link
Contributor

@diegoalzate diegoalzate commented May 26, 2023

Overview

This pr allows users to import types and also re-structures how we import specific packages.

example of how to import

still works if you to this

import {api} from "hopr-sdk"

recommended:

import { apiFunction } from "hopr-sdk/api"

but there's a gotcha

REQUIRES "moduleResolution": "node16" or "nodenext" on tsconfig client side. this is ok because we require node16 to install the package anyway. But since it is config, a client might have something different.

Why does this gotcha exist?

it seems to be a on going conversation on different issues and very confusing progress, however this module resolution will work on node 12 and 14.

source: microsoft/TypeScript#50794

@diegoalzate diegoalzate requested a review from a team May 26, 2023 19:29
@diegoalzate diegoalzate self-assigned this May 26, 2023
@diegoalzate diegoalzate added the enhancement New feature or request label May 26, 2023
Copy link
Contributor

@ItsLuized ItsLuized left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻
One question: Should we document how these configs should look like (e.g. in a README file) ?

@mjadach-iv
Copy link
Contributor

👍🏻 One question: Should we document how these configs should look like (e.g. in a README file) ?

Yep, cc: @camilovegag

@diegoalzate diegoalzate merged commit 27f3a69 into main May 29, 2023
@diegoalzate diegoalzate deleted the export-types branch May 29, 2023 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants