Skip to content

Commit a137a20

Browse files
committed
[vue3] publish 3.3.1
1 parent ebbb4c7 commit a137a20

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ dist-ssr
3434
stats.html
3535
/docs/
3636
/docs/.vuepress/
37-
pnpm-lock.yaml
37+
pnpm-lock.yaml
38+
/yarn.lock

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-web-terminal",
3-
"version": "3.3.1-rc.0",
3+
"version": "3.3.1",
44
"description": "A beautiful web-side command line window plugin (native simulation). 一个漂亮的网页命令行插件(原生模拟)",
55
"license": "Apache-2.0",
66
"private": false,

publish.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ def execute(command, with_result = False,encoding = ENCODING):
1818
else:
1919
raise Exception(f"exit with {p.returncode}, stderr: {stderr}")
2020
else:
21-
subprocess.call(command, shell=True, encoding=encoding)
21+
returncode = subprocess.call(command, shell=True, encoding=encoding)
22+
if returncode != 0:
23+
raise Exception(f"exit with {returncode}")
2224

2325
if __name__ == '__main__':
2426
registry = execute(f'npm config get registry', with_result=True)
2527
node_version = execute(f'node -v', with_result=True)
28+
if not node_version.startswith(f'v{NODE_VERSION}'):
29+
raise Exception(f'Node version must be {NODE_VERSION}')
2630
try:
27-
execute(f'nvm use {NODE_VERSION}')
2831
execute(f'pnpm install')
2932
execute(f'pnpm run build')
3033
execute(f'npm config set registry {NPM_REPOSITORY}')
3134
execute(f'npm publish')
3235
finally:
33-
execute(f'nvm use {node_version}')
34-
execute(f'npm config set registry {registry}')
36+
execute(f'npm config set registry {registry}')

src/Terminal.vue

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const props = defineProps({
117117
commandFormatter: Function as PropType<CommandFormatterFunc>,
118118
// 滚动条滚动模式
119119
scrollMode: {
120-
type: String,
120+
type: String as PropType<ScrollBehavior>,
121121
default: 'smooth'
122122
},
123123
// 在 push 消息之前触发的钩子函数,只能对message对象的属性进行修改
@@ -285,23 +285,23 @@ const tips = reactive({
285285
})
286286
287287
// references
288-
const terminalContainerRef = ref<HTMLDivElement>(null)
289-
const terminalHeaderRef = ref<HTMLDivElement>(null)
290-
const terminalWindowRef = ref<HTMLDivElement>(null)
291-
const terminalCmdInputRef = ref<HTMLInputElement>(null)
292-
const terminalAskInputRef = ref<HTMLInputElement>(null)
293-
const terminalInputBoxRef = ref<HTMLParagraphElement>(null)
294-
const terminalInputPromptRef = ref<HTMLSpanElement>(null)
295-
const terminalEnFlagRef = ref<HTMLSpanElement>(null)
296-
const terminalCnFlagRef = ref<HTMLSpanElement>(null)
297-
const terminalTextEditorRef = ref<InstanceType<TEditor>>(null)
298-
const terminalCursorRef = ref<HTMLSpanElement>(null)
299-
const terminalHelpBoxRef = ref<InstanceType<THelpBox>>(null)
300-
const resizeLTRef = ref<HTMLDivElement>(null)
301-
const resizeRTRef = ref<HTMLDivElement>(null)
302-
const resizeLBRef = ref<HTMLDivElement>(null)
303-
const resizeRBRef = ref<HTMLDivElement>(null)
304-
const terminalCmdTipsRef = ref<HTMLSpanElement>(null)
288+
const terminalContainerRef = ref(null)
289+
const terminalHeaderRef = ref(null)
290+
const terminalWindowRef = ref(null)
291+
const terminalCmdInputRef = ref(null)
292+
const terminalAskInputRef = ref(null)
293+
const terminalInputBoxRef = ref(null)
294+
const terminalInputPromptRef = ref(null)
295+
const terminalEnFlagRef = ref(null)
296+
const terminalCnFlagRef = ref(null)
297+
const terminalTextEditorRef = ref<InstanceType<typeof TEditor>>(null)
298+
const terminalCursorRef = ref(null)
299+
const terminalHelpBoxRef = ref<InstanceType<typeof THelpBox>>(null)
300+
const resizeLTRef = ref(null)
301+
const resizeRTRef = ref(null)
302+
const resizeLBRef = ref(null)
303+
const resizeRBRef = ref(null)
304+
const terminalCmdTipsRef = ref(null)
305305
306306
// listeners
307307
const clickListener = ref()
@@ -872,6 +872,7 @@ const _focus = (enforceFocus?: boolean | MouseEvent) => {
872872
input = terminalAskInputRef.value
873873
cursorConf.show = false
874874
} else if (textEditor.open) {
875+
// @ts-ignore
875876
input = terminalTextEditorRef.value
876877
cursorConf.show = false
877878
} else {

0 commit comments

Comments
 (0)