Skip to content

Commit

Permalink
fix: 文件名大小写问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang committed Oct 27, 2023
1 parent 1ce66db commit 3aeefea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
8 changes: 3 additions & 5 deletions packages/mini-demo/src/pages/input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@

import * as React from 'react';
import AutoHeight from './component/auto-height';
import Basic from './component/basic';
import Clearable from './component/clearable';
import Disabled from './component/disabled';
import Native from './component/native';
import ReadOnly from './component/readOnly';
import ReadOnly from './component/read-only';
import ShowLength from './component/show-length';
import Vertical from './component/vertical';

import './index.scss';

export default () => {
Expand All @@ -23,5 +21,5 @@ export default () => {
<ShowLength />
<Vertical />
</>
)
}
);
};
14 changes: 7 additions & 7 deletions packages/mini-demo/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ let orderObj = fsExtra.readJsonSync('./order.json');

function computeName(blockName) {
const className = blockName.split('-');
return className
.map((c) => `${c.charAt(0).toUpperCase()}${c.slice(1)}`)
.join('');
return className.map((c) => `${c.charAt(0).toUpperCase()}${c.slice(1)}`).join('');
}

chokidar.watch('../../packages/zarm/src/**/demo/*.mini.tsx').on('change', async (pathDir) => {
Expand All @@ -25,18 +23,17 @@ chokidar.watch('../../packages/zarm/src/**/demo/*.mini.tsx').on('change', async
[componentName]: {
...(orderObj?.[componentName] || {}),
[capitalizedName]: match?.[1] ?? 0,
}
},
};
} else {
orderObj = {
...orderObj,
[componentName]: {
[capitalizedName]: match?.[1] ?? 0,
}
},
};
}

console.log(orderObj);
const space = ' '.repeat(6);

try {
Expand All @@ -57,7 +54,10 @@ chokidar.watch('../../packages/zarm/src/**/demo/*.mini.tsx').on('change', async
.map((c) => `${c.charAt(0).toUpperCase()}${c.slice(1)}`)
.join('');
imports.push(`import ${capitalized} from './component/${blockName}'`);
components.push({ order: orderObj?.[componentName]?.[capitalized] ?? 0, component: `<${capitalized} />` });
components.push({
order: orderObj?.[componentName]?.[capitalized] ?? 0,
component: `<${capitalized} />`,
});
});
components.sort((c1, c2) => c1.order - c2.order);

Expand Down

0 comments on commit 3aeefea

Please sign in to comment.