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(types): fixes cjs types #245

Merged
merged 1 commit into from
Jan 13, 2023
Merged

fix(types): fixes cjs types #245

merged 1 commit into from
Jan 13, 2023

Conversation

micheleriva
Copy link
Member

@micheleriva micheleriva commented Jan 13, 2023

This PR fixes types when using TypeScript via CommonJS modules. It introduces a breaking change in TypeScript, as follows:

- import { create, insert, search } from '@lyrasearch/lyra';
- import { stemmer } from '@lyrasearch/lyra/stemmer/it';
- import { requireLyraInternals } from '@lyrasearch/lyra/internals';

+ import { create, insert, search } from '@lyrasearch/lyra/cjs';
+ import { stemmer } from '@lyrasearch/lyra/cjs/stemmer/it';
+ import { requireLyraInternals } from '@lyrasearch/lyra/cjs/internals';

We basically have to manually tell TypeScript to get types and functions from CommonJS files.

Fixes #243

Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Export types
2 participants