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

Autogenerate TypeScript declaration files #2359

Merged
merged 6 commits into from
Jun 14, 2022

Conversation

thegreatercurve
Copy link
Contributor

@thegreatercurve thegreatercurve commented Jun 7, 2022

  • Remove .d.ts files and set absolute path aliases to .ts files.
  • Fix any resulting type errors.
  • Add logic to build pipeline to emit type declarations, and then move them into relevant dist folders.
  • Refactored the build scripts to run in sequence. (It takes a little while longer, but avoids some OOM errors I was getting with an early implementation).

Tested the integration by running npm run prepare-release and then copying files over to a test TypeScript integration of Lexical which uses both lexical and @lexical/react,

@vercel
Copy link

vercel bot commented Jun 7, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview Jun 13, 2022 at 9:42AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview Jun 13, 2022 at 9:42AM (UTC)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 7, 2022
Base automatically changed from bug/spread-export to main June 7, 2022 11:16
@thegreatercurve thegreatercurve force-pushed the type-generation-experiment branch from 4672391 to 4b42308 Compare June 7, 2022 11:18
@thegreatercurve thegreatercurve marked this pull request as ready for review June 7, 2022 14:39
@thegreatercurve thegreatercurve force-pushed the type-generation-experiment branch from 2add202 to 23d888f Compare June 7, 2022 15:21
@thegreatercurve thegreatercurve force-pushed the type-generation-experiment branch from f1a30de to 946f7bb Compare June 13, 2022 09:27
@thegreatercurve
Copy link
Contributor Author

Sorry to ask but can I get a re-review? I had to fix some bugs in the playground that weren't covered in the original tsconfig

@thegreatercurve thegreatercurve merged commit c26e41d into main Jun 14, 2022
@thegreatercurve thegreatercurve deleted the type-generation-experiment branch June 14, 2022 09:42
@echarles
Copy link
Contributor

That is a great move. I see the flow folders are still present. If an API changes, the d.ts will be automatically generated, does the flow files still need to be manually updated (disclaimer: I have never used flow). Nothing is written about that in https://github.com/facebook/lexical/blob/main/CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants