Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
feat: format import
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Aug 6, 2023
1 parent eab3846 commit 4cd2902
Show file tree
Hide file tree
Showing 41 changed files with 260 additions and 148 deletions.
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
out
res
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"semi": false,
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "none",

"importOrder": ["^(?!@/).*(?<!\\.vue)$", "(?<!\\.vue)$", ""],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,

"plugins": ["@trivago/prettier-plugin-sort-imports"]
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
91 changes: 89 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"vue": "^3.3.4"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@tsconfig/node18": "^18.2.0",
"@types/node": "^18.17.0",
"@vicons/material": "^0.12.0",
Expand Down
4 changes: 2 additions & 2 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
autoprefixer: {}
}
}
4 changes: 2 additions & 2 deletions server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { format } from 'date-fns'
import express, { json } from 'express'
import fs from 'fs/promises'
import multer, { memoryStorage } from 'multer'
import path from 'path'
import fs from 'fs/promises'
import { format } from 'date-fns'

async function main() {
const config = JSON.parse(await fs.readFile('config.json', 'utf-8')) as {
Expand Down
26 changes: 14 additions & 12 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { NButton, NCard, NIcon } from 'naive-ui'
import { active } from './data'
import { getTask, setTask } from './data/task'
import { history } from './history'
import { loadFS, saveFS } from './loader'
import {
NavigateBeforeOutlined,
NavigateNextOutlined,
FileDownloadOutlined,
FileUploadOutlined,
UndoOutlined,
RedoOutlined
NavigateBeforeOutlined,
NavigateNextOutlined,
RedoOutlined,
UndoOutlined
} from '@vicons/material'
import { active, navigate, type TaskData } from './data'
import TaskEdit from '@/components/TaskEdit.vue'
import TaskTree from '@/components/TaskTree.vue'
import { history } from './history'
import { loadFS, saveFS } from './loader'
import { getTask, setTask } from './data/task'
import { produce } from 'immer'
import { NButton, NCard, NIcon } from 'naive-ui'
import { computed, onMounted, ref } from 'vue'
import { fs } from '@/data/fs'
import TaskEdit from '@/components/TaskEdit.vue'
import TaskTree from '@/components/TaskTree.vue'
const expands = ref<string[]>(['root.'])
onMounted(async () => {
Expand Down
5 changes: 3 additions & 2 deletions src/Wrapper.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { NConfigProvider, NDialogProvider } from 'naive-ui'
import App from './App.vue'
import hljs from 'highlight.js/lib/core'
import hljs_json from 'highlight.js/lib/languages/json'
import { NConfigProvider, NDialogProvider } from 'naive-ui'
import App from './App.vue'
hljs.registerLanguage('json', hljs_json)
</script>
Expand Down
12 changes: 7 additions & 5 deletions src/components/ActionEdit.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<script setup lang="ts">
import { NSelect, NInput } from 'naive-ui'
import { NInput, NSelect } from 'naive-ui'
import { computed } from 'vue'
import { type Task } from '@/types'
import ClearButton from './ClearButton.vue'
import JsonEdit from './JsonEdit.vue'
import { type UseProducer, applyEditOn, updateEditOn } from '@/persis'
import type { Task } from '@/types'
import SingleStringEdit from './SingleStringEdit.vue'
import TargetEdit from './TargetEdit.vue'
import { type UseProducer, updateEditOn, applyEditOn } from '@/persis'
import ClearButton from '@/components/atomic/ClearButton.vue'
import JsonEdit from '@/components/atomic/JsonEdit.vue'
const props = defineProps<{
value: Task
Expand Down
3 changes: 2 additions & 1 deletion src/components/NavigateEdit.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { navigate } from '@/data'
import type { UseProducer } from '@/persis'
import SingleArrayEdit from './SingleArrayEdit.vue'
import SingleNavigateEdit from './SingleNavigateEdit.vue'
import { navigate } from '@/data'
type T = string | string[] | null
Expand Down
18 changes: 10 additions & 8 deletions src/components/RecognizerEdit.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script setup lang="ts">
import { NSelect, NButton, NSwitch, NInput } from 'naive-ui'
import { computed, type Ref } from 'vue'
import { type Task, type Rect, type TextRepl } from '@/types'
import ClearButton from './ClearButton.vue'
import { NInput, NSelect, NSwitch } from 'naive-ui'
import { computed } from 'vue'
import { type UseProducer, applyEditOn, updateEditOn } from '@/persis'
import type { Rect, Task, TextRepl } from '@/types'
import SingleArrayEdit from './SingleArrayEdit.vue'
import RectEdit from './RectEdit.vue'
import TemplateEdit from './TemplateEdit.vue'
import StringArrayEdit from './StringArrayEdit.vue'
import JsonEdit from './JsonEdit.vue'
import { applyEditOn, type UseProducer, updateEditOn } from '@/persis'
import TemplateEdit from './TemplateEdit.vue'
import ClearButton from '@/components/atomic/ClearButton.vue'
import JsonEdit from '@/components/atomic/JsonEdit.vue'
import RectEdit from '@/components/atomic/RectEdit.vue'
const props = defineProps<{
value: Task
Expand Down
14 changes: 8 additions & 6 deletions src/components/SingleArrayEdit.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<script setup lang="ts" generic="T">
import { AddOutlined, DeleteOutlined } from '@vicons/material'
import { produce } from 'immer'
import { NButton, NIcon } from 'naive-ui'
import { DeleteOutlined, AddOutlined } from '@vicons/material'
import { computed, ref } from 'vue'
import SingleArrayButton from './SingleArrayButton.vue'
import { computed } from 'vue'
import type { UseProducer } from '@/persis'
import { produce } from 'immer'
import SwitchButton from '@/components/array/SwitchButton.vue'
type U = T | T[] | null
Expand Down Expand Up @@ -119,10 +121,10 @@ function remove(idx: number) {
<template>
<div class="flex flex-col gap-2">
<div class="flex gap-2">
<SingleArrayButton
<SwitchButton
v-if="type === 'both'"
v-model:value="single"
></SingleArrayButton>
></SwitchButton>
<NButton :disabled="single && value !== null" @click="add">
<template #icon>
<NIcon>
Expand Down
1 change: 1 addition & 0 deletions src/components/SingleEdit.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts" generic="T">
import type { UseProducer } from '@/persis'
import SingleArrayEdit from './SingleArrayEdit.vue'
type U = T | T[] | null
Expand Down
18 changes: 10 additions & 8 deletions src/components/SingleNavigateEdit.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<script setup lang="ts">
import { NButton, NIcon, NAutoComplete, NPopover } from 'naive-ui'
import { computed } from 'vue'
import {
MovingOutlined,
WavingHandOutlined,
AdsClickOutlined,
MovingOutlined,
SwipeRightOutlined,
TranslateOutlined
TranslateOutlined,
WavingHandOutlined
} from '@vicons/material'
import ImageHover from './ImageHover.vue'
import type { UseProducer } from '@/persis'
import { getTask, taskIndex } from '@/data/task'
import { NAutoComplete, NButton, NIcon, NPopover } from 'naive-ui'
import { computed } from 'vue'
import { navigate } from '@/data'
import { getTask, taskIndex } from '@/data/task'
import type { UseProducer } from '@/persis'
import ImageHover from '@/components/atomic/ImageHover.vue'
type T = string
Expand Down
4 changes: 3 additions & 1 deletion src/components/SingleStringEdit.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { NInput } from 'naive-ui'
import { type UseProducer, updateEdit } from '@/persis'
import SingleArrayEdit from './SingleArrayEdit.vue'
import { updateEdit, type UseProducer } from '@/persis'
type T = string | string[] | null
type V = string | null
Expand Down
3 changes: 2 additions & 1 deletion src/components/SingleTemplateEdit.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { NAutoComplete } from 'naive-ui'
import { computed } from 'vue'
import type { UseProducer } from '@/persis'
import { imgIndex } from '@/data/image'
import type { UseProducer } from '@/persis'
const props = defineProps<{
value: string
Expand Down
4 changes: 3 additions & 1 deletion src/components/StringArrayEdit.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { NInput } from 'naive-ui'
import { type UseProducer, updateEdit } from '@/persis'
import SingleArrayEdit from './SingleArrayEdit.vue'
import { updateEdit, type UseProducer } from '@/persis'
type T = string | string[] | null
Expand Down
Loading

0 comments on commit 4cd2902

Please sign in to comment.