minify.lua from github
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
2026-02-26 23:13:44 +01:00
parent 41f75da8c3
commit 15bf66f1ca
3 changed files with 15 additions and 3280 deletions

4
.gitignore vendored
View File

@@ -1,6 +1,6 @@
.local .local
impostor.lua impostor.lua
impostor.min.lua impostor.original.lua
impostor.unmin.lua
prompts prompts
docs docs
minify.lua

View File

@@ -6,12 +6,12 @@ PROJECT = impostor
ORDER = $(PROJECT).inc ORDER = $(PROJECT).inc
OUTPUT = $(PROJECT).lua OUTPUT = $(PROJECT).lua
OUTPUT_MIN = $(PROJECT).min.lua OUTPUT_ORIGINAL = $(PROJECT).original.lua
OUTPUT_UNMIN = $(PROJECT).unmin.lua
OUTPUT_ZIP = $(PROJECT).html.zip OUTPUT_ZIP = $(PROJECT).html.zip
OUTPUT_TIC = $(PROJECT).tic OUTPUT_TIC = $(PROJECT).tic
MINIFY = minify.lua MINIFY = minify.lua
MINIFY_URL = https://raw.githubusercontent.com/ztimar31/lua-minify-tic80/refs/heads/master/minify.lua
SRC_DIR = inc SRC_DIR = inc
SRC = $(shell sed 's|^|$(SRC_DIR)/|' $(ORDER)) SRC = $(shell sed 's|^|$(SRC_DIR)/|' $(ORDER))
@@ -43,17 +43,17 @@ $(OUTPUT): $(SRC) $(ORDER)
echo "" >> $(OUTPUT); \ echo "" >> $(OUTPUT); \
done done
minify: $(OUTPUT_MIN) $(MINIFY):
@echo "==> Downloading $(MINIFY)"
@curl -fsSL $(MINIFY_URL) -o $(MINIFY)
$(OUTPUT_MIN): $(OUTPUT) $(MINIFY) minify: $(OUTPUT_ORIGINAL)
@echo "==> Minifying $(OUTPUT) -> $(OUTPUT_MIN)"
@lua $(MINIFY) minify $(OUTPUT) > $(OUTPUT_MIN)
unminify: $(OUTPUT_UNMIN) $(OUTPUT_ORIGINAL): $(SRC) $(ORDER) $(MINIFY)
@$(MAKE) build
$(OUTPUT_UNMIN): $(OUTPUT) $(MINIFY) @echo "==> Minifying $(OUTPUT)"
@echo "==> Unminifying $(OUTPUT) -> $(OUTPUT_UNMIN)" @cp $(OUTPUT) $(OUTPUT_ORIGINAL)
@lua $(MINIFY) unminify $(OUTPUT) > $(OUTPUT_UNMIN) @lua $(MINIFY) minify $(OUTPUT_ORIGINAL) > $(OUTPUT)
export: build export: build
@if [ -z "$(VERSION)" ]; then \ @if [ -z "$(VERSION)" ]; then \
@@ -172,7 +172,7 @@ export_assets:
@$(call f_export_asset_awk,WAVES,$(OUTPUT),$(ASSETS_LUA)) @$(call f_export_asset_awk,WAVES,$(OUTPUT),$(ASSETS_LUA))
clean: clean:
@rm -f $(PROJECT)-*.tic $(PROJECT)-*.html.zip $(OUTPUT) $(OUTPUT_MIN) $(OUTPUT_UNMIN) @rm -f $(PROJECT)-*.tic $(PROJECT)-*.html.zip $(OUTPUT) $(OUTPUT_MIN) $(PROJECT).original.lua
@echo "==> Cleaned build artifacts" @echo "==> Cleaned build artifacts"
# CI/CD Targets # CI/CD Targets
@@ -235,5 +235,4 @@ docs: build
@ldoc ${OUTPUT} -d docs @ldoc ${OUTPUT} -d docs
@echo "==> Documentation generated." @echo "==> Documentation generated."
.PHONY: all build minify unminify export watch import_assets export_assets clean lint ci-version ci-export ci-upload ci-update install_precommit_hook docs .PHONY: all build minify export watch import_assets export_assets clean lint ci-version ci-export ci-upload ci-update install_precommit_hook docs

3264
minify.lua

File diff suppressed because it is too large Load Diff