Skip to content

Commit fa2354f

Browse files
anlyyaoLeeJimgithub-actions[bot]anlyyaoRylanBot
authored
chore: upgrade vite to v6, typescript to v5 (#624)
* 0.3.1 (#330) * fix(checkbox): enable user to click content (#328) * build: resolve ts problems * chore: publish v0.3.1 (#329) * chore: publish v0.3.1 * chore: changelog's changes Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(site): fix version number parsing error (#586) (#587) * feat(site): support theme generator (#604) (#605) * style(site): add CSS variables to support dark mode * chore: remove useless log * feat(site): support theme generator Co-authored-by: Rylan <[email protected]> * Chore/main (#614) * feat(site): support theme generator (#604) * style(site): add CSS variables to support dark mode * chore: remove useless log * feat(site): support theme generator * chore: remove react-spring (#608) * chore: remove react-spring * test: update snapshots * feat(fab): 对齐 mobile-vue (#594) * feat(fab): 对齐mobile-vue" * feat(fab): prevent default when touchmove * feat(fab): prevent default * chore: update demo file name * chore: update test case * chore: remove forwardRef --------- Co-authored-by: anlyyao <[email protected]> * feat(list): add list component (#463) * feat(list): add list component re #394 * feat(list): fix list review qa fix #463 * style(list): fix code review comment fix #463 * fix: fix cr * docs: sync api --------- Co-authored-by: realcwang <[email protected]> Co-authored-by: anlyyao <[email protected]> * feat(action-sheet): 新增 ActionSheet组件 (#471) * feat(action-sheet): 新增 ActionSheet组件 * fix: 修复comment 问题 * fix: 修复同步develop后的问题 * fix: action-sheet 使用 useDefault * fix: 规范变量命名 * fix(action-sheet): 修复同步develop 后的问题(action-sheet badge 位置) * fix(grid): grid 补充 children 属性 * fix(action-sheet): 规范文档和类型定义 * fix: 优化类型和默认值 * fix: 优化类型和默认值 * fix: actionSheet适配Badge样式 * fix(action-sheet): 优化css结构 * fix: resolve conflicts * fix: fix cr and sync api docs * chore: update snapshot --------- Co-authored-by: anlyyao <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix/demo/style (#610) * fix(Demo): fixed demo page background color error * test: update snapshots * feat(Progress): support size props (#609) * feat(Progress): support size props * test: update snapshots * chore: tool functions moved to the tdesign-common repo * feat(Collapse): optimize panel animation (#611) * feat(Collapse): optimize panel animation * test: update snapshots * chore: update _common (#612) * chore: publish v0.13.0 (#613) * chore: publish v0.13.0 * chore: changelog's changes * chore: using relative paths inside components --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Rylan <[email protected]> Co-authored-by: Mike <[email protected]> Co-authored-by: feaswcy <[email protected]> Co-authored-by: realcwang <[email protected]> Co-authored-by: Jelly <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore(site): update (#619) * feat(site): support theme generator (#604) * style(site): add CSS variables to support dark mode * chore: remove useless log * feat(site): support theme generator * chore: remove react-spring (#608) * chore: remove react-spring * test: update snapshots * feat(fab): 对齐 mobile-vue (#594) * feat(fab): 对齐mobile-vue" * feat(fab): prevent default when touchmove * feat(fab): prevent default * chore: update demo file name * chore: update test case * chore: remove forwardRef --------- Co-authored-by: anlyyao <[email protected]> * feat(list): add list component (#463) * feat(list): add list component re #394 * feat(list): fix list review qa fix #463 * style(list): fix code review comment fix #463 * fix: fix cr * docs: sync api --------- Co-authored-by: realcwang <[email protected]> Co-authored-by: anlyyao <[email protected]> * feat(action-sheet): 新增 ActionSheet组件 (#471) * feat(action-sheet): 新增 ActionSheet组件 * fix: 修复comment 问题 * fix: 修复同步develop后的问题 * fix: action-sheet 使用 useDefault * fix: 规范变量命名 * fix(action-sheet): 修复同步develop 后的问题(action-sheet badge 位置) * fix(grid): grid 补充 children 属性 * fix(action-sheet): 规范文档和类型定义 * fix: 优化类型和默认值 * fix: 优化类型和默认值 * fix: actionSheet适配Badge样式 * fix(action-sheet): 优化css结构 * fix: resolve conflicts * fix: fix cr and sync api docs * chore: update snapshot --------- Co-authored-by: anlyyao <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix/demo/style (#610) * fix(Demo): fixed demo page background color error * test: update snapshots * feat(Progress): support size props (#609) * feat(Progress): support size props * test: update snapshots * chore: tool functions moved to the tdesign-common repo * feat(Collapse): optimize panel animation (#611) * feat(Collapse): optimize panel animation * test: update snapshots * chore: update _common (#612) * chore: publish v0.13.0 (#613) * chore: publish v0.13.0 * chore: changelog's changes * chore: using relative paths inside components --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(SideBar): fix component not exported (#616) * fix(SideBar): fix component not exported * fix: update example import method * chore: publish v0.13.1 (#618) * chore: publish v0.13.1 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Rylan <[email protected]> Co-authored-by: Mike <[email protected]> Co-authored-by: feaswcy <[email protected]> Co-authored-by: realcwang <[email protected]> Co-authored-by: Jelly <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: upgrade vite to v6, typescript to v5 * fix(site): fix the preview path error in the development env --------- Co-authored-by: leejimqiu <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: anlyyao <[email protected]> Co-authored-by: Rylan <[email protected]> Co-authored-by: Mike <[email protected]> Co-authored-by: feaswcy <[email protected]> Co-authored-by: realcwang <[email protected]> Co-authored-by: Jelly <[email protected]>
1 parent 04a1c58 commit fa2354f

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"site:build": "cd site && vite build",
3333
"site:serve": "cd site && vite preview",
3434
"site:intranet": "cd site && vite build --mode intranet",
35-
"site:preview": "cd site && vite build --mode preview",
35+
"site:preview": "cd site && cross-env NODE_ENV=development vite build --mode preview",
3636
"postsite:preview": "cp _site/index.html _site/404.html",
3737
"lint": "eslint --ext .ts,.tsx ./ --max-warnings 0",
3838
"lint:fix": "eslint --ext .ts,.tsx ./ --max-warnings 0 --fix",
@@ -92,14 +92,15 @@
9292
"@testing-library/react": "^12.1.4",
9393
"@testing-library/user-event": "^13.5.0",
9494
"@types/lodash-es": "^4.17.12",
95-
"@types/node": "^20.14.11",
95+
"@types/node": "^22.14.1",
9696
"@types/react": "^17.0.2",
9797
"@types/react-dom": "17.0.2",
9898
"@types/react-transition-group": "^4.4.4",
99+
"@types/rimraf": "^4.0.5",
99100
"@types/tinycolor2": "^1.4.6",
100101
"@typescript-eslint/eslint-plugin": "^5.6.0",
101102
"@typescript-eslint/parser": "^5.6.0",
102-
"@vitejs/plugin-react": "^1.1.1",
103+
"@vitejs/plugin-react": "^4.4.1",
103104
"@vitest/coverage-istanbul": "^2.0.3",
104105
"@vitest/coverage-v8": "^2.0.3",
105106
"@vitest/ui": "^2.0.3",
@@ -139,7 +140,7 @@
139140
"react": "^17.0.2",
140141
"react-dom": "^17.0.2",
141142
"react-router-dom": "^6.2.2",
142-
"rimraf": "^3.0.2",
143+
"rimraf": "^6.0.1",
143144
"rollup": "^2.55.0",
144145
"rollup-plugin-analyzer": "^4.0.0",
145146
"rollup-plugin-esbuild": "^4.5.0",
@@ -153,10 +154,10 @@
153154
"tdesign-icons-view": "^0.3.6",
154155
"tdesign-site-components": "^0.15.6",
155156
"tdesign-theme-generator": "^1.1.0",
156-
"typescript": "^4.5.3",
157-
"vite": "^2.7.0",
158-
"vite-plugin-pwa": "^0.11.11",
159-
"vite-plugin-tdoc": "^2.0.0",
157+
"typescript": "^5.8.3",
158+
"vite": "^6.2.3",
159+
"vite-plugin-pwa": "^1.0.0",
160+
"vite-plugin-tdoc": "^2.0.4",
160161
"vitest": "^2.0.3",
161162
"workbox-precaching": "^6.3.0"
162163
},

site/pwaConfig.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
export default {
22
strategies: 'injectManifest',
3-
includeAssets: ['favicon.svg', 'favicon.ico', 'apple-touch-icon.png'],
3+
includeAssets: ['favicon.svg', 'favicon.ico', 'apple-touch-icon.png'],
4+
injectManifest: {
5+
maximumFileSizeToCacheInBytes: 7000000,
6+
},
47
manifest: {
58
name: 'TDesign for Mobile React',
69
short_name: 'TDesign',
@@ -16,7 +19,7 @@ export default {
1619
src: 'pwa-512x512.png',
1720
sizes: '512x512',
1821
type: 'image/png',
19-
}
20-
]
21-
}
22+
},
23+
],
24+
},
2225
};

