Compare commits

...

7 Commits

Author SHA1 Message Date
Trent Larson ce1e3a96c2 more tweaks to adapt to vite builds 8 months ago
Jason Buchanan 035f2a5b04
docs: adding do for updated development server run command 8 months ago
Jason Buchanan 09dccc34d6
fix: buffer typescript error in util.ts when parsing ArrayBuffer 8 months ago
Jason Buchanan ca240ab795
fix: es modules syntax for buffer deps instead of commonjs require 8 months ago
Jason Buchanan 01b5ca6ec8
chore: update vitejs config to deploy on the same default port as the @vue/cli-service 8 months ago
Jason Buchanan 6f49260c1e
fix: AccountViewView.vue template not resolving dep for dexie-export-import/dist/import 8 months ago
Jason Buchanan 38f44771e9
Initial stab at vitejs update 8 months ago
  1. 8
      .env.production
  2. 7
      .eslintrc.js
  3. 7
      README.md
  4. 3
      babel.config.js
  5. 17
      index.html
  6. 29089
      package-lock.json
  7. 106
      package.json
  8. 20
      project.task.yaml
  9. 17
      public/index.html
  10. 3
      src/assets/styles/tailwind.css
  11. 4
      src/constants/app.ts
  12. 2
      src/libs/crypto/index.ts
  13. 2
      src/libs/endorserServer.ts
  14. 30
      src/libs/util.ts
  15. 2
      src/registerServiceWorker.ts
  16. 127
      src/router/index.ts
  17. 11
      src/views/AccountViewView.vue
  18. 4
      src/views/ContactQRScanShowView.vue
  19. 4
      src/views/ContactsView.vue
  20. 2
      src/views/HelpView.vue
  21. 34
      tsconfig.json
  22. 18
      vite.config.mjs
  23. 30
      vue.config.js

8
.env.production

@ -1,4 +1,4 @@
# Only the variables that start with VUE_APP_ are seen in the application process.env in Vue. # Only the variables that start with VITE_ are seen in the application process.env in Vue.
VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H
VUE_APP_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch VITE_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch
VUE_APP_DEFAULT_IMAGE_API_SERVER=https://image-api.timesafari.app VITE_DEFAULT_IMAGE_API_SERVER=https://image-api.timesafari.app

7
.eslintrc.js

