update project config to match official create vue recommendations
This commit is contained in:
18
.eslintrc.cjs
Normal file
18
.eslintrc.cjs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/* eslint-env node */
|
||||||
|
require('@rushstack/eslint-patch/modern-module-resolution')
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
'extends': [
|
||||||
|
'plugin:vue/vue3-essential',
|
||||||
|
'eslint:recommended',
|
||||||
|
'@vue/eslint-config-typescript',
|
||||||
|
'@vue/eslint-config-prettier/skip-formatting'
|
||||||
|
],
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 'latest'
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'vue/multi-word-component-names': 'off'
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
{
|
{
|
||||||
"tabWidth": 2,
|
"$schema": "https://json.schemastore.org/prettierrc",
|
||||||
"useTabs": false,
|
|
||||||
"semi": false,
|
"semi": false,
|
||||||
|
"tabWidth": 2,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"printWidth": 88,
|
"printWidth": 100,
|
||||||
|
"trailingComma": "none",
|
||||||
"htmlWhitespaceSensitivity": "ignore",
|
"htmlWhitespaceSensitivity": "ignore",
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"prettier-plugin-tailwindcss"
|
"prettier-plugin-tailwindcss"
|
||||||
4569
package-lock.json
generated
4569
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@@ -1,12 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "contexted-v3",
|
"name": "contexted-v3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.1.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vue-tsc && vite build",
|
"build": "run-p type-check build-only",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview",
|
||||||
|
"build-only": "vite build",
|
||||||
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
||||||
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||||
|
"format": "prettier --write src/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ckeditor/ckeditor5-autoformat": "^37.1.0",
|
"@ckeditor/ckeditor5-autoformat": "^37.1.0",
|
||||||
@@ -33,15 +37,24 @@
|
|||||||
"marked": "^4.3.0",
|
"marked": "^4.3.0",
|
||||||
"shortid": "^2.2.16",
|
"shortid": "^2.2.16",
|
||||||
"turndown": "^7.1.2",
|
"turndown": "^7.1.2",
|
||||||
"vue": "^3.3.1"
|
"vue": "^3.3.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@rushstack/eslint-patch": "^1.2.0",
|
||||||
|
"@tsconfig/node18": "^2.0.1",
|
||||||
"@types/dompurify": "^3.0.2",
|
"@types/dompurify": "^3.0.2",
|
||||||
"@types/lodash-es": "^4.17.7",
|
"@types/lodash-es": "^4.17.7",
|
||||||
|
"@types/node": "^20.2.1",
|
||||||
"@types/shortid": "^0.0.29",
|
"@types/shortid": "^0.0.29",
|
||||||
"@types/turndown": "^5.0.1",
|
"@types/turndown": "^5.0.1",
|
||||||
"@vitejs/plugin-vue": "^4.2.2",
|
"@vitejs/plugin-vue": "^4.2.2",
|
||||||
|
"@vue/eslint-config-prettier": "^7.1.0",
|
||||||
|
"@vue/eslint-config-typescript": "^11.0.3",
|
||||||
|
"@vue/tsconfig": "^0.4.0",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
|
"eslint": "^8.40.0",
|
||||||
|
"eslint-plugin-vue": "^9.13.0",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
"postcss": "^8.4.23",
|
"postcss": "^8.4.23",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"prettier-plugin-tailwindcss": "^0.2.8",
|
"prettier-plugin-tailwindcss": "^0.2.8",
|
||||||
@@ -50,7 +63,7 @@
|
|||||||
"typescript": "^5.0.2",
|
"typescript": "^5.0.2",
|
||||||
"unplugin-auto-import": "^0.15.3",
|
"unplugin-auto-import": "^0.15.3",
|
||||||
"unplugin-vue-components": "^0.24.1",
|
"unplugin-vue-components": "^0.24.1",
|
||||||
"vite": "^4.3.5",
|
"vite": "^4.3.8",
|
||||||
"vue-tsc": "^1.6.4"
|
"vue-tsc": "^1.6.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export default class ContextedLinkEditing extends Plugin {
|
|||||||
model.createRange(model.createPositionAt(block, 0), focus),
|
model.createRange(model.createPositionAt(block, 0), focus),
|
||||||
model
|
model
|
||||||
)
|
)
|
||||||
const inputText = (text as string).split(']]').at(-1)
|
const inputText = (text as string).split(']]').slice(-1)[0]
|
||||||
const autocompleteText = (inputText as string).match(/(?<=\[\[).*/g)
|
const autocompleteText = (inputText as string).match(/(?<=\[\[).*/g)
|
||||||
const cursorNodes = [focus.textNode, focus.nodeBefore, focus.nodeAfter]
|
const cursorNodes = [focus.textNode, focus.nodeBefore, focus.nodeAfter]
|
||||||
const autocompleteNode: any = cursorNodes.find((node) =>
|
const autocompleteNode: any = cursorNodes.find((node) =>
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ defineExpose({ handleKeypress })
|
|||||||
</li>
|
</li>
|
||||||
<SearchResult
|
<SearchResult
|
||||||
v-for="result in results"
|
v-for="result in results"
|
||||||
|
:key="result.id"
|
||||||
:result="result"
|
:result="result"
|
||||||
:active-result="activeResult"
|
:active-result="activeResult"
|
||||||
@go-to-note="emit('createLink', result.title)"
|
@go-to-note="emit('createLink', result.title)"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const props = defineProps<{
|
|||||||
<div class="badge-outline badge">{{ props.references.length }}</div>
|
<div class="badge-outline badge">{{ props.references.length }}</div>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li v-for="reference in props.references">
|
<li v-for="reference in props.references" :key="reference.id">
|
||||||
<a class="rounded-md" @click="setActiveNote(reference.id)">
|
<a class="rounded-md" @click="setActiveNote(reference.id)">
|
||||||
<i class="far fa-file-alt fa-fw" />
|
<i class="far fa-file-alt fa-fw" />
|
||||||
{{ reference.title }}
|
{{ reference.title }}
|
||||||
|
|||||||
@@ -56,17 +56,16 @@ const handleKeydown = (event: KeyboardEvent) => {
|
|||||||
@keydown="handleKeydown"
|
@keydown="handleKeydown"
|
||||||
/>
|
/>
|
||||||
<div class="z-1000 dropdown absolute left-0 right-0 top-[100%]" v-if="active">
|
<div class="z-1000 dropdown absolute left-0 right-0 top-[100%]" v-if="active">
|
||||||
<ul
|
<ul tabindex="0" class="menu mt-1 w-full rounded-md bg-base-100 p-2 text-black shadow">
|
||||||
tabindex="0"
|
<template v-if="results.length > 0">
|
||||||
class="menu mt-1 w-full rounded-md bg-base-100 p-2 text-black shadow"
|
<SearchResult
|
||||||
>
|
v-for="result in results"
|
||||||
<SearchResult
|
:key="result.id"
|
||||||
v-for="result in results"
|
:result="result"
|
||||||
v-if="results.length > 0"
|
:active-result="activeResult"
|
||||||
:result="result"
|
@go-to-note="() => goToNote(result)"
|
||||||
:active-result="activeResult"
|
/>
|
||||||
@go-to-note="() => goToNote(result)"
|
</template>
|
||||||
/>
|
|
||||||
<li v-else><a>No notes found</a></li>
|
<li v-else><a>No notes found</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ const emit = defineEmits<{
|
|||||||
<template #items>
|
<template #items>
|
||||||
<SideBarMenuItem
|
<SideBarMenuItem
|
||||||
v-for="viewMode in props.viewModes"
|
v-for="viewMode in props.viewModes"
|
||||||
|
:key="viewMode.name"
|
||||||
:icon="viewMode.icon"
|
:icon="viewMode.icon"
|
||||||
:active="viewMode.name === activeViewMode.name"
|
:active="viewMode.name === activeViewMode.name"
|
||||||
@click="emit('setViewMode', viewMode)"
|
@click="emit('setViewMode', viewMode)"
|
||||||
@@ -48,6 +49,7 @@ const emit = defineEmits<{
|
|||||||
<template #items>
|
<template #items>
|
||||||
<SideBarMenuItem
|
<SideBarMenuItem
|
||||||
v-for="note in notes"
|
v-for="note in notes"
|
||||||
|
:key="note.id"
|
||||||
icon="far fa-file-alt fa-fw"
|
icon="far fa-file-alt fa-fw"
|
||||||
@click="setActiveNote(note.id)"
|
@click="setActiveNote(note.id)"
|
||||||
:title="rootNote?.title"
|
:title="rootNote?.title"
|
||||||
|
|||||||
@@ -3,27 +3,29 @@ const rows = [
|
|||||||
{
|
{
|
||||||
noteTitle: 'Cy Ganderton',
|
noteTitle: 'Cy Ganderton',
|
||||||
references: 'Quality Control Specialist',
|
references: 'Quality Control Specialist',
|
||||||
modified: 'Blue',
|
modified: 'Blue'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
noteTitle: 'Hart Hagerty',
|
noteTitle: 'Hart Hagerty',
|
||||||
references: 'Desktop Support Technician',
|
references: 'Desktop Support Technician',
|
||||||
modified: 'Purple',
|
modified: 'Purple',
|
||||||
|
rootNote: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
noteTitle: 'Brice Swyre',
|
noteTitle: 'Brice Swyre',
|
||||||
references: 'Tax Accountant',
|
references: 'Tax Accountant',
|
||||||
modified: 'Red',
|
modified: 'Red'
|
||||||
},
|
}
|
||||||
].map((row) => ({
|
].map((row) => ({
|
||||||
...row,
|
...row,
|
||||||
selected: false,
|
selected: false
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const checkedRows = ref<{ [key: string]: Boolean }>({})
|
const checkedRows = ref<{ [key: string]: Boolean }>({})
|
||||||
|
|
||||||
const toggleRow = (rowId: string) =>
|
const toggleRow = (row: any) => {
|
||||||
(checkedRows.value[rowId] = !checkedRows.value[rowId])
|
if (!row.rootNote) checkedRows.value[row.noteTitle] = !checkedRows.value[row.noteTitle]
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
@@ -45,9 +47,10 @@ const toggleRow = (rowId: string) =>
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr
|
<tr
|
||||||
class="hover hover:cursor-pointer"
|
|
||||||
v-for="row in rows"
|
v-for="row in rows"
|
||||||
@click="toggleRow(row.noteTitle)"
|
:key="row.noteTitle"
|
||||||
|
class="hover hover:cursor-pointer"
|
||||||
|
@click="toggleRow(row)"
|
||||||
>
|
>
|
||||||
<th>
|
<th>
|
||||||
<label>
|
<label>
|
||||||
@@ -55,6 +58,7 @@ const toggleRow = (rowId: string) =>
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
class="checkbox-primary checkbox checkbox-sm border-secondary"
|
class="checkbox-primary checkbox checkbox-sm border-secondary"
|
||||||
v-model="checkedRows[row.noteTitle]"
|
v-model="checkedRows[row.noteTitle]"
|
||||||
|
:disabled="row.rootNote"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</th>
|
</th>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const baseNotes = reactive<{ [noteId: string]: BaseNote }>({})
|
|||||||
|
|
||||||
export const notes = computed<Note[]>(() => {
|
export const notes = computed<Note[]>(() => {
|
||||||
return Object.entries(baseNotes)
|
return Object.entries(baseNotes)
|
||||||
.map(([_, note]) => ({
|
.map(([, note]) => ({
|
||||||
...note,
|
...note,
|
||||||
wordCount: note.content.split(' ').filter((word) => word.length > 0).length,
|
wordCount: note.content.split(' ').filter((word) => word.length > 0).length,
|
||||||
}))
|
}))
|
||||||
|
|||||||
22
tsconfig.app.json
Normal file
22
tsconfig.app.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||||
|
"include": [
|
||||||
|
"env.d.ts",
|
||||||
|
"src/**/*",
|
||||||
|
"src/**/*.vue",
|
||||||
|
"auto-imports.d.ts",
|
||||||
|
"components.d.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"src/**/__tests__/*"
|
||||||
|
],
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"./src/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,44 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"files": [],
|
||||||
"target": "ES2020",
|
|
||||||
"useDefineForClassFields": true,
|
|
||||||
"module": "ESNext",
|
|
||||||
"lib": [
|
|
||||||
"ES2020",
|
|
||||||
"DOM",
|
|
||||||
"DOM.Iterable"
|
|
||||||
],
|
|
||||||
"skipLibCheck": true,
|
|
||||||
/* Bundler mode */
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"jsx": "preserve",
|
|
||||||
/* Linting */
|
|
||||||
"strict": true,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"noUnusedParameters": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": [
|
|
||||||
"./src/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"src/**/*.ts",
|
|
||||||
"src/**/*.d.ts",
|
|
||||||
"src/**/*.tsx",
|
|
||||||
"src/**/*.vue",
|
|
||||||
"auto-imports.d.ts",
|
|
||||||
"components.d.ts"
|
|
||||||
],
|
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"path": "./tsconfig.node.json"
|
"path": "./tsconfig.node.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.app.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "@tsconfig/node18/tsconfig.json",
|
||||||
|
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"skipLibCheck": true,
|
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "bundler",
|
"types": ["node"]
|
||||||
"allowSyntheticDefaultImports": true
|
}
|
||||||
},
|
|
||||||
"include": ["vite.config.ts"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import path from 'path'
|
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
// CKEditor
|
// CKEditor
|
||||||
@@ -18,7 +19,7 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, './src'),
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user