Commit b84de1a515600d2ead1c2b5f6db949e7bf6ab923

Authored by vben
1 parent 8a1bfdf1

fix: fix npm script

build/plugin/gzip/compress.ts
1 import { gzip } from 'zlib'; 1 import { gzip } from 'zlib';
2 import { readFileSync, writeFileSync } from 'fs'; 2 import { readFileSync, writeFileSync } from 'fs';
3 import { GzipPluginOptions } from './types'; 3 import { GzipPluginOptions } from './types';
4 -import viteConfig from '../../vite.config';  
5 -import { readAllFile, getCwdPath, isBuildGzip, isSiteMode } from '../utils'; 4 +import viteConfig from '../../../vite.config';
  5 +import { readAllFile, getCwdPath, isBuildGzip, isSiteMode } from '../../utils';
6 6
7 export function startGzip( 7 export function startGzip(
8 fileContent: string | Buffer, 8 fileContent: string | Buffer,
build/script/cli.ts
@@ -6,7 +6,7 @@ import { argv } from 'yargs'; @@ -6,7 +6,7 @@ import { argv } from 'yargs';
6 import { runChangeLog } from './changelog'; 6 import { runChangeLog } from './changelog';
7 import { runPostInstall } from './postinstall'; 7 import { runPostInstall } from './postinstall';
8 import { runPreview } from './preview'; 8 import { runPreview } from './preview';
9 -import { runPreserve } from './preserve'; 9 +// import { runPreserve } from './preserve';
10 import { runBuild } from './build'; 10 import { runBuild } from './build';
11 11
12 const task = (argv._ || [])[0]; 12 const task = (argv._ || [])[0];
@@ -23,9 +23,9 @@ switch (task) { @@ -23,9 +23,9 @@ switch (task) {
23 runBuild(); 23 runBuild();
24 break; 24 break;
25 25
26 - case 'preserve':  
27 - runPreserve();  
28 - break; 26 + // case 'preserve':
  27 + // runPreserve();
  28 + // break;
29 29
30 case 'postinstall': 30 case 'postinstall':
31 runPostInstall(); 31 runPostInstall();
build/script/preserve.ts
@@ -69,3 +69,5 @@ export async function runPreserve() { @@ -69,3 +69,5 @@ export async function runPreserve() {
69 } catch (error) {} 69 } catch (error) {}
70 } 70 }
71 } 71 }
  72 +
  73 +runPreserve();
package.json
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 "version": "2.0.0-rc.1", 3 "version": "2.0.0-rc.1",
4 "scripts": { 4 "scripts": {
5 "bootstrap": "yarn install", 5 "bootstrap": "yarn install",
6 - "serve": "node ./build/jsc.ts preserve && cross-env NODE_ENV=development vite", 6 + "serve": "cross-env ts-node --files -P ./build/tsconfig.json ./build/script/preserve && cross-env NODE_ENV=development vite",
7 "build": "node ./build/jsc.ts build", 7 "build": "node ./build/jsc.ts build",
8 "build:site": "cross-env SITE=true npm run build ", 8 "build:site": "cross-env SITE=true npm run build ",
9 "build:no-cache": "yarn clean:cache && npm run build", 9 "build:no-cache": "yarn clean:cache && npm run build",
src/components/Transition/src/ExpandTransition.ts
@@ -33,14 +33,14 @@ export default function (expandedParentClass = '', x = false) { @@ -33,14 +33,14 @@ export default function (expandedParentClass = '', x = false) {
33 33
34 enter(el: HTMLExpandElement) { 34 enter(el: HTMLExpandElement) {
35 const initialStyle = el._initialStyle; 35 const initialStyle = el._initialStyle;
36 - const offset = `${el[offsetProperty]}px`;  
37 36
38 el.style.setProperty('transition', 'none', 'important'); 37 el.style.setProperty('transition', 'none', 'important');
39 - el.style.visibility = 'hidden';  
40 - el.style.visibility = initialStyle.visibility!; 38 + // Hide overflow to account for collapsed margins in the calculated height
41 el.style.overflow = 'hidden'; 39 el.style.overflow = 'hidden';
  40 + const offset = `${el[offsetProperty]}px`;
  41 +
42 el.style[sizeProperty] = '0'; 42 el.style[sizeProperty] = '0';
43 - /* eslint-disable-next-line */ 43 +
44 void el.offsetHeight; // force reflow 44 void el.offsetHeight; // force reflow
45 45
46 el.style.transition = initialStyle.transition; 46 el.style.transition = initialStyle.transition;
@@ -48,9 +48,7 @@ export default function (expandedParentClass = '', x = false) { @@ -48,9 +48,7 @@ export default function (expandedParentClass = '', x = false) {
48 if (expandedParentClass && el._parent) { 48 if (expandedParentClass && el._parent) {
49 el._parent.classList.add(expandedParentClass); 49 el._parent.classList.add(expandedParentClass);
50 } 50 }
51 - console.log('======================');  
52 - console.log(sizeProperty, offset);  
53 - console.log('======================'); 51 +
54 requestAnimationFrame(() => { 52 requestAnimationFrame(() => {
55 el.style[sizeProperty] = offset; 53 el.style[sizeProperty] = offset;
56 }); 54 });