Skip to content

Commit

Permalink
auto expand rime and opencc in file manager
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed May 19, 2023
1 parent caacd41 commit c131411
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 19 deletions.
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@
"@codemirror/legacy-modes": "^6.3.2",
"@libreservice/my-widget": "^0.1.2",
"@libreservice/my-worker": "^0.4.0",
"@libreservice/wasm-code": "^0.1.0",
"@playwright/test": "^1.32.3",
"@libreservice/wasm-code": "^0.1.1",
"@playwright/test": "1.32.3",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-replace": "^5.0.2",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"@vicons/fa": "^0.12.0",
"@vicons/fluent": "^0.12.0",
"@vitejs/plugin-vue": "^4.1.0",
"@vitejs/plugin-vue": "^4.2.3",
"emoji-regex": "^10.2.1",
"esbuild": "^0.17.17",
"eslint": "^8.38.0",
"esbuild": "^0.17.19",
"eslint": "^8.40.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-vue": "^9.11.0",
"eslint-plugin-vue": "^9.13.0",
"idb": "^7.1.1",
"js-yaml": "^4.1.0",
"naive-ui": "^2.34.3",
"playwright": "^1.32.3",
"rollup": "^3.20.6",
"playwright": "1.32.3",
"rollup": "^3.22.0",
"rollup-plugin-esbuild": "^5.0.0",
"textarea-caret": "^3.1.0",
"tslib": "^2.5.0",
"tslib": "^2.5.1",
"typescript": "^5.0.4",
"vite": "^4.2.2",
"vite": "^4.3.8",
"vite-plugin-pwa": "^0.14.7",
"vite-plugin-run": "^0.4.1",
"vooks": "^0.2.12",
"vue": "^3.2.47",
"vue-router": "^4.1.6",
"vue-tsc": "^1.2.0"
"vue": "^3.3.4",
"vue-router": "^4.2.1",
"vue-tsc": "^1.6.5"
}
}
16 changes: 15 additions & 1 deletion src/components/MyEditor.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { toRaw } from 'vue'
import { ref, toRaw, onMounted } from 'vue'
import { NButton, useNotification } from 'naive-ui'
import { json } from '@codemirror/legacy-modes/mode/javascript'
import { lua } from '@codemirror/legacy-modes/mode/lua'
Expand Down Expand Up @@ -75,6 +75,19 @@ worker.control('deployStatus', async (status: 'start' | 'failure' | 'success', s
break
}
})
const wc = ref<InstanceType<typeof WasmCode>>()
onMounted(() => {
[
'/',
'/rime/',
'/usr/',
'/usr/local/',
'/usr/local/share/',
'/usr/local/share/opencc/'
].forEach(wc.value!.expandFolder)
})
</script>

<template>
Expand All @@ -87,6 +100,7 @@ worker.control('deployStatus', async (status: 'start' | 'failure' | 'success', s
Deploy
</n-button>
<wasm-code
ref="wc"
:fs="FS"
height="80vh"
:lang-parser-map="langParserMap"
Expand Down
6 changes: 4 additions & 2 deletions test/test-advanced.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ test('Debug', async ({ page }) => {
await debugInput.fill('{Page_Down}')
await page.keyboard.press('Enter')
await expect(item(page, '1 等')).toBeVisible()

for (const name of ['rime', 'opencc']) {
await expect(page.locator('.n-tree').getByText(name, { exact: true })).toBeVisible()
}
})

test('Advanced', async ({ page }) => {
Expand Down Expand Up @@ -80,7 +84,6 @@ test('Deploy', async ({ page }) => {
await deploy(page)
await expect(page.getByText('Deployment failed')).toBeVisible()

await page.getByText('/', { exact: true }).click()
await page.getByText('rime', { exact: true }).click({
button: 'right'
})
Expand All @@ -98,7 +101,6 @@ test('Deploy', async ({ page }) => {
await page.locator('.n-dialog .n-button').getByText('Upload').click()

const content = page.locator('.cm-content')
await page.getByText('rime', { exact: true }).click()
await page.getByText('default.yaml', { exact: true }).click()
await content.click()
await page.keyboard.press('Control+f')
Expand Down

0 comments on commit c131411

Please sign in to comment.