From 63bdd2a89c917ef457430ef71840868cf9ed338c Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 16:56:24 +0800 Subject: [PATCH 01/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01376cff..ecd61207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,5 +31,6 @@ jobs: run: | mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key + echo "$WX_PRIVATE_KEY" | xxd chmod +x ./build/ci.js node ./build/ci.js --skip-key-write From 347af8efdea68a46faf8ec3ee1585b3ae9e0ec8a Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 16:59:49 +0800 Subject: [PATCH 02/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecd61207..b88b1afd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,11 @@ name: WeChat MiniProgram Demo CI/CD on: - pull_request: - types: [closed] + push: branches: - master jobs: upload: - if: github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From c65fd01e5f4d8b95fccbfd40fd96418123912129 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:05:02 +0800 Subject: [PATCH 03/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b88b1afd..6be401f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,11 @@ name: WeChat MiniProgram Demo CI/CD - on: push: branches: - master + pull_request: + branches: + - master jobs: upload: runs-on: ubuntu-latest From cc98a43c305c257bec598b3ac0611e6ba7740fd1 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:08:26 +0800 Subject: [PATCH 04/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6be401f6..8bd92e0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,5 +32,3 @@ jobs: mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key echo "$WX_PRIVATE_KEY" | xxd - chmod +x ./build/ci.js - node ./build/ci.js --skip-key-write From 21221b06a63ee481e4830025d26c60cd7f3c5138 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:11:37 +0800 Subject: [PATCH 05/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bd92e0f..b2136f98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,4 +31,7 @@ jobs: run: | mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key - echo "$WX_PRIVATE_KEY" | xxd + echo "$WX_PRIVATE_KEY" | head -c 16 | xxd + echo "$WX_PRIVATE_KEY" | wc -c + cat ./build/key + From 4dc42462814fe58a1b527c89f132a83df284f060 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:35:30 +0800 Subject: [PATCH 06/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2136f98..0cc624ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,9 +29,12 @@ jobs: env: WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }} run: | + # 验证密钥是否为空 + if [ -z "$WX_PRIVATE_KEY" ]; then + echo "❌ 错误: WX_PRIVATE_KEY 为空,请检查 GitHub Secrets 设置" + exit 1 + fi mkdir -p ./build echo "$WX_PRIVATE_KEY" > ./build/key - echo "$WX_PRIVATE_KEY" | head -c 16 | xxd - echo "$WX_PRIVATE_KEY" | wc -c - cat ./build/key + echo "$WX_PRIVATE_KEY" | xxd From 6146f61c5f92686de83469bc6f0b4d86499d6803 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:43:18 +0800 Subject: [PATCH 07/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0cc624ff..ca65bdd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: pull_request: branches: - master + +permissions: + contents: read + secrets: read jobs: upload: runs-on: ubuntu-latest From 53798f9779d91672afd5bd784cadcff7b9a42d2c Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:43:54 +0800 Subject: [PATCH 08/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca65bdd2..17a0530c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,6 @@ on: permissions: contents: read - secrets: read jobs: upload: runs-on: ubuntu-latest From 12f5554b8e667f3ee21093d188c518e6a0faf7f4 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:46:24 +0800 Subject: [PATCH 09/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17a0530c..8afdfc94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,8 @@ on: permissions: contents: read + secrets: read + jobs: upload: runs-on: ubuntu-latest From 86af349999ccb6398f5205bc90745d9ca78d3de4 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Wed, 14 May 2025 17:47:49 +0800 Subject: [PATCH 10/16] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8afdfc94..e0c4f506 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,8 @@ on: permissions: contents: read - secrets: read - + actions: read + jobs: upload: runs-on: ubuntu-latest From 2923ce6764e11c895831229446edaf889d126bec Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 27 May 2025 14:38:11 +0800 Subject: [PATCH 11/16] feat: pr lint --- .github/workflows/pr-lint-check.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pr-lint-check.yml diff --git a/.github/workflows/pr-lint-check.yml b/.github/workflows/pr-lint-check.yml new file mode 100644 index 00000000..dbc2832c --- /dev/null +++ b/.github/workflows/pr-lint-check.yml @@ -0,0 +1,19 @@ +name: PR Lint Check + +on: + pull_request: + branches: feat-wzy-cs + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + - name: Install dependencies + run: npm install + - name: Run lint + run: npm run lint From d02d1f471cfb7b15ac32c5ea0750278c51b7655a Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 27 May 2025 14:44:11 +0800 Subject: [PATCH 12/16] feat: pr lint --- .github/workflows/pr-lint-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-lint-check.yml b/.github/workflows/pr-lint-check.yml index dbc2832c..10c6270c 100644 --- a/.github/workflows/pr-lint-check.yml +++ b/.github/workflows/pr-lint-check.yml @@ -2,7 +2,7 @@ name: PR Lint Check on: pull_request: - branches: feat-wzy-cs + branches: [master] jobs: lint: From 162e27b448bb2b60abf8e488b0cae497b9b0e705 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 27 May 2025 14:51:05 +0800 Subject: [PATCH 13/16] feat: pr lint --- .eslintrc.js => .eslintrc.mjs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .eslintrc.js => .eslintrc.mjs (100%) diff --git a/.eslintrc.js b/.eslintrc.mjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.mjs From aae32011012b6499600418fb21a3be387109467f Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 27 May 2025 17:02:02 +0800 Subject: [PATCH 14/16] =?UTF-8?q?feat:=20eslint=E8=A7=84=E5=88=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.mjs | 99 --------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 .eslintrc.mjs diff --git a/.eslintrc.mjs b/.eslintrc.mjs deleted file mode 100644 index 9c06dd31..00000000 --- a/.eslintrc.mjs +++ /dev/null @@ -1,99 +0,0 @@ -module.exports = { - extends: [ - 'airbnb-base', - 'plugin:promise/recommended' - ], - parserOptions: { - ecmaVersion: 9, - ecmaFeatures: { - jsx: false - }, - sourceType: 'module' - }, - env: { - es6: true, - node: true, - jest: true - }, - plugins: [ - 'import', - 'node', - 'promise' - ], - rules: { - 'arrow-parens': 'off', - 'comma-dangle': [ - 'error', - 'only-multiline' - ], - complexity: ['error', 10], - 'func-names': 'off', - 'global-require': 'off', - 'handle-callback-err': [ - 'error', - '^(err|error)$' - ], - 'import/no-unresolved': [ - 'error', - { - caseSensitive: true, - commonjs: true, - ignore: ['^[^.]'] - } - ], - 'import/prefer-default-export': 'off', - 'linebreak-style': 'off', - 'no-catch-shadow': 'error', - 'no-continue': 'off', - 'no-div-regex': 'warn', - 'no-else-return': 'off', - 'no-param-reassign': 'off', - 'no-plusplus': 'off', - 'no-shadow': 'off', - // enable console for this project - 'no-console': 'off', - 'no-multi-assign': 'off', - 'no-underscore-dangle': 'off', - 'node/no-deprecated-api': 'error', - 'node/process-exit-as-throw': 'error', - 'object-curly-spacing': [ - 'error', - 'always' - ], - 'operator-linebreak': [ - 'error', - 'after', - { - overrides: { - ':': 'before', - '?': 'before' - } - } - ], - 'prefer-arrow-callback': 'off', - 'prefer-destructuring': 'off', - 'prefer-template': 'off', - 'quote-props': [ - 1, - 'as-needed', - { - unnecessary: true - } - ], - semi: [ - 'error', - 'never' - ] - }, - globals: { - window: true, - document: true, - App: true, - Page: true, - Component: true, - Behavior: true, - wx: true, - worker: true, - getApp: true - } -} From cc34eeb157ffef32b79a2a783e55a6f266bcfba1 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 27 May 2025 17:02:16 +0800 Subject: [PATCH 15/16] =?UTF-8?q?feat:=20eslint=E8=A7=84=E5=88=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..23312612 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,103 @@ +module.exports = { + extends: [ + 'airbnb-base', + 'plugin:promise/recommended' + ], + parserOptions: { + ecmaVersion: 9, + ecmaFeatures: { + jsx: false + }, + sourceType: 'module' + }, + env: { + es6: true, + node: true, + jest: true + }, + plugins: [ + 'import', + 'node', + 'promise' + ], + rules: { + 'arrow-parens': 'off', + 'eqeqeq': 'off', + 'no-bitwise': 'off', + 'comma-dangle': [ + 'error', + 'only-multiline' + ], + complexity: ['error', 10], + 'func-names': 'off', + 'global-require': 'off', + 'handle-callback-err': [ + 'error', + '^(err|error)$' + ], + 'import/no-unresolved': [ + 'error', + { + caseSensitive: true, + commonjs: true, + ignore: ['^[^.]'] + } + ], + 'max-len': 'off', + 'no-unused-vars': 'off', + 'import/prefer-default-export': 'off', + 'linebreak-style': 'off', + 'no-catch-shadow': 'error', + 'no-continue': 'off', + 'no-div-regex': 'warn', + 'no-else-return': 'off', + 'no-param-reassign': 'off', + 'no-plusplus': 'off', + 'no-shadow': 'off', + // enable console for this project + 'no-console': 'off', + 'no-multi-assign': 'off', + 'no-underscore-dangle': 'off', + 'node/no-deprecated-api': 'error', + 'node/process-exit-as-throw': 'error', + 'object-curly-spacing': [ + 'error', + 'always' + ], + 'operator-linebreak': [ + 'error', + 'after', + { + overrides: { + ':': 'before', + '?': 'before' + } + } + ], + 'prefer-arrow-callback': 'off', + 'prefer-destructuring': 'off', + 'prefer-template': 'off', + 'quote-props': [ + 1, + 'as-needed', + { + unnecessary: true + } + ], + semi: [ + 'error', + 'never' + ] + }, + globals: { + window: true, + document: true, + App: true, + Page: true, + Component: true, + Behavior: true, + wx: true, + worker: true, + getApp: true + } +} \ No newline at end of file From 73ac4beda3db83b34f208fdc616a7dae767246c3 Mon Sep 17 00:00:00 2001 From: v_guanglwen Date: Tue, 27 May 2025 17:05:16 +0800 Subject: [PATCH 16/16] =?UTF-8?q?feat:=20=E5=8E=BB=E6=8E=89ESModule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 5268c025..3330ab8e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "miniprogram-demo", "version": "1.0.0", "description": "WeChat miniprogram demo", - "type": "module", "scripts": { "init": "npm run sync && cd cloudfunctions/ && npm i --production && cd ../miniprogram/ && npm i --production", "lint": "eslint .",