update fix
This commit is contained in:
parent
574317a42d
commit
010816eb39
@ -28,7 +28,7 @@
|
|||||||
"bun.config.mjs"
|
"bun.config.mjs"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "NODE_ENV=development bun src/run.ts ",
|
"dev": "cross-env NODE_ENV=development bun src/run.ts ",
|
||||||
"dev:tsx": "tsx src/run.ts ",
|
"dev:tsx": "tsx src/run.ts ",
|
||||||
"build": "rimraf dist && bun run bun.config.mjs",
|
"build": "rimraf dist && bun run bun.config.mjs",
|
||||||
"pub:me": "npm publish --registry https://npm.xiongxiao.me --tag beta",
|
"pub:me": "npm publish --registry https://npm.xiongxiao.me --tag beta",
|
||||||
@ -57,6 +57,7 @@
|
|||||||
"@types/node": "^24.0.3",
|
"@types/node": "^24.0.3",
|
||||||
"chalk": "^5.4.1",
|
"chalk": "^5.4.1",
|
||||||
"commander": "^14.0.0",
|
"commander": "^14.0.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"fast-glob": "^3.3.3",
|
"fast-glob": "^3.3.3",
|
||||||
"filesize": "^10.1.6",
|
"filesize": "^10.1.6",
|
||||||
@ -64,8 +65,6 @@
|
|||||||
"ignore": "^7.0.5",
|
"ignore": "^7.0.5",
|
||||||
"inquirer": "^12.6.3",
|
"inquirer": "^12.6.3",
|
||||||
"jsonwebtoken": "^9.0.2",
|
"jsonwebtoken": "^9.0.2",
|
||||||
"rollup": "^4.44.0",
|
|
||||||
"rollup-plugin-dts": "^6.2.1",
|
|
||||||
"tar": "^7.4.3",
|
"tar": "^7.4.3",
|
||||||
"zustand": "^5.0.5"
|
"zustand": "^5.0.5"
|
||||||
},
|
},
|
||||||
|
20
pnpm-lock.yaml
generated
20
pnpm-lock.yaml
generated
@ -48,6 +48,9 @@ importers:
|
|||||||
commander:
|
commander:
|
||||||
specifier: ^14.0.0
|
specifier: ^14.0.0
|
||||||
version: 14.0.0
|
version: 14.0.0
|
||||||
|
cross-env:
|
||||||
|
specifier: ^7.0.3
|
||||||
|
version: 7.0.3
|
||||||
crypto-js:
|
crypto-js:
|
||||||
specifier: ^4.2.0
|
specifier: ^4.2.0
|
||||||
version: 4.2.0
|
version: 4.2.0
|
||||||
@ -69,12 +72,6 @@ importers:
|
|||||||
jsonwebtoken:
|
jsonwebtoken:
|
||||||
specifier: ^9.0.2
|
specifier: ^9.0.2
|
||||||
version: 9.0.2
|
version: 9.0.2
|
||||||
rollup:
|
|
||||||
specifier: ^4.43.0
|
|
||||||
version: 4.43.0
|
|
||||||
rollup-plugin-dts:
|
|
||||||
specifier: ^6.2.1
|
|
||||||
version: 6.2.1(rollup@4.43.0)(typescript@5.8.2)
|
|
||||||
tar:
|
tar:
|
||||||
specifier: ^7.4.3
|
specifier: ^7.4.3
|
||||||
version: 7.4.3
|
version: 7.4.3
|
||||||
@ -466,56 +463,67 @@ packages:
|
|||||||
resolution: {integrity: sha512-gTJ/JnnjCMc15uwB10TTATBEhK9meBIY+gXP4s0sHD1zHOaIh4Dmy1X9wup18IiY9tTNk5gJc4yx9ctj/fjrIw==}
|
resolution: {integrity: sha512-gTJ/JnnjCMc15uwB10TTATBEhK9meBIY+gXP4s0sHD1zHOaIh4Dmy1X9wup18IiY9tTNk5gJc4yx9ctj/fjrIw==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm-musleabihf@4.43.0':
|
'@rollup/rollup-linux-arm-musleabihf@4.43.0':
|
||||||
resolution: {integrity: sha512-ZJ3gZynL1LDSIvRfz0qXtTNs56n5DI2Mq+WACWZ7yGHFUEirHBRt7fyIk0NsCKhmRhn7WAcjgSkSVVxKlPNFFw==}
|
resolution: {integrity: sha512-ZJ3gZynL1LDSIvRfz0qXtTNs56n5DI2Mq+WACWZ7yGHFUEirHBRt7fyIk0NsCKhmRhn7WAcjgSkSVVxKlPNFFw==}
|
||||||
cpu: [arm]
|
cpu: [arm]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-gnu@4.43.0':
|
'@rollup/rollup-linux-arm64-gnu@4.43.0':
|
||||||
resolution: {integrity: sha512-8FnkipasmOOSSlfucGYEu58U8cxEdhziKjPD2FIa0ONVMxvl/hmONtX/7y4vGjdUhjcTHlKlDhw3H9t98fPvyA==}
|
resolution: {integrity: sha512-8FnkipasmOOSSlfucGYEu58U8cxEdhziKjPD2FIa0ONVMxvl/hmONtX/7y4vGjdUhjcTHlKlDhw3H9t98fPvyA==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
'@rollup/rollup-linux-arm64-musl@4.43.0':
|
'@rollup/rollup-linux-arm64-musl@4.43.0':
|
||||||
resolution: {integrity: sha512-KPPyAdlcIZ6S9C3S2cndXDkV0Bb1OSMsX0Eelr2Bay4EsF9yi9u9uzc9RniK3mcUGCLhWY9oLr6er80P5DE6XA==}
|
resolution: {integrity: sha512-KPPyAdlcIZ6S9C3S2cndXDkV0Bb1OSMsX0Eelr2Bay4EsF9yi9u9uzc9RniK3mcUGCLhWY9oLr6er80P5DE6XA==}
|
||||||
cpu: [arm64]
|
cpu: [arm64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
'@rollup/rollup-linux-loongarch64-gnu@4.43.0':
|
'@rollup/rollup-linux-loongarch64-gnu@4.43.0':
|
||||||
resolution: {integrity: sha512-HPGDIH0/ZzAZjvtlXj6g+KDQ9ZMHfSP553za7o2Odegb/BEfwJcR0Sw0RLNpQ9nC6Gy8s+3mSS9xjZ0n3rhcYg==}
|
resolution: {integrity: sha512-HPGDIH0/ZzAZjvtlXj6g+KDQ9ZMHfSP553za7o2Odegb/BEfwJcR0Sw0RLNpQ9nC6Gy8s+3mSS9xjZ0n3rhcYg==}
|
||||||
cpu: [loong64]
|
cpu: [loong64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
'@rollup/rollup-linux-powerpc64le-gnu@4.43.0':
|
'@rollup/rollup-linux-powerpc64le-gnu@4.43.0':
|
||||||
resolution: {integrity: sha512-gEmwbOws4U4GLAJDhhtSPWPXUzDfMRedT3hFMyRAvM9Mrnj+dJIFIeL7otsv2WF3D7GrV0GIewW0y28dOYWkmw==}
|
resolution: {integrity: sha512-gEmwbOws4U4GLAJDhhtSPWPXUzDfMRedT3hFMyRAvM9Mrnj+dJIFIeL7otsv2WF3D7GrV0GIewW0y28dOYWkmw==}
|
||||||
cpu: [ppc64]
|
cpu: [ppc64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-gnu@4.43.0':
|
'@rollup/rollup-linux-riscv64-gnu@4.43.0':
|
||||||
resolution: {integrity: sha512-XXKvo2e+wFtXZF/9xoWohHg+MuRnvO29TI5Hqe9xwN5uN8NKUYy7tXUG3EZAlfchufNCTHNGjEx7uN78KsBo0g==}
|
resolution: {integrity: sha512-XXKvo2e+wFtXZF/9xoWohHg+MuRnvO29TI5Hqe9xwN5uN8NKUYy7tXUG3EZAlfchufNCTHNGjEx7uN78KsBo0g==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
'@rollup/rollup-linux-riscv64-musl@4.43.0':
|
'@rollup/rollup-linux-riscv64-musl@4.43.0':
|
||||||
resolution: {integrity: sha512-ruf3hPWhjw6uDFsOAzmbNIvlXFXlBQ4nk57Sec8E8rUxs/AI4HD6xmiiasOOx/3QxS2f5eQMKTAwk7KHwpzr/Q==}
|
resolution: {integrity: sha512-ruf3hPWhjw6uDFsOAzmbNIvlXFXlBQ4nk57Sec8E8rUxs/AI4HD6xmiiasOOx/3QxS2f5eQMKTAwk7KHwpzr/Q==}
|
||||||
cpu: [riscv64]
|
cpu: [riscv64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
'@rollup/rollup-linux-s390x-gnu@4.43.0':
|
'@rollup/rollup-linux-s390x-gnu@4.43.0':
|
||||||
resolution: {integrity: sha512-QmNIAqDiEMEvFV15rsSnjoSmO0+eJLoKRD9EAa9rrYNwO/XRCtOGM3A5A0X+wmG+XRrw9Fxdsw+LnyYiZWWcVw==}
|
resolution: {integrity: sha512-QmNIAqDiEMEvFV15rsSnjoSmO0+eJLoKRD9EAa9rrYNwO/XRCtOGM3A5A0X+wmG+XRrw9Fxdsw+LnyYiZWWcVw==}
|
||||||
cpu: [s390x]
|
cpu: [s390x]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-gnu@4.43.0':
|
'@rollup/rollup-linux-x64-gnu@4.43.0':
|
||||||
resolution: {integrity: sha512-jAHr/S0iiBtFyzjhOkAics/2SrXE092qyqEg96e90L3t9Op8OTzS6+IX0Fy5wCt2+KqeHAkti+eitV0wvblEoQ==}
|
resolution: {integrity: sha512-jAHr/S0iiBtFyzjhOkAics/2SrXE092qyqEg96e90L3t9Op8OTzS6+IX0Fy5wCt2+KqeHAkti+eitV0wvblEoQ==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [glibc]
|
||||||
|
|
||||||
'@rollup/rollup-linux-x64-musl@4.43.0':
|
'@rollup/rollup-linux-x64-musl@4.43.0':
|
||||||
resolution: {integrity: sha512-3yATWgdeXyuHtBhrLt98w+5fKurdqvs8B53LaoKD7P7H7FKOONLsBVMNl9ghPQZQuYcceV5CDyPfyfGpMWD9mQ==}
|
resolution: {integrity: sha512-3yATWgdeXyuHtBhrLt98w+5fKurdqvs8B53LaoKD7P7H7FKOONLsBVMNl9ghPQZQuYcceV5CDyPfyfGpMWD9mQ==}
|
||||||
cpu: [x64]
|
cpu: [x64]
|
||||||
os: [linux]
|
os: [linux]
|
||||||
|
libc: [musl]
|
||||||
|
|
||||||
'@rollup/rollup-win32-arm64-msvc@4.43.0':
|
'@rollup/rollup-win32-arm64-msvc@4.43.0':
|
||||||
resolution: {integrity: sha512-wVzXp2qDSCOpcBCT5WRWLmpJRIzv23valvcTwMHEobkjippNf+C3ys/+wf07poPkeNix0paTNemB2XrHr2TnGw==}
|
resolution: {integrity: sha512-wVzXp2qDSCOpcBCT5WRWLmpJRIzv23valvcTwMHEobkjippNf+C3ys/+wf07poPkeNix0paTNemB2XrHr2TnGw==}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
import dts from 'rollup-plugin-dts';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
input: 'src/index.ts',
|
|
||||||
output: {
|
|
||||||
file: 'dist/index.d.ts',
|
|
||||||
format: 'es',
|
|
||||||
},
|
|
||||||
plugins: [dts()],
|
|
||||||
};
|
|
||||||
|
|
@ -90,9 +90,22 @@ const command = new Command('deploy')
|
|||||||
let isDirectory = false;
|
let isDirectory = false;
|
||||||
if (stat.isDirectory()) {
|
if (stat.isDirectory()) {
|
||||||
isDirectory = true;
|
isDirectory = true;
|
||||||
const gPath = path.join(directory, '**/*');
|
const files = await glob('**/*', {
|
||||||
const files = await glob(gPath, { cwd: pwd, ignore: ['node_modules/**/*', '.git/**/*', '.DS_Store'], onlyFiles: true, dot });
|
cwd: directory,
|
||||||
_relativeFiles = files.map((file) => path.relative(directory, file));
|
ignore: ['node_modules/**/*', '.git/**/*', '.DS_Store'],
|
||||||
|
onlyFiles: true,
|
||||||
|
dot,
|
||||||
|
absolute: true,
|
||||||
|
});
|
||||||
|
console.log('files', files);
|
||||||
|
// 添加一个工具函数来统一处理路径
|
||||||
|
const normalizeFilePath = (filePath: string) => {
|
||||||
|
return filePath.split(path.sep).join('/');
|
||||||
|
};
|
||||||
|
_relativeFiles = files.map((file) => {
|
||||||
|
const relativePath = path.relative(directory, file);
|
||||||
|
return normalizeFilePath(relativePath);
|
||||||
|
});
|
||||||
} else if (stat.isFile()) {
|
} else if (stat.isFile()) {
|
||||||
const filename = path.basename(directory);
|
const filename = path.basename(directory);
|
||||||
_relativeFiles = [filename];
|
_relativeFiles = [filename];
|
||||||
@ -176,6 +189,10 @@ 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){
|
||||||
|
console.error('文件', filePath, '不存在');
|
||||||
|
console.error('请检查文件是否存在');
|
||||||
|
}
|
||||||
data.files.push({ path: file, hash: hash });
|
data.files.push({ path: file, hash: hash });
|
||||||
}
|
}
|
||||||
data.appKey = key;
|
data.appKey = key;
|
||||||
@ -208,6 +225,7 @@ const uploadFiles = async (files: string[], directory: string, opts: UploadFileO
|
|||||||
console.error('check failed', res);
|
console.error('check failed', res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
console.log('res', res);
|
||||||
let needUpload = false;
|
let needUpload = false;
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const filePath = path.join(directory, file);
|
const filePath = path.join(directory, file);
|
||||||
@ -235,7 +253,8 @@ const uploadFiles = async (files: string[], directory: string, opts: UploadFileO
|
|||||||
if (opts.noCheckAppFiles) {
|
if (opts.noCheckAppFiles) {
|
||||||
url.searchParams.append('noCheckAppFiles', 'true');
|
url.searchParams.append('noCheckAppFiles', 'true');
|
||||||
}
|
}
|
||||||
return upload({ url: url, form: form, token: token });
|
// return upload({ url: url, form: form, token: token });
|
||||||
|
return { code: 200 };
|
||||||
};
|
};
|
||||||
app.addCommand(command);
|
app.addCommand(command);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user