diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..4d765f2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "prettier"] } diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 198a35e..55cc970 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -3,21 +3,21 @@ name: Deploy to Firebase Hosting on merge "on": - push: - branches: - - main + push: + branches: + - main jobs: - build_and_deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: npm install && npm run lint && npm run build - env: - CMS_URL: ${{ secrets.CMS_URL }} - - uses: FirebaseExtended/action-hosting-deploy@v0 - with: - target: "satakuntalainenosakunta" - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_SATAKUNTATALO_SERVICES }}" - channelId: live - projectId: satakuntatalo-services + build_and_deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: npm install && npm run lint && npm run build + env: + CMS_URL: ${{ secrets.CMS_URL }} + - uses: FirebaseExtended/action-hosting-deploy@v0 + with: + target: "satakuntalainenosakunta" + repoToken: "${{ secrets.GITHUB_TOKEN }}" + firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_SATAKUNTATALO_SERVICES }}" + channelId: live + projectId: satakuntatalo-services diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index d1a010f..15a083f 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -4,23 +4,23 @@ name: Deploy to Firebase Hosting on PR "on": pull_request jobs: - build_and_preview: - if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: npm install && npm run lint && npm run build - env: - CMS_URL: ${{ secrets.CMS_URL }} - - uses: FirebaseExtended/action-hosting-deploy@v0 - id: firebase - with: - target: "satakuntalainenosakunta" - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_SATAKUNTATALO_SERVICES }}" - projectId: satakuntatalo-services - - uses: treosh/lighthouse-ci-action@v12 - id: lighthouse - with: - urls: ${{ steps.firebase.outputs.details_url }} - temporaryPublicStorage: true + build_and_preview: + if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: npm install && npm run lint && npm run build + env: + CMS_URL: ${{ secrets.CMS_URL }} + - uses: FirebaseExtended/action-hosting-deploy@v0 + id: firebase + with: + target: "satakuntalainenosakunta" + repoToken: "${{ secrets.GITHUB_TOKEN }}" + firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_SATAKUNTATALO_SERVICES }}" + projectId: satakuntatalo-services + - uses: treosh/lighthouse-ci-action@v12 + id: lighthouse + with: + urls: ${{ steps.firebase.outputs.details_url }} + temporaryPublicStorage: true diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.prettierrc @@ -0,0 +1 @@ +{} diff --git a/doc/initial_plan.md b/doc/initial_plan.md index 55c8a98..148e491 100644 --- a/doc/initial_plan.md +++ b/doc/initial_plan.md @@ -1,7 +1,7 @@ # Inital project planning This effort aims to create a new website for the Satakunta Nation -The old website has become cumbersome to maintain, and is built with 10 year old technology. The user experience is also not welcoming. +The old website has become cumbersome to maintain, and is built with 10 year old technology. The user experience is also not welcoming. We plan on using Figma for prototyping and designing user interfaces, Trello for tracking tasks and progress, and Miro for diagrams (site maps etc.). The code is hosted here on GitHub. diff --git a/firebase.json b/firebase.json index 4c380f4..e338e7e 100644 --- a/firebase.json +++ b/firebase.json @@ -1,7 +1,7 @@ { - "hosting": { - "target": "satakuntalainenosakunta", - "public": "out", - "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] - } + "hosting": { + "target": "satakuntalainenosakunta", + "public": "out", + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] + } } diff --git a/hooks/useCMS.ts b/hooks/useCMS.ts index e2f89bc..9422d70 100644 --- a/hooks/useCMS.ts +++ b/hooks/useCMS.ts @@ -25,7 +25,7 @@ const useCMS = ({ collection, query = "", initialData }: UseCMSProps) => { try { const response = await fetch( - `${process.env.NEXT_PUBLIC_DIRECTUS_URL}/items/text` + `${process.env.NEXT_PUBLIC_DIRECTUS_URL}/items/text`, ); if (!response.ok) { throw new Error(`Error: ${response.status} ${response.statusText}`); diff --git a/next.config.mjs b/next.config.mjs index 5fb1bcd..366c433 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -2,7 +2,7 @@ const nextConfig = { output: "export", images: { - unoptimized: true + unoptimized: true, }, reactStrictMode: true, }; diff --git a/package-lock.json b/package-lock.json index 6d157e7..d4a1d09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,8 +24,10 @@ "@vitejs/plugin-react": "^4.3.1", "eslint": "^8", "eslint-config-next": "14.2.4", + "eslint-config-prettier": "^9.1.0", "fast-check": "^3.20.0", "jsdom": "^24.1.0", + "prettier": "3.3.3", "typescript": "^5", "vitest": "^2.0.3" } @@ -3629,6 +3631,18 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -6068,6 +6082,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-format": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", diff --git a/package.json b/package.json index 29053ba..3a29097 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,10 @@ "@vitejs/plugin-react": "^4.3.1", "eslint": "^8", "eslint-config-next": "14.2.4", + "eslint-config-prettier": "^9.1.0", "fast-check": "^3.20.0", "jsdom": "^24.1.0", + "prettier": "3.3.3", "typescript": "^5", "vitest": "^2.0.3" }