Skip to content

Commit c60208f

Browse files
committed
fix: 🐛 (customization) replace capitalized options
1 parent 18905d3 commit c60208f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/customization.mjs

+12
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,28 @@ function renameCamelCases(libraryName) {
101101
to: camelcase(libraryName)
102102
}
103103

104+
const capsReplaceOptions = {
105+
ignore: 'node_modules/**/*',
106+
files: '**/*.{ts,html,json,scss,js}',
107+
from: new RegExp(capitalize(camelcase(LIBRARY_NAME), 'g')),
108+
to: capitalize(camelcase(libraryName))
109+
}
110+
104111
try {
105112
spinner.start();
106113
replaceInFile.sync(replaceOptions);
114+
replaceInFile.sync(capsReplaceOptions);
107115
spinner.stop();
108116
} catch (error) {
109117
spinner.fail('Oh no, an error occurred while replacing class names, configs, styles')
110118
console.error(error);
111119
}
112120
}
113121

122+
function capitalize(value){
123+
return value.charAt(0).toUpperCase() + value.substring(1);
124+
}
125+
114126
function generateSpinner(text) {
115127
return ora({
116128
text, spinner: 'christmas'

0 commit comments

Comments
 (0)