Replace UserConfig typedef with a subpath export (#3460) #3562
+7
−6
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.
This is a minimum viable patch that starts work on #3460. Notably, this change removes the requirement of
maxNodeModuleJsDepth
intsconfig.json
for TS packages that want to import UserConfig API, as mentioned in the mega TS issue.Since modifying the functionality of exports, imports, and declarations will involve some cleanup, removal and renaming, further work is probably something best left to the next major release.
I've removed the
@typedef
comment fromEleventy.js
, since adding atypes
subpath export makes exporting it from Eleventy's main file redundant. If backwards compatiblity is needed, then something like this will implement the fuctionality offered by the subpath export:Also note, declaring
./src/UserConfig.js
as a"types"
export will still block it from being directly consumed (see #3460), since"."
is the only pathname that has a"import/require"
key. It's therefore only possible to import it as a type, either from Typescript or from JSDoc.