Skip to content

Commit

Permalink
bugfix: resolve template pkg name as lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jan 1, 2024
1 parent e406583 commit cac8381
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
4 changes: 2 additions & 2 deletions bin/cb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {Ora} from 'ora';
import shell from 'shelljs';
import {setTimeout} from 'timers';

import {camelCaseToDash} from '../utils/functions.js';
import {camelCaseToDash, camelCaseToLowerLetters} from '../utils/functions.js';

export const cbResultExpo = (
template: string,
Expand Down Expand Up @@ -35,7 +35,7 @@ export const cbResultExpo = (
shell.sed(
'-i',
'dooboo',
camelCaseToDash(`${nameOfApp}`),
camelCaseToLowerLetters(`${nameOfApp}`),
`./${nameOfApp}/app.config.ts`,
);

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions utils/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ export const camelCaseToDash = (str: string): string => {
return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();
};

export const camelCaseToLowerLetters = (str: string): string => {
return str.replace(/([a-zA-Z])(?=[A-Z])/g, '$1').toLowerCase();
};

export const camelize = (str: string): string => {
return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, (match, index) => {
// or if (/\s+/.test(match)) for white spaces
Expand Down

0 comments on commit cac8381

Please sign in to comment.