-
Notifications
You must be signed in to change notification settings - Fork 604
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
[api-extractor] Design change: by default config paths should be relative to api-extractor.json folder #1216
Comments
Also, I realized that API Extractor's The Thus, to avoid confusion I'm going to rename this setting to |
I created a PR #1217 that initially shows how api-extractor-template.json would look with this proposed change. @iclanton what do you think? The resolution rules are definitely more obvious, but the amount of explanation required in the comments makes it seem overengineered. It would be nice to find a way to simplify it. (Note that tsconfig.json avoids this problem by presumptuously assuming its file will go in the root folder of the project, but I wouldn't want that requirement for api-extractor.json.) |
I suppose this design is unavoidable unless we give up one of the two requirements: Either (1) we'd have to resolve @skaapgif in case you had any thoughts |
It is not immediately obvious to me why you would inherit from another Having said that, I agree that paths resolved relative to the location of the config file is the most obvious/intuitive for me. If there was no other documentation or comments this would be my assumption. The documentation is a bit more verbose, but it feels like the configuration is much more explicit which reduces uncertainty, so I like the |
Agreed. I think @iclanton's concern more about establishing the general convention that we will apply to any other fields that may be introduced in the future (as well for various other config files developed in this repo). For example Rush Stack toolchain relies heavily on I went ahead and implemented the full change in the PR. It required partially resolving the extended config files as they are loaded, which muddies the separation between |
This was published with API Extractor beta release 7.0.41 |
Issue #1017 fixed some weirdness with the resolution of relative paths in api-extractor.json and added documentation explaining how each field is resolved.
However after dogfooding this release, @iclanton felt strongly that all settings should use the same rules for resolution; otherwise when reading the file it is difficult to remember how each setting is resolved. The intuitive behavior would be for them to be relative to the folder of the file being processed (i.e. api-extractor.json or one of its
extends
references). But since most of the settings are specifying output file paths, it's more natural to specify them relative to therootFolder
. So he suggested to introduce a<rootFolder>
token to make this explicit (which is similar to<rootDir>
used by Jest).The text was updated successfully, but these errors were encountered: