From 2109079c5bc4f48904a0543897ede33fcfebad77 Mon Sep 17 00:00:00 2001 From: brenzi Date: Tue, 7 May 2024 10:05:41 +0200 Subject: [PATCH] introduce eslint and prettier and GHA checks (#21) * introduce eslint and prettier * add GHA CI * run prettier again --- .github/workflows/build.yml | 24 + .github/workflows/deploy.yml | 4 +- .github/workflows/prettier.yml | 24 + README.md | 5 +- app.config.ts | 8 +- app.vue | 37 +- assets/css/main.css | 2 +- assets/scss/_fonts.scss | 36 +- assets/scss/_variables.scss | 41 +- assets/scss/main.scss | 510 ++++---- components/CheckWalletTab.vue | 145 ++- components/Contacts/Form.vue | 197 +-- components/Contacts/Info.vue | 11 +- components/Contacts/index.vue | 51 +- components/CreateWalletTab.vue | 70 +- components/Docs/Texts.vue | 21 +- components/Docs/index.vue | 393 +++--- components/Footer/index.vue | 143 ++- components/Global/LineLink.vue | 151 +-- components/Global/RadialGradient.vue | 34 +- components/Global/Simple.vue | 320 ++--- components/Header/Menu.vue | 38 +- components/Header/index.vue | 217 ++-- components/Index/Community.vue | 18 +- components/Index/Delegator.vue | 30 +- components/Index/Hunter.vue | 27 +- components/Index/Main.vue | 29 +- components/Index/News.vue | 15 +- components/Index/Partner.vue | 26 +- components/Index/Prizes.vue | 43 +- components/Index/Rules.vue | 67 +- components/Index/Scalability.vue | 30 +- components/Index/Steps.vue | 75 +- components/Index/UseCases.vue | 116 -- components/Index/Validator.vue | 31 +- components/Index/Work.vue | 16 +- components/InviteFriendTab.vue | 140 ++- components/Logo/index.vue | 151 ++- components/LogoIntegritee/index.vue | 203 ++-- components/PublishonxTab.vue | 128 +- components/Socials/Section.vue | 314 +++-- components/Socials/index.vue | 14 +- components/UnshieldTab.vue | 80 +- configs/app.config.ts | 281 +++-- docker-compose.yml | 4 +- eslint.config.mjs | 5 + helpers/date.ts | 14 +- helpers/generateSEO.ts | 33 +- helpers/stripHTML.ts | 4 +- nuxt.config.ts | 73 +- package.json | 12 +- pages/index.vue | 23 +- plugins/lockScroll.ts | 26 +- prettierrc.json | 6 + public/site.webmanifest | 34 +- store/account.ts | 45 +- store/incognitee.ts | 62 +- store/paseo.ts | 12 +- tailwind.config.js | 3 +- yarn.lock | 1652 +++++++++++++++++++++++++- 60 files changed, 4257 insertions(+), 2067 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/prettier.yml delete mode 100644 components/Index/UseCases.vue create mode 100644 eslint.config.mjs create mode 100644 prettierrc.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b58bb7e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: Generate Check + +on: + pull_request: + branches: + - master + +jobs: + generate: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "20" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run Generate + run: yarn generate diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d13aa91..fa2d3ec 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,8 +28,8 @@ jobs: needs: build # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: - pages: write # to deploy to Pages - id-token: write # to verify the deployment originates from an appropriate source + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source # Deploy to the github_pages environment environment: name: github_pages diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml new file mode 100644 index 0000000..9c864db --- /dev/null +++ b/.github/workflows/prettier.yml @@ -0,0 +1,24 @@ +name: Prettier Check + +on: + pull_request: + branches: + - master + +jobs: + prettier: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "20" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run Prettier + run: yarn prettier --check . diff --git a/README.md b/README.md index edfa622..9e3c069 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. ## Note -The `@encointer/worker-api` uses the browser's built-in `webcrypto` api. This library is only available in secure -secure contexts. Hence, in local development you must use `localhost`. `webcrypto` is undefined on `127.0.0.1` and + +The `@encointer/worker-api` uses the browser's built-in `webcrypto` api. This library is only available in secure +secure contexts. Hence, in local development you must use `localhost`. `webcrypto` is undefined on `127.0.0.1` and `0.0.0.0`. ## Setup diff --git a/app.config.ts b/app.config.ts index 358e382..e47276a 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,10 +1,10 @@ -import { defineAppConfig } from '#imports' +import { defineAppConfig } from "#imports"; export default defineAppConfig({ - title: 'Integritee', + title: "Integritee", theme: { colors: { - primary: '#ff0000', + primary: "#ff0000", }, }, -}) +}); diff --git a/app.vue b/app.vue index 1582f16..3d59a4f 100644 --- a/app.vue +++ b/app.vue @@ -1,10 +1,11 @@ -git - - + + + + + diff --git a/components/Socials/index.vue b/components/Socials/index.vue index 5bb1f77..07f35ae 100644 --- a/components/Socials/index.vue +++ b/components/Socials/index.vue @@ -12,11 +12,15 @@ -