-
Notifications
You must be signed in to change notification settings - Fork 618
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
[heft] Add tryLoadProjectConfigurationFileAsync
API and use in plugins
#5147
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f6a02a7
to
3272d94
Compare
D4N14L
reviewed
Mar 5, 2025
libraries/heft-config-file/src/test/__snapshots__/ConfigurationFile.test.ts.snap
Outdated
Show resolved
Hide resolved
iclanton
reviewed
Mar 5, 2025
heft-plugins/heft-api-extractor-plugin/src/ApiExtractorPlugin.ts
Outdated
Show resolved
Hide resolved
octogonz
reviewed
Mar 5, 2025
95f3335
to
3ae827e
Compare
3ae827e
to
1a8877d
Compare
1a8877d
to
8447ed9
Compare
D4N14L
approved these changes
Apr 8, 2025
D4N14L
approved these changes
Apr 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new API to
HeftConfiguration
,tryLoadProjectConfigurationFileAsync
, so that plugins can load riggable config files without taking a direct dependency (and risking version duplication) on@rushstack/heft-config-file
.Starts addressing #5092. The motivation is to get us to a world where Heft plugins don't need any runtime dependencies other than on any external tools they bring with them, because all the core functionality of a Heft plugin is available on arguments passed to
apply
, similar to prior art in webpack plugins, that have thecompiler.webpack
field that provides access to all functionality that would otherwise be obtained viaimport ... from 'webpack'
.This API change removes any need for Heft plugins to take their own dependency on the
@rushstack/heft-config-file
package for normal scenarios.Details
Fixes an issue with
PathResolutionMethod.resolveRelativeToProjectRoot
when extending from a file that lives in a different package. It was previously resolving relative to the package that contained the file being extended from, rather than the file that contains the original loaded configuration file.Adds a new
customValidationFunction
option to the configuration file APIs that can be used to perform additional validation after loading a file.Uses this API in
heft-api-extractor-plugin
,heft-sass-plugin
, andheft-typescript-plugin
.Currently doesn't expose the version that throws if the file cannot be found.
All needed types are re-exported under the
ConfigurationFile
namespace on@rushstack/heft
.How it was tested
Existing build tests for these plugins.
Impacted documentation
API Documentation for
@rushstack/heft
.