From 7874ac4e815e22cf4c43f0d5f0455ca543c236fb Mon Sep 17 00:00:00 2001 From: Alok Gupta Date: Tue, 30 Jul 2024 21:28:58 +0530 Subject: [PATCH 1/3] Add algolia search env in build step & remove duplicate pkg from pkg.json --- .github/workflows/preview-deployment.yml | 3 ++ .github/workflows/production-deployment.yml | 5 ++- .gitignore | 1 + package.json | 3 +- yarn.lock | 36 ++++----------------- 5 files changed, 16 insertions(+), 32 deletions(-) diff --git a/.github/workflows/preview-deployment.yml b/.github/workflows/preview-deployment.yml index a8eb57236..3042b103b 100644 --- a/.github/workflows/preview-deployment.yml +++ b/.github/workflows/preview-deployment.yml @@ -72,6 +72,9 @@ jobs: - name: Build Site run: yarn run build + env: + NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.NEXT_PUBLIC_ALGOLIA_APP_ID }} + NEXT_PUBLIC_ALGOLIA_API_KEY: ${{ secrets.NEXT_PUBLIC_ALGOLIA_API_KEY }} - name: Deploy to Cloudflare Pages uses: AdrianGonz97/refined-cf-pages-action@v1 diff --git a/.github/workflows/production-deployment.yml b/.github/workflows/production-deployment.yml index b659b6231..9a09b934f 100644 --- a/.github/workflows/production-deployment.yml +++ b/.github/workflows/production-deployment.yml @@ -1,4 +1,4 @@ -name: Docs Production Deployment +name: Production Deployment on: push: branches: @@ -52,6 +52,9 @@ jobs: - name: Build Site run: yarn run build + env: + NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.NEXT_PUBLIC_ALGOLIA_APP_ID }} + NEXT_PUBLIC_ALGOLIA_API_KEY: ${{ secrets.NEXT_PUBLIC_ALGOLIA_API_KEY }} - name: Deploy to Cloudflare Pages uses: AdrianGonz97/refined-cf-pages-action@v1 diff --git a/.gitignore b/.gitignore index d70f6cb33..42468966c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ yarn-error.log* .env.development.local .env.test.local .env.production.local +.env # vercel .vercel diff --git a/package.json b/package.json index 371a344a7..24c4fa752 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,8 @@ "@next/eslint-plugin-next": "^14.0.1", "@types/file-saver": "^2.0.7", "@types/js-yaml": "^4.0.5", - "@types/node": "^20.0.0", - "@types/react": "18.3.3", "@types/node": "^20.14.10", + "@types/react": "18.3.3", "@types/react-syntax-highlighter": "^15.5.13", "@types/react-text-truncate": "^0.14.1", "@typescript-eslint/eslint-plugin": "^6.21.0", diff --git a/yarn.lock b/yarn.lock index 955fc0994..12b79efc7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1168,7 +1168,7 @@ deep-is@^0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== -define-data-property@^1.0.1, define-data-property@^1.1.1: +define-data-property@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== @@ -3311,7 +3311,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -safe-array-concat@^1.1.2: +safe-array-concat@^1.0.1, safe-array-concat@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.1.2.tgz#81d77ee0c4e8b863635227c721278dd524c20edb" integrity sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q== @@ -3383,7 +3383,7 @@ semver@^7.0.0, semver@^7.5.3, semver@^7.5.4: dependencies: lru-cache "^6.0.0" -set-function-length@^1.2.1: +set-function-length@^1.1.1, set-function-length@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== @@ -3400,12 +3400,9 @@ set-function-name@^2.0.0, set-function-name@^2.0.1: resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" set-function-name@^2.0.2: version "2.0.2" @@ -3422,16 +3419,6 @@ setimmediate@^1.0.5: resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== -set-function-name@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" - integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== - dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - functions-have-names "^1.2.3" - has-property-descriptors "^1.0.2" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3612,7 +3599,7 @@ string.prototype.trimend@^1.0.8: define-properties "^1.2.1" es-object-atoms "^1.0.0" -string.prototype.trimstart@^1.0.8: +string.prototype.trimstart@^1.0.7, string.prototype.trimstart@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== @@ -3628,15 +3615,6 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -string.prototype.trimstart@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz#7ee834dda8c7c17eff3118472bb35bfedaa34dde" - integrity sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - es-object-atoms "^1.0.0" - "strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" From f121a74d2a0054fcc5d1aad6567e519b3ad7c138 Mon Sep 17 00:00:00 2001 From: Alok Gupta Date: Tue, 30 Jul 2024 21:39:51 +0530 Subject: [PATCH 2/3] fixes preview deployment --- .github/workflows/preview-deployment.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-deployment.yml b/.github/workflows/preview-deployment.yml index 3042b103b..d4d9d4c75 100644 --- a/.github/workflows/preview-deployment.yml +++ b/.github/workflows/preview-deployment.yml @@ -79,8 +79,8 @@ jobs: - name: Deploy to Cloudflare Pages uses: AdrianGonz97/refined-cf-pages-action@v1 with: - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + apiToken: ${{ secrets.CF_API_TOKEN }} + accountId: ${{ secrets.CF_ACCOUNT_ID }} githubToken: ${{ secrets.GITHUB_TOKEN }} projectName: ${{ vars.CF_PROJECT_NAME }} directory: out From 7176bf4af5882c8260d50dd032af57f50f924b76 Mon Sep 17 00:00:00 2001 From: Alok Gupta Date: Tue, 30 Jul 2024 21:43:54 +0530 Subject: [PATCH 3/3] chore(husky): fix husky warning --- .husky/pre-commit | 3 --- 1 file changed, 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 6c9e70886..4c0003ca0 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,3 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - echo 'Performing code styling, testing, and building processes before committing' # Check ESLint Standards