-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: PR title generator & update contributing guideline (#4812)
* fix: use relative path * feat: save `semantic.json` * chore: update scopes * ci: auto update mod list * docs: PR title generator * docs: remove `Summary` section was being unused and potentially confusing * docs: visible PR template checklist * docs: advice against commiting on `main` --------- Co-authored-by: nocontribute <>
- Loading branch information
Showing
8 changed files
with
267 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,4 @@ jobs: | |
run: | | ||
deno lint | ||
deno test | ||
deno run --allow-read --allow-write scripts/semantic.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"types": [ | ||
"feat", | ||
"fix", | ||
"docs", | ||
"style", | ||
"refactor", | ||
"perf", | ||
"test", | ||
"build", | ||
"ci", | ||
"chore", | ||
"revert" | ||
], | ||
"scopes": [ | ||
"content", | ||
"UI", | ||
"i18n", | ||
"balance", | ||
"port", | ||
"mods/DinoMod", | ||
"mods/FujiStruct", | ||
"mods/Graphical_Overmap", | ||
"mods/Graphical_Overmap_Fujistruct", | ||
"mods/Graphical_Overmap_More_Locations", | ||
"mods/Graphical_Overmap_Urban_Development", | ||
"mods/MMA", | ||
"mods/Mundane_Zombies", | ||
"mods/No_Acid_Zombies", | ||
"mods/No_Anthills", | ||
"mods/No_Bees", | ||
"mods/No_Big_Zombies", | ||
"mods/No_Blobs", | ||
"mods/No_Explosive_Zombies", | ||
"mods/No_Ferals", | ||
"mods/No_Fungi", | ||
"mods/No_Rail_Stations", | ||
"mods/No_Wasps", | ||
"mods/Old_Mutations", | ||
"mods/Only_Wildlife", | ||
"mods/RL_Classes", | ||
"mods/StatsThroughSkills", | ||
"mods/UDP_BN_FAKE_SNOW", | ||
"mods/Zombie_Nightvision", | ||
"mods/aftershock", | ||
"mods/alt_map_key", | ||
"mods/cbm_slots", | ||
"mods/classic_zombies", | ||
"mods/craftgp", | ||
"mods/crazy_cataclysm", | ||
"mods/crt_expansion", | ||
"mods/desertpack", | ||
"mods/disable_lifting", | ||
"mods/elevated_bridges", | ||
"mods/fuji_mpp", | ||
"mods/generic_guns", | ||
"mods/innawoods", | ||
"mods/limit_fungal_growth", | ||
"mods/magiclysm", | ||
"mods/manualbionicinstall", | ||
"mods/modular_turrets", | ||
"mods/more_classes_scenarios", | ||
"mods/my_sweet_cataclysm", | ||
"mods/no_filthy_clothing", | ||
"mods/no_flaming_weapons", | ||
"mods/no_hope", | ||
"mods/no_medieval_items", | ||
"mods/no_mutagen", | ||
"mods/no_npc_food", | ||
"mods/no_olg_guns", | ||
"mods/no_religious_Texts", | ||
"mods/no_reviving_zombies", | ||
"mods/no_rivtech_guns", | ||
"mods/no_scifi", | ||
"mods/no_survivor_armor", | ||
"mods/no_zombify", | ||
"mods/novitamins", | ||
"mods/pride_flags", | ||
"mods/ruralbiome", | ||
"mods/saveload_lua_test", | ||
"mods/sees_player_hitbutton", | ||
"mods/sees_player_retro", | ||
"mods/smart_house_remote_mod", | ||
"mods/speedydex", | ||
"mods/stats_through_kills", | ||
"mods/teleportation_tech", | ||
"mods/test_data" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
--- | ||
import json from "../assets/semantic.json" | ||
const generalScopes = json.scopes.filter((scope) => !scope.startsWith("mods/")) | ||
const modScopes = json.scopes.filter((scope) => scope.startsWith("mods/")) | ||
--- | ||
|
||
<style> | ||
optgroup, | ||
label, | ||
select, | ||
select[name="scope"] option { | ||
margin-top: 0 !important; | ||
} | ||
input { | ||
width: 100%; | ||
} | ||
input:disabled { | ||
background-color: var(--sl-color-gray-6); | ||
} | ||
fieldset { | ||
display: grid; | ||
grid-template-columns: max-content 1fr; | ||
gap: 1rem; | ||
} | ||
|
||
fieldset label { | ||
justify-self: end; | ||
} | ||
</style> | ||
|
||
<script> | ||
// well this isn't very great but it was quick and dirty to write | ||
|
||
const outputElem = document.querySelector("input[name=output]") as HTMLInputElement | ||
const typeElem = document.querySelector("select[name=type]") as HTMLSelectElement | ||
const scopeElems = document.querySelectorAll( | ||
"select[name=scope] optgroup option", | ||
) as NodeListOf<HTMLOptionElement> | ||
|
||
const subjectElem = document.querySelector("input[name=subject]") as HTMLInputElement | ||
|
||
let type = typeElem.value | ||
let subject = subjectElem.value | ||
const scopes = new Set() | ||
|
||
const updateOutput = () => { | ||
outputElem.disabled = type.length === 0 || subject.length === 0 | ||
|
||
const output = `${type}${scopes.size ? `(${Array.from(scopes).join(",")})` : ""}: ${subject}` | ||
outputElem.value = output | ||
} | ||
|
||
typeElem.addEventListener("change", (e) => { | ||
type = (e.target as HTMLSelectElement).value | ||
updateOutput() | ||
}) | ||
|
||
scopeElems.forEach((scopeElem) => | ||
scopeElem.addEventListener("click", (e) => { | ||
const scope = (e.target as HTMLOptionElement).value | ||
scopes.has(scope) ? scopes.delete(scope) : scopes.add(scope) | ||
updateOutput() | ||
}), | ||
) | ||
|
||
subjectElem.addEventListener("input", (e) => { | ||
subject = (e.target as HTMLInputElement).value | ||
updateOutput() | ||
}) | ||
|
||
// initialize state | ||
updateOutput() | ||
|
||
// clipboard | ||
document.querySelector("form")!.addEventListener("submit", (e) => { | ||
e.preventDefault() | ||
navigator.clipboard.writeText(outputElem.value) | ||
}) | ||
</script> | ||
|
||
<form> | ||
<fieldset> | ||
<label for="type">Type</label> | ||
<select name="type" required> | ||
<option value="">select type</option> | ||
{json.types.map((type) => <option value={type}>{type}</option>)} | ||
</select> | ||
<label for="scope">Scope</label> | ||
<select name="scope" multiple size="6"> | ||
<optgroup label="general"> | ||
{generalScopes.map((scope) => <option value={scope}>{scope}</option>)} | ||
</optgroup> | ||
<optgroup label="mods"> | ||
{modScopes.map((scope) => <option value={scope}>{scope}</option>)} | ||
</optgroup> | ||
</select> | ||
<label for="subject">Subject</label> | ||
<input | ||
type="text" | ||
name="subject" | ||
placeholder="summarize what does this PR does here" | ||
required | ||
/> | ||
</fieldset> | ||
<label for="output">Output</label> | ||
<input type="text" name="output" /> | ||
<button type="submit">copy to clipboard</button> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.