Skip to content

Commit bc6d875

Browse files
committed
[infra] Migrate build to tsdown
1 parent 40308ba commit bc6d875

File tree

11 files changed

+623
-68
lines changed

11 files changed

+623
-68
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"prettier": "pretty-quick --ignore-path .lintignore --branch master",
3131
"prettier:all": "prettier --write . --ignore-path .lintignore",
3232
"size:snapshot": "pnpm -F ./test/bundle-size check",
33-
"size:why": "pnpm size:snapshot --analyze --accurateBundles",
33+
"size:why": "pnpm size:snapshot --analyze",
3434
"start": "pnpm install && pnpm docs:dev",
3535
"test": "pnpm test:chromium",
3636
"test:e2e": "cross-env NODE_ENV=production pnpm test:e2e:build && concurrently --success first --kill-others \"pnpm test:e2e:run\" \"pnpm test:e2e:server\"",
@@ -66,7 +66,7 @@
6666
"@babel/plugin-transform-react-constant-elements": "^7.27.1",
6767
"@base-ui-components/monorepo-tests": "workspace:*",
6868
"@mui/internal-bundle-size-checker": "^1.0.9-canary.34",
69-
"@mui/internal-code-infra": "^0.0.2-canary.59",
69+
"@mui/internal-code-infra": "https://pkg.pr.new/mui/mui-public/@mui/internal-code-infra@ddb7a74",
7070
"@mui/internal-docs-utils": "^2.0.1",
7171
"@mui/internal-markdown": "^2.0.7",
7272
"@mui/internal-scripts": "^2.0.10",
@@ -129,6 +129,7 @@
129129
"terser": "^5.43.1",
130130
"terser-webpack-plugin": "^5.3.14",
131131
"tsx": "^4.20.4",
132+
"tsdown": "^0.14.1",
132133
"typescript": "^5.9.2",
133134
"unist-util-visit": "^5.0.0",
134135
"vite": "^7.1.3",

packages/react/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@
7272
"type": "commonjs",
7373
"scripts": {
7474
"prebuild": "rimraf --glob build build-tests \"*.tsbuildinfo\"",
75-
"build": "code-infra build --ignore \"**/*.template.js\" && pnpm build:copy-files",
76-
"build:stable": "code-infra build --bundle esm --ignore \"**/*.template.js\" --buildTypes false",
77-
"build:copy-files": "code-infra copy-files .npmignore",
78-
"test:package": "publint --pack pnpm && attw --pack ./build --exclude-entrypoints package.json --exclude-entrypoints esm --exclude-entrypoints cjs",
75+
"build": "tsdown && code-infra copy-files",
76+
"test:package": "publint --pack pnpm run . && attw --pack ./build --exclude-entrypoints package.json",
7977
"release": "pnpm build && pnpm publish",
8078
"test": "cross-env NODE_ENV=test VITEST_ENV=jsdom vitest",
8179
"typescript": "tsc -b tsconfig.json"

packages/react/src/accordion/header/AccordionHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22
import * as React from 'react';
3-
import { BaseUIComponentProps } from '../../utils/types';
3+
import type { BaseUIComponentProps } from '../../utils/types';
44
import { useRenderElement } from '../../utils/useRenderElement';
55
import type { AccordionItem } from '../item/AccordionItem';
66
import { useAccordionItemContext } from '../item/AccordionItemContext';

packages/react/src/use-render/useRender.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as React from 'react';
2-
import type { ComponentRenderFn } from '../utils/types';
3-
import { HTMLProps } from '../utils/types';
2+
import type { ComponentRenderFn, HTMLProps } from '../utils/types';
43
import { useRenderElement } from '../utils/useRenderElement';
54

65
/**

packages/react/src/utils/useRenderElement.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useMergedRefs, useMergedRefsN } from '@base-ui-components/utils/useMerg
33
import { isReactVersionAtLeast } from '@base-ui-components/utils/reactVersion';
44
import { mergeObjects } from '@base-ui-components/utils/mergeObjects';
55
import type { BaseUIComponentProps, ComponentRenderFn, HTMLProps } from './types';
6-
import { CustomStyleHookMapping, getStyleHookProps } from './getStyleHookProps';
6+
import { type CustomStyleHookMapping, getStyleHookProps } from './getStyleHookProps';
77
import { resolveClassName } from './resolveClassName';
88
import { mergeProps, mergePropsN, mergeClassNames } from '../merge-props';
99
import { EMPTY_OBJECT } from './constants';

packages/react/tsconfig.build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"moduleResolution": "bundler",
1111
"noEmit": false,
1212
"rootDir": "./src",
13-
"outDir": "build/esm"
13+
"jsx": "react-jsx",
14+
"outDir": "build"
1415
},
1516
"include": ["src/**/*.ts*"],
1617
"exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"],

packages/utils/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
"type": "commonjs",
1616
"scripts": {
1717
"prebuild": "rimraf --glob build build-tests \"*.tsbuildinfo\"",
18-
"build": "code-infra build && pnpm build:copy-files",
19-
"build:stable": "code-infra build --bundle esm --buildTypes false",
18+
"build": "tsdown && code-infra copy-files",
2019
"build:copy-files": "code-infra copy-files .npmignore",
21-
"test:package": "publint --pack pnpm run ./build && attw --pack ./build --exclude-entrypoints package.json --exclude-entrypoints esm --exclude-entrypoints cjs",
20+
"test:package": "publint --pack pnpm run build && attw --pack ./build --exclude-entrypoints package.json",
2221
"release": "pnpm build && pnpm publish",
2322
"test": "cross-env NODE_ENV=test VITEST_ENV=jsdom vitest",
2423
"typescript": "tsc -b tsconfig.json"

packages/utils/tsconfig.build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"moduleResolution": "bundler",
1111
"noEmit": false,
1212
"rootDir": "./src",
13-
"outDir": "build/esm"
13+
"jsx": "react-jsx",
14+
"outDir": "build"
1415
},
1516
"include": ["src/**/*.ts*", "src/**/*.tsx"],
1617
"exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"]

0 commit comments

Comments
 (0)