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

Add support for a typedocMain field in package.json. #1677

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

itsjamie
Copy link
Contributor

@itsjamie itsjamie commented Sep 7, 2021

This can be used to generate a tree of your source using tsc and point
at it to generate documentation outside your normal build process.

This takes a different tack and instead of falling back to the typings, this allows you to set a specific packageMain value that is built directly with TSC. This can act as an escape hatch for projects with weird builds that involve webpack / rollup / etc, and more complex typings setups with api-extractor to go along with the bundling.

For example, in our particular case, we use webpack 4 and api-extractor to bundle packages that are used at development time, but publicly are exposed as a single package. Therefore we bundle the TS via webpack and tsloader, and bundle the declaration files using an api-extractor rollup.

Resolves #1674.

This can be used to generate a tree of your source using `tsc` and point
at it to generate documentation outside your normal build process.

Resolves TypeStrong#1674.
@itsjamie
Copy link
Contributor Author

itsjamie commented Sep 9, 2021

Just a note, you don't even need to generate the tree with tsc outside the binary. You can literally point typedocMain at your entry point. Because you support running directly on the TypeScript source, this means no extra steps.

@cheelahim
Copy link

@Gerrit0 What's your take on this one? I have a few projects which would benefit from this option.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 10, 2021

I need to pull it down and play with it, fix the CI failure, add a test, and write some docs for it, it seems like an elegant solution though.

@Gerrit0 Gerrit0 merged commit e8e6244 into TypeStrong:master Sep 10, 2021
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 10, 2021

TIL, GitHub's gh tool merges remotely :/ that's annoying, wanted to play with it first!

@itsjamie
Copy link
Contributor Author

For future reference, If you want to use the gh tool locally, you could use: gh pr checkout 1677

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 10, 2021

Good to know, thanks! This has been released in 0.22.0

@itsjamie itsjamie deleted the add-typedocMain branch September 10, 2021 20:22
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.

Generating documentation while using webpack 4 and ts-loader.
3 participants