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: define types versions covering all import options #369

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

fpdrozd
Copy link
Contributor

@fpdrozd fpdrozd commented Mar 30, 2023

Description

This PR adds typesVersions property to package.json files of storefront sdk and platform sdk that points to the same type definitions for all /dist/... imports.

Before, only importing the sdks by name included type definitions:

import { makeClient } from '@spree/storefront-api-v2-sdk';

While specifying an explicit path didn't, resulting in a "Cannot find module ... or its corresponding type declarations" error:

import { makeClient } from '@spree/storefront-api-v2-sdk/dist/server';
// or
import { makeClient } from '@spree/storefront-api-v2-sdk/dist/server/index';

This issue was also present in v5.1.6 of the storefront sdk (before we started splitting up the project into multiple packages).

@rafalcymerys rafalcymerys merged commit 06ae02f into main Mar 30, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix/types-versions branch March 30, 2023 10:52
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.

None yet

2 participants