Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit d233e87

Browse files
committed
refactor: update imports and improve TypeScript configuration
- Changed TypeScript imports in multiple components to use the correct paths, enhancing code clarity and maintainability. - Updated the TypeScript configuration settings in the FunctionCodeEditor component to align with the latest monaco-editor API. These changes aim to streamline the codebase and ensure compatibility with the updated TypeScript features. Signed-off-by: Innei <tukon479@gmail.com>
1 parent cb0f0ae commit d233e87

8 files changed

Lines changed: 18 additions & 31 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@
127127
"vite-tsconfig-paths": "6.0.5"
128128
},
129129
"packageManager": "pnpm@10.28.2"
130-
}
130+
}

src/components/function-editor/index.tsx

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,19 @@ export const FunctionCodeEditor = defineComponent({
5454
onMounted(() => {
5555
import('monaco-editor').then((monaco) => {
5656
const compilerOptions =
57-
monaco.languages.typescript.typescriptDefaults.getCompilerOptions()
58-
compilerOptions.target = monaco.languages.typescript.ScriptTarget.ESNext
57+
monaco.typescript.typescriptDefaults.getCompilerOptions()
58+
compilerOptions.target = monaco.typescript.ScriptTarget.ESNext
5959
compilerOptions.allowNonTsExtensions = true
6060
compilerOptions.moduleResolution =
61-
monaco.languages.typescript.ModuleResolutionKind.NodeJs
61+
monaco.typescript.ModuleResolutionKind.NodeJs
6262
compilerOptions.esModuleInterop = true
6363

64-
monaco.languages.typescript.typescriptDefaults.setCompilerOptions(
65-
compilerOptions,
66-
)
64+
monaco.typescript.typescriptDefaults.setCompilerOptions(compilerOptions)
6765

6866
const libUri = 'ts:filename/global.d.ts'
6967
if (!monaco.editor.getModel(monaco.Uri.parse(libUri))) {
7068
systemApi.getFnTypes().then((libSource) => {
71-
monaco.languages.typescript.typescriptDefaults.addExtraLib(
72-
libSource,
73-
libUri,
74-
)
69+
monaco.typescript.typescriptDefaults.addExtraLib(libSource, libUri)
7570
// When resolving definitions and references, the editor will try to use created models.
7671
// Creating a model for the library allows "peek definition/references" commands to work with the library.
7772
monaco.editor.createModel(
@@ -94,10 +89,7 @@ export const FunctionCodeEditor = defineComponent({
9489
return
9590
}
9691

97-
monaco.languages.typescript.typescriptDefaults.addExtraLib(
98-
libSource,
99-
libUri,
100-
)
92+
monaco.typescript.typescriptDefaults.addExtraLib(libSource, libUri)
10193
// When resolving definitions and references, the editor will try to use created models.
10294
// Creating a model for the library allows "peek definition/references" commands to work with the library.
10395
monaco.editor.createModel(
@@ -110,10 +102,7 @@ export const FunctionCodeEditor = defineComponent({
110102
for (const libUri in NodeDeclare) {
111103
const libSource = NodeDeclare[libUri]
112104

113-
monaco.languages.typescript.typescriptDefaults.addExtraLib(
114-
libSource,
115-
libUri,
116-
)
105+
monaco.typescript.typescriptDefaults.addExtraLib(libSource, libUri)
117106

118107
monaco.editor.createModel(
119108
libSource,

src/hooks/use-memo-fetch-data-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { nextTick, ref } from 'vue'
2-
import type { PaginateResult } from '@mx-space/api-client'
2+
import type { PaginateResult } from '~/models/base'
33
import type { Ref } from 'vue'
44

55
import { createGlobalState } from '@vueuse/core'

src/utils/authn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { toast } from 'vue-sonner'
22
import type {
33
AuthenticationResponseJSON,
44
RegistrationResponseJSON,
5-
} from '@simplewebauthn/types'
5+
} from '@simplewebauthn/browser'
66

77
import { startAuthentication, startRegistration } from '@simplewebauthn/browser'
88

src/views/analyze/components/guest-activity.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ import {
1818
watch,
1919
} from 'vue'
2020
import { useRoute } from 'vue-router'
21-
import type {
22-
NoteModel,
23-
PageModel,
24-
PostModel,
25-
RecentlyModel,
26-
} from '@mx-space/api-client'
2721
import type { fetchDataFn } from '~/hooks/use-table'
2822
import type { ActivityReadDurationType } from '~/models/activity'
2923
import type { Pager } from '~/models/base'
24+
import type { NoteModel } from '~/models/note'
25+
import type { PageModel } from '~/models/page'
26+
import type { PostModel } from '~/models/post'
27+
import type { RecentlyModel } from '~/models/recently'
3028
import type { PropType, Ref } from 'vue'
3129

3230
import { activityApi } from '~/api/activity'

src/views/debug/authn/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { toast } from 'vue-sonner'
44
import type {
55
AuthenticationResponseJSON,
66
RegistrationResponseJSON,
7-
} from '@simplewebauthn/types'
7+
} from '@simplewebauthn/browser'
88

99
import { startAuthentication, startRegistration } from '@simplewebauthn/browser'
1010

src/views/maintenance/backup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
Upload,
1212
} from 'lucide-vue-next'
1313
import { NButton, NCheckbox, NPopconfirm, NSpin } from 'naive-ui'
14-
import { computed, defineComponent, onMounted, ref, watchEffect } from 'vue'
14+
import { computed, defineComponent, onMounted, ref } from 'vue'
1515
import { toast } from 'vue-sonner'
1616
import type { PropType } from 'vue'
1717

@@ -189,7 +189,7 @@ export default defineComponent({
189189
}
190190
}
191191

192-
watchEffect(() => {
192+
onMounted(() => {
193193
setActions(
194194
<>
195195
<DeleteConfirmButton

src/views/manage-notes/hooks/use-memo-note-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { NoteModel } from '@mx-space/api-client'
1+
import type { NoteModel } from '~/models/note'
22

33
import { notesApi } from '~/api'
44
import { createMemoDataListFetchHook } from '~/hooks/use-memo-fetch-data-list'

0 commit comments

Comments
 (0)