Skip to content

refactor: SimpleSteamTinker (Lua) -> STweaker (Lune/Luau) #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .darklua.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"generator": { "name": "dense", "column_span": 175},
"bundle": {
"require_mode": {
"name" : "path",
"sources": {
"@Classes": "./src/Classes",
"@Configuration": "./src/Configuration",
"@Launcher" : "./src/Launcher",
"@Steam": "./src/Steam",
"@Utilities": "./src/Utilities",
"@Metadata": "./src/Metadata"
}
},
"excludes": ["@lune/**"]
},
"rules": [
"remove_comments",
"remove_spaces",
"remove_nil_declaration",
"compute_expression",
"remove_unused_if_branch",
"filter_after_early_return",
"remove_empty_do"
]
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# LF normalization
* text=auto
14 changes: 14 additions & 0 deletions .luaurc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"languageMode": "strict",
"lint": {
"*": false
},
"aliases": {
"Classes": "./src/Classes",
"Configuration": "./src/Configuration",
"Launcher" : "./src/Launcher",
"Steam": "./src/Steam",
"Utilities": "./src/Utilities",
"Metadata": "./src/Metadata"
}
}
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"luau-lsp.require.mode": "relativeToFile",
"luau-lsp.require.directoryAliases": {
"@lune/": "~/.lune/.typedefs/0.8.8/",
"@Classes": "src/Classes",
"@Configuration": "src/Configuration",
"@Launcher" : "src/Launcher",
"@Steam": "src/Steam",
"@Utilities": "src/Utilities",
"@Metadata": "src/Metadata"
},
"luau-lsp.sourcemap.enabled": false
}
79 changes: 27 additions & 52 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,63 +1,38 @@
# Metadata
PROJECT_NAME=simplesteamtinker
INSTALL_FOLDER_NAME=SimpleSteamTinker
PROJECT_NAME=stweaks
INSTALL_FOLDER_NAME=STWeaks
VERSION=indev

ifeq ($(PREFIX),)
PREFIX := /usr
endif
BUILD_FOLDER := dist/

.PHONY: system install uninstall clean local

# -------------- System installation --------------
# This will create a folder structure in dist that is compatible with most package managers.
system:
@echo "Packaging project for system installation..."
# Executable
mkdir -p $(BUILD_FOLDER)$(PREFIX)/bin
install -Dm755 sst $(BUILD_FOLDER)$(PREFIX)/bin
# Modules
mkdir -p $(BUILD_FOLDER)$(PREFIX)/share/$(INSTALL_FOLDER_NAME)
install -Dm644 main.lua $(BUILD_FOLDER)$(PREFIX)/share/$(INSTALL_FOLDER_NAME)/main.lua
cp -r modules $(BUILD_FOLDER)$(PREFIX)/share/$(INSTALL_FOLDER_NAME)
# UI
mkdir -p $(BUILD_FOLDER)$(PREFIX)/share/$(INSTALL_FOLDER_NAME)/ui
install -Dm644 ui/main.ui $(BUILD_FOLDER)$(PREFIX)/share/$(INSTALL_FOLDER_NAME)/ui/main.ui
# Desktop file
mkdir -p $(BUILD_FOLDER)$(PREFIX)/share/applications
install -Dm644 assets/desktop/system.desktop $(BUILD_FOLDER)$(PREFIX)/share/applications/$(PROJECT_NAME).desktop
# Icons
mkdir -p $(BUILD_FOLDER)$(PREFIX)/share/icons/hicolor/256x256/apps
mkdir -p $(BUILD_FOLDER)$(PREFIX)/share/icons/hicolor/scalable/apps
install -Dm644 assets/icons/256x256.png $(BUILD_FOLDER)$(PREFIX)/share/icons/hicolor/256x256/apps/$(PROJECT_NAME).png
install -Dm644 assets/icons/scalable.svg $(BUILD_FOLDER)$(PREFIX)/share/icons/hicolor/scalable/apps/$(PROJECT_NAME).svg

# Should only be used as last resort, the end user should use a compatible package manager if possible instead.
# This is only here for testing purposes, and also as a general "manual" on how to install the project for package maintainers.
install: system
@echo "Installing project to system..."
cp -r $(BUILD_FOLDER)$(PREFIX)/bin/* $(PREFIX)/bin
cp -r $(BUILD_FOLDER)$(PREFIX)/share/$(INSTALL_FOLDER_NAME) $(PREFIX)/share
cp -r $(BUILD_FOLDER)$(PREFIX)/share/applications/* $(PREFIX)/share/applications
cp -r $(BUILD_FOLDER)$(PREFIX)/share/icons/hicolor/256x256/apps/* $(PREFIX)/share/icons/hicolor/256x256/apps
cp -r $(BUILD_FOLDER)$(PREFIX)/share/icons/hicolor/scalable/apps/* $(PREFIX)/share/icons/hicolor/scalable/apps
# Update icon cache
@echo "Updating icon cache..."
gtk-update-icon-cache $(PREFIX)/share/icons/hicolor
uninstall:
@echo "Uninstalling project from system..."
rm -ri $(PREFIX)/bin/sst
rm -rI $(PREFIX)/share/$(INSTALL_FOLDER_NAME)
rm -ri $(PREFIX)/share/applications/$(PROJECT_NAME).desktop
rm -ri $(PREFIX)/share/icons/hicolor/256x256/apps/$(PROJECT_NAME).png
rm -ri $(PREFIX)/share/icons/hicolor/scalable/apps/$(PROJECT_NAME).svg
# Update icon cache
@ echo "Updating icon cache..."
gtk-update-icon-cache $(PREFIX)/share/icons/hicolor

# -------------- Cleaning --------------
.PHONY: build run check style clean

# -------------- Packaging --------------
$(BUILD_FOLDER)stweaks.luau: clean
@echo "Using DarkLua to bundle Luau code..."
darklua process init.luau $(BUILD_FOLDER)stweaks.luau -v

build: $(BUILD_FOLDER)stweaks.luau
@echo "Compiling project..."
lune build $(BUILD_FOLDER)stweaks.luau

# -------------- Run --------------
run:
@echo "Running project..."
lune run init

# -------------- Extra --------------
check:
@echo "Running linter..."
selene src/

style:
@echo "Running code formatter..."
stylua src/

clean:
@echo "Cleaning up..."
rm -rf $(BUILD_FOLDER)
rm -rf "$(BUILD_FOLDER)"
184 changes: 0 additions & 184 deletions README.md

This file was deleted.

8 changes: 0 additions & 8 deletions assets/desktop/system.desktop

This file was deleted.

Binary file removed assets/icons/256x256.png
Binary file not shown.
Loading