diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2d4e812..c628548 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -2,10 +2,10 @@ name: Docker on: push: - branches: [ "pro" ] - tags: [ 'v*.*.*' ] + branches: ["pro"] + tags: ["v*.*.*"] pull_request: - branches: [ "pro" ] + branches: ["pro"] env: # Use docker.io for Docker Hub if empty @@ -13,10 +13,8 @@ env: # github.repository as / IMAGE_NAME: ${{ github.repository }} - jobs: build: - runs-on: ubuntu-latest permissions: contents: read @@ -35,7 +33,7 @@ jobs: if: github.event_name != 'pull_request' uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 with: - cosign-release: 'v2.2.4' + cosign-release: "v2.2.4" # Set up BuildKit Docker container builder to be able to build # multi-platform images and export cache diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..7482114 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm nano-staged diff --git a/index.html b/index.html index 53ee57d..cb81b38 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - + diff --git a/package.json b/package.json index 910997c..835bc1e 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,14 @@ "dev": "vite", "build": "vite build", "serve": "vite preview", - "next": "bumpp" + "next": "bumpp", + "fix": "prettier --write .", + "prepare": "husky" + }, + "nano-staged": { + "*.{js,jsx,vue,ts,md,json,html}": [ + "prettier --write" + ] }, "license": "MIT", "dependencies": { @@ -24,12 +31,16 @@ "vue": "^3.5.12" }, "devDependencies": { + "@barelyhuman/prettier-config": "^2.0.2", "@vitejs/plugin-vue": "^5.1.4", "@vue/compiler-sfc": "^3.5.12", "autoprefixer": "^10.4.20", "bumpp": "^9.7.1", "cssnano": "^7.0.6", + "husky": "^9.1.7", + "nano-staged": "^0.8.0", "postcss": "^8.4.47", + "prettier": "^3.5.2", "tailwindcss": "^3.4.14", "terser": "^5.36.0", "vite": "^5.4.9" @@ -40,4 +51,4 @@ "dompurify": ">=2.5.0", "braces": ">=3.0.3" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 764c1a2..bad661c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -51,6 +51,9 @@ importers: specifier: ^3.5.12 version: 3.5.12 devDependencies: + '@barelyhuman/prettier-config': + specifier: ^2.0.2 + version: 2.0.2 '@vitejs/plugin-vue': specifier: ^5.1.4 version: 5.1.4(vite@5.4.9(terser@5.36.0))(vue@3.5.12) @@ -66,9 +69,18 @@ importers: cssnano: specifier: ^7.0.6 version: 7.0.6(postcss@8.4.47) + husky: + specifier: ^9.1.7 + version: 9.1.7 + nano-staged: + specifier: ^0.8.0 + version: 0.8.0 postcss: specifier: ^8.4.47 version: 8.4.47 + prettier: + specifier: ^3.5.2 + version: 3.5.2 tailwindcss: specifier: ^3.4.14 version: 3.4.14 @@ -106,6 +118,10 @@ packages: resolution: {integrity: sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==} engines: {node: '>=6.9.0'} + '@barelyhuman/prettier-config@2.0.2': + resolution: {integrity: sha512-ES+UvAEoRgQ/tymiU3Kqd2L1ltnTezLdecFdqdNvleS4Xv/87Rpjp7yO19OabCkLwcu6SCExYv23cQ4R0YBHww==, tarball: https://registry.npmjs.org/@barelyhuman/prettier-config/-/prettier-config-2.0.2.tgz} + hasBin: true + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==, tarball: https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz} engines: {node: '>=12'} @@ -775,6 +791,11 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==, tarball: https://registry.npmjs.org/husky/-/husky-9.1.7.tgz} + engines: {node: '>=18'} + hasBin: true + inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. @@ -940,6 +961,11 @@ packages: mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + nano-staged@0.8.0: + resolution: {integrity: sha512-QSEqPGTCJbkHU2yLvfY6huqYPjdBrOaTMKatO1F8nCSrkQGXeKwtCiCnsdxnuMhbg3DTVywKaeWLGCE5oJpq0g==, tarball: https://registry.npmjs.org/nano-staged/-/nano-staged-0.8.0.tgz} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -1240,6 +1266,11 @@ packages: resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==} engines: {node: ^10 || ^12 || >=14} + prettier@3.5.2: + resolution: {integrity: sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==, tarball: https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz} + engines: {node: '>=14'} + hasBin: true + prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} @@ -1554,6 +1585,8 @@ snapshots: '@babel/helper-validator-identifier': 7.25.7 to-fast-properties: 2.0.0 + '@barelyhuman/prettier-config@2.0.2': {} + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -2196,6 +2229,8 @@ snapshots: human-signals@5.0.0: {} + husky@9.1.7: {} + inflight@1.0.6: dependencies: once: 1.4.0 @@ -2339,6 +2374,10 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 + nano-staged@0.8.0: + dependencies: + picocolors: 1.1.1 + nanoid@3.3.7: {} node-fetch-native@1.6.4: {} @@ -2606,6 +2645,8 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + prettier@3.5.2: {} + prompts@2.4.2: dependencies: kleur: 3.0.3 diff --git a/src/components/editor-rich.vue b/src/components/editor-rich.vue index 1ede213..4f86eaa 100644 --- a/src/components/editor-rich.vue +++ b/src/components/editor-rich.vue @@ -1,5 +1,11 @@