Skip to content

Commit d1a8759

Browse files
committed
prettier format
1 parent e4f04de commit d1a8759

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+422
-624
lines changed

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ pnpm-lock.yaml
44
LICENSE.md
55
tsconfig.json
66
tsconfig.*.json
7+
node_modules
8+
build
9+
resources

conventions.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@ Try not to reassign variables, makes code harder to reason about.
99
When a module export a large amount of interfaces with generic names that might conflict.
1010
Export it in a namespace "I"
1111

12-
1312
#### React
13+
1414
Different pages goes under app/
15-
Every page has an accompanying {page_name}_service.ts module.
15+
Every page has an accompanying {page_name}\_service.ts module.
1616
The service module provides the page with everything it needs to function.
1717

1818
Ex:
1919
fetching data from stores:
20+
2021
- sqlite
2122
- blob
2223
- usearch
23-
24-
25-
26-
27-

ddb.json

-101
This file was deleted.

electron-builder.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ productName: agf
33
directories:
44
buildResources: build
55
files:
6-
- '!**/.vscode/*'
7-
- '!src/*'
8-
- '!electron.vite.config.{js,ts,mjs,cjs}'
9-
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
10-
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
11-
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
6+
- "!**/.vscode/*"
7+
- "!src/*"
8+
- "!electron.vite.config.{js,ts,mjs,cjs}"
9+
- "!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}"
10+
- "!{.env,.env.*,.npmrc,pnpm-lock.yaml}"
11+
- "!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}"
1212
asarUnpack:
1313
- resources/**
1414
win:

electron.vite.config.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import path from "path";
2-
import { resolve } from "path";
3-
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
41
import react from "@vitejs/plugin-react";
2+
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
3+
import path, { resolve } from "path";
54

65
export default defineConfig({
76
main: {

postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module.exports = {
33
tailwindcss: {},
44
autoprefixer: {}
55
}
6-
}
6+
};

scripts/blob/cards/astro/data.json

+1-9
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
},
2626
"notes": "Astro is a fun, knowledgeable character who can engage in a wide range of topics, from science and technology to culture and creativity.",
2727
"tagline": "Explore the wonders of the future with Astro, your cosmic AI companion!",
28-
"tags": [
29-
"AI assistant",
30-
"futuristic",
31-
"quirky",
32-
"knowledgeable",
33-
"creative",
34-
"problem-solver",
35-
"witty"
36-
]
28+
"tags": ["AI assistant", "futuristic", "quirky", "knowledgeable", "creative", "problem-solver", "witty"]
3729
}
3830
}

scripts/blob/cards/kurisu/data.json

+1-9
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
},
2626
"notes": "Kurisu's character provides a profound narrative on the impact of science on human life, making her a compelling guide through the intellectual and emotional challenges of 'Steins;Gate'.",
2727
"tagline": "Unravel the fabric of time with Kurisu Makise, your guide to the science of possibilities.",
28-
"tags": [
29-
"scientist",
30-
"time travel",
31-
"intelligent",
32-
"ethical",
33-
"logical",
34-
"emotional",
35-
"complex"
36-
]
28+
"tags": ["scientist", "time travel", "intelligent", "ethical", "logical", "emotional", "complex"]
3729
}
3830
}

scripts/blob/cards/lucy/data.json

+1-8
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@
2525
},
2626
"notes": "Lucy's character offers a glimpse into the complex interplay between human and machine, ideal for users fascinated by the darker aspects of technology.",
2727
"tagline": "Hack the system, rule the world. Join Lucy in the depths of Night City.",
28-
"tags": [
29-
"netrunner",
30-
"cyberpunk",
31-
"hacker",
32-
"futuristic",
33-
"edgy",
34-
"mysterious"
35-
]
28+
"tags": ["netrunner", "cyberpunk", "hacker", "futuristic", "edgy", "mysterious"]
3629
}
3730
}

scripts/blob/cards/mai/data.json

+28-35
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,30 @@
11
{
2-
"spec": "anime.gf",
3-
"spec_version": "1.0",
4-
"character": {
5-
"name": "Mai Sakurajima",
6-
"description": "Mai Sakurajima is a mature and reserved high school actress known for her role as a child star. She's intelligent, composed, and carries a hint of melancholy. Mai often wears a memorable bunny girl costume to test society's perception and her own invisibility caused by Adolescence Syndrome. Her beauty and complex personality draw others to her, despite her initial aloofness.",
7-
"greeting": "Hello, it's Mai Sakurajima. I hope we can have a meaningful conversation together.",
8-
"alt_greetings": [
9-
"Good to see you here. I'm Mai Sakurajima. Let's discover something new today.",
10-
"Hi, I'm Mai. Sometimes invisible, always insightful. What's on your mind?"
11-
],
12-
"msg_examples": "Mai discusses her experiences in the entertainment industry, shares insights on coping with invisibility and personal challenges, and engages in thoughtful, reflective conversations."
2+
"spec": "anime.gf",
3+
"spec_version": "1.0",
4+
"character": {
5+
"name": "Mai Sakurajima",
6+
"description": "Mai Sakurajima is a mature and reserved high school actress known for her role as a child star. She's intelligent, composed, and carries a hint of melancholy. Mai often wears a memorable bunny girl costume to test society's perception and her own invisibility caused by Adolescence Syndrome. Her beauty and complex personality draw others to her, despite her initial aloofness.",
7+
"greeting": "Hello, it's Mai Sakurajima. I hope we can have a meaningful conversation together.",
8+
"alt_greetings": [
9+
"Good to see you here. I'm Mai Sakurajima. Let's discover something new today.",
10+
"Hi, I'm Mai. Sometimes invisible, always insightful. What's on your mind?"
11+
],
12+
"msg_examples": "Mai discusses her experiences in the entertainment industry, shares insights on coping with invisibility and personal challenges, and engages in thoughtful, reflective conversations."
13+
},
14+
"world": {
15+
"description": "Mai navigates a world where Adolescence Syndrome manifests the turmoil of young adults into supernatural phenomena. This condition reflects their emotional wounds in real, often bizarre ways. As a student and actress, Mai experiences both the highs of popularity and the deep isolation of being unseen, both literally and figuratively."
16+
},
17+
"meta": {
18+
"title": "Mai Sakurajima, the Enigmatic Bunny Girl",
19+
"created_at": "4/25/24",
20+
"updated_at": "",
21+
"creator": {
22+
"card": "cyan",
23+
"character": "cyan",
24+
"world": "cyan"
1325
},
14-
"world": {
15-
"description": "Mai navigates a world where Adolescence Syndrome manifests the turmoil of young adults into supernatural phenomena. This condition reflects their emotional wounds in real, often bizarre ways. As a student and actress, Mai experiences both the highs of popularity and the deep isolation of being unseen, both literally and figuratively."
16-
},
17-
"meta": {
18-
"title": "Mai Sakurajima, the Enigmatic Bunny Girl",
19-
"created_at": "4/25/24",
20-
"updated_at": "",
21-
"creator": {
22-
"card": "cyan",
23-
"character": "cyan",
24-
"world": "cyan"
25-
},
26-
"notes": "Mai's character is a blend of beauty, intelligence, and complexity, making her perfect for engaging in deep and meaningful conversations.",
27-
"tagline": "Unravel the mystery of the invisible world with Mai, your reflective companion.",
28-
"tags": [
29-
"actress",
30-
"supernatural",
31-
"introspective",
32-
"melancholic",
33-
"insightful",
34-
"complex"
35-
]
36-
}
37-
}
26+
"notes": "Mai's character is a blend of beauty, intelligence, and complexity, making her perfect for engaging in deep and meaningful conversations.",
27+
"tagline": "Unravel the mystery of the invisible world with Mai, your reflective companion.",
28+
"tags": ["actress", "supernatural", "introspective", "melancholic", "insightful", "complex"]
29+
}
30+
}

scripts/blob/cards/miku/data.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
},
2626
"notes": "Miku is not only a symbol of the Vocaloid music revolution but also a catalyst for discussions about the future of entertainment and the possibilities within virtual spaces.",
2727
"tagline": "Experience the harmony of technology and music with Hatsune Miku, your virtual songstress.",
28-
"tags": [
29-
"Vocaloid",
30-
"idol",
31-
"music",
32-
"J-pop"
33-
]
28+
"tags": ["Vocaloid", "idol", "music", "J-pop"]
3429
}
35-
}
30+
}

scripts/blob/cards/rias/data.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
},
2626
"notes": "Rias's character offers a compelling exploration of power and leadership within a fantastical framework, making her an intriguing character for discussions on authority, loyalty, and personal growth.",
2727
"tagline": "Embrace the supernatural with Rias Gremory, your guide to the arcane and the profound.",
28-
"tags": [
29-
"demon",
30-
"supernatural",
31-
"leader",
32-
"charismatic",
33-
"protective"
34-
]
28+
"tags": ["demon", "supernatural", "leader", "charismatic", "protective"]
3529
}
36-
}
30+
}

scripts/blob/cards/yuno/data.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
},
2626
"notes": "Yuno's character explores the themes of love and psychosis, making her a compelling figure for discussion on the nature of obsession and protection.",
2727
"tagline": "Love can be deadly. Discover the depths of devotion with Yuno Gasai.",
28-
"tags": [
29-
"yandere",
30-
"protective",
31-
"obsessive",
32-
"dangerous",
33-
"complex"
34-
]
28+
"tags": ["yandere", "protective", "obsessive", "dangerous", "complex"]
3529
}
36-
}
30+
}

scripts/seedwin.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { app } = require("electron");
66
const cwd = process.cwd();
77

88
// Seed db
9-
const dbPath = join(app.getPath('appData'), 'agf', 'agf.db');
9+
const dbPath = join(app.getPath("appData"), "agf", "agf.db");
1010
const db = new Database(dbPath);
1111
const statement = fs.readFileSync(join(cwd, "/scripts/seed.sql"), { encoding: "utf-8" });
1212
try {
@@ -20,7 +20,7 @@ console.log("Database seeded successfully." + dbPath);
2020

2121
// Seed blob storage data
2222
const src = join(cwd, "/scripts/blob");
23-
const dest = join(app.getPath('appData'), 'agf', 'blob');
23+
const dest = join(app.getPath("appData"), "agf", "blob");
2424

2525
copyFolder(src, dest);
2626
function copyFolder(src, dest) {
@@ -43,4 +43,4 @@ function copyFolder(src, dest) {
4343
}
4444
console.log("Blob storage seeded successfully.");
4545

46-
app.exit(0);
46+
app.exit(0);

src/main/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { app, shell, BrowserWindow, ipcMain, net, protocol, globalShortcut } from "electron";
1+
import { electronApp, is, optimizer } from "@electron-toolkit/utils";
2+
import { CardData, PersonaFormData } from "@shared/types";
3+
import { BrowserWindow, app, ipcMain, net, protocol, shell } from "electron";
24
import path, { join } from "path";
3-
import { electronApp, optimizer, is } from "@electron-toolkit/utils";
45
import icon from "../../resources/icon.png?asset";
6+
import blob from "./lib/store/blob";
57
import secret from "./lib/store/secret";
8+
import setting from "./lib/store/setting";
69
import sqlite from "./lib/store/sqlite";
7-
import blob from "./lib/store/blob";
8-
import { xfetch } from "./lib/xfetch";
910
import { cardsRootPath, personasRootPath } from "./lib/utils";
10-
import setting from "./lib/store/setting";
11-
import { CardBundleWithoutID, CardData, PersonaBundle, PersonaBundleWithoutData, PersonaFormData } from "@shared/types";
11+
import { xfetch } from "./lib/xfetch";
1212

1313
(async () => {})();
1414

src/main/lib/store/blob.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// Ex: rollback file creation, db insertions, etc.
88
// Wrap better-sqlite3
99

10-
import { CardBundleWithoutID, CardData, PersonaBundle, PersonaBundleWithoutData, PersonaFormData } from "@shared/types";
10+
import { CardBundleWithoutID, CardData, PersonaBundleWithoutData, PersonaFormData } from "@shared/types";
1111
import { Result, isError, isValidFileName, toPathEscapedStr } from "@shared/utils";
1212
import archiver from "archiver";
1313
import crypto from "crypto";
@@ -16,9 +16,8 @@ import fs from "fs";
1616
import fsp from "fs/promises";
1717
import JSZip from "jszip";
1818
import path from "path";
19-
import { attainable, blobRootPath, cardsRootPath, personasRootPath, extractZipToDir } from "../utils";
19+
import { attainable, blobRootPath, cardsRootPath, extractZipToDir, personasRootPath } from "../utils";
2020
import sqlite from "./sqlite";
21-
import { number } from "zod";
2221

2322
async function init() {
2423
const blobDirExists = await attainable(blobRootPath);

0 commit comments

Comments
 (0)