Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite experimentation in newly generated vue 3 app #1023

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .browserslistrc

This file was deleted.

11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
indent_style = space
trim_trailing_whitespace = true

[*.{js,ts,vue}]
indent_size = 2
2 changes: 0 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en
22 changes: 22 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
extends: [
'plugin:vue/vue3-recommended',
'plugin:vuetify/recommended',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier'
],
overrides: [
{
files: ['cypress/e2e/**/*.{cy,spec}.{js,ts,jsx,tsx}'],
extends: ['plugin:cypress/recommended']
}
],
parserOptions: {
ecmaVersion: 'latest'
}
}
21 changes: 0 additions & 21 deletions .eslintrc.js

This file was deleted.

28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.idea
.vscode
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
*.sw?
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
7 changes: 0 additions & 7 deletions babel.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:4173'
}
})
8 changes: 8 additions & 0 deletions cypress/e2e/example.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// https://on.cypress.io/api

describe('My First Test', () => {
it('visits the app root url', () => {
cy.visit('/')
cy.contains('h1', 'You did it!')
})
})
10 changes: 10 additions & 0 deletions cypress/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["./**/*", "../support/**/*"],
"compilerOptions": {
"isolatedModules": false,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"]
}
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
39 changes: 39 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }

export {}
20 changes: 20 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
24 changes: 24 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/// <reference types="vite/client" />

declare module '@sqlite.org/sqlite-wasm'

declare module 'vuetify/lib/util/colors' {
let blue: {
base: string
darken2: string
darken3: string
lighten1: string
}
let red: {
base: string
darken2: string
darken3: string
lighten1: string
}
}

declare const APP_VERSION: string

interface FileSystemDirectoryHandle {
keys: () => { [Symbol.asyncIterator](): AsyncIterator<string> }
}
10 changes: 5 additions & 5 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Accentor</title>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<noscript>
<strong>We're sorry but Accentor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="main"></div>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
75 changes: 39 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
{
"name": "accentor",
"version": "0.33.0",
"version": "0.32.0",
"private": true,
"type": "module",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'"
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"test:unit": "vitest",
"test:e2e": "start-server-and-test preview http://localhost:4173 'cypress run --e2e'",
"test:e2e:dev": "start-server-and-test 'vite dev --port 4173' http://localhost:4173 'cypress open --e2e'",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/"
},
"dependencies": {
"@accentor/api-client-js": "^0.20.1",
"@mdi/font": "^7.4.47",
"@mdi/svg": "^7.4.47",
"@sqlite.org/sqlite-wasm": "^3.46.1-build1",
"@vueuse/core": "^11.0.1",
"broadcast-channel": "^7.0.0",
"comlink": "^4.4.1",
"fetch-retry": "^6.0.0",
"gsap": "^3.12.5",
"localforage": "^1.10.0",
"lodash.debounce": "^4.0.8",
"roboto-fontface": "^0.10.0",
"vue": "^2.7.16",
"vue-global-events": "^1.2.1",
"vue-i18n": "^8.28.2",
"vue-meta": "^2.4.0",
"vue-router": "^3.6.5",
"vuedraggable": "^2.24.3",
"vuetify": "^2.7.2",
"vuex": "^3.6.2",
"vuex-persist": "^3.1.3"
"pinia": "^2.2.2",
"vue": "^3.4.38",
"vue-router": "^4.4.3",
"vuetify": "^3.7.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
"@intlify/vue-i18n-loader": "4.0.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@rushstack/eslint-patch": "^1.10.4",
"@tsconfig/node22": "^22.0.0",
"@types/jsdom": "^21.1.7",
"@types/node": "^22.5.0",
"@vitejs/plugin-vue": "^5.1.2",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"cypress": "^13.13.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-cypress": "^3.5.0",
"eslint-plugin-vue": "^9.27.0",
"eslint-plugin-vuetify": "^1.1.0",
"eslint-plugin-vuetify": "^2.4.0",
"jsdom": "^24.1.1",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.3",
"sass": "^1.77.8",
"sass-loader": "^16.0.1",
"vue-cli-plugin-i18n": "^2.3.2",
"vue-cli-plugin-vuetify": "^2.5.8",
"vuetify-loader": "^1.9.2",
"webpack": "^5.88.2"
"start-server-and-test": "^2.0.5",
"typescript": "^5.5.4",
"vite": "^5.4.2",
"vite-plugin-vuetify": "^2.0.4",
"vitest": "^2.0.5",
"vue-tsc": "^2.0.29"
}
}
5 changes: 0 additions & 5 deletions postcss.config.js

This file was deleted.

20 changes: 20 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { useTheme } from 'vuetify'
import { usePreferredDark } from '@vueuse/core'
import { watch } from 'vue'
const theme = useTheme()
const prefersDark = usePreferredDark()
watch(prefersDark, () => (theme.global.name.value = prefersDark.value ? 'dark' : 'light'), {
immediate: true
})
</script>

<template>
<v-app>
<router-view />
</v-app>
</template>

<style scoped></style>
Loading
Loading