Commit b84de1a515600d2ead1c2b5f6db949e7bf6ab923

Authored by vben
1 parent 8a1bfdf1

fix: fix npm script

build/plugin/gzip/compress.ts
1 1 import { gzip } from 'zlib';
2 2 import { readFileSync, writeFileSync } from 'fs';
3 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 7 export function startGzip(
8 8 fileContent: string | Buffer,
... ...
build/script/cli.ts
... ... @@ -6,7 +6,7 @@ import { argv } from 'yargs';
6 6 import { runChangeLog } from './changelog';
7 7 import { runPostInstall } from './postinstall';
8 8 import { runPreview } from './preview';
9   -import { runPreserve } from './preserve';
  9 +// import { runPreserve } from './preserve';
10 10 import { runBuild } from './build';
11 11  
12 12 const task = (argv._ || [])[0];
... ... @@ -23,9 +23,9 @@ switch (task) {
23 23 runBuild();
24 24 break;
25 25  
26   - case 'preserve':
27   - runPreserve();
28   - break;
  26 + // case 'preserve':
  27 + // runPreserve();
  28 + // break;
29 29  
30 30 case 'postinstall':
31 31 runPostInstall();
... ...
build/script/preserve.ts
... ... @@ -69,3 +69,5 @@ export async function runPreserve() {
69 69 } catch (error) {}
70 70 }
71 71 }
  72 +
  73 +runPreserve();
... ...
package.json
... ... @@ -3,7 +3,7 @@
3 3 "version": "2.0.0-rc.1",
4 4 "scripts": {
5 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 7 "build": "node ./build/jsc.ts build",
8 8 "build:site": "cross-env SITE=true npm run build ",
9 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 33  
34 34 enter(el: HTMLExpandElement) {
35 35 const initialStyle = el._initialStyle;
36   - const offset = `${el[offsetProperty]}px`;
37 36  
38 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 39 el.style.overflow = 'hidden';
  40 + const offset = `${el[offsetProperty]}px`;
  41 +
42 42 el.style[sizeProperty] = '0';
43   - /* eslint-disable-next-line */
  43 +
44 44 void el.offsetHeight; // force reflow
45 45  
46 46 el.style.transition = initialStyle.transition;
... ... @@ -48,9 +48,7 @@ export default function (expandedParentClass = '', x = false) {
48 48 if (expandedParentClass && el._parent) {
49 49 el._parent.classList.add(expandedParentClass);
50 50 }
51   - console.log('======================');
52   - console.log(sizeProperty, offset);
53   - console.log('======================');
  51 +
54 52 requestAnimationFrame(() => {
55 53 el.style[sizeProperty] = offset;
56 54 });
... ...