Skip to content

Commit

Permalink
Merge pull request #3 from wowsims/ui-rewrite
Browse files Browse the repository at this point in the history
UI Rewrite
  • Loading branch information
kayla-glick authored Mar 12, 2024
2 parents 3475a5a + 5444545 commit b46dcfa
Show file tree
Hide file tree
Showing 1,068 changed files with 31,050 additions and 36,352 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# nodejs modules
node_modules

ui/core/index.ts
ui/*/index.html
ui/*/*/index.html
.dirstamp

# IDE folders
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @type {import("prettier").Options)}
* @type {import("prettier").Config}
*/
module.exports = {
printWidth: 100,
printWidth: 160,
useTabs: true,
tabWidth: 4,
semi: true,
Expand Down
215 changes: 93 additions & 122 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,131 +1,102 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"eslint.validate": ["javascript", "typescript"],
"eslint.nodePath": "./node_modules",
"eslint.workingDirectories": ["."],
"[javascript]": {
"javascript.preferences.importModuleSpecifier": "relative",
"javascript.preferences.importModuleSpecifierEnding": "minimal",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifierEnding": "minimal",
"[javascript][javascriptreact][typescript][typescriptreact][scss][html]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
"source.fixAll.eslint": "always"
}
},
"[javascriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
}
},
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
}
},
"[typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
"json.schemas": [
{
"fileMatch": ["*.apl.json"],
"url": "./schemas/apl_rotation.schema.json"
},
{
"fileMatch": ["*.gear.json"],
"url": "./schemas/gear.schema.json"
}
},
"[scss]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
}
},
"[html]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
}
},
"json.schemas": [
{
"fileMatch": [
"*.apl.json"
],
"url": "./schemas/apl_rotation.schema.json"
},
{
"fileMatch": [
"*.gear.json"
],
"url": "./schemas/gear.schema.json"
}
],
"Lua.diagnostics.globals": [
"FONT_COLOR_CODE_CLOSE",
"SELECTED_CHAT_FRAME",
"DEFAULT_CHAT_FRAME",
"InterfaceOptions_AddCategory",
"NORMAL_FONT_COLOR",
"GameFontNormal",
"GameFontHighlight",
"ACCEPT",
"CANCEL",
"GameFontHighlightLarge",
"GameFontHighlightSmall",
"SlashCmdList",
"hash_SlashCmdList",
"NORMAL_FONT_COLOR_CODE",
"CLOSE",
"PanelTemplates_TabResize",
"PanelTemplates_SetDisabledTabState",
"PanelTemplates_SelectTab",
"PanelTemplates_DeselectTab",
"SetDesaturation",
"ColorPickerFrame",
"OpacitySliderFrame",
"ChatFontNormal",
"OKAY",
"NOT_BOUND",
"NUM_BAG_SLOTS",
"NUM_BANKBAGSLOTS",
"InterfaceOptionsFrame_OpenToCategory",
"BANK_CONTAINER",
"CreateFrame",
"geterrorhandler",
"IsLoggedIn",
"PlaySound",
"GetRealmName",
"UnitName",
"UnitClass",
"UnitRace",
"UnitFactionGroup",
"GetCurrentRegion",
"GetLocale",
"C_Container",
"GetTalentInfo",
"UnitFullName",
"GetPlayerInfoByGUID",
"UnitLevel",
"tInvert",
"GetItemInfo",
"IsEquippableItem",
"UnitGUID",
"GetSpellInfo",
"GetInventorySlotInfo",
"GetInventoryItemLink",
"max",
"min",
"ceil",
"BackdropTemplateMixin",
"floor",
"GetCursorInfo",
"ClearCursor",
"hooksecurefunc",
"GetMacroInfo",
"IsShiftKeyDown",
"IsControlKeyDown",
"IsAltKeyDown",
"issecurevariable",
"GetTime",
"C_Timer",
"format",
"gsub",
"strfind",
"strsub",
"strchar",
"strbyte",
"tinsert",
"UIParent"
],
"[javascript][scss][typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
],
"Lua.diagnostics.globals": [
"FONT_COLOR_CODE_CLOSE",
"SELECTED_CHAT_FRAME",
"DEFAULT_CHAT_FRAME",
"InterfaceOptions_AddCategory",
"NORMAL_FONT_COLOR",
"GameFontNormal",
"GameFontHighlight",
"ACCEPT",
"CANCEL",
"GameFontHighlightLarge",
"GameFontHighlightSmall",
"SlashCmdList",
"hash_SlashCmdList",
"NORMAL_FONT_COLOR_CODE",
"CLOSE",
"PanelTemplates_TabResize",
"PanelTemplates_SetDisabledTabState",
"PanelTemplates_SelectTab",
"PanelTemplates_DeselectTab",
"SetDesaturation",
"ColorPickerFrame",
"OpacitySliderFrame",
"ChatFontNormal",
"OKAY",
"NOT_BOUND",
"NUM_BAG_SLOTS",
"NUM_BANKBAGSLOTS",
"InterfaceOptionsFrame_OpenToCategory",
"BANK_CONTAINER",
"CreateFrame",
"geterrorhandler",
"IsLoggedIn",
"PlaySound",
"GetRealmName",
"UnitName",
"UnitClass",
"UnitRace",
"UnitFactionGroup",
"GetCurrentRegion",
"GetLocale",
"C_Container",
"GetTalentInfo",
"UnitFullName",
"GetPlayerInfoByGUID",
"UnitLevel",
"tInvert",
"GetItemInfo",
"IsEquippableItem",
"UnitGUID",
"GetSpellInfo",
"GetInventorySlotInfo",
"GetInventoryItemLink",
"max",
"min",
"ceil",
"BackdropTemplateMixin",
"floor",
"GetCursorInfo",
"ClearCursor",
"hooksecurefunc",
"GetMacroInfo",
"IsShiftKeyDown",
"IsControlKeyDown",
"IsAltKeyDown",
"issecurevariable",
"GetTime",
"C_Timer",
"format",
"gsub",
"strfind",
"strsub",
"strchar",
"strbyte",
"tinsert",
"UIParent"
],
}
Binary file removed assets/img/balance_druid_icon.png
Binary file not shown.
Binary file removed assets/img/death_knight_icon.png
Binary file not shown.
Binary file removed assets/img/druid_icon.png
Binary file not shown.
Binary file removed assets/img/elemental_shaman_icon.png
Binary file not shown.
Binary file removed assets/img/enhancement_shaman_icon.png
Binary file not shown.
Binary file removed assets/img/feral_druid_icon.png
Binary file not shown.
Binary file removed assets/img/feral_druid_tank_icon.png
Binary file not shown.
Binary file removed assets/img/holy_paladin_icon.png
Binary file not shown.
Binary file removed assets/img/hunter_icon.png
Binary file not shown.
Binary file removed assets/img/mage_icon.png
Binary file not shown.
Binary file removed assets/img/paladin_icon.png
Binary file not shown.
Binary file removed assets/img/priest_icon.png
Binary file not shown.
Binary file removed assets/img/protection_paladin_icon.png
Binary file not shown.
Binary file removed assets/img/protection_warrior_icon.png
Binary file not shown.
Binary file removed assets/img/raid_icon.png
Binary file not shown.
Binary file removed assets/img/resto_druid_icon.png
Binary file not shown.
Binary file removed assets/img/resto_shaman_icon.png
Binary file not shown.
Binary file removed assets/img/retribution_icon.png
Binary file not shown.
Binary file removed assets/img/rogue_icon.png
Binary file not shown.
Binary file removed assets/img/shadow_priest_icon.png
Binary file not shown.
Binary file removed assets/img/shaman_icon.png
Binary file not shown.
Binary file removed assets/img/smite_priest_icon.png
Binary file not shown.
Binary file removed assets/img/togc.png
Binary file not shown.
Binary file removed assets/img/ulduar.jpg
Binary file not shown.
Binary file removed assets/img/warlock_icon.png
Binary file not shown.
Binary file removed assets/img/warrior_icon.png
Diff not rendered.
64 changes: 36 additions & 28 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,38 @@ ASSETS := $(patsubst assets/%,$(OUT_DIR)/assets/%,$(ASSETS_INPUT))
rwildcard = $(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
GOROOT := $(shell go env GOROOT)
UI_SRC := $(shell find ui -name '*.ts' -o -name '*.tsx' -o -name '*.scss' -o -name '*.html')
HTML_INDECIES := ui/balance_druid/index.html \
ui/feral_druid/index.html \
ui/feral_tank_druid/index.html \
ui/restoration_druid/index.html \
ui/elemental_shaman/index.html \
ui/enhancement_shaman/index.html \
ui/restoration_shaman/index.html \
ui/hunter/index.html \
ui/mage/index.html \
ui/rogue/index.html \
ui/holy_paladin/index.html \
ui/protection_paladin/index.html \
ui/retribution_paladin/index.html \
ui/healing_priest/index.html \
ui/shadow_priest/index.html \
ui/smite_priest/index.html \
ui/warlock/index.html \
ui/warrior/index.html \
ui/protection_warrior/index.html \
ui/deathknight/index.html \
ui/tank_deathknight/index.html \
ui/raid/index.html \
ui/detailed_results/index.html
PAGE_INDECES := ui/death_knight/blood/index.html \
ui/death_knight/frost/index.html \
ui/death_knight/unholy/index.html \
ui/druid/balance/index.html \
ui/druid/feral/index.html \
ui/druid/restoration/index.html \
ui/hunter/beast_mastery/index.html \
ui/hunter/marksmanship/index.html \
ui/hunter/survival/index.html \
ui/mage/arcane/index.html \
ui/mage/fire/index.html \
ui/mage/frost/index.html \
ui/paladin/holy/index.html \
ui/paladin/protection/index.html \
ui/paladin/retribution/index.html \
ui/priest/discipline/index.html \
ui/priest/holy/index.html \
ui/priest/shadow/index.html \
ui/rogue/assassination/index.html \
ui/rogue/combat/index.html \
ui/rogue/subtlety/index.html \
ui/shaman/elemental/index.html \
ui/shaman/enhancement/index.html \
ui/shaman/restoration/index.html \
ui/warlock/affliction/index.html \
ui/warlock/demonology/index.html \
ui/warlock/destruction/index.html \
ui/warrior/arms/index.html \
ui/warrior/fury/index.html \
ui/warrior/protection/index.html \
ui/raid/full/index.html \
ui/results/detailed/index.html

$(OUT_DIR)/.dirstamp: \
$(OUT_DIR)/lib.wasm \
Expand All @@ -39,7 +48,7 @@ $(OUT_DIR)/.dirstamp: \

$(OUT_DIR)/bundle/.dirstamp: \
$(UI_SRC) \
$(HTML_INDECIES) \
$(PAGE_INDECES) \
vite.config.js \
node_modules \
tsconfig.json \
Expand Down Expand Up @@ -78,7 +87,7 @@ clean:
ui/core/index.ts \
ui/core/proto/*.ts \
node_modules \
$(HTML_INDECIES)
$(PAGE_INDECES)
find . -name "*.results.tmp" -type f -delete

ui/core/proto/api.ts: proto/*.proto node_modules
Expand All @@ -87,8 +96,7 @@ ui/core/proto/api.ts: proto/*.proto node_modules
npx protoc --ts_out ui/core/proto --proto_path proto proto/ui.proto

ui/%/index.html: ui/index_template.html
$(eval title := $(shell echo $(shell basename $(@D)) | sed -r 's/(^|_)([a-z])/\U \2/g' | cut -c 2-))
cat ui/index_template.html | sed -e 's/@@TITLE@@/cata $(title) Simulator/g' -e 's/@@SPEC@@/$(shell basename $(@D))/g' > $@
cat ui/index_template.html | sed -e 's/@@CLASS@@/$(shell dirname $(@D) | xargs basename)/g' -e 's/@@SPEC@@/$(shell basename $(@D))/g' > $@

package-lock.json:
npm install
Expand All @@ -106,7 +114,7 @@ $(OUT_DIR)/%/index.html: ui/index_template.html $(OUT_DIR)/assets
$(eval title := $(shell echo $(shell basename $(@D)) | sed -r 's/(^|_)([a-z])/\U \2/g' | cut -c 2-))
echo $(title)
mkdir -p $(@D)
cat ui/index_template.html | sed -e 's/@@TITLE@@/cata $(title) Simulator/g' -e 's/@@SPEC@@/$(shell basename $(@D))/g' > $@
cat ui/index_template.html | sed -e 's/@@CLASS@@/$(shell dirname $((@D)) | xargs basename)/g' -e 's/@@SPEC@@/$(shell basename $(@D))/g' > $@

.PHONY: wasm
wasm: $(OUT_DIR)/lib.wasm
Expand Down
Loading

0 comments on commit b46dcfa

Please sign in to comment.