Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Sep 25, 2024
1 parent d8c9595 commit 1a8abcf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
"babel-plugin-react-docgen": "4.2.1",
"boxen": "^7.1.1",
"browser-dtector": "^3.4.0",
"camelcase": "^8.0.0",
"chai": "^4.4.1",
"chalk": "^5.3.0",
"cli-table3": "^0.6.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { camelCase } from 'es-toolkit';

/**
* Get a valid variable name for a component.
*
* @param name The name of the component.
* @returns A valid variable name.
*/
export const getComponentVariableName = async (name: string) => {
const camelCased = camelCase(name.replace(/^[^a-zA-Z_$]*/, ''));
const camelCase = await import('camelcase');

const camelCased = camelCase.default(name.replace(/^[^a-zA-Z_$]*/, ''), { pascalCase: true });
const sanitized = camelCased.replace(/[^a-zA-Z_$]+/, '');
return sanitized;
};
1 change: 1 addition & 0 deletions code/lib/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"devDependencies": {
"@types/jscodeshift": "^0.11.10",
"ansi-regex": "^6.0.1",
"camelcase": "^8.0.0",
"mdast-util-mdx-jsx": "^3.0.0",
"mdast-util-mdxjs-esm": "^2.0.1",
"remark": "^15.0.1",
Expand Down
2 changes: 2 additions & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5928,6 +5928,7 @@ __metadata:
"@types/cross-spawn": "npm:^6.0.2"
"@types/jscodeshift": "npm:^0.11.10"
ansi-regex: "npm:^6.0.1"
camelcase: "npm:^8.0.0"
cross-spawn: "npm:^7.0.3"
es-toolkit: "npm:^1.21.0"
globby: "npm:^14.0.1"
Expand Down Expand Up @@ -6053,6 +6054,7 @@ __metadata:
boxen: "npm:^7.1.1"
browser-assert: "npm:^1.2.1"
browser-dtector: "npm:^3.4.0"
camelcase: "npm:^8.0.0"
chai: "npm:^4.4.1"
chalk: "npm:^5.3.0"
cli-table3: "npm:^0.6.1"
Expand Down

0 comments on commit 1a8abcf

Please sign in to comment.