Skip to content

Commit

Permalink
素vue
Browse files Browse the repository at this point in the history
  • Loading branch information
nekobato committed Jan 5, 2024
1 parent c0ff0a9 commit f26051d
Show file tree
Hide file tree
Showing 91 changed files with 7,731 additions and 36,642 deletions.
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

11 changes: 5 additions & 6 deletions electron-builder.config.js → electron-builder.json5
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const package = require("./package.json");

module.exports = {
{
$schema: "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
appId: "net.nekobato.hazy",
asar: true,
productName: "hazy",
directories: {
output: "release/${version}",
},
files: [".output/**/*", "dist-electron"],
files: ["dist", "dist-electron"],
mac: {
category: "public.app-category.social-networking",
icon: ".output/public/icons/mac/icon.icns",
Expand Down Expand Up @@ -35,5 +35,4 @@ module.exports = {
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false,
},
buildVersion: package.version,
};
}
6 changes: 0 additions & 6 deletions electron/tsconfig.json

This file was deleted.

12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>hazy</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 22 additions & 2 deletions electron/db.ts → main/db.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { safeStorage } from "electron";
import Store from "electron-store";
import { nanoid } from "nanoid/non-secure";
import type { Instance, Timeline, User, Settings } from "@/types/store";
import { storeDefaults } from "../utils/statics";
import type { Instance, Timeline, User, Settings, InstanceStore } from "../shared/types/store";

export type StoreSchema = {
timelines: Timeline[];
Expand All @@ -11,6 +10,27 @@ export type StoreSchema = {
settings: Settings;
};

export const storeDefaults = {
users: [] as User[],
instances: [] as InstanceStore[],
timelines: [] as Timeline[],
settings: {
opacity: 50,
hazyMode: "show",
windowSize: {
width: 475,
height: 600,
},
maxPostCount: 1000,
postStyle: "all",
shortcuts: {},
shouldAppUpdate: true,
misskey: {
hideCw: false,
},
} as Settings,
};

const schema: Store.Schema<StoreSchema> = {
timelines: {
type: "array",
Expand Down
17 changes: 17 additions & 0 deletions main/electron-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/// <reference types="vite-plugin-electron/electron-env" />

declare namespace NodeJS {
interface ProcessEnv {
DIST: string;
VITE_PUBLIC: string;
}
}

interface Window {
ipc: {
send: (event: string, payload?: any) => void;
invoke: (event: string, payload?: any) => Promise<any>;
on: (event: string, callback: (event: Electron.IpcRendererEvent, ...args: any[]) => void) => void;
};
openUrl: (e: Event, url: string) => void;
}
File renamed without changes.
2 changes: 1 addition & 1 deletion electron/index.ts → main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import menuTemplate from "./menu";
import * as db from "./db";
import { apiRequest } from "./api";
import { checkUpdate } from "./autoupdate";
import type { Settings } from "@/types/store";
import type { Settings } from "../shared/types/store";

process.on("uncaughtException", function (error) {
dialog.showErrorBox("Error", error.message);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions nuxt.config.ts

This file was deleted.

Loading

0 comments on commit f26051d

Please sign in to comment.