const ci = require('miniprogram-ci') const path = require('path') const projectPath = path.resolve(__dirname, '../dist/build/mp-weixin') const privateKeyPath = path.resolve('/root/opencode-workspace/微信小程序参数/宇之然AI磁场appid/private.wxf466b3c3bc411ffc.key') const appid = 'wxf466b3c3bc411ffc' async function main() { const project = new ci.Project({ appid, type: 'miniProgram', projectPath, privateKeyPath, ignores: ['node_modules/**/*'], }) console.log(`Uploading from: ${projectPath}`) console.log(`AppID: ${appid}`) // Dry-run mode for testing — set raw false to actually upload // For testing, we do a preview first try { const previewResult = await ci.preview({ project, desc: '预览测试', setting: { es6: true, minify: false, }, }) console.log('Preview success!') console.log('Preview result:', JSON.stringify(previewResult, null, 2)) } catch (err) { console.error('Preview failed:', err.message) process.exit(1) } } main()