feature: HTML/JS/CSS minifiction and cache busting

This commit is contained in:
jamesread 2024-02-09 17:01:39 +00:00
parent 7dce77adcf
commit 086d8fd21c
27 changed files with 4798 additions and 10 deletions

View File

@ -25,7 +25,7 @@ jobs:
uses: actions/setup-node@v3
with:
cache: 'npm'
cache-dependency-path: webui/package-lock.json
cache-dependency-path: webui.dev/package-lock.json
- name: Setup Go
uses: actions/setup-go@v5

View File

@ -26,7 +26,7 @@ jobs:
uses: actions/setup-node@v3
with:
cache: 'npm'
cache-dependency-path: webui/package-lock.json
cache-dependency-path: webui.dev/package-lock.json
- name: Setup Go
uses: actions/setup-go@v5

View File

@ -17,7 +17,7 @@ on:
paths:
- 'cmd/**'
- 'internal/**'
- 'webui/**'
- 'webui.dev/**'
- 'integration-tests/**'
- 'OliveTin.proto'
branches: [main]

View File

@ -6,7 +6,7 @@ on:
paths:
- 'cmd/**'
- 'internal/**'
- 'webui/**'
- 'webui.dev/**'
- 'integration-tests/**'
- 'OliveTin.proto'

4
.gitignore vendored
View File

@ -1,4 +1,3 @@
webui/node_modules
**/*.swp
**/*.swo
gen/
@ -10,3 +9,6 @@ releases/
dist/
installation-id.txt
tmp/
webui/
webui.dev/node_modules
webui.dev/.parcel-cache

View File

@ -2,7 +2,7 @@ project_name: OliveTin
before:
hooks:
- go mod download
- rm -rf webui/node_modules
- make webui-dist
builds:
- env:
- CGO_ENABLED=0

View File

@ -63,9 +63,13 @@ devrun: compile
devcontainer: compile podman-image podman-container
webui-codestyle:
cd webui && npm install
cd webui && ./node_modules/.bin/eslint main.js js/*
cd webui && ./node_modules/.bin/stylelint style.css
cd webui.dev && npm install
cd webui.dev && ./node_modules/.bin/eslint main.js js/*
cd webui.dev && ./node_modules/.bin/stylelint style.css
webui-dist:
cd webui.dev && npm install
cd webui.dev && parcel build --dist-dir ../webui/
clean:
rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

File diff suppressed because it is too large Load Diff

View File

@ -3,13 +3,14 @@
"version": "1.0.0",
"description": "The WebUI for OliveTin",
"repository": "http://github.com/OliveTin/OliveTin",
"main": "main.js",
"source": "index.html",
"devDependencies": {
"eslint": "^7.25.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"parcel": "^2.11.0",
"stylelint": "^15.6.0",
"stylelint-config-standard": "^33.0.0"
},