Skip to content

Commit

Permalink
chore: daily development
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangtao25 committed Dec 23, 2024
1 parent f4495d0 commit 29d5b68
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-babel-plugin-canyon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
2 changes: 1 addition & 1 deletion plugins/babel-plugin-canyon/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
17 changes: 14 additions & 3 deletions plugins/babel-plugin-canyon/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
// ==========以上是属性=============
// 代理配置
Expand All @@ -36,8 +47,8 @@ export default declare((api, config, dirname) => {
}
:{}
config = {
...yushe,
...config,
...preset,
...trim(config),
}

const envs = process.env
Expand Down

0 comments on commit 29d5b68

Please sign in to comment.