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

Cleanup ESM/TypeScript build #488

Merged
merged 5 commits into from
Oct 3, 2022
Merged

Cleanup ESM/TypeScript build #488

merged 5 commits into from
Oct 3, 2022

Conversation

nene
Copy link
Collaborator

@nene nene commented Oct 3, 2022

Additional fixes/cleanup on top of #487

@@ -8,6 +8,8 @@ import grammar from './grammar.js';
import LexerAdapter from './LexerAdapter.js';
import { createEofToken } from '../lexer/token.js';

const { Parser: NearleyParser, Grammar } = nearley;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the most important change.

Now that our code is a full ESM module, NodeJS complains when attempting to import named things from CommonJS module. The workaround is to get the default export and destructure it manually.

@nene nene requested a review from inferrinizzard October 3, 2022 12:58
@nene nene merged commit 3467fe2 into master Oct 3, 2022
@nene nene deleted the esm-cleanup branch October 3, 2022 12:58
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