site/vite.config.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ const publicPathMap = {
1313
production: 'https://static.tdesign.tencent.com/mobile-react/',
1414
};
1515

16+
// Rollup 4+ 的 tree-shaking 策略调整, 这里是为了让样式在站点构建正常
17+
const disableTreeShakingPlugin = (paths) => ({
18+
name: 'disable-treeshake',
19+
transform(code, id) {
20+
for (const path of paths) {
21+
if (id.includes(path)) {
22+
return { code, map: null, moduleSideEffects: 'no-treeshake' };
23+
}
24+
}
25+
},
26+
});
27+
1628
export default ({ mode }) =>
1729
defineConfig({
1830
base: publicPathMap[mode],
@@ -48,5 +60,11 @@ export default ({ mode }) =>
4860
https: false,
4961
fs: { strict: false },
5062
},
51-
plugins: [react(), tdocPlugin(), VitePWA(pwaConfig), replace({ __DATE__: new Date().toISOString() })],
63+
plugins: [
64+
react(),
65+
tdocPlugin(),
66+
VitePWA(pwaConfig),
67+
disableTreeShakingPlugin(['style/']),
68+
replace({ __DATE__: new Date().toISOString() }),
69+
],
5270
});

site/web/Demo.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from 'react';
22
import { Link, useLocation } from 'react-router-dom';
33
import Button from 'tdesign-mobile-react/button';
44

5-
export const jsxDemoFiles = import.meta.globEager('../../src/**/_example/*.jsx');
6-
export const tsxDemoFiles = import.meta.globEager('../../src/**/_example/*.tsx');
5+
export const jsxDemoFiles = import.meta.glob('../../src/**/_example/*.jsx', { eager: true });
6+
export const tsxDemoFiles = import.meta.glob('../../src/**/_example/*.tsx', { eager: true });
77

88
const demoObject = {};
99

0 commit comments

Comments
 (0)