@ -2,6 +2,7 @@ module.exports = {
root: true, root: true,
env: { env: {
node: true, node: true,
es2022: true,
}, },
extends: [ extends: [
"plugin:vue/vue3-essential", "plugin:vue/vue3-essential",
@ -9,9 +10,9 @@ module.exports = {
"@vue/typescript/recommended", "@vue/typescript/recommended",
"plugin:prettier/recommended", "plugin:prettier/recommended",
], ],
parserOptions: { // parserOptions: {
ecmaVersion: 2020, // ecmaVersion: 2020,
}, // },
rules: { rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",

7
README.md

@ -18,6 +18,11 @@ npm install
### Compiles and hot-reloads for development ### Compiles and hot-reloads for development
``` ```
npm run dev
```
### Builds the production app
```
npm run serve npm run serve
``` ```
@ -42,7 +47,7 @@ npm run lint
``` ```
# (See .env.development for more details.) # (See .env.development for more details.)
# The test BVC_MEETUPS_PROJECT_CLAIM_ID does not resolve as a URL because it's only in the test DB and the prod redirect won't redirect there. # The test BVC_MEETUPS_PROJECT_CLAIM_ID does not resolve as a URL because it's only in the test DB and the prod redirect won't redirect there.
TIME_SAFARI_APP_TITLE="TimeSafari_Test" VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK VUE_APP_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch VUE_APP_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app npm run build TIME_SAFARI_APP_TITLE="TimeSafari_Test" VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK VITE_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app npm run build
``` ```
* Production * Production

3
babel.config.js

@ -1,3 +0,0 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};

17
index.html

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<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="/favicon.ico">
<title>TimeSafari</title>
</head>
<body>
<noscript>
<strong>We're sorry but TimeSafari doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

29089
package-lock.json

File diff suppressed because it is too large

106
package.json

@ -3,93 +3,89 @@
"version": "0.3.4", "version": "0.3.4",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "dev": "vite",
"build": "vue-cli-service build", "serve": "vite preview",
"lint": "vue-cli-service lint" "build": "VITE_GIT_HASH=`git log -1 --pretty=format:%h` vite build",
"lint": "eslint --ext .js,.ts,.vue --ignore-path .gitignore src",
"lint-fix": "eslint --ext .js,.ts,.vue --ignore-path .gitignore --fix src",
"postbuild": "cp ./sw_scripts-combined.js dist/",
"prebuild": "eslint --ext .js,.ts,.vue --ignore-path .gitignore src && node sw_combine.js"
}, },
"dependencies": { "dependencies": {
"@dicebear/collection": "^5.3.5", "@dicebear/collection": "^5.4.1",
"@dicebear/core": "^5.3.5", "@dicebear/core": "^5.4.1",
"@ethersproject/hdnode": "^5.7.0", "@ethersproject/hdnode": "^5.7.0",
"@fortawesome/fontawesome-svg-core": "^6.4.2", "@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/vue-fontawesome": "^3.0.3", "@fortawesome/vue-fontawesome": "^3.0.6",
"@pvermeer/dexie-encrypted-addon": "^3.0.0", "@pvermeer/dexie-encrypted-addon": "^3.0.0",
"@tweenjs/tween.js": "^21.0.0", "@tweenjs/tween.js": "^21.1.1",
"@types/js-yaml": "^4.0.9", "@types/js-yaml": "^4.0.9",
"@types/luxon": "^3.4.2", "@types/luxon": "^3.4.2",
"@veramo/core": "^5.4.1", "@veramo/core": "^5.6.0",
"@veramo/credential-w3c": "^5.4.1", "@veramo/credential-w3c": "^5.6.0",
"@veramo/data-store": "^5.4.1", "@veramo/data-store": "^5.6.0",
"@veramo/did-manager": "^5.4.1", "@veramo/did-manager": "^5.6.0",
"@veramo/did-provider-ethr": "^5.4.1", "@veramo/did-provider-ethr": "^5.6.0",
"@veramo/did-resolver": "^5.4.1", "@veramo/did-resolver": "^5.6.0",
"@veramo/key-manager": "^5.4.1", "@veramo/key-manager": "^5.6.0",
"@vueuse/core": "^10.4.1", "@vueuse/core": "^10.9.0",
"@zxing/text-encoding": "^0.9.0", "@zxing/text-encoding": "^0.9.0",
"axios": "^1.5.0", "axios": "^1.6.8",
"buffer": "^6.0.3",
"class-transformer": "^0.5.1", "class-transformer": "^0.5.1",
"core-js": "^3.32.1", "dexie": "^3.2.7",
"dexie": "^3.2.4", "dexie-export-import": "^4.1.1",
"dexie-export-import": "^4.0.7", "did-jwt": "^7.4.7",
"did-jwt": "^7.2.7", "ethereum-cryptography": "^2.1.3",
"ethereum-cryptography": "^2.1.2",
"ethereumjs-util": "^7.1.5", "ethereumjs-util": "^7.1.5",
"ethr-did-resolver": "^8.1.2", "ethr-did-resolver": "^8.1.2",
"git-describe": "^4.1.1",
"jdenticon": "^3.2.0", "jdenticon": "^3.2.0",
"js-generate-password": "^0.1.9", "js-generate-password": "^0.1.9",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"localstorage-slim": "^2.5.0", "localstorage-slim": "^2.7.0",
"luxon": "^3.4.4", "luxon": "^3.4.4",
"merkletreejs": "^0.3.11", "merkletreejs": "^0.3.11",
"moment": "^2.29.4", "moment": "^2.30.1",
"notiwind": "^2.0.2", "notiwind": "^2.0.2",
"papaparse": "^5.4.1", "papaparse": "^5.4.1",
"pina": "^0.20.2204228", "pina": "^0.20.2204228",
"pinia-plugin-persistedstate": "^3.2.0", "pinia-plugin-persistedstate": "^3.2.1",
"qr-code-generator-vue3": "^1.4.21", "qr-code-generator-vue3": "^1.4.21",
"ramda": "^0.29.0", "ramda": "^0.29.1",
"readable-stream": "^4.4.2", "readable-stream": "^4.5.2",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.14",
"register-service-worker": "^1.7.2", "register-service-worker": "^1.7.2",
"simple-vue-camera": "^1.1.3", "simple-vue-camera": "^1.1.3",
"three": "^0.156.1", "three": "^0.156.1",
"ua-parser-js": "^1.0.37", "ua-parser-js": "^1.0.37",
"util": "^0.12.5", "util": "^0.12.5",
"vue": "^3.3.4", "vue": "^3.4.21",
"vue-axios": "^3.5.2", "vue-axios": "^3.5.2",
"vue-facing-decorator": "^3.0.2", "vue-facing-decorator": "^3.0.4",
"vue-qrcode-reader": "^5.4.1", "vue-qrcode-reader": "^5.5.3",
"vue-router": "^4.2.4", "vue-router": "^4.3.0",
"web-did-resolver": "^2.0.27" "web-did-resolver": "^2.0.27"
}, },
"devDependencies": { "devDependencies": {
"@types/leaflet": "^1.9.4", "@types/leaflet": "^1.9.8",
"@types/ramda": "^0.29.3", "@types/ramda": "^0.29.11",
"@types/three": "^0.155.1", "@types/three": "^0.155.1",
"@types/ua-parser-js": "^0.7.39", "@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "^6.6.0", "@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.6.0", "@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vue-leaflet/vue-leaflet": "^0.10.1", "@vue-leaflet/vue-leaflet": "^0.10.1",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-pwa": "~5.0.8",
"@vue/cli-plugin-router": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-plugin-vuex": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/eslint-config-typescript": "^11.0.3", "@vue/eslint-config-typescript": "^11.0.3",
"autoprefixer": "^10.4.15", "autoprefixer": "^10.4.19",
"eslint": "^8.53.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.17.0", "eslint-plugin-vue": "^9.23.0",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
"postcss": "^8.4.29", "postcss": "^8.4.38",
"prettier": "^3.1.0", "prettier": "^3.2.5",
"tailwindcss": "^3.3.3", "tailwindcss": "^3.4.1",
"typescript": "~5.2.2" "typescript": "~5.2.2",
"vite": "^5.2.0"
} }
} }

