mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 22:52:40 +00:00
Merge branch 'master' into errorPage.jsx-cleanup
This commit is contained in:
103
.github/actions/limit-pull-requests/action.yml
vendored
Normal file
103
.github/actions/limit-pull-requests/action.yml
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
name: Limit pull requests
|
||||
description: >
|
||||
Limit the number of open pull requests to the repository created by a user
|
||||
author: ZhongRuoyu (from Homebrew repository)
|
||||
branding:
|
||||
icon: alert-triangle
|
||||
color: yellow
|
||||
|
||||
inputs:
|
||||
token:
|
||||
description: GitHub token
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
except-users:
|
||||
description: The users exempted from the limit, one per line
|
||||
required: false
|
||||
# https://docs.github.com/en/graphql/reference/enums#commentauthorassociation
|
||||
except-author-associations:
|
||||
description: The author associations exempted from the limit, one per line
|
||||
required: false
|
||||
comment-limit:
|
||||
description: >
|
||||
Post the comment when the user's number of open pull requests exceeds this
|
||||
number and `comment` is not empty
|
||||
required: true
|
||||
default: "10"
|
||||
comment:
|
||||
description: The comment to post when the limit is reached
|
||||
required: false
|
||||
close-limit:
|
||||
description: >
|
||||
Close the pull request when the user's number of open pull requests
|
||||
exceeds this number and `close` is set to `true`
|
||||
required: true
|
||||
default: "50"
|
||||
close:
|
||||
description: Whether to close the pull request when the limit is reached
|
||||
required: true
|
||||
default: "false"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Check the number of pull requests
|
||||
id: count-pull-requests
|
||||
run: |
|
||||
# If the user is exempted, assume they have no pull requests.
|
||||
if grep -Fiqx '${{ github.actor }}' <<<"$EXCEPT_USERS"; then
|
||||
echo "::notice::@${{ github.actor }} is exempted from the limit."
|
||||
echo "count=0" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
if grep -Fiqx '${{ github.event.pull_request.author_association }}' <<<"$EXCEPT_AUTHOR_ASSOCIATIONS"; then
|
||||
echo "::notice::@{{ github.actor }} is a ${{ github.event.pull_request.author_association }} exempted from the limit."
|
||||
echo "count=0" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
count="$(
|
||||
gh api \
|
||||
--method GET \
|
||||
--header 'Accept: application/vnd.github+json' \
|
||||
--header 'X-GitHub-Api-Version: 2022-11-28' \
|
||||
--field state=open \
|
||||
--paginate \
|
||||
'/repos/{owner}/{repo}/pulls' |
|
||||
jq \
|
||||
--raw-output \
|
||||
--arg USER '${{ github.actor }}' \
|
||||
'map(select(.user.login == $USER)) | length'
|
||||
)"
|
||||
echo "::notice::@${{ github.actor }} has $count open pull request(s)."
|
||||
echo "count=$count" >>"$GITHUB_OUTPUT"
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ inputs.token }}
|
||||
EXCEPT_USERS: ${{ inputs.except-users }}
|
||||
EXCEPT_AUTHOR_ASSOCIATIONS: ${{ inputs.except-author-associations }}
|
||||
shell: bash
|
||||
|
||||
- name: Comment on pull request
|
||||
if: >
|
||||
fromJSON(steps.count-pull-requests.outputs.count) > fromJSON(inputs.comment-limit) &&
|
||||
inputs.comment != ''
|
||||
run: |
|
||||
gh pr comment '${{ github.event.pull_request.number }}' \
|
||||
--body="${COMMENT_BODY}"
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ inputs.token }}
|
||||
COMMENT_BODY: ${{ inputs.comment }}
|
||||
shell: bash
|
||||
|
||||
- name: Close pull request
|
||||
if: >
|
||||
fromJSON(steps.count-pull-requests.outputs.count) > fromJSON(inputs.close-limit) &&
|
||||
inputs.close == 'true'
|
||||
run: |
|
||||
gh pr close '${{ github.event.pull_request.number }}'
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_TOKEN: ${{ inputs.token }}
|
||||
shell: bash
|
||||
29
.github/workflows/pr-check.yml
vendored
Normal file
29
.github/workflows/pr-check.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: PR Check
|
||||
on: pull_request_target
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
GH_NO_UPDATE_NOTIFIER: 1
|
||||
GH_PROMPT_DISABLED: 1
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
statuses: write
|
||||
jobs:
|
||||
limit-pull-requests:
|
||||
if: always() && github.repository_owner == 'naturalcrit'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name : Run limit-pull-requests action
|
||||
uses: ./.github/actions/limit-pull-requests
|
||||
with:
|
||||
except-users: |
|
||||
dependabot
|
||||
comment-limit: 3
|
||||
comment: |
|
||||
Hi, thanks for your contribution to the Homebrewery! You already have >=3 open pull requests. Consider completing some of your existing PRs before opening new ones. Thanks!
|
||||
close-limit: 5
|
||||
close: false
|
||||
67
package-lock.json
generated
67
package-lock.json
generated
@@ -36,15 +36,15 @@
|
||||
"marked-smartypants-lite": "^1.0.2",
|
||||
"markedLegacy": "npm:marked@^0.3.19",
|
||||
"moment": "^2.30.1",
|
||||
"mongoose": "^8.3.1",
|
||||
"mongoose": "^8.3.2",
|
||||
"nanoid": "3.3.4",
|
||||
"nconf": "^0.12.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-frame-component": "^4.1.3",
|
||||
"react-router-dom": "6.22.3",
|
||||
"react-router-dom": "6.23.0",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"superagent": "^8.1.2",
|
||||
"superagent": "^9.0.1",
|
||||
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -58,7 +58,7 @@
|
||||
"stylelint-config-recess-order": "^4.6.0",
|
||||
"stylelint-config-recommended": "^13.0.0",
|
||||
"stylelint-stylistic": "^0.4.3",
|
||||
"supertest": "^6.3.4"
|
||||
"supertest": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.8.x",
|
||||
@@ -2854,9 +2854,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@remix-run/router": {
|
||||
"version": "1.15.3",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.3.tgz",
|
||||
"integrity": "sha512-Oy8rmScVrVxWZVOpEF57ovlnhpZ8CCPlnIIumVcV9nFdiSIrus99+Lw78ekXyGvVDlIsFJbSfmSovJUhCWYV3w==",
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.16.0.tgz",
|
||||
"integrity": "sha512-Quz1KOffeEf/zwkCBM3kBtH4ZoZ+pT3xIXBG4PPW/XFtDP7EGhtTiC2+gpL9GnR7+Qdet5Oa6cYSvwKYg6kN9Q==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
@@ -6516,14 +6516,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/formidable": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz",
|
||||
"integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==",
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.1.tgz",
|
||||
"integrity": "sha512-WJWKelbRHN41m5dumb0/k8TeAx7Id/y3a+Z7QfhxP/htI9Js5zYaEDtG8uMgG0vM0lOlqnmjE99/kfpOYi/0Og==",
|
||||
"dependencies": {
|
||||
"dezalgo": "^1.0.4",
|
||||
"hexoid": "^1.0.0",
|
||||
"once": "^1.4.0",
|
||||
"qs": "^6.11.0"
|
||||
"once": "^1.4.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://ko-fi.com/tunnckoCore/commissions"
|
||||
@@ -10547,9 +10546,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mongoose": {
|
||||
"version": "8.3.1",
|
||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.3.1.tgz",
|
||||
"integrity": "sha512-D78C+s7QI4+pJQhs3XbOxzrHFEti4x+BDhaH94QrdV1/cmMA7fHc50LgLSXjzA/5q89TBK8DAXyf3VwDZbQJlA==",
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.3.2.tgz",
|
||||
"integrity": "sha512-3JcpDjFI25cF/3xpu+4+9nM0lURQTNLcP86X83+LvuICdn453QQLmhSrUr2IPM/ffLiDE9KPl9slNb2s0hZPpg==",
|
||||
"dependencies": {
|
||||
"bson": "^6.5.0",
|
||||
"kareem": "2.6.3",
|
||||
@@ -11976,11 +11975,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "6.22.3",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.22.3.tgz",
|
||||
"integrity": "sha512-dr2eb3Mj5zK2YISHK++foM9w4eBnO23eKnZEDs7c880P6oKbrjz/Svg9+nxqtHQK+oMW4OtjZca0RqPglXxguQ==",
|
||||
"version": "6.23.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.23.0.tgz",
|
||||
"integrity": "sha512-wPMZ8S2TuPadH0sF5irFGjkNLIcRvOSaEe7v+JER8508dyJumm6XZB1u5kztlX0RVq6AzRVndzqcUh6sFIauzA==",
|
||||
"dependencies": {
|
||||
"@remix-run/router": "1.15.3"
|
||||
"@remix-run/router": "1.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
@@ -11990,12 +11989,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "6.22.3",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.22.3.tgz",
|
||||
"integrity": "sha512-7ZILI7HjcE+p31oQvwbokjk6OA/bnFxrhJ19n82Ex9Ph8fNAq+Hm/7KchpMGlTgWhUxRHMMCut+vEtNpWpowKw==",
|
||||
"version": "6.23.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.23.0.tgz",
|
||||
"integrity": "sha512-Q9YaSYvubwgbal2c9DJKfx6hTNoBp3iJDsl+Duva/DwxoJH+OTXkxGpql4iUK2sla/8z4RpjAm6EWx1qUDuopQ==",
|
||||
"dependencies": {
|
||||
"@remix-run/router": "1.15.3",
|
||||
"react-router": "6.22.3"
|
||||
"@remix-run/router": "1.16.0",
|
||||
"react-router": "6.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
@@ -13598,23 +13597,23 @@
|
||||
}
|
||||
},
|
||||
"node_modules/superagent": {
|
||||
"version": "8.1.2",
|
||||
"resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz",
|
||||
"integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==",
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/superagent/-/superagent-9.0.1.tgz",
|
||||
"integrity": "sha512-CcRSdb/P2oUVaEpQ87w9Obsl+E9FruRd6b2b7LdiBtJoyMr2DQt7a89anAfiX/EL59j9b2CbRFvf2S91DhuCww==",
|
||||
"dependencies": {
|
||||
"component-emitter": "^1.3.0",
|
||||
"cookiejar": "^2.1.4",
|
||||
"debug": "^4.3.4",
|
||||
"fast-safe-stringify": "^2.1.1",
|
||||
"form-data": "^4.0.0",
|
||||
"formidable": "^2.1.2",
|
||||
"formidable": "^3.5.1",
|
||||
"methods": "^1.1.2",
|
||||
"mime": "2.6.0",
|
||||
"qs": "^6.11.0",
|
||||
"semver": "^7.3.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.4.0 <13 || >=14"
|
||||
"node": ">=14.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/superagent/node_modules/lru-cache": {
|
||||
@@ -13659,16 +13658,16 @@
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"node_modules/supertest": {
|
||||
"version": "6.3.4",
|
||||
"resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.4.tgz",
|
||||
"integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==",
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supertest/-/supertest-7.0.0.tgz",
|
||||
"integrity": "sha512-qlsr7fIC0lSddmA3tzojvzubYxvlGtzumcdHgPwbFWMISQwL22MhM2Y3LNt+6w9Yyx7559VW5ab70dgphm8qQA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"methods": "^1.1.2",
|
||||
"superagent": "^8.1.2"
|
||||
"superagent": "^9.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.4.0"
|
||||
"node": ">=14.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/supports-color": {
|
||||
|
||||
@@ -107,15 +107,15 @@
|
||||
"marked-smartypants-lite": "^1.0.2",
|
||||
"markedLegacy": "npm:marked@^0.3.19",
|
||||
"moment": "^2.30.1",
|
||||
"mongoose": "^8.3.1",
|
||||
"mongoose": "^8.3.2",
|
||||
"nanoid": "3.3.4",
|
||||
"nconf": "^0.12.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-frame-component": "^4.1.3",
|
||||
"react-router-dom": "6.22.3",
|
||||
"react-router-dom": "6.23.0",
|
||||
"sanitize-filename": "1.6.3",
|
||||
"superagent": "^8.1.2",
|
||||
"superagent": "^9.0.1",
|
||||
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -129,6 +129,6 @@
|
||||
"stylelint-config-recess-order": "^4.6.0",
|
||||
"stylelint-config-recommended": "^13.0.0",
|
||||
"stylelint-stylistic": "^0.4.3",
|
||||
"supertest": "^6.3.4"
|
||||
"supertest": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,10 +294,10 @@ const superSubScripts = {
|
||||
}
|
||||
};
|
||||
|
||||
const definitionListsInline = {
|
||||
name : 'definitionListsInline',
|
||||
const definitionListsSingleLine = {
|
||||
name : 'definitionListsSingleLine',
|
||||
level : 'block',
|
||||
start(src) { return src.match(/^[^\n]*?::[^\n]*/m)?.index; }, // Hint to Marked.js to stop and check for a match
|
||||
start(src) { return src.match(/\n[^\n]*?::[^\n]*/m)?.index; }, // Hint to Marked.js to stop and check for a match
|
||||
tokenizer(src, tokens) {
|
||||
const regex = /^([^\n]*?)::([^\n]*)(?:\n|$)/ym;
|
||||
let match;
|
||||
@@ -312,7 +312,7 @@ const definitionListsInline = {
|
||||
}
|
||||
if(definitions.length) {
|
||||
return {
|
||||
type : 'definitionListsInline',
|
||||
type : 'definitionListsSingleLine',
|
||||
raw : src.slice(0, endIndex),
|
||||
definitions
|
||||
};
|
||||
@@ -326,10 +326,10 @@ const definitionListsInline = {
|
||||
}
|
||||
};
|
||||
|
||||
const definitionListsMultiline = {
|
||||
name : 'definitionListsMultiline',
|
||||
const definitionListsMultiLine = {
|
||||
name : 'definitionListsMultiLine',
|
||||
level : 'block',
|
||||
start(src) { return src.match(/^[^\n]*\n::/m)?.index; }, // Hint to Marked.js to stop and check for a match
|
||||
start(src) { return src.match(/\n[^\n]*\n::/m)?.index; }, // Hint to Marked.js to stop and check for a match
|
||||
tokenizer(src, tokens) {
|
||||
const regex = /(\n?\n?(?!::)[^\n]+?(?=\n::))|\n::(.(?:.|\n)*?(?=(?:\n::)|(?:\n\n)|$))/y;
|
||||
let match;
|
||||
@@ -353,7 +353,7 @@ const definitionListsMultiline = {
|
||||
}
|
||||
if(definitions.length) {
|
||||
return {
|
||||
type : 'definitionListsMultiline',
|
||||
type : 'definitionListsMultiLine',
|
||||
raw : src.slice(0, endIndex),
|
||||
definitions
|
||||
};
|
||||
@@ -617,7 +617,7 @@ function MarkedVariables() {
|
||||
//^=====--------------------< Variable Handling >-------------------=====^//
|
||||
|
||||
Marked.use(MarkedVariables());
|
||||
Marked.use({ extensions: [definitionListsMultiline, definitionListsInline, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] });
|
||||
Marked.use({ extensions: [definitionListsMultiLine, definitionListsSingleLine, superSubScripts, mustacheSpans, mustacheDivs, mustacheInjectInline] });
|
||||
Marked.use(mustacheInjectBlock);
|
||||
Marked.use({ renderer: renderer, tokenizer: tokenizer, mangle: false });
|
||||
Marked.use(MarkedExtendedTables(), MarkedGFMHeadingId(), MarkedSmartypantsLite());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@import (less) './themes/assets/assets.less';
|
||||
@import (less) './themes/fonts/icon fonts/font-icons.less';
|
||||
@import (less) './themes/fonts/icon fonts/dicefont.less';
|
||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
||||
|
||||
:root {
|
||||
//Colors
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@import (less) './themes/fonts/5e/fonts.less';
|
||||
@import (less) './themes/assets/assets.less';
|
||||
@import (less) './themes/fonts/icon fonts/dicefont.less';
|
||||
@import (less) './themes/fonts/icon fonts/diceFont.less';
|
||||
|
||||
:root {
|
||||
//Colors
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* Icon Font: dicefont */
|
||||
/* Icon Font: diceFont */
|
||||
@font-face {
|
||||
font-family : 'DiceFont';
|
||||
font-style : normal;
|
||||
font-weight : normal;
|
||||
src : url('../../../fonts/icon fonts/dicefont.woff2');
|
||||
src : url('../../../fonts/icon fonts/diceFont.woff2');
|
||||
}
|
||||
|
||||
.df {
|
||||
Reference in New Issue
Block a user