From 3e2791cb5bf4286ceb5612f7ade58603ee6f45fb Mon Sep 17 00:00:00 2001 From: solderq35 Date: Fri, 25 Aug 2023 14:39:31 -0700 Subject: [PATCH] update prereqs and readme --- README.md | 3 ++- package.json | 2 +- website/docs/backend_prereqs.md | 3 --- website/docs/faq.md | 4 ++-- website/docs/frontend_prereqs.md | 30 ++++++++++++++++++++++++++---- website/docs/getting_started.md | 2 ++ 6 files changed, 33 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 39e0bcf..84e6d42 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,13 @@ How to change Node version: - `nvm install 18` (or whichever version you want) - `nvm use 18` -### Installation +### Installation / Command Line Arguments - `yarn install` to install required node modules. - `yarn start` to open the dev environment to preview the website. - `yarn build` to build the website locally (needed if you want to test the search function before deployment). - Deployment is handled by the files in `github/workflows` +- `yarn format` for code formatting ## Contribution Guidelines diff --git a/package.json b/package.json index e06b17f..8d40f91 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "test": "cross-env NODE_ENV='test' jest", "prepare": "husky install", "lint-staged": "lint-staged", - "prettier": "prettier --write ." + "format": "prettier --write ." }, "devDependencies": { "@babel/core": "^7.17.10", diff --git a/website/docs/backend_prereqs.md b/website/docs/backend_prereqs.md index cd0934f..e10d2a6 100644 --- a/website/docs/backend_prereqs.md +++ b/website/docs/backend_prereqs.md @@ -62,9 +62,6 @@ We use Yarn for this wiki. Run this _after_ you have set up npm. You may have to - IDE: Use any you like, VSCode is a personal favorite of mine. - For VSCode install appropriate extensions for Vue, Javascript, etc -- Vue Browser Debug Tools: [https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en) - - Allows you to debug vue store in browser, e.g. `vue.$store.getters["map/building_1/description"]` - - ![Screenshot](https://media.discordapp.net/attachments/1018323831468851202/1062557315640873030/image.png?width=1440&height=606) ### MySQL Workbench diff --git a/website/docs/faq.md b/website/docs/faq.md index 1545387..7a5d1b2 100644 --- a/website/docs/faq.md +++ b/website/docs/faq.md @@ -15,8 +15,8 @@ If you haven't already, please read through and follow those instructions first - `sam local start-api` for backend - As a general rule of thumb, you need to have Docker Desktop open in the background to run backend locally - [automated-jobs](https://github.com/OSU-Sustainability-Office/automated-jobs) will use syntax `node ` -- This wiki can be compiled with `npm start` -- `npm run format` or `yarn prettier` (for wiki) are for auto-formatting code +- This wiki can be compiled with `yarn start` +- `npm run format` or `yarn format` (for wiki) are for auto-formatting code - For more specific info, see the `README.md` or `package.json` of the individual repos as seen [here](getting_started#active-projects) - Note that some projects host separate `package.json` for backend folders - See [frontend prereqs](frontend_prereqs) and [backend prereqs](backend_prereqs) docs also; they are written mostly for energy-dashboard but should apply to most other Vue applications we use diff --git a/website/docs/frontend_prereqs.md b/website/docs/frontend_prereqs.md index 55cddd1..1a64521 100644 --- a/website/docs/frontend_prereqs.md +++ b/website/docs/frontend_prereqs.md @@ -7,17 +7,39 @@ description: Frontend software that must be installed in advance (Open Source Fr ## Pre-Reqs to Install -- Node Version Manager (nvm): +### NPM + +- NPM: [https://docs.npmjs.com/downloading-and-installing-node-js-and-npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) + - You probably have this but just in case + +### Yarn + +We use Yarn for this wiki. Run this _after_ you have set up npm. You may have to re-run this if you switch NodeJS versions with NVM as listed below. + +- `npm install --global yarn` +- https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable +### NVM / NodeJS + +- Node Version Manager (nvm): - This isn’t required but I highly recommend it (very annoying to switch NodeJS versions otherwise). - **This one is for Apple / Linux**: [https://github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm) - **Use this one for Windows**: [https://github.com/coreybutler/nvm-windows](https://github.com/coreybutler/nvm-windows) - Make sure to uninstall existing Node installation just in case: [https://github.com/coreybutler/nvm-windows#installation--upgrades](https://github.com/coreybutler/nvm-windows#installation--upgrades) - Read instructions in the repo README for general tips on installing specific node versions. - - Use Node 16 ( `nvm use 16 `) + - Use Node 18 ( `nvm use 18 `) + +### Browser Debug Tools + +- Inspect Element (right click > inspect in Chrome or Firefox) +- Vue Browser Debug Tools: [https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en](https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en) + - Allows you to debug vue store in browser, e.g. `vue.$store.getters["map/building_1/description"]` + - ![Screenshot](https://media.discordapp.net/attachments/1018323831468851202/1062557315640873030/image.png?width=1440&height=606) + +### IDE -- Read specific repo README for specifics (see [Getting Started](getting_started)), but in general: - - Run `npm run serve` in the frontend directory to run it. +- IDE: Use any you like, VSCode is a personal favorite of mine. + - For VSCode install appropriate extensions for Vue, Javascript, etc ## Running the Frontend diff --git a/website/docs/getting_started.md b/website/docs/getting_started.md index ddef32a..4f94226 100644 --- a/website/docs/getting_started.md +++ b/website/docs/getting_started.md @@ -47,6 +47,8 @@ Our Github Org: https://github.com/OSU-Sustainability-Office ## Contributing +- See [frontend prereqs](frontend_prereqs) doc for setup instructions for running the frontend locally +- See [backend prereqs](backend_prereqs) doc for setup instructions for running the backend locally - Any Frontend work is open to PR's / open source - Anything touching backend, including our NodeJS server (running locally), running AWS backend locally, or running AWS CRON jobs (for automated-jobs) can only be done by paid OSU Sustainability Office employees for security reasons - Open source contributors can run the production API endpoints for energy-dashboard and carbon-calculator, for debugging frontend-only issues