Skip to content

Commit 19d9d68

Browse files
Migrate to Dexie (#300)
2 parents 2fe0412 + b86f2e8 commit 19d9d68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2277
-3082
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CYPRESS_BASE_URL=http://127.0.0.1:8888
21
FIREBASE_PROJECT_ID=demo-octo
32
FIREBASE_TOKEN=fake
43
NUXT_PUBLIC_CDN_URL=

.eslintrc-todo.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,6 @@
553553
"unused-imports/no-unused-vars": "warn"
554554
}
555555
},
556-
{
557-
"files": [
558-
"src/store/modules/contexts.js"
559-
],
560-
"rules": {
561-
"@typescript-eslint/space-before-function-paren": "warn"
562-
}
563-
},
564556
{
565557
"files": [
566558
"src/store/modules/documents.js"
@@ -604,14 +596,6 @@
604596
"@typescript-eslint/comma-dangle": "warn"
605597
}
606598
},
607-
{
608-
"files": [
609-
"src/store/plugins/caching/contexts.js"
610-
],
611-
"rules": {
612-
"no-case-declarations": "warn"
613-
}
614-
},
615599
{
616600
"files": [
617601
"src/store/plugins/caching/documents.js"
@@ -809,14 +793,6 @@
809793
"@typescript-eslint/comma-dangle": "warn"
810794
}
811795
},
812-
{
813-
"files": [
814-
"test/cypress/support/e2e.ts"
815-
],
816-
"rules": {
817-
"no-proto": "warn"
818-
}
819-
},
820796
{
821797
"files": [
822798
"types/types.ts"

.github/workflows/ci.yml

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ jobs:
6464
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
6565
path: |
6666
${{ env.STORE_PATH }}
67-
~/.cache/Cypress
6867
restore-keys: v1-${{ runner.os }}-pnpm-store-
6968
- name: Install dependencies
7069
run: pnpm install --shamefully-hoist
@@ -93,62 +92,11 @@ jobs:
9392
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
9493
path: |
9594
${{ env.STORE_PATH }}
96-
~/.cache/Cypress
9795
restore-keys: v1-${{ runner.os }}-pnpm-store-
9896
- name: Install dependencies
9997
run: pnpm install --shamefully-hoist
10098
- name: Run linter
10199
run: pnpm lint
102-
test-e2e-cypress:
103-
env:
104-
NUXT_PUBLIC_FIREBASE_EMULATOR_AUTH: http://127.0.0.1:32775
105-
needs:
106-
- install-dependencies
107-
runs-on: ubuntu-latest
108-
steps:
109-
- name: Checkout the repository
110-
uses: actions/checkout@v4
111-
- name: Install Node
112-
uses: actions/setup-node@v4
113-
with:
114-
node-version: 18
115-
- name: Install pnpm
116-
uses: pnpm/action-setup@v4
117-
with:
118-
run_install: false
119-
- name: Get pnpm store directory
120-
shell: bash
121-
run: |
122-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
123-
- name: Setup pnpm cache
124-
uses: actions/cache@v3
125-
with:
126-
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
127-
path: |
128-
${{ env.STORE_PATH }}
129-
~/.cache/Cypress
130-
restore-keys: v1-${{ runner.os }}-pnpm-store-
131-
- name: Install dependencies
132-
run: pnpm install --shamefully-hoist
133-
- uses: cypress-io/[email protected]
134-
with:
135-
build: pnpm build
136-
config: baseUrl=http://127.0.0.1:8889
137-
install: false
138-
start: |
139-
pnpm firebase:start
140-
pnpm preview
141-
wait-on: 'http://127.0.0.1:8889,http://127.0.0.1:32777'
142-
- uses: actions/upload-artifact@v3
143-
if: failure()
144-
with:
145-
name: cypress-screenshots
146-
path: test/cypress/screenshots
147-
- uses: actions/upload-artifact@v3
148-
if: failure()
149-
with:
150-
name: cypress-videos
151-
path: test/cypress/videos
152100
test-e2e-playwright:
153101
needs:
154102
- install-dependencies
@@ -174,7 +122,6 @@ jobs:
174122
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
175123
path: |
176124
${{ env.STORE_PATH }}
177-
~/.cache/Cypress
178125
restore-keys: v1-${{ runner.os }}-pnpm-store-
179126
- name: Install dependencies
180127
run: pnpm install --shamefully-hoist
@@ -211,7 +158,6 @@ jobs:
211158
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
212159
path: |
213160
${{ env.STORE_PATH }}
214-
~/.cache/Cypress
215161
restore-keys: v1-${{ runner.os }}-pnpm-store-
216162
- name: Install dependencies
217163
run: pnpm install --shamefully-hoist
@@ -242,7 +188,6 @@ jobs:
242188
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
243189
path: |
244190
${{ env.STORE_PATH }}
245-
~/.cache/Cypress
246191
restore-keys: v1-${{ runner.os }}-pnpm-store-
247192
- name: Install dependencies
248193
run: pnpm install --shamefully-hoist

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ firebase/data
2121
node_modules
2222
public/manifest.webmanifest
2323
supabase
24-
test/cypress/downloads
25-
test/cypress/screenshots
26-
test/cypress/videos
2724

2825
# We are not using Zero-Installs.
2926
# https://yarnpkg.com/getting-started/qa/#which-files-should-be-gitignored

app.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<script lang="ts">
2-
import { loadSettings } from '#root/src/store/plugins/caching/settings'
2+
import { appEventTypes, logEvent } from '/helpers/app'
3+
import { loadKeybindings } from '/src/store/modules/keybindings'
4+
import { loadDocs } from '/src/store/plugins/caching/documents'
5+
import { loadSettings } from '/src/store/plugins/caching/settings'
6+
import { syncDocs } from '/src/store/plugins/sync'
37
48
import 'overlayscrollbars/overlayscrollbars.css'
59
@@ -11,13 +15,19 @@ export default defineComponent({
1115
1216
const isMounted = ref(false)
1317
14-
onMounted(() => {
18+
onMounted(async () => {
1519
isMounted.value = true
1620
21+
await loadSettings(store)
22+
await loadDocs(store)
23+
await loadKeybindings(store)
24+
25+
syncDocs(store)
26+
1727
// This is used by tests to determine when the app is ready.
1828
document.body.dataset.isMounted = 'true'
1929
20-
loadSettings(store)
30+
logEvent(appEventTypes.appMounted)
2131
})
2232
2333
const sizes = computed(() => {

components/AssistantHistoryChat.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { type Chat } from '#helpers/database'
2+
import { type Chat } from '/src/db'
33
44
export default defineComponent({
55
props: {

components/AssistantHistoryChatMessage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { type ChatMessage } from '#helpers/database'
2+
import { type ChatMessage } from '/src/db'
33
44
const trimMessage = (message = '') => {
55
return message.length > 200 ? `${message.slice(0, 200)}...` : message

components/CoreInput.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ onMounted(() => {
132132
:value="modelProxy"
133133
class="unset-all cursor-text block min-h-0 overflow-hidden resize-none placeholder-muted"
134134
:class="{ 'whitespace-nowrap': !multiline }"
135+
data-core-input
135136
@input="modelProxy = $event.target.value"
136137
@keypress.enter="handleEnter"
137138
/>

components/DocEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default defineComponent({
5151
watch(coreEditor, () => {
5252
focus()
5353
54-
// Expose the Ink instance for Cypress.
54+
// Expose the Ink instance for tests.
5555
window.inkMde = coreEditor.value?.instance
5656
})
5757

components/DocList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export default defineComponent({
152152
@keypress.enter.prevent="selectDoc(doc.id)"
153153
@click="selectDoc(doc.id)"
154154
>
155-
<LazyDoc v-bind="doc" :allow-discard="isEditing" class="h-96" />
155+
<Doc v-bind="doc" :allow-discard="isEditing" class="h-96" />
156156
<div v-if="doc.selected" class="flex items-center justify-center rounded absolute inset-0 bg-layer bg-opacity-50">
157157
<Icon name="CheckCircle" size="3rem" />
158158
</div>

0 commit comments

Comments
 (0)