Skip to content

Commit fc6707c

Browse files
authored
refactor: remove unused (#23)
1 parent e1b7d6d commit fc6707c

File tree

17 files changed

+16
-92
lines changed

17 files changed

+16
-92
lines changed

packages/cli/src/commands/dev/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { createServer } from 'vite'
44
import { resolve } from 'path'
55
import { startHMRServer } from './websocket'
66

7-
const WSS_FALLBACK_PORT = Number(process.env.PORT) || 3000
8-
97
export async function runDevServer(entryFile: string = 'src/main.ts') {
108
const server = await createServer({
119
logLevel: 'error',
@@ -49,14 +47,8 @@ export async function runDevServer(entryFile: string = 'src/main.ts') {
4947
}
5048

5149
const hotModulesMap = new Map<string, HotModule>()
52-
const disposeMap = new Map<string, (data: any) => void | Promise<void>>()
5350
const pruneMap = new Map<string, (data: any) => void | Promise<void>>()
5451
const dataMap = new Map<string, any>()
55-
const customListenersMap = new Map<string, ((data: any) => void)[]>()
56-
const ctxToListenersMap = new Map<
57-
string,
58-
Map<string, ((data: any) => void)[]>
59-
>()
6052

6153
function createHotContext(ownerPath: string) {
6254
const fullPath = resolve('.' + ownerPath)

packages/core/src/components/App.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
useRootNode,
2020
} from '../injectionSymbols'
2121
import { stdoutSymbol } from '../composables/writeStreams'
22-
import { onResize } from '../composables/screen'
2322
// TODO: useSettings()
2423

2524
export const TuiApp = defineComponent({

packages/core/src/components/TextTransform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import chalk, { ForegroundColor } from 'chalk'
1+
import chalk from 'chalk'
22
import { h, inject, FunctionalComponent } from '@vue/runtime-core'
33
import { scheduleUpdateSymbol } from '../injectionSymbols'
44
import type { OutputTransformer } from '../renderer/Output'

packages/core/src/composables/keyboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
KeyDataEventKey,
77
KeyDataEventRawHandlerFn,
88
} from '../input/types'
9-
import { checkCurrentInstance, LiteralUnion, noop } from '../utils'
9+
import { checkCurrentInstance, noop } from '../utils'
1010

1111
export type RemoveListener = () => void
1212

packages/core/src/composables/utils.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { onMounted, onUnmounted, ref } from '@vue/runtime-core'
1+
import { onMounted, onUnmounted } from '@vue/runtime-core'
22

33
export function useInterval(fn: () => void, interval?: number) {
44
let handle: ReturnType<typeof setInterval>
@@ -26,18 +26,3 @@ export function useTimeout(fn: () => void, delay?: number) {
2626
clearTimeout(handle)
2727
})
2828
}
29-
30-
function useTimeFunction<RT = any>(
31-
fn: (cb: () => void, time?: number) => RT,
32-
clear: (id?: RT) => void
33-
) {
34-
return (cb: () => void, time?: number) => {
35-
let handle: RT
36-
onMounted(() => {
37-
handle = fn(cb, time)
38-
})
39-
onUnmounted(() => {
40-
clear(handle)
41-
})
42-
}
43-
}

packages/core/src/focus/FocusManager.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { createFocusManager } from './FocusManager'
2-
import { DOMElement, DOMNode, TextNode, CommentNode } from '../renderer/dom'
2+
import { DOMElement, DOMNode, TextNode } from '../renderer/dom'
33
import {
44
ComponentInternalInstance,
55
VNode,
66
ref,
77
ComputedRef,
8-
h,
98
} from '@vue/runtime-core'
109
import { Focusable } from './types'
1110

packages/core/src/focus/FocusManager.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
ComponentInternalInstance,
32
inject,
43
InjectionKey,
54
ShallowRef,
@@ -11,10 +10,9 @@ import {
1110
previousDeepSibling,
1211
nextDeepSibling,
1312
} from '../renderer/nodeOpts'
14-
import { DOMElement, DOMNode, isDOMElement } from '../renderer/dom'
13+
import { DOMElement, DOMNode } from '../renderer/dom'
1514
import { checkCurrentInstance, getElementFromInstance, noop } from '../utils'
1615
import { Focusable, FocusId } from './types'
17-
import { indentHTML } from '../utils/indentHTML'
1816

1917
export interface FocusManager {
2018
activeElement: ShallowRef<Focusable | null | undefined>

packages/core/src/index.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import cliTruncate from 'cli-truncate'
2-
import sliceAnsi from 'slice-ansi'
31
import {
42
createApp,
53
defineComponent,

packages/core/src/input/inputSequences.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { inputDataToString } from './debug'
21
import { defineKeypressEvent, defineMouseEvent } from './keyEvents'
32
import {
43
KeyDataEventKeyCode,
@@ -52,13 +51,6 @@ const MOUSE_SEQ_START = '\x1b[M' // Mouse click
5251
const MOUSE_ENCODE_OFFSET = 32 // mouse values are encoded as numeric values + 040 (32 in octal)
5352
const MOUSE_EXTENDED_SEQ_START = '\x1b[<' // Ends with M/m
5453

55-
const enum InputSequenceParserState {
56-
xterm,
57-
vt_keycode_and_modifier,
58-
vt_keycode_drop,
59-
vt_modifier_end_letter,
60-
}
61-
6254
type CSISeqParsed = Array<string | number>
6355

6456
type MouseExtendedCSISeq = [number, number, number, string]

packages/core/src/input/types.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,6 @@ export type KeyDataEventKeyCode =
158158
*/
159159
export type KeyDataEventKey = LiteralUnion<KeyDataEventKeyCode, string>
160160

161-
function defineKeypressEvent(
162-
key: KeyDataEventKeyCode,
163-
modifiers?: Partial<_InputDataEventModifiers>
164-
): KeyDataEvent {
165-
return {
166-
key,
167-
altKey: false,
168-
shiftKey: false,
169-
ctrlKey: false,
170-
metaKey: false,
171-
...modifiers,
172-
}
173-
}
174-
175161
export const enum MouseEventButton {
176162
/**
177163
* Also known as `main`.

0 commit comments

Comments
 (0)