This is an automated email from the ASF dual-hosted git repository.
robin0716 pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/test by this push:
new ec16ac9a chore(scripts): Remove humps dependency
ec16ac9a is described below
commit ec16ac9ad2e1eeaf9f39db29589f69edebce5e47
Author: robin <[email protected]>
AuthorDate: Mon Jul 15 11:31:57 2024 +0800
chore(scripts): Remove humps dependency
---
ui/package.json | 1 -
ui/pnpm-lock.yaml | 7 -------
ui/scripts/plugin.js | 7 +++++--
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/ui/package.json b/ui/package.json
index 33d31156..5fc8b553 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -78,7 +78,6 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
- "humps": "^2.0.1",
"husky": "^8.0.1",
"js-yaml": "^4.1.0",
"lint-staged": "^13.2.3",
diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml
index b48e6b05..3124ae49 100644
--- a/ui/pnpm-lock.yaml
+++ b/ui/pnpm-lock.yaml
@@ -189,9 +189,6 @@ importers:
eslint-plugin-react-hooks:
specifier: ^4.6.0
version: 4.6.0([email protected])
- humps:
- specifier: ^2.0.1
- version: 2.0.1
husky:
specifier: ^8.0.1
version: 8.0.1
@@ -7043,10 +7040,6 @@ packages:
engines: {node: '>=14.18.0'}
dev: true
- /[email protected]:
- resolution: {integrity:
sha512-E0eIbrFWUhwfXJmsbdjRQFQPrl5pTEoKlz163j1mTqqUnU9PgR4AgB8AIITzuB3vLBdxZXyZ9TDIrwB2OASz4g==}
- dev: true
-
/[email protected]:
resolution: {integrity:
sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==}
engines: {node: '>=14'}
diff --git a/ui/scripts/plugin.js b/ui/scripts/plugin.js
index a0d31e0c..d554df8f 100644
--- a/ui/scripts/plugin.js
+++ b/ui/scripts/plugin.js
@@ -19,11 +19,14 @@
const path = require('path');
const fs = require('fs');
-const humps = require('humps');
const pluginPath = path.join(__dirname, '../src/plugins');
const pluginFolders = fs.readdirSync(pluginPath);
+function pascalize(str) {
+ return str.split(/[_-]/).map((part) => part.charAt(0).toUpperCase() +
part.slice(1)).join('');
+}
+
function resetPackageJson() {
const packageJsonPath = path.join(__dirname, '..', 'package.json');
const packageJsonContent = require(packageJsonPath);
@@ -59,7 +62,7 @@ function addPluginToIndexTs(packageName) {
const indexTsPath = path.join(pluginPath, 'index.ts');
const indexTsContent = fs.readFileSync(indexTsPath, 'utf-8');
const lines = indexTsContent.split('\n');
- const ComponentName = humps.pascalize(packageName);
+ const ComponentName = pascalize(packageName);
const importLine = `export { default as ${ComponentName} } from
'${packageName}';`;
if (!lines.includes(importLine)) {
lines.push(importLine);