Allow to specify a custom `tsconfig` in packages mode for monorepos
See original GitHub issueSearch Terms
Monorepo, tsconfig, custom path
Problem
When operating in monorepo mode (multiple packages), each package may contain several tsconfig
files.
For instance, Nx generates 3 tsconfig
files per TypeScript project:
tsconfig.json
- base configuration, extends workspace’s roottsconfig
;tsconfig.lib.json
- production code configuration, extends package’stsconfig.json
;tsconfig.spec.json
- tests configuration, extends package’stsconfig.json
.
When one generates documentation for several packages, TypeDoc uses tsconfig.json
instead of desired tsconfig.lib.json
without ability to override the file name (or location).
Suggested Solution
Allow to override package’s tsconfig
file name (location) via package.json
settings:
{
"name": "@org/package-a",
"typedoc": {
"entryPoint": "./src/index.ts",
"readmeFile": "./README.md",
"tsconfig": "./tsconfig.lib.json"
}
}
So that TypeDoc will be more monorepo-friendly and multi-config-friendly.
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
The Ultimate Guide to TypeScript Monorepos
I've written a couple of posts about how to set up JavaScript and TypeScript Monorepos over the past three years (#1, #2, #3,...
Read more >Custom tsconfig.json name #1251 - parcel-bundler ... - GitHub
Ideally, there should be a command line option to specify the name and path of the tsconfig.json file. Context. Compiling and bundling ...
Read more >Setting up a monorepo with Lerna for a TypeScript project
Learn how to setup a monorepo with Lerna and configure it for ... Independent mode allows us to have different versions per package....
Read more >How to set up a TypeScript monorepo and make Go ... - Medium
First thing's first, let's setup the monorepo. You can use Lerna or yarn workspaces to create the monorepo structure and symlink the packages...
Read more >Monorepo Typescript how to build package together?
I have Pacakage 'A' And app 'B'. 'Package A' index.ts export default "foo". A's package.json main: index.ts types: index.ts. A's tsconfig.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The relevant code starts at https://github.com/TypeStrong/typedoc/blob/master/src/lib/utils/entry-point.ts#L323, seems reasonable to treat this option like the readmeFile is tested today
Yep, I managed to generate docs for all libraries from Nx workspace and deploy them to GitHub pages.
But to achieve this, I had to rename
tsconfig*
files in every library so that TypeDoc resolved the righttsconfig.json
. So it pushed me to override default configs generated and maintained by Nx.