This commit is contained in:
2026-01-17 01:13:55 +08:00
parent 327f115ef2
commit cc043bfd7e
17 changed files with 768 additions and 790 deletions

View File

@@ -14,7 +14,7 @@ const parseIfJson = (str: string) => {
return {};
}
};
const command = new Command('npm').description('npm command show publish and set .npmrc').action(async (options) => {});
const command = new Command('npm').description('npm command show publish and set .npmrc').action(async (options) => { });
const publish = new Command('publish')
.argument('[registry]')
.option('-p --proxy', 'proxy')
@@ -33,6 +33,10 @@ const publish = new Command('publish')
name: 'npm',
value: 'npm',
},
{
name: 'cnb',
value: 'cnb'
}
],
});
}
@@ -60,6 +64,9 @@ const publish = new Command('publish')
case 'npm':
cmd = 'npm publish --registry https://registry.npmjs.org';
break;
case 'cnb':
cmd = 'npm publish --registry https://npm.cnb.cool/kevisual/registry/-/packages/';
break;
default:
cmd = 'npm publish --registry https://npm.xiongxiao.me';
break;
@@ -136,6 +143,7 @@ const npmrc = new Command('set')
const npmrcContent =
config?.npmrc ||
`//npm.xiongxiao.me/:_authToken=\${ME_NPM_TOKEN}
//npm.cnb.cool/kevisual/registry/-/packages/:_authToken=\${CNB_API_KEY}
//registry.npmjs.org/:_authToken=\${NPM_TOKEN}
`;
const execPath = process.cwd();

View File

@@ -8,7 +8,7 @@ import { logger, printClickableLink } from '@/module/logger.ts';
import { chalk } from '@/module/chalk.ts';
import path from 'node:path';
import { fileIsExist } from '@/uitls/file.ts';
import { confirm } from '@inquirer/prompts'
const command = new Command('sync')
.option('-d --dir <dir>')
.description('同步项目')
@@ -33,7 +33,19 @@ const syncUpload = new Command('upload')
};
const filepath = sync.getRelativePath(opts.file);
const newInfos = [];
const uploadLength = syncList.length;
logger.info(`开始上传文件,总计 ${uploadLength} 个文件`);
if (uploadLength > 100) {
// 提示用户确认
const shouldContinue = await confirm({
message: `即将上传 ${uploadLength} 个文件,是否继续?`,
default: false,
});
if (!shouldContinue) {
logger.info('已取消上传');
return;
}
}
for (const item of syncList) {
if (!item.auth || !item.exist) {
nodonwArr.push(item);