From 74685fa741350a2438dc4419df5868babd2692be Mon Sep 17 00:00:00 2001 From: ChatonDeAru <823314+chatondearu@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:52:33 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Use=20.env=20to=20pass=20service?= =?UTF-8?q?s=20accounts=20access=20and=20some=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 14 +++++++++ .eslintrc.js | 1 + .nvmrc | 1 + package.json | 5 ++-- src/components/Knowledge/BoxItem.tsx | 2 +- src/server/gsheets/accessors.ts | 45 +++++++++------------------- src/server/ssr.tsx | 2 +- src/types/index.d.ts | 3 ++ yarn.lock | 5 ++++ 9 files changed, 43 insertions(+), 35 deletions(-) create mode 100644 .env.example create mode 100644 .nvmrc diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a489cbe --- /dev/null +++ b/.env.example @@ -0,0 +1,14 @@ +## Google Cloud Platform Service Account +GCP_SERVICE_ACCOUNT_PRIVATE_KEY= +GCP_SERVICE_ACCOUNT_CLIENT_ID= +GCP_SERVICE_ACCOUNT_CLIENT_EMAIL= +GSHEET_ID= + +## Discord +DISCORD_TOKEN= +DISCORD_CLIENTID= +DISCORD_GUILDID= + +## Notifications +FORCE_ORANGE_PUBLIC_VAPID_KEY= +FORCE_ORANGE_PRIVATE_VAPID_KEY= \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 88bb4b1..ede1411 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -52,6 +52,7 @@ module.exports = { "testing-library/no-node-access": "off", "testing-library/render-result-naming-convention": "off", "jsx-a11y/label-has-associated-control": "off", + "jsx-a11y/control-has-associated-label": "off", }, globals: { __CLIENT__: true, diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..72c7744 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18.12.1 \ No newline at end of file diff --git a/package.json b/package.json index 4d83f80..644778c 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ "npm": ">=6" }, "scripts": { - "dev": "yarn dev:build && nodemon ./public/server", - "ser": "yarn dev:build && node ./public/server", + "dev": "yarn dev:build && nodemon -r dotenv/config ./public/server", + "ser": "yarn dev:build && node -r dotenv/config ./public/server", "dev:build": "cross-env NODE_ENV=development webpack --config ./webpack/server.config.ts", "local-start": "cross-env LOCAL=true yarn build && node ./public/server", "discord-register": "cross-env REGISTER_DISCORD_COMMANDS=true yarn build && node ./public/server", @@ -175,6 +175,7 @@ "compression-webpack-plugin": "^8.0.1", "css-loader": "^5.2.6", "css-minimizer-webpack-plugin": "^3.0.2", + "dotenv": "^16.3.1", "eslint": "^7.14.0", "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^8.3.0", diff --git a/src/components/Knowledge/BoxItem.tsx b/src/components/Knowledge/BoxItem.tsx index 0b309f6..4a874e4 100644 --- a/src/components/Knowledge/BoxItem.tsx +++ b/src/components/Knowledge/BoxItem.tsx @@ -71,7 +71,7 @@ const BoxItem: React.FC = ({ target="_blank" rel="noreferrer" > -
+