Skip to content

Commit ef8030d

Browse files
committed
Add npm script for Docker dev and improve UI feedback
- Add 'docker:dev' npm script for development Docker Compose setup - Fix npm script naming consistency (build-css:prod) - Update Docker Compose command to use modern 'docker compose' syntax - Increase SEARCH_TERM_MIN_LENGTH to 3 in dev config - Add warning/info emojis to search feedback messages
1 parent bc271d0 commit ef8030d

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

docker-compose-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ services:
88
- ./db.json:/data/db.json:ro
99
environment:
1010
- SEARCH_HIGHLIGHT_LIMIT=10
11-
- SEARCH_TERM_MIN_LENGTH=2
11+
- SEARCH_TERM_MIN_LENGTH=3
1212
restart: unless-stopped

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
"description": "A web interface for takeCode",
55
"main": "index.js",
66
"scripts": {
7-
"build": "rm -f public/styles.css && npm run version:sync && npm run build-css-prod && echo '✅ Build completed successfully'",
7+
"build": "rm -f public/styles.css && npm run version:sync && npm run build-css:prod && echo '✅ Build completed successfully'",
88
"dev": "npm run build-css & cd public && python3 -m http.server 8000",
9+
"docker:dev": "docker compose -f docker-compose-dev.yml up --build",
910
"build-css": "tailwindcss -i ./src/input.css -o ./public/styles.css",
10-
"build-css-prod": "tailwindcss -i ./src/input.css -o ./public/styles.css --minify",
11+
"build-css:prod": "tailwindcss -i ./src/input.css -o ./public/styles.css --minify",
1112
"version:sync": "node -e \"const fs = require('fs'); const { execSync } = require('child_process'); const tag = execSync('git describe --tags --abbrev=0').toString().trim().replace(/^v/, ''); const pkg = JSON.parse(fs.readFileSync('package.json')); pkg.version = tag; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\\n'); console.log('Updated version to:', tag);\""
1213
},
1314
"devDependencies": {

public/js/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ document.addEventListener('DOMContentLoaded', () => {
251251
}));
252252

253253
// Show message about minimum length
254-
searchInfoBar.innerHTML = `Search term too short (minimum ${minLength} characters)`;
254+
searchInfoBar.innerHTML = `⚠️ Search term too short (minimum ${minLength} characters)`;
255255
searchInfoBar.classList.remove('hidden');
256256
} else {
257257
// Filter snippets and determine which tab should be active
@@ -332,7 +332,7 @@ document.addEventListener('DOMContentLoaded', () => {
332332
});
333333
});
334334

335-
searchInfoBar.innerHTML = `${totalMatches} match${totalMatches !== 1 ? 'es' : ''} found in ${snippetCount} snippet${snippetCount !== 1 ? 's' : ''}`;
335+
searchInfoBar.innerHTML = `ℹ️ ${totalMatches} match${totalMatches !== 1 ? 'es' : ''} found in ${snippetCount} snippet${snippetCount !== 1 ? 's' : ''}`;
336336
searchInfoBar.classList.remove('hidden');
337337
}
338338

0 commit comments

Comments
 (0)