20
project.task.yaml

@ -1,13 +1,19 @@
tasks : tasks :
- bug - landscape doesn't show full camera - fix the notification link to the app
- bug - got blank screen and errors on iPhone with no bottom tabs - 01 change scanning flow - allow them to stay on the QR/scanning screen after scanning someone
- add to readme - check version, close tabs & restart phone if necessary
- bug maybe - a new give remembers the previous project - 24 contextual tutorials https://docs.google.com/document/d/11C_K3RM0rgo0onih20KFhcIzukZyq_CRWqaWX5om_kM/edit#heading=h.iwiwcydou5hw
- alert & stop if give amount < 0
- add warning that all data (except ID) is public - feeds - add "remote" filter, if they choose 'visible' then warn that they won't see any others, cache list & don't reload front page on change
- onboarding video
- .1 add shortcut from project (etc?) to the public project page in a browser
- .1 add KindSpring link to ideas
- .1 on feed, don't show "to someone anonymous" if it's to a project
- 16 save data backups in Google
- 16 generate and use passkeys for identities
- .5 show "give" buttons (eg. from anonymous) even if they can't give, greyed out, and give them a warning and instructions
- .2 when adding a claim on home screen, push that claim to the top of the list - .2 when adding a claim on home screen, push that claim to the top of the list
- 24 allow a person record with interests, including location; purpose? contact methods? enhance other connections the same? (suggestion from Philippines) assignee-group:ui - 24 allow a person record with interests, including location; purpose? contact methods? enhance other connections the same? (suggestion from Philippines) assignee-group:ui

17
public/index.html

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="">
<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><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

3
src/assets/styles/tailwind.css

