Skip to content

Commit

Permalink
Create reset frontend testing script and link in contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Dec 18, 2024
1 parent 68afc74 commit a888f2c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
19 changes: 10 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,15 @@ All branding elements such as logos, icons, colors and fonts should follow those
Nuxt uses auto imports to make frontend development more seamless, but at times these imports malfunction. For the `Property 'PROPERTY_NAME' does not exist on type...` errors, this is caused both by having an out of sync `yarn.lock` file and having Nuxt improperly installed.
Things to check are:
Please run [frontend/reset_local_env.sh](frontend/reset_local_env.sh) to reset the local frontend environment to allow for local testing. This can be done via the following commands:
1. Replace `yarn.lock` file with the one in main
2. Run `yarn cache clean` (this clears the yarn cache system wide and takes a long time)
3. Delete the `node_modules` folder
4. Load environment variables into your shell with `set -a && source ../.env.dev && set +a`
5. Rerun `yarn install`
6. Restart your IDE to assure that changes are picked up
```bash
# Linux:
sh frontend/reset_local_env.sh
> [!NOTE]
> Also make sure that the dependencies have been installed within the appropriate directory (`/backend` and `/frontend`).
# MacOS:
sh frontend/reset_local_env.sh
# Windows:
# Run the commands below found in frontend/reset_local_env.sh.
```
20 changes: 20 additions & 0 deletions frontend/reset_local_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Run this script to reset the local frontend environment to allow for local testing.
# macOS: sh frontend/reset_local_env.sh
# Linux: bash frontend/reset_local_env.sh
# Windows: Run the commands below.

# Replace local yarn.lock file with the one in main:
wget -O yarn.lock https://raw.githubusercontent.com/activist-org/activist/refs/heads/main/frontend/yarn.lock

# Clear the yarn cache system wide (might take a long time):
yarn cache clean

# Delete the node_modules folder:
rm -rf node_modules

# Load environment variables into your shell:
set -a && source ../.env.dev && set +a

# Reinstall and prompt to restart IDE:
yarn install
echo "Please restart your IDE to assure that changes are picked up."

0 comments on commit a888f2c

Please sign in to comment.