From 18bd747b252821b2e89e93531bfb75da69e937d0 Mon Sep 17 00:00:00 2001 From: Dirk Holtwick Date: Tue, 4 Oct 2022 22:39:08 +0200 Subject: [PATCH] Prettier single quote --- .eslintignore | 28 + .eslintrc | 3 + .github/workflows/codeql-analysis.yml | 4 +- .gitignore | 9 +- .prettierrc | 3 +- .vscode/settings.json | 7 + docker-compose.development.yml | 2 +- docker-compose.yml | 3 +- docker-package.json | 2 +- docs/coturn.md | 2 +- docs/development.md | 2 +- .../docker-compose.briefing-proxy.yml | 2 +- docs/examples/docker-compose.nginx-proxy.yml | 1 - index.html | 111 +- package.json | 8 +- public/service-worker.js | 16 +- scripts/app.js | 2 +- src/app.vue | 18 +- src/bugs/index.js | 34 +- src/bugs/lazy-sentry.js | 8 +- src/components/app-chat.vue | 28 +- src/components/app-embed.vue | 34 +- src/components/app-help.vue | 6 +- src/components/app-main.vue | 74 +- src/components/app-settings.vue | 46 +- src/components/app-share.vue | 18 +- src/components/app-video.vue | 22 +- src/components/app-welcome.vue | 26 +- src/components/app-whitelabel.vue | 26 +- src/config.js | 42 +- src/css/_html.scss | 4 +- src/css/_macros.scss | 2 +- src/css/_reset.scss | 8 +- src/css/_units.scss | 2 +- src/css/_variables.scss | 24 +- src/css/app.scss | 4 +- src/css/briefing.scss | 16 +- src/css/chat.scss | 4 +- src/css/forms.scss | 10 +- src/css/index.scss | 14 +- src/css/layout-maximized.scss | 2 +- src/css/stack.scss | 4 +- src/css/text.scss | 2 +- src/external-links.ts | 42 +- src/in-browser-test.js | 18 +- src/lib/assert.js | 12 +- src/lib/base.js | 10 +- src/lib/base64.js | 6 +- src/lib/history.ts | 8 +- src/lib/iframe.js | 14 +- src/lib/local.spec.js | 16 +- src/lib/locale.js | 4 +- src/lib/locale.spec.js | 26 +- src/lib/names-const.js | 5698 ++++++++--------- src/lib/names.js | 10 +- src/lib/names.spec.js | 10 +- src/lib/qrcode.js | 288 +- src/lib/share.js | 12 +- src/locales/de.json | 2 +- src/locales/en.json | 2 +- src/locales/es.json | 2 +- src/locales/fr.json | 2 +- src/locales/it.json | 2 +- src/locales/kr.json | 2 +- src/locales/pt.json | 2 +- src/locales/ro.json | 2 +- src/locales/ru.json | 2 +- src/locales/tr.json | 2 +- src/locales/zh.json | 2 +- src/logic/connection.js | 60 +- src/logic/fingerprint.js | 22 +- src/logic/fingerprint.spec.js | 20 +- src/logic/sdp-manipulation.js | 18 +- src/logic/simple-peer.ts | 294 +- src/logic/stream.js | 34 +- src/logic/webrtc-peer.js | 62 +- src/logic/webrtc.ts | 74 +- src/main.js | 50 +- src/state.js | 147 +- src/ui/lib/directives/trapFocus.js | 18 +- src/ui/lib/helpers.js | 4 +- src/ui/sea-button.scss | 2 +- src/ui/sea-button.vue | 32 +- src/ui/sea-form-group.vue | 4 +- src/ui/sea-input-base.vue | 12 +- src/ui/sea-link.vue | 4 +- src/ui/sea-modal.scss | 2 +- src/ui/sea-modal.vue | 40 +- src/ui/sea-switch.scss | 4 +- src/ui/sea-switch.vue | 12 +- src/ui/sea-symbol.vue | 2 +- src/zerva/apple.ts | 22 +- src/zerva/config.ts | 16 +- src/zerva/index.ts | 20 +- src/zerva/room.ts | 54 +- vite.config.js | 10 +- vitest.config.ts | 10 +- 97 files changed, 3986 insertions(+), 3942 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc create mode 100644 .vscode/settings.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..b4fd470 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,28 @@ +_archive +.DS_* +.env.* +.htaccess +.htaccess* +.idea +.out.* +.rsync-ignore +*.local +*.log +*.spec.* +bg.jpg +build +data +dist +dist_electron +docker +internal +legacy +logs +node_modules +npm-debug.log +package-lock.json +pnpm-lock.yaml +tmp +video +www +yarn-error.log \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..09c2e42 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "@antfu" +} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a194558..93b7b1c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,4 +1,4 @@ -name: "CodeQL" +name: 'CodeQL' on: push: @@ -7,7 +7,7 @@ on: # The branches below must be a subset of the branches above branches: [master] schedule: - - cron: "0 0 * * 6" + - cron: '0 0 * * 6' jobs: analyse: diff --git a/.gitignore b/.gitignore index 07dcec8..d22ba29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -.env.* .DS_* +.env.* .htaccess .htaccess* .idea @@ -7,18 +7,11 @@ .rsync-ignore *.local *.log -app/public/faces -bg.jpg -bower_components dist dist_electron docker internal legacy -legacy/app/public/faces -legacy/ios/Briefing/Briefing.xcodeproj/project.xcworkspace/xcuserdata/dirk.xcuserdatad/UserInterfaceState.xcuserstate -legacy/ios/Briefing/Briefing.xcodeproj/xcuserdata/dirk.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist -legacy/ios/Briefing/Briefing.xcodeproj/xcuserdata/dirk.xcuserdatad/xcschemes/xcschememanagement.plist logs node_modules npm-debug.log diff --git a/.prettierrc b/.prettierrc index cc4e915..5149b1b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,5 @@ { "trailingComma": "es5", - "semi": false + "semi": false, + "singleQuote": true } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..cb0d092 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "prettier.enable": false, + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + } +} diff --git a/docker-compose.development.yml b/docker-compose.development.yml index b905109..127c2e3 100644 --- a/docker-compose.development.yml +++ b/docker-compose.development.yml @@ -1,6 +1,6 @@ # Please read https://github.com/holtwick/briefing/blob/master/docs/docker.md for proper use of Docker -version: "3" +version: '3' services: briefing: diff --git a/docker-compose.yml b/docker-compose.yml index dcf1be0..59d1396 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ # Please read https://github.com/holtwick/briefing/blob/master/docs/docker.md for proper use of Docker -version: "3" +version: '3' services: briefing: @@ -10,7 +10,6 @@ services: - ./data:/app/data ports: - 8080:8080 - # networks: # default: # external: diff --git a/docker-package.json b/docker-package.json index e8d9982..992e845 100644 --- a/docker-package.json +++ b/docker-package.json @@ -15,4 +15,4 @@ "engines": { "node": ">=16.0.0" } -} \ No newline at end of file +} diff --git a/docs/coturn.md b/docs/coturn.md index e06676e..741b9de 100644 --- a/docs/coturn.md +++ b/docs/coturn.md @@ -40,7 +40,7 @@ proc-group=turnserver Docker might be an alternative, but I didn't try by myself: -- https://hub.docker.com/r/instrumentisto/coturn +- https://hub.docker.com/r/coturn/coturn - https://gabrieltanner.org/blog/turn-server --- diff --git a/docs/development.md b/docs/development.md index da14a70..674bb24 100644 --- a/docs/development.md +++ b/docs/development.md @@ -18,7 +18,7 @@ Most customization can be done by setting env variables, see [.env](../.env) for Enable logging by entering the following in the browsers console: ```js -localStorage.zeed = "*" +localStorage.zeed = '*' ``` ## Technology stack diff --git a/docs/examples/docker-compose.briefing-proxy.yml b/docs/examples/docker-compose.briefing-proxy.yml index ba75d11..350c0b2 100644 --- a/docs/examples/docker-compose.briefing-proxy.yml +++ b/docs/examples/docker-compose.briefing-proxy.yml @@ -1,4 +1,4 @@ -version: "3" +version: '3' services: briefing: diff --git a/docs/examples/docker-compose.nginx-proxy.yml b/docs/examples/docker-compose.nginx-proxy.yml index 3666525..49b8e19 100644 --- a/docs/examples/docker-compose.nginx-proxy.yml +++ b/docs/examples/docker-compose.nginx-proxy.yml @@ -16,4 +16,3 @@ networks: default: external: name: proxy - diff --git a/index.html b/index.html index 4fa007d..f83d550 100644 --- a/index.html +++ b/index.html @@ -1,55 +1,74 @@ + + + + + - - - - - + Briefing - Secure direct video conferencing - Briefing - Secure direct video conferencing + - + + + + - - - - + + + + + + + + + + + - - - - - - - - - - - + - + + + - - - - - - -
- - - - \ No newline at end of file + + +
+ + + diff --git a/package.json b/package.json index 92f5436..1fdc195 100644 --- a/package.json +++ b/package.json @@ -25,14 +25,16 @@ "check": "vue-tsc --noEmit", "clean": "rm -rf dist www", "format": "prettier --write .", + "lint": "eslint .", + "lint:fix": "eslint . --fix", "preview": "vite preview", "reset": "rm -rf node_modules pnpm-lock.yaml dist dist_www www", "serve": "cross-env ZEED=* LEVEL=i node dist/main.cjs", "start": "cross-env ZEED=* LEVEL=a zerva src/zerva/index.ts", "test": "cross-env ZEED=* LEVEL=i vitest -r src --globals", + "upload:dockerhub": "nr build:docker && cd docker && docker buildx build --platform linux/arm64,linux/amd64,linux/s390x,linux/arm/v7,linux/arm/v6 -t holtwick/briefing:$npm_package_version -t holtwick/briefing:latest --push .", "upload:production": "nr build && rsync -rvz --exclude-from=.rsyncignore * docker-dev:briefing", - "upload:stage": "cross-env MODE=stage nr build:basis && rsync -rvz --exclude-from=.rsyncignore * docker-pro:briefing", - "upload:dockerhub": "nr build:docker && cd docker && docker buildx build --platform linux/arm64,linux/amd64,linux/s390x,linux/arm/v7,linux/arm/v6 -t holtwick/briefing:$npm_package_version -t holtwick/briefing:latest --push ." + "upload:stage": "cross-env MODE=stage nr build:basis && rsync -rvz --exclude-from=.rsyncignore * docker-pro:briefing" }, "dependencies": { "@sentry/browser": "^7.14.0", @@ -46,12 +48,14 @@ "zeed": "^0.8.31" }, "devDependencies": { + "@antfu/eslint-config": "^0.27.0", "@antfu/ni": "^0.18.2", "@types/node": "^18.7.23", "@vitejs/plugin-vue2": "^2.0.0", "@zerva/bin": "^0.14.2", "@zerva/vite": "^0.14.2", "cross-env": "^7.0.3", + "eslint": "^8.24.0", "prettier": "^2.7.1", "sass": "^1.55.0", "tsc": "^2.0.4", diff --git a/public/service-worker.js b/public/service-worker.js index b7eaa58..ccecad3 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -1,21 +1,21 @@ -console.info("Unregister previous service workers") +console.info('Unregister previous service workers') try { - self.addEventListener("install", () => { + self.addEventListener('install', () => { // Skip over the "waiting" lifecycle state, to ensure that our // new service worker is activated immediately, even if there's // another tab open controlled by our older service worker code. self.skipWaiting() }) - self.addEventListener("activate", () => { + self.addEventListener('activate', () => { // Optional: Get a list of all the current open windows/tabs under // our service worker's control, and force them to reload. // This can "unbreak" any open windows/tabs as soon as the new // service worker activates, rather than users having to manually reload. self.clients .matchAll({ - type: "window", + type: 'window', }) .then((windowClients) => { windowClients.forEach((windowClient) => { @@ -24,7 +24,7 @@ try { }) }) - self.addEventListener("activate", function (e) { + self.addEventListener('activate', function (e) { self.registration .unregister() .then(function () { @@ -35,7 +35,7 @@ try { }) }) } catch (err) { - console.error("Activate failed", err) + console.error('Activate failed', err) } try { @@ -43,7 +43,7 @@ try { for (let name of names) caches.delete(name) }) } catch (err) { - console.error("Cache delete failed", err) + console.error('Cache delete failed', err) } try { @@ -53,5 +53,5 @@ try { } }) } catch (err) { - console.error("Unregistering failed", err) + console.error('Unregistering failed', err) } diff --git a/scripts/app.js b/scripts/app.js index d4d0a5d..56217d4 100644 --- a/scripts/app.js +++ b/scripts/app.js @@ -1,3 +1,3 @@ // Some services prefer to start with app.js -import "./dist/main.cjs" +import './dist/main.cjs' diff --git a/src/app.vue b/src/app.vue index b0a7aa1..191f3aa 100644 --- a/src/app.vue +++ b/src/app.vue @@ -6,16 +6,16 @@ diff --git a/src/components/app-embed.vue b/src/components/app-embed.vue index 47a22d4..040e5c8 100644 --- a/src/components/app-embed.vue +++ b/src/components/app-embed.vue @@ -80,14 +80,14 @@ diff --git a/src/ui/sea-modal.scss b/src/ui/sea-modal.scss index 2d306cf..72d0fb7 100644 --- a/src/ui/sea-modal.scss +++ b/src/ui/sea-modal.scss @@ -1,6 +1,6 @@ // Copyright (c) 2020-2022 Dirk Holtwick. All rights reserved. https://holtwick.de/copyright -@import "../css/variables"; +@import '../css/variables'; $modalOverlayBackground: var(--overlay-color, rgba(black, 0.75)); $modalSepColor: var(--separator-color, $gray-color-light); diff --git a/src/ui/sea-modal.vue b/src/ui/sea-modal.vue index c3a99f0..9c92b72 100644 --- a/src/ui/sea-modal.vue +++ b/src/ui/sea-modal.vue @@ -51,27 +51,27 @@