Skip to content

Commit 4f670b0

Browse files
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.
1 parent 59a412c commit 4f670b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+10954
-2305
lines changed

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Node modules
2+
node_modules/
3+
4+
# Vite build outputs
5+
dist/*
6+
!dist/.gitkeep
7+
8+
# Editor files
9+
.vscode/
10+
.idea/
11+
*.swp
12+
*.swo
13+
14+
# OS files
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Logs
19+
*.log
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
24+
# Environment variables
25+
.env
26+
.env.local
27+
.env.development.local
28+
.env.test.local
29+
.env.production.local
30+
31+
# ESLint and Prettier configs (created by precommit script)
32+
.eslintrc.json
33+
.prettierrc.json

.mentat/precommit.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
echo "Running linters and formatters..."
4+
5+
# Install ESLint and Prettier if not already installed
6+
if ! command -v eslint &> /dev/null || ! command -v prettier &> /dev/null; then
7+
echo "Installing ESLint and Prettier..."
8+
npm install --no-save eslint prettier eslint-config-prettier eslint-plugin-prettier
9+
fi
10+
11+
# Create ESLint config if it doesn't exist
12+
if [ ! -f ".eslintrc.json" ]; then
13+
echo '{
14+
"extends": ["prettier"],
15+
"plugins": ["prettier"],
16+
"rules": {
17+
"prettier/prettier": ["error", {
18+
"endOfLine": "auto"
19+
}]
20+
},
21+
"env": {
22+
"browser": true,
23+
"node": true,
24+
"es6": true
25+
},
26+
"parserOptions": {
27+
"ecmaVersion": 2020
28+
}
29+
}' > .eslintrc.json
30+
fi
31+
32+
# Create Prettier config if it doesn't exist
33+
if [ ! -f ".prettierrc.json" ]; then
34+
echo '{
35+
"singleQuote": true,
36+
"trailingComma": "es5",
37+
"printWidth": 100
38+
}' > .prettierrc.json
39+
fi
40+
41+
# Run Prettier on JavaScript files
42+
echo "Running Prettier on JavaScript files..."
43+
npx prettier --write "**/*.js" "**/*.json" "**/*.html" "**/*.css" --ignore-path .gitignore
44+
45+
# Run ESLint with --fix flag on JavaScript files
46+
echo "Running ESLint on JavaScript files..."
47+
npx eslint --fix "**/*.js" --ignore-path .gitignore
48+
49+
echo "Precommit checks completed!"

.mentat/setup.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
echo "Installing dependencies for the main project..."
4+
npm install
5+
6+
echo "Installing dependencies for the src project..."
7+
cd src
8+
npm install
9+
10+
echo "Installing dependencies for the npm server components..."
11+
cd npm
12+
# Create package.json if it doesn't exist
13+
if [ ! -f "package.json" ]; then
14+
echo '{
15+
"name": "scratch-shop-server",
16+
"version": "1.0.0",
17+
"description": "Server components for Scratch Shop",
18+
"main": "server.js",
19+
"scripts": {
20+
"start": "node server.js"
21+
},
22+
"dependencies": {
23+
"express": "^4.18.2",
24+
"axios": "^1.6.2",
25+
"dotenv": "^16.3.1",
26+
"body-parser": "^1.20.2",
27+
"cors": "^2.8.5"
28+
}
29+
}' > package.json
30+
fi
31+
npm install
32+
33+
# Return to root directory
34+
cd ../..
35+
36+
echo "Setup completed successfully!"

Partners/list.html

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<title>Partners | Coding Hut</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<style>
77
body {
88
overflow-x: hidden;
99
font-family: Sans-Serif;
1010
margin: 0;
1111
}
12-
<link href='https://fonts.googleapis.com/css?family=Comfortaa' rel='stylesheet'>
12+
<link href='https://fonts.googleapis.com/css?family=Comfortaa' rel='stylesheet'>
1313
<style>
1414
body {
15-
font-family: 'Comfortaa';font-size: 22px;
16-
}
15+
font-family: 'Comfortaa';
16+
font-size: 22px;
17+
}
1718

