Skip to content

Commit 8b2504b

Browse files
committed
fix: EdgeKv Replacement bug.
1 parent 6c230e4 commit 8b2504b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esa-cli",
3-
"version": "1.0.4-beta.1",
3+
"version": "1.0.4-beta.3",
44
"description": "A CLI for operating Alibaba Cloud ESA Functions and Pages.",
55
"main": "bin/enter.cjs",
66
"type": "module",
@@ -19,6 +19,7 @@
1919
"dev": "tsc --watch",
2020
"eslint": "eslint src/ --ext .js,.jsx,.ts,.tsx",
2121
"prepare": "husky install",
22+
"prepublishOnly": "npm run build",
2223
"lint-staged": "lint-staged",
2324
"test": "vitest --coverage",
2425
"coverage": "vitest --coverage",

src/commands/dev/build.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ const renameMock = {
3838
}
3939
if (
4040
path.parentPath?.type === 'MemberExpression' &&
41-
path.key === 'object'
41+
path.key === 'object' &&
42+
path.node.name === 'cache'
4243
) {
43-
path.node.name = replacements[name as ReplacementKeys];
44+
path.node.name = 'mockCache';
45+
} else if (path.node.name === 'EdgeKV') {
46+
path.node.name = 'mockKV';
4447
}
4548
}
4649
});

0 commit comments

Comments
 (0)