Skip to content

Commit

Permalink
sharedにパス通したいな
Browse files Browse the repository at this point in the history
  • Loading branch information
nekobato committed Aug 23, 2023
1 parent f2ca544 commit babd0d2
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 95 deletions.
8 changes: 2 additions & 6 deletions packages/main/db.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { safeStorage } from "electron";
import Store from "electron-store";
import { v4 as uuid } from "uuid";
import { Timeline } from "../shared/types/Store";

export type StoreSchema = {
timeline: {
id: string; // uuid
userId: string;
channel: string;
options: string;
}[];
timeline: Timeline[];
instance: {
id: string; // uuid
type: "misskey" | "mastodon";
Expand Down
8 changes: 7 additions & 1 deletion packages/main/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"extends": "../../tsconfig.json"
"extends": "../../tsconfig.json",
"compilerOptions": {
"paths": {
"@/shared/*": ["../shared/*"]
}
},
"include": ["**/*.ts"]
}
2 changes: 1 addition & 1 deletion packages/main/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig({
sourcemap: true,
emptyOutDir: true,
rollupOptions: {
external: ["electron", "sqlite3", ...builtinModules, ...Object.keys(pkg.dependencies || {})],
external: ["electron", ...builtinModules, ...Object.keys(pkg.dependencies || {})],
},
commonjsOptions: {
ignoreGlobal: false,
Expand Down
58 changes: 0 additions & 58 deletions packages/mutation-types.ts

This file was deleted.

17 changes: 9 additions & 8 deletions packages/renderer/src/components/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const postAtttachments = computed(() => {
});
const openPost = () => {
console.log(new URL(`/notes/${props.post.id}`, timelineStore.currentInstance?.url).toString());
ipcSend("open-url", { url: new URL(`/notes/${props.post.id}`, timelineStore.currentInstance?.url).toString() });
};
Expand Down Expand Up @@ -84,14 +85,6 @@ const isMyReaction = (reaction: string, myReaction?: string) => {
<div class="post-data">
<div class="hazy-post-info">
<span class="username" v-html="props.post.user.name" />
<div class="hazy-post-actions">
<button class="hazy-post-action" @click="openPost">
<Icon class="nn-icon size-xsmall" icon="mingcute:add-fill" />
</button>
<button class="hazy-post-action" @click="openPost">
<Icon class="nn-icon size-xsmall" icon="mingcute:external-link-line" />
</button>
</div>
</div>
<div class="hazy-post-contents">
<img class="hazy-avatar" :src="props.post.user.avatarUrl" alt="" />
Expand Down Expand Up @@ -123,6 +116,14 @@ const isMyReaction = (reaction: string, myReaction?: string) => {
<span class="count">{{ reaction.count }}</span>
</button>
</div>
<div class="hazy-post-actions">
<button class="hazy-post-action" @click="openPost">
<Icon class="nn-icon size-xsmall" icon="mingcute:add-fill" />
</button>
<button class="hazy-post-action" @click="openPost">
<Icon class="nn-icon size-xsmall" icon="mingcute:external-link-line" />
</button>
</div>
</div>
</template>
Expand Down
3 changes: 1 addition & 2 deletions packages/renderer/src/pages/PostWindow/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { Icon } from "@iconify/vue";
import { computed, onMounted, reactive, ref } from "vue";
import HazyButton from "@/components/common/HazyButton.vue";
import hazyAlert from "@/components/common/HazyAlert.vue";
import { User } from "@prisma/client";
const state = reactive({
users: [] as User[],
users: [] as any,
currentUserIndex: 0,
post: {
isSending: false,
Expand Down
1 change: 0 additions & 1 deletion packages/renderer/src/store/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ipcInvoke } from "@/utils/ipc";
import { Instance as InstanceTable, User } from "@prisma/client";
import { Post } from "@/types/Post";
import { defineStore } from "pinia";
import { Emoji, MisskeyEntities } from "@/types/misskey";
Expand Down
11 changes: 2 additions & 9 deletions packages/renderer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"baseUrl": ".",
"allowJs": true,
"paths": {
"@/*": ["src/*"]
"@/*": ["./src/*"],
"@@/*": ["../*"]
}
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
Expand Down
14 changes: 14 additions & 0 deletions packages/shared/types/Store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type Timeline = {
id: string; // uuid
userId: string;
channel: string;
options: string;
};

export type Instance = {
id: string; // uuid
type: "misskey" | "mastodon";
name: string;
url: string;
iconUrl: string;
};
9 changes: 0 additions & 9 deletions packages/shared/types/hazy.ts

This file was deleted.

0 comments on commit babd0d2

Please sign in to comment.