@@ -43,6 +43,7 @@ import {
43
43
} from " ../../../types" ;
44
44
import { useExportComponent } from " ../composables/useExportComponent" ;
45
45
import { createBoilerOptions , createBoilerComposition } from " ../right-sidebar/createBoilerFuncs"
46
+ import { createBoilerOptions , createBoilerComposition } from " ../right-sidebar/createBoilerFuncs"
46
47
// import * as fs from "fs"
47
48
// import { fs } from "electron";
48
49
// import { path } from 'path';
@@ -85,7 +86,7 @@ const showExportProjectDialog = () => {
85
86
.catch ((err : Error ) => console .log (err ));
86
87
};
87
88
88
- const writeFile = async (filePath : any , content : any ) => {
89
+ export const writeFile = async (filePath : any , content : any ) => {
89
90
if (! filePath ) {
90
91
console .error (' filePath is undefined' );
91
92
return ;
@@ -94,18 +95,18 @@ const writeFile = async(filePath: any, content: any) => {
94
95
.catch ((error : any ) => console .error (error ));
95
96
}
96
97
97
- async function checkFileExists(path : string ) {
98
+ export async function checkFileExists(path : string ) {
98
99
const fileExistBool = await ipcRenderer .invoke (' check-file-exists' , path );
99
100
return fileExistBool .status ;
100
101
};
101
102
102
- const mkdirSync = async (... args : string []) => {
103
+ export const mkdirSync = async (... args : string []) => {
103
104
await ipcRenderer .invoke (' mkdirSync' , [... args ])
104
- . then (( response : any ) => console . log ( ' mkdirSync response is ' , response ))
105
+
105
106
.catch ((error : any ) => console .error (error ));
106
107
}
107
108
108
- const pathJoin = (... args : string []) => {
109
+ export const pathJoin = (... args : string []) => {
109
110
if (args .some (arg => arg === undefined )) { // undefined handler for if any args are undefined
110
111
console .error (' arguments are undefined)' );
111
112
return ;
@@ -252,9 +253,10 @@ const createComponentCode = async(
252
253
await writeFile (
253
254
componentLocation + " .vue" ,
254
255
await writeTemplate (componentName , children , routes .value ) +
255
- await writeStyle (componentName )
256
+ await writeStyle (componentName )
256
257
);
257
258
console .log (' finished write createComponent code' )
259
+ // fs.writeFileSync() console.log('about to write createComponent code for not App')
258
260
} else {
259
261
if (store .composition === false ) {
260
262
// fs.writeFileSync(
@@ -1005,7 +1007,7 @@ const createTSDeclaration = async(location: string) => {
1005
1007
};
1006
1008
1007
1009
const createStore = async (location : string ) => {
1008
- let str = ` import { createStore } from 'vuex ';\n ` ;
1010
+ let str = ` import { createStore } from 'pinia ';\n ` ;
1009
1011
str += ` \n const store = createStore({` ;
1010
1012
str += ` \n\t state () {` ;
1011
1013
str += ` \n\t\t return {` ;
@@ -1086,6 +1088,7 @@ const createPackage = async(location: string) => {
1086
1088
str += ` \n\t "dependencies": {` ;
1087
1089
str += ` \n\t\t "vue": "^3.4.21",` ;
1088
1090
str += ` \n\t\t "vue-router": "^4.0.12",` ;
1091
+ str += ` \n\t\t "pinia": "^2.1.7"` ;
1089
1092
str += ` \n\t\t "vuex": "^4.0.2"` ;
1090
1093
str += ` ,\n\t\t "element-plus": "^2.2.16" ` ;
1091
1094
0 commit comments