Skip to content

Commit

Permalink
sqlite experimentation in new vue 3 app
Browse files Browse the repository at this point in the history
  • Loading branch information
chvp committed Aug 15, 2024
1 parent c7cc639 commit b02cbfa
Show file tree
Hide file tree
Showing 157 changed files with 6,007 additions and 23,856 deletions.
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>
81 changes: 41 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,52 @@
"version": "0.33.0",
"private": true,
"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",
"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"
"@vueuse/core": "^10.3.0",
"comlink": "^4.4.1",
"fetch-retry": "^5.0.6",
"pinia": "^2.1.4",
"sqlocal": "0.11.1",
"vue": "^3.3.4",
"vue-router": "^4.2.4",
"vuetify": "^3.3.11"
},
"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",
"@vue/eslint-config-prettier": "^9.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.27.0",
"eslint-plugin-vuetify": "^1.1.0",
"prettier": "^3.3.3",
"sass": "^1.77.8",
"sass-loader": "^16.0.0",
"vue-cli-plugin-i18n": "^2.3.2",
"vue-cli-plugin-vuetify": "^2.5.8",
"vuetify-loader": "^1.9.2",
"webpack": "^5.88.2"
"@rushstack/eslint-patch": "^1.3.2",
"@tsconfig/node18": "^18.2.0",
"@types/jsdom": "^21.1.1",
"@types/node": "^18.17.0",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/test-utils": "^2.4.1",
"@vue/tsconfig": "^0.4.0",
"cypress": "^12.17.2",
"eslint": "^8.54.0",
"eslint-plugin-cypress": "^2.13.3",
"eslint-plugin-vue": "^9.18.1",
"eslint-plugin-vuetify": "^2.0.5",
"jsdom": "^22.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"start-server-and-test": "^2.0.0",
"typescript": "~5.1.6",
"vite": "^4.4.6",
"vite-plugin-vuetify": "^1.0.2",
"vitest": "^0.33.0",
"vue-tsc": "^1.8.6"
}
}
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

0 comments on commit b02cbfa

Please sign in to comment.