A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
chore(scripts): Remove humps dependency
robinec16ac9ad2e1
diff --git a/ui/package.json b/ui/package.jsonindex 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.yamlindex 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.0version: 4.6.0([email protected])- humps:- specifier: ^2.0.1- version: 2.0.1husky:specifier: ^8.0.1version: 8.0.1@@ -7043,10 +7040,6 @@ packages:engines: {node: '>=14.18.0'}dev: true- resolution: {integrity: sha512-E0eIbrFWUhwfXJmsbdjRQFQPrl5pTEoKlz163j1mTqqUnU9PgR4AgB8AIITzuB3vLBdxZXyZ9TDIrwB2OASz4g==}- dev: true-resolution: {integrity: sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==}engines: {node: '>=14'}diff --git a/ui/scripts/plugin.js b/ui/scripts/plugin.jsindex 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);