-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] develop from misskey-dev:develop #6
Changes from 3 commits
0d76842
46d96c7
22c4e9d
02ecd1b
5df85b8
085b3ab
61f4a03
efa80f9
865b303
0f0660d
72bc789
1991a02
c3437b1
1a79f0d
b44313f
de3ddb5
738b3ea
45f909e
866abff
5eea41b
7e9c38d
bff8130
7135da7
6bd46e7
b359e3c
f0ec68c
39498dd
cb3106c
f965f65
3548ffb
9181eb2
d1eb10a
674a424
3411b9c
8bae2ec
2307849
d0b7c74
916ed49
86b4f49
8f40f93
5c42a0e
c7354c5
0bb5ac0
fccc5b6
676c599
8b163cd
400ae6e
63f9c27
3137c10
9dacc20
d63b854
4b04b29
d6ba12e
1a521a4
59e2e43
008a66d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
"build-assets": "node ./scripts/build-assets.mjs", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コード改善点 (Uncle Bob 風)
|
||
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets", | ||
"build-storybook": "pnpm --filter frontend build-storybook", | ||
"build-misskey-js-with-types": "pnpm build-pre && pnpm --filter backend... --filter=!misskey-js build && pnpm --filter backend generate-api-json && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api", | ||
"build-misskey-js-with-types": "pnpm build-pre && pnpm --filter backend... --filter=!misskey-js build && pnpm --filter backend generate-api-json --no-build && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api", | ||
"start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js", | ||
"start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js", | ||
"init": "pnpm migrate", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
"test:e2e": "pnpm build && pnpm build:test && pnpm jest:e2e", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コード改善点 (Uncle Bob スタイル)
|
||
"test-and-coverage": "pnpm jest-and-coverage", | ||
"test-and-coverage:e2e": "pnpm build && pnpm build:test && pnpm jest-and-coverage:e2e", | ||
"generate-api-json": "pnpm build && node ./scripts/generate_api_json.js" | ||
"generate-api-json": "node ./scripts/generate_api_json.js" | ||
}, | ||
"optionalDependencies": { | ||
"@swc/core-android-arm64": "1.3.11", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,34 @@ | |
* SPDX-License-Identifier: AGPL-3.0-only | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コード改善点 (Uncle Bob 風)
|
||
*/ | ||
|
||
import { loadConfig } from '../built/config.js' | ||
import { genOpenapiSpec } from '../built/server/api/openapi/gen-spec.js' | ||
import { writeFileSync } from "node:fs"; | ||
import { execa } from 'execa'; | ||
import { writeFileSync, existsSync } from "node:fs"; | ||
|
||
const config = loadConfig(); | ||
const spec = genOpenapiSpec(config, true); | ||
async function main() { | ||
if (!process.argv.includes('--no-build')) { | ||
await execa('pnpm', ['run', 'build'], { | ||
stdout: process.stdout, | ||
stderr: process.stderr, | ||
}); | ||
} | ||
|
||
writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8'); | ||
if (!existsSync('./built')) { | ||
throw new Error('`built` directory does not exist.'); | ||
} | ||
|
||
/** @type {import('../src/config.js')} */ | ||
const { loadConfig } = await import('../built/config.js'); | ||
|
||
/** @type {import('../src/server/api/openapi/gen-spec.js')} */ | ||
const { genOpenapiSpec } = await import('../built/server/api/openapi/gen-spec.js'); | ||
|
||
const config = loadConfig(); | ||
const spec = genOpenapiSpec(config, true); | ||
|
||
writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8'); | ||
} | ||
|
||
main().catch(e => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,22 +24,23 @@ export type MkSystemWebhookResult = { | |
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コード改善点 (Uncle Bob 風)
|
||
|
||
export async function showSystemWebhookEditorDialog(props: MkSystemWebhookEditorProps): Promise<MkSystemWebhookResult | null> { | ||
const { dispose, result } = await new Promise<{ dispose: () => void, result: MkSystemWebhookResult | null }>(async resolve => { | ||
const { dispose: _dispose } = os.popup( | ||
const { result } = await new Promise<{ result: MkSystemWebhookResult | null }>(async resolve => { | ||
const { dispose } = os.popup( | ||
defineAsyncComponent(() => import('@/components/MkSystemWebhookEditor.vue')), | ||
props, | ||
{ | ||
submitted: (ev: MkSystemWebhookResult) => { | ||
resolve({ dispose: _dispose, result: ev }); | ||
resolve({ result: ev }); | ||
}, | ||
canceled: () => { | ||
resolve({ result: null }); | ||
}, | ||
closed: () => { | ||
resolve({ dispose: _dispose, result: null }); | ||
dispose(); | ||
}, | ||
}, | ||
); | ||
}); | ||
|
||
dispose(); | ||
|
||
return result; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,15 @@ SPDX-License-Identifier: AGPL-3.0-only | |
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コード改善点 (Uncle Bob風に)
|
||
<template> | ||
<MkModalWindow | ||
ref="dialogEl" | ||
:width="450" | ||
:height="590" | ||
:canClose="true" | ||
:withOkButton="false" | ||
:okButtonDisabled="false" | ||
@click="onCancelClicked" | ||
@close="onCancelClicked" | ||
@closed="onCancelClicked" | ||
@closed="emit('closed')" | ||
> | ||
<template #header> | ||
{{ mode === 'create' ? i18n.ts._webhookSettings.createWebhook : i18n.ts._webhookSettings.modifyWebhook }} | ||
|
@@ -59,8 +60,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed, onMounted, ref, toRefs } from 'vue'; | ||
import FormSection from '@/components/form/section.vue'; | ||
import { computed, onMounted, ref, shallowRef, toRefs } from 'vue'; | ||
import MkInput from '@/components/MkInput.vue'; | ||
import MkSwitch from '@/components/MkSwitch.vue'; | ||
import { | ||
|
@@ -82,9 +82,12 @@ type EventType = { | |
|
||
const emit = defineEmits<{ | ||
(ev: 'submitted', result: MkSystemWebhookResult): void; | ||
(ev: 'canceled'): void; | ||
(ev: 'closed'): void; | ||
}>(); | ||
|
||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>(); | ||
|
||
const props = defineProps<MkSystemWebhookEditorProps>(); | ||
|
||
const { mode, id, requiredEvents } = toRefs(props); | ||
|
@@ -133,12 +136,14 @@ async function onSubmitClicked() { | |
switch (mode.value) { | ||
case 'create': { | ||
const result = await misskeyApi('admin/system-webhook/create', params); | ||
dialogEl.value?.close(); | ||
emit('submitted', result); | ||
break; | ||
} | ||
case 'edit': { | ||
// eslint-disable-next-line | ||
const result = await misskeyApi('admin/system-webhook/update', { id: id.value!, ...params }); | ||
dialogEl.value?.close(); | ||
emit('submitted', result); | ||
break; | ||
} | ||
|
@@ -147,13 +152,15 @@ async function onSubmitClicked() { | |
} catch (ex: any) { | ||
const msg = ex.message ?? i18n.ts.internalServerErrorDescription; | ||
await os.alert({ type: 'error', title: i18n.ts.error, text: msg }); | ||
emit('closed'); | ||
dialogEl.value?.close(); | ||
emit('canceled'); | ||
} | ||
}); | ||
} | ||
|
||
function onCancelClicked() { | ||
emit('closed'); | ||
dialogEl.value?.close(); | ||
emit('canceled'); | ||
} | ||
|
||
async function loadingScope<T>(fn: () => Promise<T>): Promise<T> { | ||
|
@@ -183,11 +190,12 @@ onMounted(async () => { | |
for (const ev of Object.keys(events.value)) { | ||
events.value[ev] = res.on.includes(ev as SystemWebhookEventType); | ||
} | ||
// eslint-disable-next-line | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} catch (ex: any) { | ||
const msg = ex.message ?? i18n.ts.internalServerErrorDescription; | ||
await os.alert({ type: 'error', title: i18n.ts.error, text: msg }); | ||
emit('closed'); | ||
dialogEl.value?.close(); | ||
emit('canceled'); | ||
} | ||
break; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only | |
</template> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. コード改善点 (Uncle Bob風)
|
||
|
||
<script lang="ts" setup> | ||
import { onMounted, ref } from 'vue'; | ||
import { onMounted, ref, shallowRef } from 'vue'; | ||
import * as Misskey from 'misskey-js'; | ||
import MkInput from '@/components/MkInput.vue'; | ||
import FormSplit from '@/components/form/split.vue'; | ||
|
@@ -91,7 +91,7 @@ const host = ref(''); | |
const users = ref<Misskey.entities.UserLite[]>([]); | ||
const recentUsers = ref<Misskey.entities.UserDetailed[]>([]); | ||
const selected = ref<Misskey.entities.UserLite | null>(null); | ||
const dialogEl = ref(); | ||
const dialogEl = shallowRef<InstanceType<typeof MkModalWindow>>(); | ||
|
||
function search() { | ||
if (username.value === '' && host.value === '') { | ||
|
@@ -122,7 +122,7 @@ async function ok() { | |
}); | ||
emit('ok', user); | ||
|
||
dialogEl.value.close(); | ||
dialogEl.value?.close(); | ||
|
||
// 最近使ったユーザー更新 | ||
let recents = defaultStore.state.recentlyUsedUsers; | ||
|
@@ -133,7 +133,7 @@ async function ok() { | |
|
||
function cancel() { | ||
emit('cancel'); | ||
dialogEl.value.close(); | ||
dialogEl.value?.close(); | ||
} | ||
|
||
onMounted(() => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コード改善点
**Note**
や**Warning**
を[!NOTE]
や[!WARNING]
に統一することで、可読性と視覚的な一貫性を向上させましょう。