From 4f670b08b3e0b133b407279d6956c5ee06ddb299 Mon Sep 17 00:00:00 2001 From: MentatBot <160964065+MentatBot@users.noreply.github.com> Date: Tue, 22 Apr 2025 07:27:26 +0000 Subject: [PATCH 1/4] chore: add setup and precommit scripts This PR adds two scripts to help with automatic development: 1. `.mentat/setup.sh`: Installs all necessary dependencies for the project - Main project dependencies (Vite) - Src project dependencies (Gulp and related plugins) - Node.js server dependencies (Express and related packages) 2. `.mentat/precommit.sh`: Runs code quality checks before commits - Configures and runs Prettier for code formatting - Configures and runs ESLint with auto-fix 3. Also updates `.gitignore` to exclude auto-generated files These scripts will help maintain code quality and ensure consistent environment setup. --- .gitignore | 33 + .mentat/precommit.sh | 49 + .mentat/setup.sh | 36 + Partners/list.html | 25 +- Partners/partnerlogin.html | 82 +- Reviews/addreview.html | 32 +- Reviews/list.html | 25 +- Rewards/balance.html | 35 +- Support/support.html | 1 - bannedusers.json | 10 +- package-lock.json | 860 ++++ sites/YOURSITEURL/home.html | 38 +- sites/center.html | 1 - src/404.html | 242 +- src/Strikes/my-strikes.html | 64 +- src/Wiki/Community_Portal.html | 21 +- src/Wiki/edit.html | 370 +- src/Wiki/post.html | 48 +- src/Wiki/sitemaplinks.html | 132 +- src/Wiki/topic_template.html | 79 +- src/Wiki/wiki-guidelines.html | 22 +- src/about.html | 441 +-- src/account.html | 488 +-- src/api/orders.html | 142 +- src/auth.html | 14 +- src/deploy/canuseDeploy.json | 12 +- src/deploy/home.html | 185 +- src/google0bd18e79f285dd20.html | 2 +- src/google152e72ba02049324.html | 2 +- src/gulpfile.js | 51 +- src/message_person.html | 246 +- src/messages.html | 42 +- src/npm/app.js | 94 +- src/npm/package-lock.json | 898 +++++ src/npm/package.json | 16 + src/npm/server.js | 262 +- src/npm/wikis.json | 1 - src/order-tracker.html | 287 +- src/package-lock.json | 6493 +++++++++++++++++++++++++++++++ src/privatemessages.html | 310 +- src/webhosting.html | 163 +- tests/account-dashboard.html | 32 +- tests/localsite.html | 867 +++-- vite.config.js | 6 +- 44 files changed, 10954 insertions(+), 2305 deletions(-) create mode 100644 .gitignore create mode 100755 .mentat/precommit.sh create mode 100755 .mentat/setup.sh create mode 100644 package-lock.json create mode 100644 src/npm/package-lock.json create mode 100644 src/npm/package.json create mode 100644 src/package-lock.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8c2f2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# Node modules +node_modules/ + +# Vite build outputs +dist/* +!dist/.gitkeep + +# Editor files +.vscode/ +.idea/ +*.swp +*.swo + +# OS files +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Environment variables +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# ESLint and Prettier configs (created by precommit script) +.eslintrc.json +.prettierrc.json diff --git a/.mentat/precommit.sh b/.mentat/precommit.sh new file mode 100755 index 0000000..8e87de1 --- /dev/null +++ b/.mentat/precommit.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +echo "Running linters and formatters..." + +# Install ESLint and Prettier if not already installed +if ! command -v eslint &> /dev/null || ! command -v prettier &> /dev/null; then + echo "Installing ESLint and Prettier..." + npm install --no-save eslint prettier eslint-config-prettier eslint-plugin-prettier +fi + +# Create ESLint config if it doesn't exist +if [ ! -f ".eslintrc.json" ]; then + echo '{ + "extends": ["prettier"], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": ["error", { + "endOfLine": "auto" + }] + }, + "env": { + "browser": true, + "node": true, + "es6": true + }, + "parserOptions": { + "ecmaVersion": 2020 + } +}' > .eslintrc.json +fi + +# Create Prettier config if it doesn't exist +if [ ! -f ".prettierrc.json" ]; then + echo '{ + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 100 +}' > .prettierrc.json +fi + +# Run Prettier on JavaScript files +echo "Running Prettier on JavaScript files..." +npx prettier --write "**/*.js" "**/*.json" "**/*.html" "**/*.css" --ignore-path .gitignore + +# Run ESLint with --fix flag on JavaScript files +echo "Running ESLint on JavaScript files..." +npx eslint --fix "**/*.js" --ignore-path .gitignore + +echo "Precommit checks completed!" diff --git a/.mentat/setup.sh b/.mentat/setup.sh new file mode 100755 index 0000000..9b8a4b0 --- /dev/null +++ b/.mentat/setup.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +echo "Installing dependencies for the main project..." +npm install + +echo "Installing dependencies for the src project..." +cd src +npm install + +echo "Installing dependencies for the npm server components..." +cd npm +# Create package.json if it doesn't exist +if [ ! -f "package.json" ]; then + echo '{ + "name": "scratch-shop-server", + "version": "1.0.0", + "description": "Server components for Scratch Shop", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.18.2", + "axios": "^1.6.2", + "dotenv": "^16.3.1", + "body-parser": "^1.20.2", + "cors": "^2.8.5" + } +}' > package.json +fi +npm install + +# Return to root directory +cd ../.. + +echo "Setup completed successfully!" diff --git a/Partners/list.html b/Partners/list.html index f7d8577..382701b 100644 --- a/Partners/list.html +++ b/Partners/list.html @@ -1,19 +1,20 @@ - +