From e78b8f6f273afdf98e81d84cf9deb9823b681c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Fri, 21 Jul 2023 14:53:35 +0800 Subject: [PATCH] chore: bump cssinjs (#43691) * chore: bump cssinjs * chore: bump cssinjs * chore: default light & motion * test: snapshot ignore motion * chore: clean up * chore: bump cssinjs version * chore: adjust log * chore: adjust log --- .dumi/theme/layouts/GlobalLayout.tsx | 2 +- .dumi/theme/slots/Footer/AdditionalInfo.tsx | 6 ++---- package.json | 2 +- scripts/argos-upload.ts | 7 +++++-- tests/shared/imageTest.tsx | 1 + 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.dumi/theme/layouts/GlobalLayout.tsx b/.dumi/theme/layouts/GlobalLayout.tsx index 5d8373a65c..521d5cce79 100644 --- a/.dumi/theme/layouts/GlobalLayout.tsx +++ b/.dumi/theme/layouts/GlobalLayout.tsx @@ -45,7 +45,7 @@ const GlobalLayout: React.FC = () => { const [{ theme = [], direction, isMobile }, setSiteState] = useLayoutState({ isMobile: false, direction: 'ltr', - theme: ['light', 'motion-off'], + theme: [], }); const updateSiteConfig = useCallback( diff --git a/.dumi/theme/slots/Footer/AdditionalInfo.tsx b/.dumi/theme/slots/Footer/AdditionalInfo.tsx index 447b4be308..3bc0adcaf5 100644 --- a/.dumi/theme/slots/Footer/AdditionalInfo.tsx +++ b/.dumi/theme/slots/Footer/AdditionalInfo.tsx @@ -45,10 +45,8 @@ export default function InfoNewVersion() { const { content } = getComputedStyle(p); setSupportWhere(String(content).includes('CHECK')); - return () => { - document.body.removeChild(p); - removeCSS(whereCls); - }; + document.body.removeChild(p); + removeCSS(whereCls); }, []); return supportWhere ? null : ( diff --git a/package.json b/package.json index 46922deba7..5026b3e762 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ ], "dependencies": { "@ant-design/colors": "^7.0.0", - "@ant-design/cssinjs": "^1.10.1", + "@ant-design/cssinjs": "^1.13.2", "@ant-design/icons": "^5.1.0", "@ant-design/react-slick": "~1.0.0", "@babel/runtime": "^7.18.3", diff --git a/scripts/argos-upload.ts b/scripts/argos-upload.ts index 2da210b1ff..e6779f8282 100644 --- a/scripts/argos-upload.ts +++ b/scripts/argos-upload.ts @@ -19,7 +19,7 @@ function execFile(command: string, args: string[]) { const screenshotsBase = 'imageSnapshots'; const screenshotsChunks = `imageSnapshots-chunks`; -const BATCH_SIZE = 200; +const BATCH_SIZE = 128; async function cpToTemp(screenshot: string, target: string) { await execFile('mkdir', ['-p', target]); @@ -40,6 +40,9 @@ async function run() { ), ); + // eslint-disable-next-line no-console -- pipe stdout + console.log('Chunk Size:', chunks.length, '/', 'Total Snapshots:', screenshots.length); + for (let i = 0; i < chunks.length; i += 1) { // eslint-disable-next-line no-await-in-loop const result = await argos.upload({ @@ -51,7 +54,7 @@ async function run() { }, }); // eslint-disable-next-line no-console -- pipe stdout - console.log(result); + console.log(i, '>', result); } } diff --git a/tests/shared/imageTest.tsx b/tests/shared/imageTest.tsx index 6317bcec34..8cd5e51d44 100644 --- a/tests/shared/imageTest.tsx +++ b/tests/shared/imageTest.tsx @@ -39,6 +39,7 @@ export default function imageTest(component: React.ReactElement) { page.on('request', onRequestHandle); await page.goto(`file://${process.cwd()}/tests/index.html`); await page.addStyleTag({ path: `${process.cwd()}/dist/reset.css` }); + await page.addStyleTag({content: '*{animation: none!important;}'}) const cache = createCache();