Skip to content

Commit

Permalink
refactor: allow current-maintainers to be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham committed Dec 12, 2023
1 parent 15d1ebf commit c8d87fd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# THIS FILE IS AUTOGENERATED. DO NOT EDIT IT BY HAND.

/styles/advent-of-code @rubyowo
/styles/anilist @AnubisNekhet
/styles/boringproxy @Gandalf-the-Blue
/styles/brave-search @ndsboy
/styles/bstats @rockquiet
/styles/canvas-lms @TheMemeSniper

/styles/chatgpt
/styles/chatreplay @AnubisNekhet
/styles/chess.com @coldenate @isabelroses @skelebro1
/styles/cinny @jn-sena
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ await updateFile(
join(REPO_ROOT, ".github/CODEOWNERS"),
Object.entries(userstylesData.userstyles)
.map(([slug, { readme }]) => {
if (readme["current-maintainers"] === undefined) return "";
if (!readme["current-maintainers"]) return "";
const currentMaintainers = readme["current-maintainers"]
.map((maintainer) => `@${maintainer.url.split("/").pop()}`)
.join(" ");
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate/templates/userstyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{{/each}}
{{/if}}

{{#if collaborators.currentMaintainers}}
{{#if collaborators.currentMaintainers.length}}
## πŸ’ Current {{pluralize collaborators.currentMaintainers 'Maintainer'}}
{{#each collaborators.currentMaintainers}}
- [{{name}}]({{url}})
Expand Down
7 changes: 5 additions & 2 deletions scripts/userstyles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"title": "README",
"description": "Options to help in the auto-generation of the userstyle README.",
"type": "object",
"required": ["app-link"],
"required": ["app-link", "current-maintainers"],
"properties": {
"app-link": {
"$id": "#userstyles/userstyle/readme/app-link",
Expand Down Expand Up @@ -135,11 +135,15 @@
"$id": "#userstyles/userstyle/readme/current-maintainers",
"title": "Current Maintainers",
"description": "List of all active maintainers for this userstyle.",
"type": "array",
"minItems": 0,
"$ref": "#/$defs/collaborators"
},
"past-maintainers": {
"$id": "#userstyles/userstyle/readme/past-maintainers",
"title": "Past Maintainers",
"type":"array",
"minItems": 1,
"description": "List of all maintainers that have maintained on this userstyle in the past.",
"$ref": "#/$defs/collaborators"
}
Expand All @@ -160,7 +164,6 @@
"collaborators": {
"$id": "#collaborators",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
Expand Down
3 changes: 2 additions & 1 deletion scripts/userstyles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ userstyles:
category: game
readme:
app-link: https://adventofcode.com
past-maintainers: [*rubyowo]
current-maintainers: [*rubyowo]
anilist:
name: ["AniList", "AniChart"]
category: leisure
Expand Down Expand Up @@ -151,6 +151,7 @@ userstyles:
category: productivity
readme:
app-link: "https://chat.openai.com"
current-maintainers: []
past-maintainers: [*rubyowo]
chatreplay:
name: ChatReplay
Expand Down
6 changes: 2 additions & 4 deletions styles/advent-of-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@



## 🚧 Looking for Maintainers 🚧
- If you are interested in maintaining this userstyle, please raise a **Pull Request** and add yourself into the `current-maintainers` array in the `userstyles.yml` file.

## πŸ’– Past Maintainer
## πŸ’ Current Maintainer
- [rubyowo](https://github.com/rubyowo)


 

<p align="center">
Expand Down

0 comments on commit c8d87fd

Please sign in to comment.