Commit 313ad1f
committed
[code-infra] Convert remaining @mui/system .js+.d.ts pairs to TypeScript (part 2)
Completes the @mui/system TypeScript conversion started in mui#48578. Collapses
the 9 remaining hand-written .js + .d.ts pairs into single .ts/.tsx source
(tsc-emitted declarations) and renames the standalone CSSProperties.d.ts:
- RtlProvider/index, colorManipulator, createStyled, createTheme/{createTheme,index},
styleFunctionSx/{styleFunctionSx,index}, cssVars/createCssVarsProvider
- CSSProperties.d.ts -> CSSProperties.ts (type-only csstype import)
Pragmatic conversions follow the ts-package-migration skill: as any / as unknown
as T casts Babel strips (never restructuring runtime), Pattern A propTypes
(Identifier LHS) so the production guard survives, and private_createBreakpoints
kept at runtime but @internal (stripInternal) so the published type surface is
unchanged.
Tooling/config updates required by the conversion:
- scripts/coreTypeScriptProjects.js: point the api-docs-builder's @mui/system
entry at src/index.ts (was src/index.d.ts, which the conversion removes) so
pnpm proptypes (test_static) can build the project.
- @mui/material-pigment-css imports @mui/system/RtlProvider (now .tsx) and builds
via tsc; added the @mui/system project reference to its tsconfig.build.json.
- exports map: drop redundant ./createTheme + ./styleFunctionSx entries (wildcard
covers them as .ts), keep explicit ./RtlProvider pointing at index.tsx.
Documented non-breaking type-surface deltas: unstable_resolveBreakpointValues is
now in the root .d.ts (real runtime export consumed by @mui/lab Masonry, missing
from the hand-written index.d.ts); names the old index.d.ts claimed as values via
export * but index.js never exported at runtime (breakpointKeys, getStyleValue2,
extendSxProp, prepareCssVars, ...) are now correctly type-only at the root.
Verified: @mui/system build + typescript + test (1112 pass) + proptypes +
module augmentation, and downstream builds of @mui/material, @mui/lab,
@mui/material-pigment-css.1 parent bff3c4a commit 313ad1f
25 files changed
Lines changed: 734 additions & 876 deletions
File tree
- packages
- mui-material-pigment-css
- mui-system
- src
- RtlProvider
- colorManipulator
- createStyled
- createTheme
- cssVars
- styleFunctionSx
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 85 | + | |
| 86 | + | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
This file was deleted.
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | | - | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | | - | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | | - | |
| 26 | + | |
Lines changed: 0 additions & 30 deletions
This file was deleted.
0 commit comments