From 29d5b68e6ad11e3ab23049fd001fccf583d4ceea Mon Sep 17 00:00:00 2001 From: zhangtao25 Date: Mon, 23 Dec 2024 10:46:58 +0800 Subject: [PATCH] chore: daily development --- .../workflows/publish-babel-plugin-canyon.yml | 2 +- plugins/babel-plugin-canyon/package.json | 2 +- plugins/babel-plugin-canyon/src/index.ts | 17 ++++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-babel-plugin-canyon.yml b/.github/workflows/publish-babel-plugin-canyon.yml index 83dec851..67f53c84 100644 --- a/.github/workflows/publish-babel-plugin-canyon.yml +++ b/.github/workflows/publish-babel-plugin-canyon.yml @@ -21,6 +21,6 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} - run: | - pnpm dist-tag add babel-plugin-canyon@2.0.1 latest + pnpm dist-tag add babel-plugin-canyon@2.0.2 latest env: NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} diff --git a/plugins/babel-plugin-canyon/package.json b/plugins/babel-plugin-canyon/package.json index e86a1954..7aab6bd7 100644 --- a/plugins/babel-plugin-canyon/package.json +++ b/plugins/babel-plugin-canyon/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-canyon", - "version": "2.0.1", + "version": "2.0.2", "description": "", "scripts": { "release": "babel src --extensions \".ts\" --out-dir lib", diff --git a/plugins/babel-plugin-canyon/src/index.ts b/plugins/babel-plugin-canyon/src/index.ts index 1aa66164..926c00d4 100644 --- a/plugins/babel-plugin-canyon/src/index.ts +++ b/plugins/babel-plugin-canyon/src/index.ts @@ -14,13 +14,24 @@ function newAtob() { } const newatob = newAtob() +function trim(obj) { + return Object.keys(obj).reduce((acc, key) => { + if (typeof obj[key] === "string"){ + acc[key] = obj[key].trim(); + } else { + acc[key] = obj[key]; + } + return acc; + }, {}); +} + export default declare((api, config, dirname) => { api.assertVersion(7); return { visitor: { Program: { exit: (path) => { - const yushe = (process.env.CI_SERVER_URL || '').includes(newatob('Y3RyaXA=')) ? { + const preset = (process.env.CI_SERVER_URL || '').includes(newatob('Y3RyaXA=')) ? { provider: 'tripgl', // ==========以上是属性============= // 代理配置 @@ -36,8 +47,8 @@ export default declare((api, config, dirname) => { } :{} config = { - ...yushe, - ...config, + ...preset, + ...trim(config), } const envs = process.env