1819
.menu-container {
1920
position: relative;
@@ -108,7 +109,7 @@
108109
<nav class="menu-container">
109110
<!-- Logo -->
110111
<a href="https://scratch-coding-hut.github.io" class="menu-logo">
111-
<img src="https://i.postimg.cc/6qgPbyGH/temp-Image-BJ164c.avif" alt="Coding Hut Logo"/>
112+
<img src="https://i.postimg.cc/6qgPbyGH/temp-Image-BJ164c.avif" alt="Coding Hut Logo" />
112113
</a>
113114

114115
<!-- Menu for Mobile -->
@@ -120,7 +121,11 @@
120121
<li><a href="https://scratch-coding-hut.github.io">Home</a></li>
121122
<li><a href="https://scratch-coding-hut.github.io/about">About</a></li>
122123
<li><a href="https://scratch.mit.edu/discuss/topic/652178/">Scratch Forum</a></li>
123-
<li><a href="https://scratch-coding-hut.github.io/Wiki/sitemaplinks">Wiki | FAQ | More Links</a></li>
124+
<li>
125+
<a href="https://scratch-coding-hut.github.io/Wiki/sitemaplinks"
126+
>Wiki | FAQ | More Links</a
127+
>
128+
</li>
124129
</ul>
125130
<ul>
126131
<li><a href="https://scratch-coding-hut.github.io/messages">Messages</a></li>
@@ -129,9 +134,9 @@
129134
</div>
130135
</nav>
131136

132-
<h1 style="text-align:center;"><b>Coding Hut</b></h1>
133-
<h2 style="text-align:center;">Partners</h2>
134-
<p style="text-align:center;">Here is a list of some of coding hut's partners.</p>
137+
<h1 style="text-align: center"><b>Coding Hut</b></h1>
138+
<h2 style="text-align: center">Partners</h2>
139+
<p style="text-align: center">Here is a list of some of coding hut's partners.</p>
135140

136141
<script>
137142
function toggleMenu() {

Partners/partnerlogin.html

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
<html>
2-
<head>
3-
<title>Partner Login | Coding Hut</title>
4-
</head>
5-
<body>
6-
<h1>Coding Hut Partner Dashboard Login</h1>
7-
You can login to your partner dashboard below.
8-
<br>
9-
<form action="/Partners/confirm.html">
10-
<b>Shop Details:</b>
11-
<br><br>
12-
<label for="pname">Partner Shop Name:</label><br>
13-
<input type="text" id="pname" name="pname" required><br>
14-
<br>
15-
<b>User Details:</b>
16-
<br><br>
17-
<label for="puser">Partner Username:</label><br>
18-
<input type="text" id="puser" name="puser">
19-
<br><br>
20-
<label for="plkey">Partner Login Key:</label><br>
21-
<input type="text" id="plkey" name="plkey" required>
22-
<br><br>
23-
<b>System & Connection Details:</b>
24-
<br><br>
25-
<label for="version">Version of Partner Dashboard to connect to:</label>
26-
<select id="version" name="version" disabled>
27-
<option value="1.0-beta">1.0 BETA</option>
28-
<option value="1.0">1.0 GENERAL</option>
29-
</select>
30-
<br>
31-
<input type="submit" value="Sign In">
32-
</form>
33-
<br>
34-
<b>Are you a partner but don't know your login info?</b>
35-
<br>
36-
You can get your login info by entering your Scratch username, and entering the Request ID that you got.
37-
This info won't stay there forever, so make sure to keep your login info safe!
38-
If you fergot your login info, please tell us on our Scratch Forum Thread.
39-
<br>
2+
<head>
3+
<title>Partner Login | Coding Hut</title>
4+
</head>
5+
<body>
6+
<h1>Coding Hut Partner Dashboard Login</h1>
7+
You can login to your partner dashboard below.
8+
<br />
9+
<form action="/Partners/confirm.html">
10+
<b>Shop Details:</b>
11+
<br /><br />
12+
<label for="pname">Partner Shop Name:</label><br />
13+
<input type="text" id="pname" name="pname" required /><br />
14+
<br />
15+
<b>User Details:</b>
16+
<br /><br />
17+
<label for="puser">Partner Username:</label><br />
18+
<input type="text" id="puser" name="puser" />
19+
<br /><br />
20+
<label for="plkey">Partner Login Key:</label><br />
21+
<input type="text" id="plkey" name="plkey" required />
22+
<br /><br />
23+
<b>System & Connection Details:</b>
24+
<br /><br />
25+
<label for="version">Version of Partner Dashboard to connect to:</label>
26+
<select id="version" name="version" disabled>
27+
<option value="1.0-beta">1.0 BETA</option>
28+
<option value="1.0">1.0 GENERAL</option>
29+
</select>
30+
<br />
31+
<input type="submit" value="Sign In" />
32+
</form>
33+
<br />
34+
<b>Are you a partner but don't know your login info?</b>
35+
<br />
36+
You can get your login info by entering your Scratch username, and entering the Request ID that
37+
you got. This info won't stay there forever, so make sure to keep your login info safe! If you
38+
fergot your login info, please tell us on our Scratch Forum Thread.
39+
<br />
4040

41-
<b>There's currently no request ID's so the form is hidden</b>
42-
43-
</body></html>
41+
<b>There's currently no request ID's so the form is hidden</b>
42+
</body>
43+
</html>

Reviews/addreview.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<html>
2-
<head>
3-
<title>Review Us | Coding Hut</title>
4-
</head>
5-
<body>
6-
<h1>Review Coding Hut</h1>
7-
<form>
8-
<label for="order">What did you order?</label><br>
9-
<input type="text" id="order" name="order"><br>
10-
<label for="codinghut">Please describe your expirence with Coding Hut:</label><br>
11-
<input type="text" id="codinghut" name="codinghut">
12-
<label for="likes">What did you like about the product you recived?:</label><br>
13-
<input type="text" id="likes" name="likes">
14-
<label for="dislikes">What did you dislike about the product you recived?:</label><br>
15-
<input type="text" id="dislikes" name="dislikes">
16-
</form>
17-
</body>
2+
<head>
3+
<title>Review Us | Coding Hut</title>
4+
</head>
5+
<body>
6+
<h1>Review Coding Hut</h1>
7+
<form>
8+
<label for="order">What did you order?</label><br />
9+
<input type="text" id="order" name="order" /><br />
10+
<label for="codinghut">Please describe your expirence with Coding Hut:</label><br />
11+
<input type="text" id="codinghut" name="codinghut" />
12+
<label for="likes">What did you like about the product you recived?:</label><br />
13+
<input type="text" id="likes" name="likes" />
14+
<label for="dislikes">What did you dislike about the product you recived?:</label><br />
15+
<input type="text" id="dislikes" name="dislikes" />
16+
</form>
17+
</body>
1818
</html>

Reviews/list.html

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<title>Reviews | Coding Hut</title>
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<style>
77
body {
88
overflow-x: hidden;
99
font-family: Sans-Serif;
1010
margin: 0;
1111
}
12-
<link href='https://fonts.googleapis.com/css?family=Comfortaa' rel='stylesheet'>
12+
<link href='https://fonts.googleapis.com/css?family=Comfortaa' rel='stylesheet'>
1313
<style>
1414
body {
15-
font-family: 'Comfortaa';font-size: 22px;
16-
}
15+
font-family: 'Comfortaa';
16+
font-size: 22px;
17+
}
1718

1819
.menu-container {
1920
position: relative;
@@ -108,7 +109,7 @@
108109
<nav class="menu-container">
109110
<!-- Logo -->
110111
<a href="https://scratch-coding-hut.github.io" class="menu-logo">
111-
<img src="https://i.postimg.cc/6qgPbyGH/temp-Image-BJ164c.avif" alt="Coding Hut Logo"/>
112+
<img src="https://i.postimg.cc/6qgPbyGH/temp-Image-BJ164c.avif" alt="Coding Hut Logo" />
112113
</a>
113114

114115
<!-- Menu for Mobile -->
@@ -120,7 +121,11 @@
120121
<li><a href="https://scratch-coding-hut.github.io">Home</a></li>
121122
<li><a href="https://scratch-coding-hut.github.io/about">About</a></li>
122123
<li><a href="https://scratch.mit.edu/discuss/topic/652178/">Scratch Forum</a></li>
123-
<li><a href="https://scratch-coding-hut.github.io/Wiki/sitemaplinks">Wiki | FAQ | More Links</a></li>
124+
<li>
125+
<a href="https://scratch-coding-hut.github.io/Wiki/sitemaplinks"
126+
>Wiki | FAQ | More Links</a
127+
>
128+
</li>
124129
</ul>
125130
<ul>
126131
<li><a href="https://scratch-coding-hut.github.io/messages">Messages</a></li>
@@ -129,9 +134,9 @@
129134
</div>
130135
</nav>
131136

132-
<h1 style="text-align:center;"><b>Coding Hut</b></h1>
133-
<h2 style="text-align:center;">Reviews</h2>
134-
<p style="text-align:center;">Here are some reviews from our customers.</p>
137+
<h1 style="text-align: center"><b>Coding Hut</b></h1>
138+
<h2 style="text-align: center">Reviews</h2>
139+
<p style="text-align: center">Here are some reviews from our customers.</p>
135140

136141
<script>
137142
function toggleMenu() {

0 commit comments

Comments
 (0)