From 42bbbae9840da992665278b48556612cc05d1873 Mon Sep 17 00:00:00 2001 From: hieu-w Date: Mon, 3 Feb 2025 16:52:31 +0700 Subject: [PATCH] Fix babel missing hasOwn transform --- babel.config.js | 7 ++++++- package-lock.json | 34 ++++++++++++++++++++++++++++------ package.json | 3 ++- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/babel.config.js b/babel.config.js index cee7515a..16c0ebe8 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1 +1,6 @@ -module.exports = require("@toruslabs/config/babel.config.js"); +const torusConfig = require("@toruslabs/config/babel.config.js"); + +module.exports = { + ...torusConfig, + plugins: [...torusConfig.plugins, "babel-plugin-transform-object-hasown"], +}; diff --git a/package-lock.json b/package-lock.json index a812f3be..d0507a57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "@babel/register": "^7.25.9", "@babel/runtime": "^7.26.0", "@rollup/plugin-replace": "^6.0.1", - "@toruslabs/config": "^2.2.0", + "@toruslabs/config": "^3.0.1", "@toruslabs/eslint-config-typescript": "^3.3.4", "@toruslabs/torus-scripts": "^6.1.6", "@types/color": "^4.2.0", @@ -50,6 +50,7 @@ "@types/once": "^1.4.5", "@types/pump": "^1.1.3", "@types/readable-stream": "^4.0.18", + "babel-plugin-transform-object-hasown": "^1.1.0", "cross-env": "^7.0.3", "eslint": "^8.56.0", "husky": "^9.1.7", @@ -3301,13 +3302,12 @@ "license": "MIT" }, "node_modules/@toruslabs/config": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@toruslabs/config/-/config-2.2.0.tgz", - "integrity": "sha512-gH69an6qIVEP9W/YkPmroBrqoPfIf8aoBSGC6ZAcc4ihXDeyByXtdpThZ+wm9TSWMYsjewhZVstRAZeaE3zp9w==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@toruslabs/config/-/config-3.0.1.tgz", + "integrity": "sha512-X3vvvBK+sY4riwwxIUFLO93j8x6ElpshkDPzkz/NT6sDL+aQ0LOCZa75CfSfyhcOheJpfG9YgXpePCzHCkOWfg==", "dev": true, - "license": "MIT", "engines": { - "node": ">=18.x", + "node": ">=20.x", "npm": ">=9.x" }, "peerDependencies": { @@ -3585,6 +3585,19 @@ "eslint": "^8.x" } }, + "node_modules/@toruslabs/torus-scripts/node_modules/@toruslabs/config": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@toruslabs/config/-/config-2.2.0.tgz", + "integrity": "sha512-gH69an6qIVEP9W/YkPmroBrqoPfIf8aoBSGC6ZAcc4ihXDeyByXtdpThZ+wm9TSWMYsjewhZVstRAZeaE3zp9w==", + "dev": true, + "engines": { + "node": ">=18.x", + "npm": ">=9.x" + }, + "peerDependencies": { + "@babel/runtime": "^7.16" + } + }, "node_modules/@toruslabs/tweetnacl-js": { "version": "1.0.4", "license": "Unlicense" @@ -4718,6 +4731,15 @@ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, + "node_modules/babel-plugin-transform-object-hasown": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-hasown/-/babel-plugin-transform-object-hasown-1.1.0.tgz", + "integrity": "sha512-HD1IFdodOjsKOKli9RG47jEuo6kOZ9G3Q+0jheP7BZHkMAIN+PnMPaGmvBjpGQX/zaGlKKWumSs5LZNV0+ioqQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "dev": true, diff --git a/package.json b/package.json index e81f7042..c5e2615b 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@babel/register": "^7.25.9", "@babel/runtime": "^7.26.0", "@rollup/plugin-replace": "^6.0.1", - "@toruslabs/config": "^2.2.0", + "@toruslabs/config": "^3.0.1", "@toruslabs/eslint-config-typescript": "^3.3.4", "@toruslabs/torus-scripts": "^6.1.6", "@types/color": "^4.2.0", @@ -81,6 +81,7 @@ "@types/once": "^1.4.5", "@types/pump": "^1.1.3", "@types/readable-stream": "^4.0.18", + "babel-plugin-transform-object-hasown": "^1.1.0", "cross-env": "^7.0.3", "eslint": "^8.56.0", "husky": "^9.1.7",