@@ -45,10 +45,10 @@ describe("create-gen-app", () => {
4545 describe ( "extractVariables" , ( ) => {
4646 it ( "should extract variables from filenames" , async ( ) => {
4747 fs . writeFileSync (
48- path . join ( testTempDir , "____PROJECT_NAME____ .txt" ) ,
48+ path . join ( testTempDir , "____projectName____ .txt" ) ,
4949 "content"
5050 ) ;
51- fs . writeFileSync ( path . join ( testTempDir , "____AUTHOR____ .md" ) , "content" ) ;
51+ fs . writeFileSync ( path . join ( testTempDir , "____author____ .md" ) , "content" ) ;
5252
5353 const result = await extractVariables ( testTempDir ) ;
5454
@@ -62,7 +62,7 @@ describe("create-gen-app", () => {
6262 it ( "should extract variables from file contents" , async ( ) => {
6363 fs . writeFileSync (
6464 path . join ( testTempDir , "test.txt" ) ,
65- "Hello ____USER_NAME____ , welcome to ____PROJECT_NAME____ !"
65+ "Hello ____userName____ , welcome to ____projectName____ !"
6666 ) ;
6767
6868 const result = await extractVariables ( testTempDir ) ;
@@ -77,11 +77,11 @@ describe("create-gen-app", () => {
7777 } ) ;
7878
7979 it ( "should extract variables from nested directories" , async ( ) => {
80- const nestedDir = path . join ( testTempDir , "src" , "____MODULE_NAME____ " ) ;
80+ const nestedDir = path . join ( testTempDir , "src" , "____moduleName____ " ) ;
8181 fs . mkdirSync ( nestedDir , { recursive : true } ) ;
8282 fs . writeFileSync (
83- path . join ( nestedDir , "____FILE_NAME____ .ts" ) ,
84- 'export const ____CONSTANT____ = "value";'
83+ path . join ( nestedDir , "____fileName____ .ts" ) ,
84+ 'export const ____constant____ = "value";'
8585 ) ;
8686
8787 const result = await extractVariables ( testTempDir ) ;
@@ -163,7 +163,7 @@ module.exports = {
163163 it ( "should skip .questions.json and .questions.js from variable extraction" , async ( ) => {
164164 fs . writeFileSync (
165165 path . join ( testTempDir , ".questions.json" ) ,
166- '{"questions": [{"name": "____SHOULD_NOT_EXTRACT____ "}]}'
166+ '{"questions": [{"name": "____shouldNotExtract____ "}]}'
167167 ) ;
168168
169169 const result = await extractVariables ( testTempDir ) ;
@@ -176,7 +176,7 @@ module.exports = {
176176 it ( "should handle variables with different casings" , async ( ) => {
177177 fs . writeFileSync (
178178 path . join ( testTempDir , "test.txt" ) ,
179- "____lowercase____ ____UPPERCASE____ ____CamelCase____ ____snake_case____"
179+ "____lowercase____ ____uppercase____ ____CamelCase____ ____snake_case____"
180180 ) ;
181181
182182 const result = await extractVariables ( testTempDir ) ;
@@ -210,9 +210,9 @@ module.exports = {
210210
211211 const extractedVariables : ExtractedVariables = {
212212 fileReplacers : [
213- { variable : "PROJECT_NAME " , pattern : / _ _ _ _ P R O J E C T _ N A M E _ _ _ _ / g } ,
213+ { variable : "projectName " , pattern : / _ _ _ _ p r o j e c t N a m e _ _ _ _ / g } ,
214214 ] ,
215- contentReplacers : [ { variable : "AUTHOR " , pattern : / _ _ _ _ A U T H O R _ _ _ _ / g } ] ,
215+ contentReplacers : [ { variable : "author " , pattern : / _ _ _ _ a u t h o r _ _ _ _ / g } ] ,
216216 projectQuestions : null ,
217217 } ;
218218
@@ -272,7 +272,7 @@ module.exports = {
272272
273273 const extractedVariables : ExtractedVariables = {
274274 fileReplacers : [
275- { variable : "PROJECT_NAME " , pattern : / _ _ _ _ P R O J E C T _ N A M E _ _ _ _ / g } ,
275+ { variable : "projectName " , pattern : / _ _ _ _ p r o j e c t N a m e _ _ _ _ / g } ,
276276 ] ,
277277 contentReplacers : [ ] ,
278278 projectQuestions : null ,
@@ -298,7 +298,7 @@ module.exports = {
298298 const extractedVariables : ExtractedVariables = {
299299 fileReplacers : [ ] ,
300300 contentReplacers : [
301- { variable : "USERFULLNAME " , pattern : / _ _ _ _ U S E R F U L L N A M E _ _ _ _ / g } ,
301+ { variable : "fullName " , pattern : / _ _ _ _ f u l l N a m e _ _ _ _ / g } ,
302302 ] ,
303303 projectQuestions : {
304304 questions : [
@@ -330,7 +330,7 @@ module.exports = {
330330 const extractedVariables : ExtractedVariables = {
331331 fileReplacers : [ ] ,
332332 contentReplacers : [
333- { variable : "MODULEDESC " , pattern : / _ _ _ _ M O D U L E D E S C _ _ _ _ / g } ,
333+ { variable : "moduleDesc " , pattern : / _ _ _ _ m o d u l e D e s c _ _ _ _ / g } ,
334334 ] ,
335335 projectQuestions : {
336336 questions : [
@@ -363,7 +363,7 @@ module.exports = {
363363 const extractedVariables : ExtractedVariables = {
364364 fileReplacers : [ ] ,
365365 contentReplacers : [
366- { variable : "USERFULLNAME " , pattern : / _ _ _ _ U S E R F U L L N A M E _ _ _ _ / g } ,
366+ { variable : "fullName " , pattern : / _ _ _ _ f u l l N a m e _ _ _ _ / g } ,
367367 ] ,
368368 projectQuestions : {
369369 questions : [
@@ -394,7 +394,7 @@ module.exports = {
394394 const extractedVariables : ExtractedVariables = {
395395 fileReplacers : [ ] ,
396396 contentReplacers : [
397- { variable : "MODULEDESC " , pattern : / _ _ _ _ M O D U L E D E S C _ _ _ _ / g } ,
397+ { variable : "moduleDesc " , pattern : / _ _ _ _ m o d u l e D e s c _ _ _ _ / g } ,
398398 ] ,
399399 projectQuestions : {
400400 questions : [
@@ -417,7 +417,7 @@ module.exports = {
417417 it ( "should replace variables in file contents" , async ( ) => {
418418 fs . writeFileSync (
419419 path . join ( testTempDir , "README.md" ) ,
420- "# ____PROJECT_NAME____ \n\nBy ____AUTHOR____ "
420+ "# ____projectName____ \n\nBy ____author____ "
421421 ) ;
422422
423423 const extractedVariables = await extractVariables ( testTempDir ) ;
@@ -443,7 +443,7 @@ module.exports = {
443443
444444 it ( "should replace variables in filenames" , async ( ) => {
445445 fs . writeFileSync (
446- path . join ( testTempDir , "____PROJECT_NAME____ .config.js" ) ,
446+ path . join ( testTempDir , "____projectName____ .config.js" ) ,
447447 "module.exports = {};"
448448 ) ;
449449
@@ -466,11 +466,11 @@ module.exports = {
466466 } ) ;
467467
468468 it ( "should replace variables in nested directory names" , async ( ) => {
469- const nestedDir = path . join ( testTempDir , "src" , "____MODULE_NAME____ " ) ;
469+ const nestedDir = path . join ( testTempDir , "src" , "____moduleName____ " ) ;
470470 fs . mkdirSync ( nestedDir , { recursive : true } ) ;
471471 fs . writeFileSync (
472472 path . join ( nestedDir , "index.ts" ) ,
473- 'export const name = "____MODULE_NAME____ ";'
473+ 'export const name = "____moduleName____ ";'
474474 ) ;
475475
476476 const extractedVariables = await extractVariables ( testTempDir ) ;
@@ -517,7 +517,7 @@ module.exports = {
517517 it ( "should handle multiple occurrences of the same variable" , async ( ) => {
518518 fs . writeFileSync (
519519 path . join ( testTempDir , "test.txt" ) ,
520- "____NAME____ loves ____NAME____ and ____NAME____ is great!"
520+ "____name____ loves ____name____ and ____name____ is great!"
521521 ) ;
522522
523523 const extractedVariables = await extractVariables ( testTempDir ) ;
@@ -578,7 +578,7 @@ module.exports = {
578578 fs . mkdirSync ( ignoredDir ) ;
579579 fs . writeFileSync (
580580 path . join ( ignoredDir , "example.txt" ) ,
581- "This file has ____IGNORED____ variable"
581+ "This file has ____ignored____ variable"
582582 ) ;
583583 fs . writeFileSync (
584584 path . join ( testTempDir , ".questions.json" ) ,
0 commit comments