Skip to content

feat: bundle internal packages types#5610

Merged
OEvgeny merged 12 commits intomainfrom
fix/pkg-types
Oct 8, 2025
Merged

feat: bundle internal packages types#5610
OEvgeny merged 12 commits intomainfrom
fix/pkg-types

Conversation

@OEvgeny
Copy link
Copy Markdown
Collaborator

@OEvgeny OEvgeny commented Oct 7, 2025

Fixes #

Changelog Entry

Fixed published package types containing internal package references, in PR #5610, by @OEvgeny

Description

This PR adds a layer of bundling for our types as well as an extra validation layer to ensure we do not leak @msinternal/* packages type references to the outside.

Design

As to the date tsup does not resolve external package types which is stated in their docs:

Note that --dts does not resolve external (aka in node_modules) types used in the .d.ts file, if that's somehow a requirement, try the experimental --dts-resolve flag instead.

I've tried the above mentioned experimental --dts-resolve flag without any luck. So the only option seems to shop around for the solutions available.

The dtsroll package is designed to modify generated definition files in place according to the package.json dependencies definitions.

I shuffled a bit dependencies definitions in the package.json files we have, but overall dependencies changes are optional except for the bundle package.

I also removed Webpack 4 legacy entries for internal packages as these packages should be bundled and such entries trip dtsroll for some reason.

Specific Changes

  • updated public package.json files to include dtsroll transform step
  • updated public package.json files to include validation step
  • reworked createComponentIcon schema type as the resulting type was rather complex
  • reworked createComponentIcon usage as the old is not compatible with our precommit check
  • removed top level entry files from internal packages and switched tsd to use correct resolution strategy

-

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@OEvgeny OEvgeny marked this pull request as ready for review October 7, 2025 19:30
Comment thread packages/bundle/package.json
Comment thread packages/bundle/package.json
Comment thread packages/component/src/Utils/createIconComponent.tsx
Comment thread packages/core/package.json Outdated
Comment thread packages/api-middleware/package.json
Comment thread packages/fluent-theme/src/components/icon/FluentIcon.tsx
Comment thread packages/fluent-theme/package.json Outdated
compulim
compulim previously approved these changes Oct 8, 2025
Copy link
Copy Markdown
Contributor

@compulim compulim left a comment

Choose a reason for hiding this comment

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

Nitpicking.

@OEvgeny OEvgeny merged commit 96f366b into main Oct 8, 2025
125 of 129 checks passed
@OEvgeny OEvgeny deleted the fix/pkg-types branch October 8, 2025 22:15
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