Skip to content

Commit

Permalink
Merge branch 'main' into display-no-buffs-2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Aug 6, 2024
2 parents a018d50 + c12426d commit 16eafc9
Show file tree
Hide file tree
Showing 51 changed files with 2,082 additions and 1,500 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text=auto eol=lf
* text=auto eol=lf
src/assets/modifierdata/* linguist-detectable
11 changes: 6 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ updates:
directory: /
labels: [ ]
schedule:
interval: weekly
interval: monthly
time: '17:00'
groups:
github-actions:
patterns:
Expand All @@ -14,9 +15,8 @@ updates:
directory: /
labels: [ ]
schedule:
interval: weekly
ignore:
- dependency-name: eslint-plugin-jsx-a11y
interval: monthly
time: '17:00'
groups:
npm-dependencies:
patterns:
Expand All @@ -29,7 +29,8 @@ updates:
directory: /wasm_module
labels: [ ]
schedule:
interval: weekly
interval: monthly
time: '17:00'
allow:
- dependency-type: all
groups:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:

env:
PAGES_PROJECT_NAME: discretize-optimizer
PAGES_PROJECT_NAME: optimizer
NODE_VERSION: 18

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-with-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
PAGES_PROJECT_NAME: discretize-optimizer
PAGES_PROJECT_NAME: optimizer

concurrency:
group: 'deploy'
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/previews-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
types: [opened, reopened, synchronize, ready_for_review]

env:
PAGES_PROJECT_NAME: discretize-optimizer
PAGES_PROJECT_NAME: optimizer
PAGES_PROJECT_URL_SLUG: discretize-gear-optimizer
NODE_VERSION: 18

jobs:
Expand All @@ -17,7 +18,7 @@ jobs:
- name: Check that secrets exist
id: check-secret-step
run: |
if [ "${{ secrets.CF_GLOBAL_APIKEY }}" != '' ]; then
if [ "${{ secrets.CI_CF_PAGES }}" != '' ]; then
echo "exists=true" >> $GITHUB_OUTPUT;
else
echo "exists=false" >> $GITHUB_OUTPUT;
Expand Down Expand Up @@ -96,6 +97,6 @@ jobs:
| ----------------------- | - |
| **Last commit:** | ${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha || github.sha }} |
| **Preview URL**: | ${{ steps.pages-action.outputs.url }} |
| **Branch Preview URL**: | https://${{ github.head_ref || github.ref_name }}.${{ env.PAGES_PROJECT_NAME }}.pages.dev |
| **Branch Preview URL**: | https://${{ github.head_ref || github.ref_name }}.${{ env.PAGES_PROJECT_URL_SLUG }}.pages.dev |
comment_tag: deployment
mode: upsert
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm checkStaged
21 changes: 21 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ESLint } from 'eslint';

// https://github.com/lint-staged/lint-staged?tab=readme-ov-file#how-can-i-ignore-files-from-eslintignore
const removeIgnoredFiles = async (files) => {
const eslint = new ESLint();
const isIgnored = await Promise.all(
files.map((file) => {
return eslint.isPathIgnored(file);
}),
);
const filteredFiles = files.filter((_, i) => !isIgnored[i]);
return filteredFiles.join(' ');
};

export default {
'*': ['prettier --check --cache --ignore-unknown'],
'**/*.{ts,tsx,js,jsx}': async (files) => {
const filesToLint = await removeIgnoredFiles(files);
return [`eslint --max-warnings=0 ${filesToLint} --cache`];
},
};
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.md
*.json
*.yaml
*.yml
src/utils/mapping/
Expand Down
2 changes: 2 additions & 0 deletions docs/Contributing/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pnpm develop

Note that the Rust/Webassembly code will not update in real time; the `pnpm wasm` command must be rerun to compile any changes to it.

*To install an optional pre-commit git hook that will lint and format your code before you commit it, run `pnpm enable-hooks`. Note that this does not currently perform typescript type checking. This command must be run manually whenever the git hook code is changed. To disable hooks, run `pnpm disable-hooks`.*

### Pull Requests

