@@ -6,15 +6,15 @@ import createGatsbyApp from './createGatsbyApp.util';
6
6
/**
7
7
* Handles the exporting of projects in various configurations based on user selections.
8
8
* This function supports the creation of Classic React applications, Next.js applications,
9
- * Gatsby.js applications , and a basic export of component files without full application scaffolding.
9
+ * Gatsby.js apps , and a basic export of component files without full application scaffolding.
10
10
*
11
11
* @param {string } path - The directory path where the project should be exported.
12
12
* @param {string } appName - The name of the application to be created.
13
13
* @param {number } genOption - Indicates the type of generation:
14
14
* 0 for only component files, 1 for complete application setup.
15
- * @param {string } projectType - Specifies the type of project : 'Classic React', 'Next.js', or 'Gatsby.js'.
15
+ * @param {string } projectType - Specifies project type: 'Classic React', 'Next.js', or 'Gatsby.js'.
16
16
* @param {any[] } components - An array of components to be included in the project.
17
- * @param {number[] } rootComponents - An array of indices identifying which components are root components.
17
+ * @param {number[] } rootComponents - An array of indices identifying root components.
18
18
* @param {boolean } [tests] - Optional. Whether to include test setups in the generated application.
19
19
* @returns {void } - This function does not return a value but will log the outcome of the file writing operation to the console.
20
20
*/
@@ -25,35 +25,35 @@ const exportProject = (
25
25
projectType : string ,
26
26
components : any ,
27
27
rootComponents : number [ ] ,
28
- tests ?: boolean
28
+ tests ?: boolean ,
29
29
) : void => {
30
30
// Create fully functional classic react application
31
31
if ( genOption === 1 && projectType === 'Classic React' ) {
32
32
createApplicationUtil ( {
33
33
path,
34
34
appName,
35
35
components,
36
- testchecked : tests
36
+ testchecked : tests ,
37
37
} ) . catch ( ( err ) => console . log ( err ) ) ;
38
- } // export all component files, but don't create all application files
39
- else if ( genOption === 0 ) {
38
+ } else if ( genOption === 0 ) {
39
+ // export all component files, but don't create all application files
40
40
createFiles ( components , path , appName , false ) ;
41
- } // Create fully functional Next.js and Gatsby .js application files
42
- else if ( genOption === 1 && projectType === 'Next .js' ) {
41
+ } else if ( genOption === 1 && projectType === 'Next .js' ) {
42
+ // Create fully functional Next.js and Gatsby .js application files
43
43
createNextApp ( {
44
44
path,
45
45
appName,
46
46
components,
47
47
rootComponents,
48
- testchecked : tests
48
+ testchecked : tests ,
49
49
} ) . catch ( ( err ) => console . log ( err ) ) ;
50
50
} else if ( genOption === 1 && projectType === 'Gatsby.js' ) {
51
51
createGatsbyApp ( {
52
52
path,
53
53
appName,
54
54
components,
55
55
rootComponents,
56
- testchecked : tests
56
+ testchecked : tests ,
57
57
} ) . catch ( ( err ) => console . log ( err ) ) ;
58
58
}
59
59
} ;
0 commit comments