Compare commits
2 Commits
59fd7a6411
...
ba3b2190ab
| Author | SHA1 | Date | |
|---|---|---|---|
| ba3b2190ab | |||
| b1f54cf813 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kevisual/cli",
|
"name": "@kevisual/cli",
|
||||||
"version": "0.0.66",
|
"version": "0.0.67",
|
||||||
"description": "envision 命令行工具",
|
"description": "envision 命令行工具",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"basename": "/root/cli",
|
"basename": "/root/cli",
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
"inquirer": "^13.0.1",
|
"inquirer": "^13.0.1",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"tar": "^7.5.2",
|
"tar": "^7.5.2",
|
||||||
"zustand": "^5.0.8"
|
"zustand": "^5.0.9"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22.0.0"
|
"node": ">=22.0.0"
|
||||||
|
|||||||
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -85,8 +85,8 @@ importers:
|
|||||||
specifier: ^7.5.2
|
specifier: ^7.5.2
|
||||||
version: 7.5.2
|
version: 7.5.2
|
||||||
zustand:
|
zustand:
|
||||||
specifier: ^5.0.8
|
specifier: ^5.0.9
|
||||||
version: 5.0.8(@types/react@19.1.9)
|
version: 5.0.9(@types/react@19.1.9)
|
||||||
|
|
||||||
assistant:
|
assistant:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -1673,8 +1673,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==}
|
resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
zustand@5.0.8:
|
zustand@5.0.9:
|
||||||
resolution: {integrity: sha512-gyPKpIaxY9XcO2vSMrLbiER7QMAMGOQZVRdJ6Zi782jkbzZygq5GI9nG8g+sMgitRtndwaBSl7uiqC49o1SSiw==}
|
resolution: {integrity: sha512-ALBtUj0AfjJt3uNRQoL1tL2tMvj6Gp/6e39dnfT6uzpelGru8v1tPOGBzayOWbPJvujM8JojDk3E1LxeFisBNg==}
|
||||||
engines: {node: '>=12.20.0'}
|
engines: {node: '>=12.20.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@types/react': '>=18.0.0'
|
'@types/react': '>=18.0.0'
|
||||||
@@ -3108,6 +3108,6 @@ snapshots:
|
|||||||
|
|
||||||
yallist@5.0.0: {}
|
yallist@5.0.0: {}
|
||||||
|
|
||||||
zustand@5.0.8(@types/react@19.1.9):
|
zustand@5.0.9(@types/react@19.1.9):
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/react': 19.1.9
|
'@types/react': 19.1.9
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const getPackageJson = (opts?: { version?: string; appKey?: string }) =>
|
|||||||
const packageJson = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
const packageJson = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
||||||
const basename = packageJson.basename || '';
|
const basename = packageJson.basename || '';
|
||||||
const version = packageJson.version || '';
|
const version = packageJson.version || '';
|
||||||
const app = packageJson.app as { key: string };
|
const app = packageJson.app;
|
||||||
const userAppArry = basename.split('/');
|
const userAppArry = basename.split('/');
|
||||||
if (userAppArry.length <= 2 && !opts?.appKey) {
|
if (userAppArry.length <= 2 && !opts?.appKey) {
|
||||||
console.error(chalk.red('basename is error, 请输入正确的路径, packages.json中basename例如 /root/appKey'));
|
console.error(chalk.red('basename is error, 请输入正确的路径, packages.json中basename例如 /root/appKey'));
|
||||||
@@ -154,13 +154,7 @@ const command = new Command('deploy')
|
|||||||
logger.debug('deploy success', res2.data);
|
logger.debug('deploy success', res2.data);
|
||||||
if (id && showBackend) {
|
if (id && showBackend) {
|
||||||
console.log('\n');
|
console.log('\n');
|
||||||
// 获取当前应用的key
|
console.log(chalk.blue('服务端应用部署: '), 'envision pack-deploy', id);
|
||||||
const pkKey = pkgInfo?.app?.key || pkgInfo?.appKey;
|
|
||||||
console.log(chalk.blue('服务端应用部署: '), 'envision pack-deploy', id, '-k <key>');
|
|
||||||
if (pkKey) {
|
|
||||||
console.log('\n');
|
|
||||||
console.log(chalk.blue('命令推荐: '), 'envision pack-deploy', id, `-k ${pkKey} -f`);
|
|
||||||
}
|
|
||||||
console.log('\n');
|
console.log('\n');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -186,7 +180,7 @@ const uploadFiles = async (files: string[], directory: string, opts: UploadFileO
|
|||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const filePath = path.join(directory, file);
|
const filePath = path.join(directory, file);
|
||||||
const hash = getHash(filePath);
|
const hash = getHash(filePath);
|
||||||
if(!hash){
|
if (!hash) {
|
||||||
console.error('文件', filePath, '不存在');
|
console.error('文件', filePath, '不存在');
|
||||||
console.error('请检查文件是否存在');
|
console.error('请检查文件是否存在');
|
||||||
}
|
}
|
||||||
@@ -274,7 +268,7 @@ const deployLoadFn = async (id: string, org?: string) => {
|
|||||||
const baseURL = getBaseURL();
|
const baseURL = getBaseURL();
|
||||||
const deployURL = new URL(`/${user}/${key}/`, baseURL);
|
const deployURL = new URL(`/${user}/${key}/`, baseURL);
|
||||||
console.log(chalk.blue('deployURL', deployURL.href));
|
console.log(chalk.blue('deployURL', deployURL.href));
|
||||||
} catch (error) {}
|
} catch (error) { }
|
||||||
} else {
|
} else {
|
||||||
console.error('deploy-load failed', res.message);
|
console.error('deploy-load failed', res.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,17 +316,6 @@ const packDeployCommand = new Command('pack-deploy')
|
|||||||
.option('-i, --install ', 'install dependencies')
|
.option('-i, --install ', 'install dependencies')
|
||||||
.action(async (id, opts) => {
|
.action(async (id, opts) => {
|
||||||
let { force, key, install } = opts || {};
|
let { force, key, install } = opts || {};
|
||||||
if (!key) {
|
|
||||||
const answers = await inquirer.prompt([
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
name: 'key',
|
|
||||||
message: 'Enter your deploy to services fileKey:',
|
|
||||||
when: () => !key, // 当 username 为空时,提示用户输入
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
key = answers.key || key;
|
|
||||||
}
|
|
||||||
const res = await deployLoadFn(id, key, force, install);
|
const res = await deployLoadFn(id, key, force, install);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user