Feel free to open PRs for unfinished work as [draft PRs](https://github.blog/2019-02-14-introducing-draft-pull-requests/)!
Expand Down
6 changes: 3 additions & 3 deletions functions/share/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function generate_rand(KV_NAMESPACE: KVNamespace, i: number) {
} else {
return random_data;
}
} catch (e) {
} catch {
return generate_rand(KV_NAMESPACE, i + 1);
}
}
Expand All @@ -56,7 +56,7 @@ export const onRequestPost: PagesFunction<Env> = async (context) => {
if (!existingValueBuffer) {
// no duplicate, insert value
console.log(`writing new key: ${key}`);
await KV.put(key, dataBuffer);
await KV.put(key, dataBuffer, { metadata: { timestamp: Date.now() } });
} else {
// duplicate detected.
// checks if the saved buffer in KV is equals with what was transmitted in the request
Expand All @@ -67,7 +67,7 @@ export const onRequestPost: PagesFunction<Env> = async (context) => {
// this should probably never happen unless developing?
key = await generate_rand(KV, 0);
console.warn(`current key has mismatched data! writing new key: ${key}`);
await KV.put(key, dataBuffer);
await KV.put(key, dataBuffer, { metadata: { timestamp: Date.now() } });
}
}

Expand Down
32 changes: 19 additions & 13 deletions locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"Copy build": "Copy build",
"Copy from selected character": "Copy from selected character",
"Copy selected sigils to both slots": "Copy selected sigils to both slots",
"Core game changes are updated for the March 19th game patch, but preset coefficients and trait selections may not yet be completely updated. Most gear results will be correctly optimized, but DPS estimates and comparisons may be wrong.<br/><br/>Templates not marked as Outdated are up to date.": "Core game changes are updated for the March 19th game patch, but preset coefficients and trait selections may not yet be completely updated. Most gear results will be correctly optimized, but DPS estimates and comparisons may be wrong.<br/><br/>Templates not marked as Outdated are up to date.",
"Core game changes are updated for the June 25th game patch, but preset coefficients and trait selections may not yet be completely updated. Most gear results will be correctly optimized, but DPS estimates and comparisons may be wrong.<br/><br/>Templates not marked as Outdated are up to date.": "Core game changes are updated for the June 25th game patch, but preset coefficients and trait selections may not yet be completely updated. Most gear results will be correctly optimized, but DPS estimates and comparisons may be wrong.<br/><br/>Templates not marked as Outdated are up to date.",
"Create build templates that can be used for the gear optimizer.": "Create build templates that can be used for the gear optimizer.",
"Create templates for the discretize.eu website. Please check the discretize-guides repo for more information.": "Create templates for the discretize.eu website. Please check the discretize-guides repo for more information.",
"Ctrl+d": "Ctrl+d",
Expand Down Expand Up @@ -282,6 +282,7 @@
"amountLabel_% revealed": "% revealed",
"amountLabel_% scholar": "% scholar",
"amountLabel_% stability uptime": "% stability uptime",
"amountLabel_% strike damage from blade skills": "% strike damage from blade skills",
"amountLabel_% swiftness": "% swiftness",
"amountLabel_% uptime": "% uptime",
"amountLabel_% vigor": "% vigor",
Expand Down Expand Up @@ -333,8 +334,8 @@
"buildTemplateName_Alacrity Power Mech Concentration (No Simulation)": "Alacrity Power Mech Concentration (No Simulation)",
"buildTemplateName_Alacrity Power Renegade": "Alacrity Power Renegade",
"buildTemplateName_Alacrity Power Willbender": "Alacrity Power Willbender",
"buildTemplateName_Alacrity Specter D/D": "Alacrity Specter D/D",
"buildTemplateName_Alacrity Specter SC/D 57%": "Alacrity Specter SC/D 57%",
"buildTemplateName_Alacrity Specter SC/D 60%": "Alacrity Specter SC/D 60%",
"buildTemplateName_Alacrity Staff Mirage": "Alacrity Staff Mirage",
"buildTemplateName_Boon Condi Chrono": "Boon Condi Chrono",
"buildTemplateName_Boon Condi Daredevil (no log)": "Boon Condi Daredevil (no log)",
Expand Down Expand Up @@ -362,8 +363,8 @@
"buildTemplateName_Condi Weaver Scepter": "Condi Weaver Scepter",
"buildTemplateName_Condi Weaver Staff": "Condi Weaver Staff",
"buildTemplateName_Condi Weaver Sword": "Condi Weaver Sword",
"buildTemplateName_Condi Willbender": "Condi Willbender",
"buildTemplateName_Condi Willbender GS": "Condi Willbender GS",
"buildTemplateName_Condi Willbender Sword (approx.)": "Condi Willbender Sword (approx.)",
"buildTemplateName_Heal Alacrity Druid": "Heal Alacrity Druid",
"buildTemplateName_Heal Alacrity Mech": "Heal Alacrity Mech",
"buildTemplateName_Heal Alacrity Renegade": "Heal Alacrity Renegade",
Expand Down Expand Up @@ -399,13 +400,13 @@
"buildTemplateName_Power Staff Daredevil (Approx.)": "Power Staff Daredevil (Approx.)",
"buildTemplateName_Power Tempest": "Power Tempest",
"buildTemplateName_Power Untamed": "Power Untamed",
"buildTemplateName_Power Vindicator (Approx.)": "Power Vindicator (Approx.)",
"buildTemplateName_Power Vindicator": "Power Vindicator",
"buildTemplateName_Power Virtuoso GS": "Power Virtuoso GS",
"buildTemplateName_Power Weaver": "Power Weaver",
"buildTemplateName_Power Willbender Radiance": "Power Willbender Radiance",
"buildTemplateName_Power Willbender Virtues": "Power Willbender Virtues",
"buildTemplateName_Quickness Condi Berserker": "Quickness Condi Berserker",
"buildTemplateName_Quickness Condi Firebrand 77%": "Quickness Condi Firebrand 77%",
"buildTemplateName_Quickness Condi Firebrand 40%": "Quickness Condi Firebrand 40%",
"buildTemplateName_Quickness Condi Herald": "Quickness Condi Herald",
"buildTemplateName_Quickness Condi Scrapper": "Quickness Condi Scrapper",
"buildTemplateName_Quickness Condi Untamed": "Quickness Condi Untamed",
Expand Down Expand Up @@ -506,8 +507,8 @@
"preset_affix_Condi Alacrity Mirage 0%": "Condi Alacrity Mirage 0%",
"preset_affix_Condi Alacrity Renegade 37.5%": "Condi Alacrity Renegade 37.5%",
"preset_affix_Condi Alacrity Scourge 28.8%": "Condi Alacrity 28.8%",
"preset_affix_Condi Alacrity Specter 42%": "Condi Alacrity Specter 42%",
"preset_affix_Condi Alacrity Specter 57%": "Condi Alacrity Specter 57%",
"preset_affix_Condi Alacrity Specter 60%": "Condi Alacrity Specter 60%",
"preset_affix_Condi Alacrity Willbender 14%": "Condi Alacrity Willbender 14%",
"preset_affix_Condi Barrier Specter": "Condi Barrier Specter",
"preset_affix_Condi Boon": "Condi Boon",
Expand All @@ -517,7 +518,7 @@
"preset_affix_Condi DPS Rampager": "Condi DPS Rampager",
"preset_affix_Condi Hybrid Firebrand 40%": "Condi Hybrid Firebrand 40%",
"preset_affix_Condi Hybrid Firebrand 78%": "Condi Hybrid Firebrand 78%",
"preset_affix_Condi Quickbrand 77%": "Condi Quickbrand 77%",
"preset_affix_Condi Quickbrand 40%": "Condi Quickbrand 40%",
"preset_affix_Condi Quickness Berserker 44.7%": "Condi Quickness Berserker 44.7%",
"preset_affix_Condi Quickness Harbinger 12.8%": "Condi Quickness Harbinger 12.8%",
"preset_affix_Condi Quickness Herald 0%": "Condi Quickness Herald 0%",
Expand Down Expand Up @@ -548,15 +549,12 @@
"preset_distribution_100% Power": "100% Power",
"preset_distribution_Alacrity Hybrid Tempest": "Alacrity Hybrid Tempest",
"preset_distribution_Alacrity Renegade": "Alacrity Renegade",
"preset_distribution_Alacrity Specter D/D (allies)": "Alacrity Specter D/D (allies)",
"preset_distribution_Alacrity Specter SC/D (allies)": "Alacrity Specter SC/D (allies)",
"preset_distribution_Alacrity Staff Mirage": "Alacrity Staff Mirage",
"preset_distribution_Axe Mirage (Deception Torch)": "Axe Mirage (Deception Torch)",
"preset_distribution_Boon Condi Chrono": "Boon Condi Chrono",
"preset_distribution_Boon Power Chrono GS": "Boon Power Chrono GS",
"preset_distribution_CFB (5 Page RF, Allies)": "CFB (5 Page RF, Allies)",
"preset_distribution_CFB (5 Page RF, No Allies)": "CFB (5 Page RF, No Allies)",
"preset_distribution_CFB (8 Page, Allies)": "CFB (8 Page, Allies)",
"preset_distribution_CFB (8 page, no allies)": "CFB (8 page, no allies)",
"preset_distribution_Condi Alac Invocation": "Condi Alac Invocation",
"preset_distribution_Condi Alac Invocation (no allies)": "Condi Alac Invocation (no allies)",
"preset_distribution_Condi Alac Mechanist (inaccurate)": "Condi Alac Mechanist (inaccurate)",
Expand All @@ -567,6 +565,8 @@
"preset_distribution_Condi Daredevil (No Allies)": "Condi Daredevil (No Allies)",
"preset_distribution_Condi Deadeye": "Condi Deadeye",
"preset_distribution_Condi Druid": "Condi Druid",
"preset_distribution_Condi Firebrand": "Condi Firebrand",
"preset_distribution_Condi Firebrand (No Allies)": "Condi Firebrand (No Allies)",
"preset_distribution_Condi Holo": "Condi Holo",
"preset_distribution_Condi Mechanist J-Drive (approx.)": "Condi Mechanist J-Drive (approx.)",
"preset_distribution_Condi Mechanist Jade Dynamo Pistol (approx.)": "Condi Mechanist Jade Dynamo Pistol (approx.)",
Expand Down Expand Up @@ -594,6 +594,7 @@
"preset_distribution_Condi Weaver Scepter": "Condi Weaver Scepter",
"preset_distribution_Condi Weaver Staff (Large)": "Condi Weaver Staff (Large)",
"preset_distribution_Condi Weaver Sword": "Condi Weaver Sword",
"preset_distribution_Condi Willbender": "Condi Willbender",
"preset_distribution_Condi Willbender GS": "Condi Willbender GS",
"preset_distribution_Condi Willbender Sword": "Condi Willbender Sword",
"preset_distribution_Core Guardian": "Core Guardian",
Expand Down Expand Up @@ -644,7 +645,7 @@
"preset_distribution_Rifle Deadeye Premeditation": "Rifle Deadeye Premeditation",
"preset_distribution_Rifle Deadeye Silent Scope": "Rifle Deadeye Silent Scope",
"preset_extra_Alacrity Hybrid Tempest": "Alacrity Hybrid Tempest",
"preset_extra_Alacrity Specter SC/D": "Alacrity Specter SC/D",
"preset_extra_Alacrity Specter": "Alacrity Specter",
"preset_extra_Alacrity Staff Mirage": "Alacrity Staff Mirage",
"preset_extra_Bladesworn": "Bladesworn",
"preset_extra_Boon Condi Chrono": "Boon Condi Chrono",
Expand Down Expand Up @@ -677,6 +678,7 @@
"preset_extra_Condi Weaver Sword": "Condi Weaver Sword",
"preset_extra_Condi Willbender": "Condi Willbender",
"preset_extra_DH Virtues (Fractal)": "DH Virtues (Fractal)",
"preset_extra_DH Virtues (Raid)": "DH Virtues (Raid)",
"preset_extra_DPS Harbinger": "DPS Harbinger",
"preset_extra_DPS Mirage (Raid)": "DPS Mirage (Raid)",
"preset_extra_DPS Scourge": "DPS Scourge",
Expand Down Expand Up @@ -722,6 +724,7 @@
"preset_male": "male",
"preset_trait_Alacrity Bladesworn": "Alacrity Bladesworn",
"preset_trait_Alacrity Hybrid Tempest": "Alacrity Hybrid Tempest",
"preset_trait_Alacrity Specter D/D": "Alacrity Specter D/D",
"preset_trait_Alacrity Specter SC/D": "Alacrity Specter SC/D",
"preset_trait_Alacrity Staff Mirage": "Alacrity Staff Mirage",
"preset_trait_Axe Mirage": "Axe Mirage",
Expand Down Expand Up @@ -889,16 +892,18 @@
"traitSubText_10x empowerment": "10x empowerment",
"traitSubText_1x (old)": "1x (old)",
"traitSubText_25x": "25x",
"traitSubText_2x": "2x",
"traitSubText_2x (old)": "2x (old)",
"traitSubText_3x": "3x",
"traitSubText_3x (old)": "3x (old)",
"traitSubText_4x": "4x",
"traitSubText_5x": "5x",
"traitSubText_Archetype Deadly (ConDmg/Prec)": "Archetype Deadly (ConDmg/Prec)",
"traitSubText_Archetype Ferocious (Pwr/Feroc)": "Archetype Ferocious (Pwr/Feroc)",
"traitSubText_Archetype Stout (Tough/Vit)": "Archetype Stout (Tough/Vit)",
"traitSubText_Archetype Supportive (Vit/Heal)": "Archetype Supportive (Vit/Heal)",
"traitSubText_Archetype Versatile (Vit/Conc)": "Archetype Versatile (Vit/Conc)",
"traitSubText_above": "above",
"traitSubText_above 90% bonus": "above 90% bonus",
"traitSubText_active": "active",
"traitSubText_against defiant foes": "against defiant foes",
"traitSubText_against defiant foes, base": "against defiant foes, base",
Expand Down Expand Up @@ -927,6 +932,7 @@
"traitSubText_impaired/defiant": "impaired/defiant",
"traitSubText_in med kit": "in med kit",
"traitSubText_in shroud": "in shroud",
"traitSubText_low health": "low health",
"traitSubText_mainhand dagger; boonless": "mainhand dagger; boonless",
"traitSubText_melee": "melee",
"traitSubText_melee, not accurate": "melee, not accurate",
Expand Down
Loading

0 comments on commit 16eafc9

Please sign in to comment.