Skip to content

[api-extractor] Improved model for rollup *.d.ts target folder configuration - #582

Merged
Pete Gonzalez (octogonz) merged 10 commits into
masterfrom
pgonzal/new-dts-config
Mar 25, 2018
Merged

Pete Gonzalez (octogonz) merged 10 commits into
masterfrom
pgonzal/new-dts-config

Conversation

@octogonz

@octogonz Pete Gonzalez (octogonz) commented Mar 24, 2018 •

Copy link
Copy Markdown
Collaborator

This PR tunes up the api-extractor.json config file settings to prepare for initial release of the *.d.ts rollup feature.

  • Trimming is now opt-in, and controlled by the trimming setting
  • When trimming is disabled, the *.d.ts rollup filename is now automatically inferred from the typings field in package.json
  • When trimming is enabled, the three *.d.ts rollups now have the same filename, but are written to separate folders for each release type: dist/internal, dist/beta, and dist/public.

The earlier design assumed that we would modify the typings field in package.json to point immediately prior to publishing, to point to one of the *.d.ts files. We realized that this won't work for multiple entry points (where the *.d.ts filename must match the *.js filename.) Also, different release types often have other differences besides just the typings. Overall it's a better design for each release target to be built into its own folder.

this._monitoredLogger.logError('The "mainDtsRollupPath" setting was not specified.'
+ ' In this case, the package.json "typings" field must point to a file under'
+ ' the "publishFolder": ' + dtsRollup.publishFolder!);
return false;

@octogonz Pete Gonzalez (octogonz) Mar 24, 2018 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return false; [](start = 11, length = 14)

This is not right #Resolved

if (!path.isAbsolute(mainDtsRollupPath)) {
this._monitoredLogger.logError('The "mainDtsRollupPath" setting must be a relative path'
+ ' that can be combined with "publishFolderForInternal", "publishFolderForBeta", '
+ 'or "publishFolderForPublic".');

@octogonz Pete Gonzalez (octogonz) Mar 24, 2018 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about untrimmed? #Resolved

@octogonz

Pete Gonzalez (octogonz) commented Mar 25, 2018 •

Copy link
Copy Markdown
Collaborator Author

:shipit:

Approved with PullApprove Approved with PullApprove

@octogonz
Pete Gonzalez (octogonz) merged commit f8e2993 into master Mar 25, 2018
@octogonz
Pete Gonzalez (octogonz) deleted the pgonzal/new-dts-config branch May 2, 2018 04:18
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.

2 participants