-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal.sh
More file actions
47 lines (47 loc) · 1.91 KB
/
local.sh
File metadata and controls
47 lines (47 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
echo "==================================="
echo "Linting and minifying files..."
echo "==================================="
echo "Validating source files..."
echo "-----------------------------------"
echo "Validating JavaScript"
npx eslint release_notes.js
echo "-----------------------------------"
echo "Validating HTML"
npx htmlhint release_notes.html
echo "-----------------------------------"
echo "Validating CSS"
npx stylelint release_notes.css
echo "-----------------------------------"
echo "All source files validated successfully."
echo "==================================="
echo "Starting minification process..."
echo "Output will be in the 'out' directory."
mkdir -p out
echo "-----------------------------------"
echo "Minifying HTML"
npx html-minifier --collapse-whitespace --remove-comments --minify-css true --minify-js true -o ./out/release_notes.html release_notes.html
echo "-----------------------------------"
echo "Minifying JavaScript"
npx terser release_notes.js -o ./out/release_notes.js --compress --mangle --comments "/eslint/"
echo "-----------------------------------"
echo "Minifying CSS"
npx csso-cli release_notes.css --output ./out/release_notes.css
echo "-----------------------------------"
echo "Minification complete."
echo "==================================="
echo "Starting validation of minified files..."
echo "-----------------------------------"
echo "Validating minified JavaScript"
npx eslint --no-ignore out/release_notes.js
echo "-----------------------------------"
echo "Validating minified HTML"
npx htmlhint out/release_notes.html
echo "-----------------------------------"
echo "Validating minified CSS"
npx stylelint out/release_notes.css
echo "-----------------------------------"
echo "Building release notes JSON..."
python release_notes.py --num_commits 15 --output out/release_notes.json
echo "-----------------------------------"
echo "All done!"
echo "==================================="