Skip to content

Commit 7a892d2

Browse files
committed
modularized some code, as well as updated 'What's new' in the app
Co-authored-by: Daniel Garan <[email protected]> Co-authored-by: Kevin Can <[email protected]> Co-authored-by: Anthony Herrera <[email protected]> Co-authored-by: Rob Sinzieri <[email protected]> Co-authored-by: Roderick de Leon <[email protected]>
1 parent 53b6613 commit 7a892d2

File tree

5 files changed

+117
-99
lines changed

5 files changed

+117
-99
lines changed

src/assets/export-API.png

14.2 KB
Loading
11.1 KB
Loading

src/components/nav-buttons/ExportMenu.vue

Lines changed: 98 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import {
4343
} from "../../../types";
4444
import { useExportComponent } from "../composables/useExportComponent";
4545
import { createBoilerOptions, createBoilerComposition } from "../right-sidebar/createBoilerFuncs"
46-
import { createBoilerOptions, createBoilerComposition } from "../right-sidebar/createBoilerFuncs"
4746
// import * as fs from "fs"
4847
// import { fs } from "electron";
4948
// import { path } from 'path';
@@ -86,7 +85,7 @@ const showExportProjectDialog = () => {
8685
.catch((err: Error) => console.log(err));
8786
};
8887
89-
export const writeFile = async(filePath: any, content: any) => {
88+
const writeFile = async(filePath: any, content: any) => {
9089
if (!filePath) {
9190
console.error('filePath is undefined');
9291
return;
@@ -95,18 +94,18 @@ export const writeFile = async(filePath: any, content: any) => {
9594
.catch((error:any) => console.error(error));
9695
}
9796
98-
export async function checkFileExists(path:string) {
97+
async function checkFileExists(path:string) {
9998
const fileExistBool = await ipcRenderer.invoke('check-file-exists', path);
10099
return fileExistBool.status;
101100
};
102101
103-
export const mkdirSync = async (...args:string[]) => {
102+
const mkdirSync = async (...args:string[]) => {
104103
await ipcRenderer.invoke('mkdirSync', [...args ])
105-
104+
.then((response: any) => console.log('mkdirSync response is', response))
106105
.catch((error:any) => console.error(error));
107106
}
108107
109-
export const pathJoin = (...args:string[]) => {
108+
const pathJoin = (...args:string[]) => {
110109
if (args.some(arg => arg === undefined)) { //undefined handler for if any args are undefined
111110
console.error('arguments are undefined)');
112111
return;
@@ -253,10 +252,9 @@ const createComponentCode = async(
253252
await writeFile(
254253
componentLocation + ".vue",
255254
await writeTemplate(componentName, children, routes.value) +
256-
await writeStyle(componentName)
255+
await writeStyle(componentName)
257256
);
258257
console.log('finished write createComponent code')
259-
// fs.writeFileSync() console.log('about to write createComponent code for not App')
260258
} else {
261259
if (store.composition === false) {
262260
// fs.writeFileSync(
@@ -265,9 +263,9 @@ const createComponentCode = async(
265263
componentLocation + ".vue",
266264
await writeComments(componentName) +
267265
await writeTemplate(componentName, children, routes.value) +
268-
await createBoilerOptions(componentName, children)
266+
await createBoilerOptions(componentName, children)
269267
// + await writeStyle(componentName)
270-
);
268+
);
271269
console.log('finished to write createComponent code')
272270
} else {
273271
// fs.writeFileSync(
@@ -276,7 +274,7 @@ const createComponentCode = async(
276274
componentLocation + ".vue",
277275
await writeComments(componentName) +
278276
await writeTemplate(componentName, children, routes.value) +
279-
await createBoilerComposition(componentName, children)
277+
await createBoilerComposition(componentName, children)
280278
// + await writeStyle(componentName)
281279
);
282280
console.log('finished to write createComponent code')
@@ -1009,45 +1007,91 @@ const createTSDeclaration = async(location: string) => {
10091007
const createStore = async(location: string) => {
10101008
let str = `import { createStore } from 'pinia';\n`;
10111009
str += `\nconst store = createStore({`;
1012-
str += `\n\tstate () {`;
1013-
str += `\n\t\treturn {`;
1014-
if (!userState.value.length) {
1015-
str += `\n\t\t\t//placeholder for state`;
1016-
}
1017-
for (let i = 0; i < userState.value.length; i++) {
1018-
str += `\n\t\t\t${userState.value[i]}: "PLACEHOLDER FOR VALUE",`;
1019-
if (i === userState.value.length - 1) {
1020-
str = str.slice(0, -1);
1010+
1011+
1012+
if (store.composition) { //in composition API
1013+
1014+
1015+
str += `\n\tstate: () => ({`;
1016+
if (!userState.value.length) {
1017+
str += `\n\t\t//PLACE YOUR STATE OBJECT HERE`;
10211018
}
1022-
}
1023-
str += `\n\t\t}`;
1024-
str += `\n\t},`;
1025-
str += `\n\tmutations: {`;
1026-
if (!userActions.value.length) {
1027-
str += `\n\t\t\t//placeholder for mutations`;
1028-
}
1029-
for (let i = 0; i < userActions.value.length; i++) {
1030-
str += `\n\t\t${userActions.value[i]} (state) {`;
1031-
str += `\n\t\t\t//placeholder for your mutation`;
1032-
str += `\n\t\t},`;
1033-
if (i === userActions.value.length - 1) {
1034-
str = str.slice(0, -1);
1019+
for (let i = 0; i < userState.value.length; i++) {
1020+
str += `\n\t\t${userState.value[i]}: "PLACE YOUR STATE'S VALUE HERE",`;
1021+
if (i === userState.value.length - 1) {
1022+
str = str.slice(0, -1);
1023+
}
1024+
}
1025+
str += `\n\t}),`;
1026+
str += `\n\tactions: {`;
1027+
if (!userActions.value.length) {
1028+
str += `\n\t\t\t//PLACE YOUR ACTIONS OBJECT HERE`;
1029+
}
1030+
for (let i = 0; i < userActions.value.length; i++) {
1031+
str += `\n\t\t${userActions.value[i]} () {`;
1032+
if (userState.value[0]) {
1033+
str += `\n\t\t\t// EX. this.${userState.value[0]} += 1`;
1034+
} else {
1035+
str += `\n\t\t\t// EX. this.firstStateProperty += 1')`;
1036+
}
1037+
str += `\n\t\t},`;
1038+
if (i === userActions.value.length - 1) {
1039+
str = str.slice(0, -1);
1040+
}
1041+
}
1042+
str += `\n\t}`;
1043+
1044+
} else { //in options API
1045+
1046+
str += `\n\tstate: {`;
1047+
1048+
if (!userState.value.length) {
1049+
str += `\n\t\t//PLACE YOUR STATE OBJECT HERE`;
1050+
}
1051+
for (let i = 0; i < userState.value.length; i++) {
1052+
str += `\n\t\t${userState.value[i]}: "PLACE YOUR STATE'S VALUE HERE",`;
1053+
if (i === userState.value.length - 1) {
1054+
str = str.slice(0, -1);
1055+
}
10351056
}
1036-
}
1037-
str += `\n\t},`;
1038-
str += `\n\tactions: {`;
1039-
if (!userActions.value.length) {
1040-
str += `\n\t\t\t//placeholder for actions`;
1041-
}
1042-
for (let i = 0; i < userActions.value.length; i++) {
1043-
str += `\n\t\t${userActions.value[i]} () {`;
1044-
str += `\n\t\t\tstore.commit('${userActions.value[i]}')`;
10451057
str += `\n\t\t},`;
1046-
if (i === userActions.value.length - 1) {
1047-
str = str.slice(0, -1);
1058+
1059+
1060+
str += `\n\tmutations: {`;
1061+
if (!userActions.value.length) {
1062+
str += `\n\t\t\t//PLACE YOUR MUTATIONS OBJECT HERE`;
1063+
}
1064+
for (let i = 0; i < userActions.value.length; i++) {
1065+
str += `\n\t\t${userActions.value[i]} (state) {`;
1066+
str += `\n\t\t\t//placeholder for your mutation`;
1067+
str += `\n\t\t},`;
1068+
if (i === userActions.value.length - 1) {
1069+
str = str.slice(0, -1);
1070+
}
1071+
}
1072+
str += `\n\t},`;
1073+
str += `\n\tactions: {`;
1074+
if (!userActions.value.length) {
1075+
str += `\n\t\t\t//PLACE YOUR ACTIONS OBJECT HERE`;
10481076
}
1077+
for (let i = 0; i < userActions.value.length; i++) {
1078+
str += `\n\t\t${userActions.value[i]} () {`;
1079+
str += `\n\t\t\tstore.commit('${userActions.value[i]}')`;
1080+
str += `\n\t\t},`;
1081+
if (i === userActions.value.length - 1) {
1082+
str = str.slice(0, -1);
1083+
}
1084+
}
1085+
str += `\n\t}`;
10491086
}
1050-
str += `\n\t}`;
1087+
1088+
1089+
1090+
1091+
1092+
1093+
1094+
10511095
str += "\n})\n";
10521096
str += `\nexport default store;`;
10531097
if (exportAsTypescript.value === "on") {
@@ -1087,10 +1131,9 @@ const createPackage = async(location: string) => {
10871131
str += `\n\t},`;
10881132
str += `\n\t"dependencies": {`;
10891133
str += `\n\t\t"vue": "^3.4.21",`;
1090-
str += `\n\t\t"vue-router": "^4.0.12",`;
1134+
str += `\n\t\t"vue-router": "^4.3.0",`;
10911135
str += `\n\t\t"pinia": "^2.1.7"`;
1092-
str += `\n\t\t"vuex": "^4.0.2"`;
1093-
str += `,\n\t\t"element-plus": "^2.2.16"`;
1136+
str += `,\n\t\t"element-plus": "^2.6.2"`;
10941137
10951138
if (exportOauth.value === "on" || exportOauthGithub.value === "on") {
10961139
str += `,\n\t\t "firebase": "^9.6.9"`;
@@ -1099,8 +1142,8 @@ const createPackage = async(location: string) => {
10991142
str += `\n\t"devDependencies": {`;
11001143
str += `\n\t\t"@vitejs/plugin-vue": "^5.0.4",`;
11011144
str += `\n\t\t"eslint": "^8.5.0",`;
1102-
str += `\n\t\t"eslint-plugin-vue": "^8.2.0",`;
1103-
str += `\n\t\t"vite": "^5.2.0"`;
1145+
str += `\n\t\t"eslint-plugin-vue": "^9.24.0",`;
1146+
str += `\n\t\t"vite": "^5.2.6"`;
11041147
if (importTest.value === "on") {
11051148
str += `,\n\t\t"@babel/core": "^7.12.16",`;
11061149
str += `\n\t\t"@babel/eslint-parser": "^7.12.16",`;
@@ -1114,12 +1157,12 @@ const createPackage = async(location: string) => {
11141157
str += `\n\t\t"jest": "^27.0.5"`;
11151158
}
11161159
if (exportAsTypescript.value === "on") {
1117-
str += `,\n\t\t"@rushstack/eslint-patch": "^1.1.0",`;
1160+
str += `,\n\t\t"@rushstack/eslint-patch": "^1.8.0",`;
11181161
str += `\n\t\t"@vue/tsconfig": "^0.1.3",`;
1119-
str += `\n\t\t"typescript": "^5.2.2",`;
1120-
str += `\n\t\t"vue-tsc": "^2.0.6",`;
1121-
str += `\n\t\t"@types/node": "^16.11.25",`;
1122-
str += `\n\t\t"@vue/eslint-config-typescript": "^10.0.0"`;
1162+
str += `\n\t\t"typescript": "^5.4.3",`;
1163+
str += `\n\t\t"vue-tsc": "^2.0.7",`;
1164+
str += `\n\t\t"@types/node": "^20.11.30",`;
1165+
str += `\n\t\t"@vue/eslint-config-typescript": "^13.0.0"`;
11231166
}
11241167
str += `\n\t}\n}`;
11251168
// fs.writeFileSync(path.join(location, "package.json"), str);

src/components/right-sidebar/tutorial/BasicFunctions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
class="tut-btn"
147147
color="secondary"
148148
id="version-btn"
149-
label="New Features in Version 10"
149+
label="ADVANCED FUNCTIONALITY"
150150
@click="nextTab"
151151
/>
152152
<q-btn

src/components/right-sidebar/tutorial/NewVersionInfo.vue

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,40 @@
11
<template>
22
<section id="newFeatures">
33
<h6 class="infoHeading">What's New in OverVue 11.0?</h6>
4-
<p class="info-sub-heading">Interactive Tree View</p>
4+
<p class="info-sub-heading">Toggle between Options/Composition API</p>
55
<p class="infoContent">
6-
Drag and drop tree nodes to change the component structure! Changes made
7-
within the tree view will be reflected in the Code Preview. This view
8-
replaces the previous grid view. Although Grid Mode is considered
9-
deprecated, it can still be found within the application (see Advanced
10-
Functionality).
6+
OverVue 11.0 adds the ability to display your code generated in the code
7+
preview in both options and composition API, taking advantage of the pinia
8+
state management library. You can now toggle back and forth between each
9+
API format.
1110
</p>
1211
<img
13-
alt="Interactive Tree View"
14-
src="../../../assets/interactive-tree.png"
12+
alt="Toggle between Options/Composition API"
13+
src="../../../assets/options-composition-API.png"
1514
class="tut-screenshot"
1615
/>
17-
<p class="info-sub-heading">Updated HTML Elements Section</p>
16+
<p class="info-sub-heading">Updated Export Functionality</p>
1817
<p class="infoContent">
19-
OverVue 10.0 comes with a new and revamped HTML elements section. You can
20-
now change the order of and nest the HTML elements that are within your
21-
components by interacting with its tree list structure. From this section,
22-
you can also delete and edit HTML elements.
23-
</p>
24-
<img
25-
alt="HTML Elements Section"
26-
src="../../../assets/nested-elements.png"
27-
class="tut-screenshot"
28-
/>
29-
<p class="info-sub-heading">Component Focus Modal</p>
30-
<p class="infoContent">
31-
If you're going to be spending a lot of time organizing HTML elements in
32-
any one component, use the component focus modal. The modal can be opened
33-
by double-clicking on a component within the main tree view.
18+
Export now provides support for the pinia state management library. Now, you
19+
can choose which API formtat you want exported to your local machine, just
20+
select the desired format, hit export, and voilà!
21+
3422
</p>
3523
<img
36-
alt="Component Focus Modal"
37-
src="../../../assets/modal.png"
24+
alt="Updated Export Functionality"
25+
src="../../../assets/export-API.png"
3826
class="tut-screenshot"
3927
/>
40-
<p class="info-sub-heading">Vuetensils Component Library</p>
28+
<p class="info-sub-heading">Patched Save Functionality</p>
4129
<p class="infoContent">
42-
Quickly create accessible HTML elements by adding components from the
43-
Vuetensils Component Library! These naked components are designed to have
44-
bare minimum styles, to avoid bloat while including accessibility. Learn
45-
more about Vuetensils in their official
46-
<a
47-
class="link"
48-
@click="openUrl('https://vuetensils.com/Introduction.html')"
49-
>
50-
<u>documentation</u> </a
51-
>.
30+
You can now save the current state of your entire application into a JSON file
31+
on your local machine.
5232
</p>
53-
<img
54-
alt="Vuetensils"
55-
src="../../../assets/vuetensils.png"
56-
class="tut-screenshot"
57-
/>
5833
<q-btn
5934
class="tut-btn"
6035
color="secondary"
6136
id="advanced-btn"
62-
label="Advanced Functionality"
37+
label="The Basics"
6338
@click="nextTab"
6439
/>
6540
<q-btn

0 commit comments

Comments
 (0)