feat: 1.统一右侧抽屉关闭按钮布局 2.统一 UI 组件为 Ant Design 移除 radix-ui、floating-ui 组件 3. 修复 ESLint 文件格式错误的问题
This commit is contained in:
@@ -12,7 +12,8 @@ const path = require('path');
|
||||
const SRC_DIR = path.join(__dirname, '..', 'src');
|
||||
const LOCALES_DIR = path.join(__dirname, '..', 'src', 'i18n', 'locales');
|
||||
const load = (n) =>
|
||||
JSON.parse(fs.readFileSync(path.join(LOCALES_DIR, `${n}.json`), 'utf8')).translation;
|
||||
JSON.parse(fs.readFileSync(path.join(LOCALES_DIR, `${n}.json`), 'utf8'))
|
||||
.translation;
|
||||
const LANGS = require('./i18n_langs.cjs');
|
||||
const DICTS = LANGS.map((l) => [l, load(l)]);
|
||||
|
||||
@@ -25,7 +26,11 @@ function walk(dir, files = []) {
|
||||
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||
const full = path.join(dir, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
if (['node_modules', 'dist'].includes(entry.name) || entry.name.startsWith('.')) continue;
|
||||
if (
|
||||
['node_modules', 'dist'].includes(entry.name) ||
|
||||
entry.name.startsWith('.')
|
||||
)
|
||||
continue;
|
||||
walk(full, files);
|
||||
} else if (/\.(jsx?|tsx?)$/.test(entry.name)) files.push(full);
|
||||
}
|
||||
@@ -43,7 +48,9 @@ const COL_RE2 =
|
||||
const CJK = /[一-鿿]/;
|
||||
const rows = [];
|
||||
|
||||
for (const file of walk(SRC_DIR).filter((f) => !f.includes(path.join('src', 'i18n')))) {
|
||||
for (const file of walk(SRC_DIR).filter(
|
||||
(f) => !f.includes(path.join('src', 'i18n')),
|
||||
)) {
|
||||
const c = fs.readFileSync(file, 'utf8');
|
||||
const rel = path.relative(SRC_DIR, file);
|
||||
const push = (key, width) => {
|
||||
@@ -83,7 +90,9 @@ const uniq = rows.filter((r) => {
|
||||
return true;
|
||||
});
|
||||
|
||||
const perLang = LANGS.map((l) => `${l} ${uniq.filter((r) => r.lng === l).length}`).join(' / ');
|
||||
const perLang = LANGS.map(
|
||||
(l) => `${l} ${uniq.filter((r) => r.lng === l).length}`,
|
||||
).join(' / ');
|
||||
console.log(`固定列宽装不下译文的位置:${uniq.length} 处(${perLang})\n`);
|
||||
const LIMIT = Number(process.argv[2]) || 30; // 可传参查看全部
|
||||
for (const r of uniq.slice(0, LIMIT)) {
|
||||
|
||||
Reference in New Issue
Block a user