@ -1,9 +1,8 @@
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');
@layer base { @layer base {
html { html {
font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif !important; font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif !important;

4
src/constants/app.ts

@ -20,11 +20,11 @@ export enum AppString {
} }
export const DEFAULT_ENDORSER_API_SERVER = export const DEFAULT_ENDORSER_API_SERVER =
process.env.VUE_APP_DEFAULT_ENDORSER_API_SERVER || import.meta.env.VITE_DEFAULT_ENDORSER_API_SERVER ||
AppString.TEST_ENDORSER_API_SERVER; AppString.TEST_ENDORSER_API_SERVER;
export const DEFAULT_IMAGE_API_SERVER = export const DEFAULT_IMAGE_API_SERVER =
process.env.VUE_APP_DEFAULT_IMAGE_API_SERVER || import.meta.env.VITE_DEFAULT_IMAGE_API_SERVER ||
AppString.TEST_IMAGE_API_SERVER; AppString.TEST_IMAGE_API_SERVER;
export const DEFAULT_PUSH_SERVER = export const DEFAULT_PUSH_SERVER =

2
src/libs/crypto/index.ts

@ -113,7 +113,7 @@ export const sign = async (privateKeyHex: string) => {
* The SimpleSigner returns a configured function for signing data. * The SimpleSigner returns a configured function for signing data.
* *
* @example * @example
* const signer = SimpleSigner(process.env.PRIVATE_KEY) * const signer = SimpleSigner(import.meta.env.PRIVATE_KEY)
* signer(data, (err, signature) => { * signer(data, (err, signature) => {
* ... * ...
* }) * })

2
src/libs/endorserServer.ts

@ -794,7 +794,7 @@ export const claimSpecialDescription = (
}; };
export const BVC_MEETUPS_PROJECT_CLAIM_ID = export const BVC_MEETUPS_PROJECT_CLAIM_ID =
process.env.VUE_APP_BVC_MEETUPS_PROJECT_CLAIM_ID || import.meta.env.VITE_BVC_MEETUPS_PROJECT_CLAIM_ID ||
"https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; // this won't resolve as a URL on production; it's a URN only found in the test system "https://endorser.ch/entity/01HNTZYJJXTGT0EZS3VEJGX7AK"; // this won't resolve as a URL on production; it's a URN only found in the test system
export const bvcMeetingJoinClaim = (did: string, startTime: string) => { export const bvcMeetingJoinClaim = (did: string, startTime: string) => {

30
src/libs/util.ts

@ -12,9 +12,6 @@ import { deriveAddress, generateSeed, newIdentifier } from "@/libs/crypto";
import { GenericServerRecord, containsHiddenDid } from "@/libs/endorserServer"; import { GenericServerRecord, containsHiddenDid } from "@/libs/endorserServer";
import * as serverUtil from "@/libs/endorserServer"; import * as serverUtil from "@/libs/endorserServer";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Buffer = require("buffer/").Buffer;
// If you edit this, check that the numbers still line up on the side in the alert (on mobile, too), // If you edit this, check that the numbers still line up on the side in the alert (on mobile, too),
// and make sure they can take all actions while the notification shows. // and make sure they can take all actions while the notification shows.
export const ONBOARD_MESSAGE = export const ONBOARD_MESSAGE =
@ -238,6 +235,19 @@ export const generateSaveAndActivateIdentity = async (): Promise<string> => {
return newId.did; return newId.did;
}; };
function getBase64(subscription: PushSubscription, key: PushEncryptionKeyName) {
const buffer = subscription.getKey(key);
if (!buffer) {
return null;
}
const value = Buffer.from(buffer);
return value
.toString("base64")
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/, "");
}
export const sendTestThroughPushServer = async ( export const sendTestThroughPushServer = async (
subscription: PushSubscription, subscription: PushSubscription,
skipFilter: boolean, skipFilter: boolean,
@ -254,18 +264,8 @@ export const sendTestThroughPushServer = async (
// Use something other than "Daily Update" https://gitea.anomalistdesign.com/trent_larson/py-push-server/src/commit/3c0e196c11bc98060ec5934e99e7dbd591b5da4d/app.py#L213 // Use something other than "Daily Update" https://gitea.anomalistdesign.com/trent_larson/py-push-server/src/commit/3c0e196c11bc98060ec5934e99e7dbd591b5da4d/app.py#L213
const DIRECT_PUSH_TITLE = "DIRECT_NOTIFICATION"; const DIRECT_PUSH_TITLE = "DIRECT_NOTIFICATION";
const auth = Buffer.from(subscription.getKey("auth")); const authB64 = getBase64(subscription, "auth");
const authB64 = auth const p256dhB64 = getBase64(subscription, "p256dh");
.toString("base64")
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/, "");
const p256dh = Buffer.from(subscription.getKey("p256dh"));
const p256dhB64 = p256dh
.toString("base64")
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/, "");
const newPayload = { const newPayload = {
endpoint: subscription.endpoint, endpoint: subscription.endpoint,
keys: { keys: {

2
src/registerServiceWorker.ts

@ -2,7 +2,7 @@
import { register } from "register-service-worker"; import { register } from "register-service-worker";
if (process.env.NODE_ENV === "production") { if (import.meta.env.NODE_ENV === "production") {
register("/sw_scripts-combined.js", { register("/sw_scripts-combined.js", {
ready() { ready() {
console.log( console.log(

127
src/router/index.ts

@ -31,221 +31,154 @@ const routes: Array<RouteRecordRaw> = [
{ {
path: "/account", path: "/account",
name: "account", name: "account",
component: () => component: () => import("../views/AccountViewView.vue"),
import(/* webpackChunkName: "account" */ "../views/AccountViewView.vue"),
}, },
{ {
path: "/claim/:id?", path: "/claim/:id?",
name: "claim", name: "claim",
component: () => component: () => import("../views/ClaimView.vue"),
import(/* webpackChunkName: "claim" */ "../views/ClaimView.vue"),
}, },
{ {
path: "/confirm-contact", path: "/confirm-contact",
name: "confirm-contact", name: "confirm-contact",
component: () => component: () => import("../views/ConfirmContactView.vue"),
import(
/* webpackChunkName: "confirm-contact" */ "../views/ConfirmContactView.vue"
),
}, },
{ {
path: "/contact-amounts", path: "/contact-amounts",
name: "contact-amounts", name: "contact-amounts",
component: () => component: () => import("../views/ContactAmountsView.vue"),
import(
/* webpackChunkName: "contact-amounts" */ "../views/ContactAmountsView.vue"
),
}, },
{ {
path: "/contact-gives", path: "/contact-gives",
name: "contact-gives", name: "contact-gives",
component: () => component: () => import("../views/ContactGiftingView.vue"),
import(
/* webpackChunkName: "contact-gives" */ "../views/ContactGiftingView.vue"
),
}, },
{ {
path: "/contact-qr", path: "/contact-qr",
name: "contact-qr", name: "contact-qr",
component: () => component: () => import("../views/ContactQRScanShowView.vue"),
import(
/* webpackChunkName: "contact-qr" */ "../views/ContactQRScanShowView.vue"
),
}, },
{ {
path: "/contacts", path: "/contacts",
name: "contacts", name: "contacts",
component: () => component: () => import("../views/ContactsView.vue"),
import(/* webpackChunkName: "contacts" */ "../views/ContactsView.vue"),
}, },
{ {
path: "/discover", path: "/discover",
name: "discover", name: "discover",
component: () => component: () => import("../views/DiscoverView.vue"),
import(/* webpackChunkName: "discover" */ "../views/DiscoverView.vue"),
}, },
{ {
path: "/gifted-details", path: "/gifted-details",
name: "gifted-details", name: "gifted-details",
component: () => component: () => import("../views/GiftedDetails.vue"),
import(
/* webpackChunkName: "gifted-details" */ "../views/GiftedDetails.vue"
),
}, },
{ {
path: "/help", path: "/help",
name: "help", name: "help",
component: () => component: () => import("../views/HelpView.vue"),
import(/* webpackChunkName: "help" */ "../views/HelpView.vue"),
}, },
{ {
path: "/", path: "/",
name: "home", name: "home",
component: () => component: () => import("../views/HomeView.vue"),
import(/* webpackChunkName: "home" */ "../views/HomeView.vue"),
}, },
{ {
path: "/help-notifications", path: "/help-notifications",
name: "help-notifications", name: "help-notifications",
component: () => component: () => import("../views/HelpNotificationsView.vue"),
import(
/* webpackChunkName: "help-notifications" */ "../views/HelpNotificationsView.vue"
),
}, },
{ {
path: "/identity-switcher", path: "/identity-switcher",
name: "identity-switcher", name: "identity-switcher",
component: () => component: () => import("../views/IdentitySwitcherView.vue"),
import(
/* webpackChunkName: "identity-switcher" */ "../views/IdentitySwitcherView.vue"
),
}, },
{ {
path: "/import-account", path: "/import-account",
name: "import-account", name: "import-account",
component: () => component: () => import("../views/ImportAccountView.vue"),
import(
/* webpackChunkName: "import-account" */ "../views/ImportAccountView.vue"
),
}, },
{ {
path: "/import-derive", path: "/import-derive",
name: "import-derive", name: "import-derive",
component: () => component: () => import("../views/ImportDerivedAccountView.vue"),
import(
/* webpackChunkName: "import-derive" */ "../views/ImportDerivedAccountView.vue"
),
}, },
{ {
path: "/new-edit-account", path: "/new-edit-account",
name: "new-edit-account", name: "new-edit-account",
component: () => component: () => import("../views/NewEditAccountView.vue"),
import(
/* webpackChunkName: "new-edit-account" */ "../views/NewEditAccountView.vue"
),
}, },
{ {
path: "/new-edit-project", path: "/new-edit-project",
name: "new-edit-project", name: "new-edit-project",
component: () => component: () => import("../views/NewEditProjectView.vue"),
import(
/* webpackChunkName: "new-edit-project" */ "../views/NewEditProjectView.vue"
),
}, },
{ {
path: "/new-identifier", path: "/new-identifier",
name: "new-identifier", name: "new-identifier",
component: () => component: () => import("../views/NewIdentifierView.vue"),
import(
/* webpackChunkName: "new-identifier" */ "../views/NewIdentifierView.vue"
),
}, },
{ {
path: "/project/:id?", path: "/project/:id?",
name: "project", name: "project",
component: () => component: () => import("../views/ProjectViewView.vue"),
import(/* webpackChunkName: "project" */ "../views/ProjectViewView.vue"),
}, },
{ {
path: "/projects", path: "/projects",
name: "projects", name: "projects",
component: () => component: () => import("../views/ProjectsView.vue"),
import(/* webpackChunkName: "projects" */ "../views/ProjectsView.vue"),
beforeEnter: enterOrStart, beforeEnter: enterOrStart,
}, },
{ {
path: "/quick-action-bvc", path: "/quick-action-bvc",
name: "quick-action-bvc", name: "quick-action-bvc",
component: () => component: () => import("../views/QuickActionBvcView.vue"),
import(
/* webpackChunkName: "quick-action-bvc" */ "../views/QuickActionBvcView.vue"
),
}, },
{ {
path: "/quick-action-bvc-begin", path: "/quick-action-bvc-begin",
name: "quick-action-bvc-begin", name: "quick-action-bvc-begin",
component: () => component: () => import("../views/QuickActionBvcBeginView.vue"),
import(
/* webpackChunkName: "quick-action-bvc-begin" */ "../views/QuickActionBvcBeginView.vue"
),
}, },
{ {
path: "/quick-action-bvc-end", path: "/quick-action-bvc-end",
name: "quick-action-bvc-end", name: "quick-action-bvc-end",
component: () => component: () => import("../views/QuickActionBvcEndView.vue"),
import(
/* webpackChunkName: "quick-action-bvc-end" */ "../views/QuickActionBvcEndView.vue"
),
}, },
{ {
path: "/scan-contact", path: "/scan-contact",
name: "scan-contact", name: "scan-contact",
component: () => component: () => import("../views/ContactScanView.vue"),
import(
/* webpackChunkName: "scan-contact" */ "../views/ContactScanView.vue"
),
}, },
{ {
path: "/search-area", path: "/search-area",
name: "search-area", name: "search-area",
component: () => component: () => import("../views/SearchAreaView.vue"),
import(
/* webpackChunkName: "search-area" */ "../views/SearchAreaView.vue"
),
}, },
{ {
path: "/seed-backup", path: "/seed-backup",
name: "seed-backup", name: "seed-backup",
component: () => component: () => import("../views/SeedBackupView.vue"),
import(
/* webpackChunkName: "seed-backup" */ "../views/SeedBackupView.vue"
),
}, },
{ {
path: "/start", path: "/start",
name: "start", name: "start",
component: () => component: () => import("../views/StartView.vue"),
import(/* webpackChunkName: "start" */ "../views/StartView.vue"),
}, },
{ {
path: "/statistics", path: "/statistics",
name: "statistics", name: "statistics",
component: () => component: () => import("../views/StatisticsView.vue"),
import(
/* webpackChunkName: "statistics" */ "../views/StatisticsView.vue"
),
}, },
{ {
path: "/test", path: "/test",
name: "test", name: "test",
component: () => component: () => import("../views/TestView.vue"),
import(/* webpackChunkName: "test" */ "../views/TestView.vue"),
}, },
]; ];
/** @type {*} */ /** @type {*} */
const router = createRouter({ const router = createRouter({
history: createWebHistory(process.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
routes, routes,
}); });

11
src/views/AccountViewView.vue

@ -516,7 +516,6 @@
<script lang="ts"> <script lang="ts">
import { AxiosError, AxiosRequestConfig } from "axios"; import { AxiosError, AxiosRequestConfig } from "axios";
import Dexie from "dexie"; import Dexie from "dexie";
import "dexie-export-import";
import { ImportProgress } from "dexie-export-import/dist/import"; import { ImportProgress } from "dexie-export-import/dist/import";
import { ref } from "vue"; import { ref } from "vue";
import { Component, Vue } from "vue-facing-decorator"; import { Component, Vue } from "vue-facing-decorator";
@ -539,9 +538,7 @@ import {
EndorserRateLimits, EndorserRateLimits,
ImageRateLimits, ImageRateLimits,
} from "@/libs/endorserServer"; } from "@/libs/endorserServer";
import { Buffer } from "buffer/";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Buffer = require("buffer/").Buffer;
interface IAccount { interface IAccount {
did: string; did: string;
@ -909,11 +906,11 @@ export default class AccountViewView extends Vue {
// Trigger the download // Trigger the download
this.downloadDatabaseBackup(this.downloadUrl); this.downloadDatabaseBackup(this.downloadUrl);
// Revoke the temporary URL -- not yet because of DuckDuckGo download failure
//URL.revokeObjectURL(this.downloadUrl);
// Notify the user that the download has started // Notify the user that the download has started
this.notifyDownloadStarted(); this.notifyDownloadStarted();
// Revoke the temporary URL -- after a pause to avoid DuckDuckGo download failure
setTimeout(() => URL.revokeObjectURL(this.downloadUrl), 1000);
} catch (error) { } catch (error) {
this.handleExportError(error); this.handleExportError(error);
} }

4
src/views/ContactQRScanShowView.vue

@ -88,9 +88,7 @@ import {
CONTACT_URL_PREFIX, CONTACT_URL_PREFIX,
ENDORSER_JWT_URL_LOCATION, ENDORSER_JWT_URL_LOCATION,
} from "@/libs/endorserServer"; } from "@/libs/endorserServer";
import { Buffer } from "buffer/";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Buffer = require("buffer/").Buffer;
@Component({ @Component({
components: { components: {

4
src/views/ContactsView.vue

@ -313,8 +313,8 @@ import QuickNav from "@/components/QuickNav.vue";
import EntityIcon from "@/components/EntityIcon.vue"; import EntityIcon from "@/components/EntityIcon.vue";
import { Account } from "@/db/tables/accounts"; import { Account } from "@/db/tables/accounts";
// eslint-disable-next-line @typescript-eslint/no-var-requires import { Buffer } from "buffer/";
const Buffer = require("buffer/").Buffer;
@Component({ @Component({
components: { QuickNav, EntityIcon }, components: { QuickNav, EntityIcon },

2
src/views/HelpView.vue

@ -385,7 +385,7 @@ export default class Help extends Vue {
$notify!: (notification: NotificationIface, timeout?: number) => void; $notify!: (notification: NotificationIface, timeout?: number) => void;
package = Package; package = Package;
commitHash = process.env.VUE_APP_GIT_HASH; commitHash = import.meta.env.VITE_GIT_HASH;
showOnboardInfo() { showOnboardInfo() {
this.$notify( this.$notify(

34
tsconfig.json

@ -1,38 +1,26 @@
{ {
"compilerOptions": { "compilerOptions": {
"allowJs": true, "target": "ES2020", // Latest ECMAScript features that are widely supported by modern browsers
"resolveJsonModule": true, "module": "ESNext", // Use ES modules
"target": "esnext", "strict": true, // Enable all strict type checking options
"module": "esnext", "jsx": "preserve", // Preserves JSX to be transformed by Babel or another transpiler
"strict": true, "moduleResolution": "node", // Use Node.js style module resolution
"strictPropertyInitialization": false,
"jsx": "preserve",
"moduleResolution": "node",
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "esModuleInterop": true, // Enables compatibility with CommonJS modules for default imports
"esModuleInterop": true, "allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export
"allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, // Disallow inconsistently-cased references to the same file
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": true, "useDefineForClassFields": true,
"sourceMap": true, "sourceMap": true,
"baseUrl": "./src", "baseUrl": "./src", // Base directory to resolve non-relative module names
"types": [
"webpack-env"
],
"paths": { "paths": {
"@/components/*": ["components/*"], "@/components/*": ["components/*"],
"@/views/*": ["views/*"], "@/views/*": ["views/*"],
"@/db/*": ["db/*"], "@/db/*": ["db/*"],
"@/libs/*": ["libs/*"], "@/libs/*": ["libs/*"],
"@/constants/*": ["constants/*"], "@/constants/*": ["constants/*"],
"@/store/*": ["store/*"], "@/store/*": ["store/*"]
}, },
"lib": [ "lib": ["ES2020", "dom", "dom.iterable"], // Include typings for ES2020 and DOM APIs
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}, },
"include": [ "include": [
"src/**/*.ts", "src/**/*.ts",

18
vite.config.mjs

@ -0,0 +1,18 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import * as path from "path";
// https://vitejs.dev/config/
export default defineConfig({
server: {
port: 8080
},
plugins: [ vue() ],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
buffer: path.resolve(__dirname, 'node_modules', 'buffer'),
'dexie-export-import/dist/import': 'dexie-export-import/dist/import/index.js',
},
},
});

30
vue.config.js

@ -1,36 +1,8 @@
const { defineConfig } = require("@vue/cli-service");
const { gitDescribeSync } = require("git-describe");
const { exec } = require("child_process");
process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash;
const TIME_SAFARI_APP_TITLE = const TIME_SAFARI_APP_TITLE =
process.env.TIME_SAFARI_APP_TITLE || require("./package.json").name; import.meta.env.TIME_SAFARI_APP_TITLE || require("./package.json").name;
module.exports = defineConfig({ module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
devtool: "source-map",
experiments: {
topLevelAwait: true,
},
plugins: [
{
// Still don't know why this runs three times.
apply: (compiler) => {
compiler.hooks.beforeCompile.tap("BeforeCompile", () => {
// Execute combine-sw.js script
exec("node sw_combine.js", (error, stdout, stderr) => {
if (error || stderr) {
console.error("Service worker files error:", error || stderr);
} else {
console.log("Finished combining service worker files.", stdout);
}
});
});
},
},
],
},
pwa: { pwa: {
name: TIME_SAFARI_APP_TITLE, name: TIME_SAFARI_APP_TITLE,
iconPaths: { iconPaths: {

Loading…
Cancel
Save