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

clean up the types and export them #497

Closed
micahstubbs opened this issue Aug 26, 2019 · 4 comments
Closed

clean up the types and export them #497

micahstubbs opened this issue Aug 26, 2019 · 4 comments

Comments

@micahstubbs
Copy link
Contributor

clean up the types and export them

#316

@micahstubbs
Copy link
Contributor Author

Semiotic is super-awesome. It would be really nice to be able to use the native types for Semiotic in my TypeScript project 😄

@charmsRace
Copy link

charmsRace commented Feb 27, 2020

I'm trying to get a handle on this (not necessarily for a semiotic production PR, but at least to yarn link into my own TypeScript project), but I'm finding it confusing to start taking apart the build pipeline. It seems that rollup-plugin-typescript does not support emitting TS declaration files, so you need to do something like add a "dist:types": "tsc -p ./tsconfig.json --emitDeclarationOnly" script in package.json, in addition to adding "declaration" and "declarationDir" to tsconfig.json::compilerOptions.

After fixing some basic typing errors (unexported interfaces within OrdinalFrame.tsx, etc.), this seems to sort-of work, but it's not quite that simple. The declarations are emitted, but they're A) not consolidated to a single index.d.ts or anything, which would probably be ideal, and B) not actually visible after yarn link-ing. I'm missing something here, but I'm not sure if it's to do with rollup settings (never used it), package.json settings, or the semiotic-specific build pipeline.

I'd appreciate any input here @emeeks. I feel like delta here can't be too large, since semiotic's already in TypeScript (may be optimistic here), but I don't have a comprehensive enough understanding of semiotic to puzzle it out (haven't even learned the API yet). I may decide to work on this in the future after this use case, but in the meantime I need to use a library that already has typings.

@micahstubbs
Copy link
Contributor Author

💯 for helping @Calamitizer figure out the types

@emeeks
Copy link
Member

emeeks commented Mar 22, 2020

I think the latest version should have types exported, if it doesn't feel free to open a new issue.

@emeeks emeeks closed this as completed Mar 22, 2020
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