Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多了个符号miniprogram-ci打包报错 #163

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7c26c79
feat: swiper change skyline
Mar 13, 2025
6664ec3
fix: components change skyline
Mar 13, 2025
fef90e8
fix: appjson add pages
Mar 13, 2025
c12a241
fix: Update code format and appid
Mar 17, 2025
b0a83ec
fix: Delete cover-image
Mar 17, 2025
4cf213b
fix: update code format
Mar 18, 2025
27e1c81
fix: delete useless function
Mar 18, 2025
4df1e0f
fix: delete unnecessary symbols
Mar 20, 2025
d6c8d7b
fix: navigation-bar style
Mar 20, 2025
bf9aa61
feat: github action + miniprogram-ci
Mar 20, 2025
f883065
fix: code format
Apr 2, 2025
ef789d6
fix: code format
Apr 2, 2025
5bd4e44
fix: code format
Apr 2, 2025
b111d52
fix: code format
Apr 2, 2025
f12f490
fix: code format
Apr 2, 2025
fdae3e2
fix: code format
Apr 2, 2025
3934c37
fix: code format
Apr 2, 2025
f117c6d
fix: code format
Apr 2, 2025
365ee16
fix: code format
Apr 2, 2025
5d32f22
fix: code format
Apr 2, 2025
2d4d540
fix: code format
Apr 2, 2025
9d69bf9
fix: code format
Apr 2, 2025
eb157b2
fix: code format
Apr 2, 2025
6b87e8f
fix: code format
Apr 2, 2025
906561d
fix: code format
Apr 2, 2025
dd619cb
fix: code format
Apr 2, 2025
0cb1c4e
fix: code format
Apr 2, 2025
fb142d6
fix: code format
Apr 2, 2025
eeb8fae
fix: code format
Apr 2, 2025
4c22ca9
fix: code format
Apr 2, 2025
51dbbce
fix: code format
Apr 2, 2025
e668202
fix: code format
Apr 2, 2025
d4fa81e
fix: code format
Apr 2, 2025
a0c6f3f
fix: code format
Apr 2, 2025
90a39c3
fix: code format
Apr 2, 2025
ddfe8a5
fix: code format
Apr 2, 2025
9be7f44
fix: code format
Apr 2, 2025
3e8bdf0
fix: code format
Apr 2, 2025
d7625dc
fix: code format
Apr 2, 2025
c32d933
fix: code format
Apr 2, 2025
4f8ae27
fix: code format
Apr 2, 2025
58232a2
fix: code format
Apr 2, 2025
045b15e
fix: code format(1)
Apr 2, 2025
8e63fef
fix: code format(2)
Apr 2, 2025
b142b30
fix: code format(3)
Apr 2, 2025
dde6b55
fix: code format(4)
Apr 2, 2025
2de3d14
fix: code format(5)
Apr 2, 2025
7e29145
fix: code format(6)
Apr 2, 2025
76259cc
fix: update package
Apr 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 29 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
module.exports = {
'extends': [
extends: [
'airbnb-base',
'plugin:promise/recommended'
],
'parserOptions': {
'ecmaVersion': 9,
'ecmaFeatures': {
'jsx': false
parserOptions: {
ecmaVersion: 9,
ecmaFeatures: {
jsx: false
},
'sourceType': 'module'
sourceType: 'module'
},
'env': {
'es6': true,
'node': true,
'jest': true
env: {
es6: true,
node: true,
jest: true
},
'plugins': [
plugins: [
'import',
'node',
'promise'
],
'rules': {
rules: {
'arrow-parens': 'off',
'comma-dangle': [
'error',
'only-multiline'
],
'complexity': ['error', 10],
complexity: ['error', 10],
'func-names': 'off',
'global-require': 'off',
'handle-callback-err': [
Expand All @@ -36,9 +36,9 @@ module.exports = {
'import/no-unresolved': [
'error',
{
'caseSensitive': true,
'commonjs': true,
'ignore': ['^[^.]']
caseSensitive: true,
commonjs: true,
ignore: ['^[^.]']
}
],
'import/prefer-default-export': 'off',
Expand All @@ -64,7 +64,7 @@ module.exports = {
'error',
'after',
{
'overrides': {
overrides: {
':': 'before',
'?': 'before'
}
Expand All @@ -77,23 +77,23 @@ module.exports = {
1,
'as-needed',
{
'unnecessary': true
unnecessary: true
}
],
'semi': [
semi: [
'error',
'never'
]
},
'globals': {
'window': true,
'document': true,
'App': true,
'Page': true,
'Component': true,
'Behavior': true,
'wx': true,
'worker': true,
'getApp': true
globals: {
window: true,
document: true,
App: true,
Page: true,
Component: true,
Behavior: true,
wx: true,
worker: true,
getApp: true
}
}
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: WeChat MiniProgram Demo CI/CD

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Upload MiniProgram
env:
WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }}
run: |
echo "$WX_PRIVATE_KEY" > ./build/key
node ./build/ci.js
47 changes: 47 additions & 0 deletions build/ci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const path = require('path')
const ci = require('miniprogram-ci')
const fs = require('fs')
const packageJson = require('../package.json')

const privateKeyContent = process.env.WX_PRIVATE_KEY
if (!privateKeyContent) {
throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets')
}

const privateKeyPath = path.resolve(__dirname, './private.key')
fs.writeFileSync(privateKeyPath, privateKeyContent)

const project = new ci.Project({
appid: 'wx622bee4f78fa4f5a',
type: 'miniProgram',
projectPath: path.resolve(__dirname, '../'),
privateKeyPath: path.resolve(__dirname, './key'),
ignores: [path.resolve(__dirname, '../miniprogram/node_modules/**/*')]
})
const robotNumber = 2
const params = {
onProgressUpdate: console.log,
robot: robotNumber,
version: packageJson.version,
desc: packageJson.bundleDescription,
setting: {
es7: true,
minifyJS: true,
minifyWXML: true,
minifyWXSS: true,
codeProtect: false,
autoPrefixWXSS: true
},
}
ci.upload({
project,
...params
}).then(res => {
console.debug('>>>>upload res', res)
}).catch(err => {
console.error('>>>>upload error', err)
throw err
}).finally(() => {
// 删除临时私钥文件
fs.unlinkSync(privateKeyPath)
})
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

function generate(options) {
if (!options) {
throw new Error('options must be provided')
}

const { serviceName, funcName, data } = options
const {serviceName, funcName, data} = options

const serviceConfig = config.find(c => c.serviceName === serviceName)
const serviceConfig = config.find(c => c.serviceName === serviceName)
if (!serviceConfig) {
throw new Error('service not found')
}
Expand Down Expand Up @@ -38,7 +37,7 @@ function generate(options) {
if (!reqProtoJSON.fields[key]) {
throw new Error(`'${key}' doesn't exist in '${reqProtoName}' proto, valid keys are ${Object.keys(reqProtoJSON.fields)}`)
}
}
}
} else {
throw new Error('data must be object')
}
Expand All @@ -64,7 +63,7 @@ function generateV2(options) {
throw new Error('options must be provided')
}

const { apiName, data } = options
const {apiName, data} = options

const apiConfig = config.find(c => c.apiName === apiName)

Expand All @@ -91,7 +90,7 @@ function generateV2(options) {
if (!reqProtoJSON.fields[key]) {
throw new Error(`'${key}' doesn't exist in '${reqProtoName}' proto, valid keys are ${Object.keys(reqProtoJSON.fields)}`)
}
}
}
} else {
throw new Error('data must be object')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path')
const yargs = require('yargs')
const chalk = require('chalk')
const debug = require('debug')('cli')
const pbjs = require("protobufjs/cli/pbjs")
const pbjs = require('protobufjs/cli/pbjs')

const log = (...msg) => {
console.log(chalk.blue('svrkit-utils'), ...msg)
Expand Down Expand Up @@ -50,7 +50,7 @@ function main() {
throw err
}

let staticModuleContent = fs.readFileSync(staticModuleFilePath, 'utf8')
const staticModuleContent = fs.readFileSync(staticModuleFilePath, 'utf8')
fs.writeFileSync(staticModuleFilePath, `// #lizard forgives
${staticModuleContent}`, 'utf8')

Expand Down Expand Up @@ -95,4 +95,3 @@ ${protoUtils}
module.exports = {
main,
}

Loading