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

Missing dist/meriyah.d.ts file #153

Closed
fisker opened this issue Nov 5, 2020 · 17 comments
Closed

Missing dist/meriyah.d.ts file #153

fisker opened this issue Nov 5, 2020 · 17 comments

Comments

@fisker
Copy link
Collaborator

fisker commented Nov 5, 2020

This file is not generated.

@fisker
Copy link
Collaborator Author

fisker commented Nov 5, 2020

Ah, found it, it's in dist/src/meriyah.d.ts, so fix this in package.json ?

https://github.com/meriyah/meriyah/blob/master/package.json#L9-L10

@3cp
Copy link
Member

3cp commented Nov 5, 2020

Not sure if this is a regression due to tsc? Let me check old versions.

@3cp
Copy link
Member

3cp commented Nov 5, 2020

Looks like a regression.

@3cp
Copy link
Member

3cp commented Nov 5, 2020

Oh, it's my code. Caused by export { version } from '../package.json';

@3cp
Copy link
Member

3cp commented Nov 5, 2020

This is troublesome for typescript. Do you have any idea how to bypass this issue?

@fisker
Copy link
Collaborator Author

fisker commented Nov 5, 2020

Another thing, this CommentType is not right

export type CommentType = 'Line' | 'Block' | 'HTMLOpen' | 'HTMLClose';

@3cp
Copy link
Member

3cp commented Nov 5, 2020

what's wrong there?

@3cp 3cp closed this as completed in 1ffac6e Nov 5, 2020
@fisker
Copy link
Collaborator Author

fisker commented Nov 5, 2020

- export type CommentType = 'Line' | 'Block' | 'HTMLOpen' | 'HTMLClose'; 
+ export type CommentType = 'MultiLine' | 'SingleLine' | 'HashbangComment' | 'HTMLOpen' | 'HTMLClose'; 

@3cp
Copy link
Member

3cp commented Nov 5, 2020

Right, I am not sure why there is another definition in src/lexer/comments. Should find someway to reuse.

@fisker
Copy link
Collaborator Author

fisker commented Nov 5, 2020

Change estree.ts and import {CommentType} in src/lexer/comments?

@3cp
Copy link
Member

3cp commented Nov 5, 2020

@KFlash there is mismatch of type

export type CommentType = 'Line' | 'Block' | 'HTMLOpen' | 'HTMLClose';

export const CommentTypes = ['SingleLine', 'MultiLine', 'HTMLOpen', 'HTMLClose', 'HashbangComment'];

Any idea how to define once and reuse in both places?

@3cp
Copy link
Member

3cp commented Nov 5, 2020

@fisker that CommentType enum in src/lexer/comments is backed by integer, not string.

@3cp
Copy link
Member

3cp commented Nov 5, 2020

v3.1.4 is released with updated type path in package.json.

@fisker
Copy link
Collaborator Author

fisker commented Nov 5, 2020

We'll be able to use meriyah in prettier to format .js in next few days, but we don't use JavaScript...:smile:

@KFlash
Copy link
Contributor

KFlash commented Nov 5, 2020

@3cp Just change the names in estree.ts ?

@3cp
Copy link
Member

3cp commented Nov 5, 2020

Sure. Will do.

@3cp
Copy link
Member

3cp commented Nov 5, 2020

Patched in master branch.

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

No branches or pull requests

3 participants