diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4afc80a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,6 @@ +.nuxt +Cargo.lock +dist +node_modules +pnpm-lock.yaml +target diff --git a/crates/backend/tests/specs/index.e2e.js b/crates/backend/tests/specs/index.e2e.js index 4d69165..8c6a46b 100644 --- a/crates/backend/tests/specs/index.e2e.js +++ b/crates/backend/tests/specs/index.e2e.js @@ -1,32 +1,32 @@ // calculates the luma from a hex color `#abcdef` function luma(hex) { - if (hex.startsWith('#')) { - hex = hex.substring(1) - } + if (hex.startsWith("#")) { + hex = hex.substring(1); + } - const rgb = parseInt(hex, 16) - const r = (rgb >> 16) & 0xff - const g = (rgb >> 8) & 0xff - const b = (rgb >> 0) & 0xff - return 0.2126 * r + 0.7152 * g + 0.0722 * b + const rgb = parseInt(hex, 16); + const r = (rgb >> 16) & 0xff; + const g = (rgb >> 8) & 0xff; + const b = (rgb >> 0) & 0xff; + return 0.2126 * r + 0.7152 * g + 0.0722 * b; } -describe('Hello Tauri', () => { - it('should be cordial', async () => { - const header = await $('body > h1') - const text = await header.getText() - expect(text).toMatch(/^[hH]ello/) - }) +describe("Hello Tauri", () => { + it("should be cordial", async () => { + const header = await $("body > h1"); + const text = await header.getText(); + expect(text).toMatch(/^[hH]ello/); + }); - it('should be excited', async () => { - const header = await $('body > h1') - const text = await header.getText() - expect(text).toMatch(/!$/) - }) + it("should be excited", async () => { + const header = await $("body > h1"); + const text = await header.getText(); + expect(text).toMatch(/!$/); + }); - it('should be easy on the eyes', async () => { - const body = await $('body') - const backgroundColor = await body.getCSSProperty('background-color') - expect(luma(backgroundColor.parsed.hex)).toBeLessThan(100) - }) -}) \ No newline at end of file + it("should be easy on the eyes", async () => { + const body = await $("body"); + const backgroundColor = await body.getCSSProperty("background-color"); + expect(luma(backgroundColor.parsed.hex)).toBeLessThan(100); + }); +}); diff --git a/crates/backend/wdio.conf.js b/crates/backend/wdio.conf.js index 4006540..db89ce1 100644 --- a/crates/backend/wdio.conf.js +++ b/crates/backend/wdio.conf.js @@ -1,39 +1,39 @@ -const os = require('os') -const path = require('path') -const { spawn, spawnSync } = require('child_process') +const os = require("os"); +const path = require("path"); +const { spawn, spawnSync } = require("child_process"); // keep track of the `tauri-driver` child process -let tauriDriver +let tauriDriver; exports.config = { - specs: ['./tests/specs/**/*.js'], - maxInstances: 1, - capabilities: [ - { - maxInstances: 1, - 'tauri:options': { - application: '../../target/debug/app', - }, - }, - ], - reporters: ['spec'], - framework: 'mocha', - mochaOpts: { - ui: 'bdd', - timeout: 60000, + specs: ["./tests/specs/**/*.js"], + maxInstances: 1, + capabilities: [ + { + maxInstances: 1, + "tauri:options": { + application: "../../target/debug/app", + }, }, + ], + reporters: ["spec"], + framework: "mocha", + mochaOpts: { + ui: "bdd", + timeout: 60000, + }, - // ensure the rust project is built since we expect this binary to exist for the webdriver sessions - onPrepare: () => spawnSync('cargo', ['build']), + // ensure the rust project is built since we expect this binary to exist for the webdriver sessions + onPrepare: () => spawnSync("cargo", ["build"]), - // ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests - beforeSession: () => + // ensure we are running `tauri-driver` before the session starts so that we can proxy the webdriver requests + beforeSession: () => (tauriDriver = spawn( - path.resolve(os.homedir(), '.cargo', 'bin', 'tauri-driver'), - [], - { stdio: [null, process.stdout, process.stderr] } + path.resolve(os.homedir(), ".cargo", "bin", "tauri-driver"), + [], + { stdio: [null, process.stdout, process.stderr] } )), - // clean up the `tauri-driver` process we spawned at the start of the session - afterSession: () => tauriDriver.kill(), -} \ No newline at end of file + // clean up the `tauri-driver` process we spawned at the start of the session + afterSession: () => tauriDriver.kill(), +}; diff --git a/crates/frontend/src/assets/scss/main.scss b/crates/frontend/src/assets/scss/main.scss index 29b97d9..b72899e 100644 --- a/crates/frontend/src/assets/scss/main.scss +++ b/crates/frontend/src/assets/scss/main.scss @@ -1,4 +1,4 @@ -@import './vuetify/main.scss'; +@import "./vuetify/main.scss"; html, body { diff --git a/crates/frontend/src/assets/scss/variables.scss b/crates/frontend/src/assets/scss/variables.scss index 848c653..5341881 100644 --- a/crates/frontend/src/assets/scss/variables.scss +++ b/crates/frontend/src/assets/scss/variables.scss @@ -1,3 +1,3 @@ -@use 'vuetify/settings' with ( +@use "vuetify/settings" with ( $utilities: yes ); diff --git a/crates/frontend/src/assets/scss/vuetify/main.scss b/crates/frontend/src/assets/scss/vuetify/main.scss index 453dd0b..50bf9c6 100644 --- a/crates/frontend/src/assets/scss/vuetify/main.scss +++ b/crates/frontend/src/assets/scss/vuetify/main.scss @@ -1,4 +1,4 @@ -@use 'vuetify' with ( +@use "vuetify" with ( $utilities: yes, $color-pack: false ); diff --git a/package.json b/package.json new file mode 100644 index 0000000..1de4934 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "board-voter-root", + "private": true, + "scripts": { + "format": "prettier --write .", + "format-check": "prettier --check ." + }, + "devDependencies": { + "prettier": "^2.8.8" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cdea734..758a451 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,12 @@ settings: importers: + .: + devDependencies: + prettier: + specifier: ^2.8.8 + version: 2.8.8 + crates/backend: dependencies: '@tauri-apps/cli': @@ -6332,6 +6338,12 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + /pretty-bytes@6.1.0: resolution: {integrity: sha512-Rk753HI8f4uivXi4ZCIYdhmG1V+WKzvRMg/X+M42a6t7D07RcmopXJMDNk6N++7Bl75URRGsb40ruvg7Hcp2wQ==} engines: {node: ^14.13.1 || >=16.0.0}