Skip to content

Commit

Permalink
chore: upgrade version of acorn and acron walk (#37641)
Browse files Browse the repository at this point in the history
## Description
acorn and acorn walk did not have a fixed version, this pr fixes the
versions to `"acorn": "8.14.0", "acorn-walk": "8.3.4"` respectively.


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/test all

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11958829944>
> Commit: 518c411
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11958829944&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Thu, 21 Nov 2024 19:47:19 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
	- Updated dependency versions for improved performance and security: 
		- `acorn` updated to version `8.14.0`
		- `acorn-walk` updated to version `8.3.4`
- **Bug Fixes**
- Enhanced error handling in `canTranslateToUI` function for better
conditional and logical expression processing.
- Improved logic in `getMainAction` function to ensure accurate function
name generation based on call expression structure.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
ayushpahwa authored Nov 21, 2024
1 parent b113cf7 commit 0dac601
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions app/client/packages/ast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@rollup/plugin-commonjs": "^22.0.0",
"@types/escodegen": "^0.0.7",
"@types/lodash": "^4.14.120",
"acorn": "^8.8.0",
"acorn-walk": "^8.2.0",
"acorn": "8.14.0",
"acorn-walk": "8.3.4",
"astravel": "^0.6.1",
"astring": "^1.7.5",
"escodegen": "^2.0.0",
Expand Down
5 changes: 0 additions & 5 deletions app/client/packages/ast/src/actionCreator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,16 +800,13 @@ export function canTranslateToUI(
simple(astWithComments, {
ConditionalExpression(node) {
if (
// @ts-expect-error: types not matched
isCallExpressionNode(node.consequent) ||
// @ts-expect-error: types not matched
isCallExpressionNode(node.alternate)
) {
canTranslate = false;
}
},
LogicalExpression(node) {
// @ts-expect-error: types not matched
if (isCallExpressionNode(node.left) || isCallExpressionNode(node.right)) {
canTranslate = false;
}
Expand Down Expand Up @@ -912,12 +909,10 @@ export function getMainAction(
ExpressionStatement(node) {
simple(node, {
CallExpression(node) {
// @ts-expect-error: types not matched
if (node.callee.type === NodeTypes.Identifier) {
mainAction = generate(node, { comments: true }).trim();
} else {
mainAction =
// @ts-expect-error: types not matched
generate(node.callee, { comments: true }).trim() + "()";
}
},
Expand Down
38 changes: 19 additions & 19 deletions app/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8405,8 +8405,8 @@ __metadata:
"@types/lodash": ^4.14.120
"@typescript-eslint/eslint-plugin": ^5.25.0
"@typescript-eslint/parser": ^5.25.0
acorn: ^8.8.0
acorn-walk: ^8.2.0
acorn: 8.14.0
acorn-walk: 8.3.4
astravel: ^0.6.1
astring: ^1.7.5
escodegen: ^2.0.0
Expand Down Expand Up @@ -12463,14 +12463,7 @@ __metadata:
languageName: node
linkType: hard

"acorn-walk@npm:^7.0.0, acorn-walk@npm:^7.1.1, acorn-walk@npm:^7.2.0":
version: 7.2.0
resolution: "acorn-walk@npm:7.2.0"
checksum: 9252158a79b9d92f1bc0dd6acc0fcfb87a67339e84bcc301bb33d6078936d27e35d606b4d35626d2962cd43c256d6f27717e70cbe15c04fff999ab0b2260b21f
languageName: node
linkType: hard

"acorn-walk@npm:^8.0.2, acorn-walk@npm:^8.1.1, acorn-walk@npm:^8.2.0":
"acorn-walk@npm:8.3.4, acorn-walk@npm:^8.0.2, acorn-walk@npm:^8.1.1, acorn-walk@npm:^8.2.0":
version: 8.3.4
resolution: "acorn-walk@npm:8.3.4"
dependencies:
Expand All @@ -12479,6 +12472,13 @@ __metadata:
languageName: node
linkType: hard

"acorn-walk@npm:^7.0.0, acorn-walk@npm:^7.1.1, acorn-walk@npm:^7.2.0":
version: 7.2.0
resolution: "acorn-walk@npm:7.2.0"
checksum: 9252158a79b9d92f1bc0dd6acc0fcfb87a67339e84bcc301bb33d6078936d27e35d606b4d35626d2962cd43c256d6f27717e70cbe15c04fff999ab0b2260b21f
languageName: node
linkType: hard

"acorn@npm:8.10.0":
version: 8.10.0
resolution: "acorn@npm:8.10.0"
Expand All @@ -12488,6 +12488,15 @@ __metadata:
languageName: node
linkType: hard

"acorn@npm:8.14.0, acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.2.4, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
version: 8.14.0
resolution: "acorn@npm:8.14.0"
bin:
acorn: bin/acorn
checksum: 8755074ba55fff94e84e81c72f1013c2d9c78e973c31231c8ae505a5f966859baf654bddd75046bffd73ce816b149298977fff5077a3033dedba0ae2aad152d4
languageName: node
linkType: hard

"acorn@npm:^4.0.9":
version: 4.0.13
resolution: "acorn@npm:4.0.13"
Expand All @@ -12506,15 +12515,6 @@ __metadata:
languageName: node
linkType: hard

"acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.2.4, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.0, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0":
version: 8.14.0
resolution: "acorn@npm:8.14.0"
bin:
acorn: bin/acorn
checksum: 8755074ba55fff94e84e81c72f1013c2d9c78e973c31231c8ae505a5f966859baf654bddd75046bffd73ce816b149298977fff5077a3033dedba0ae2aad152d4
languageName: node
linkType: hard

"add-px-to-style@npm:1.0.0":
version: 1.0.0
resolution: "add-px-to-style@npm:1.0.0"
Expand Down

0 comments on commit 0dac601

Please sign in to comment.