mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
refactor(scopes): simplify scopes.json structure
This commit is contained in:
+106
-161
@@ -1,7 +1,106 @@
|
|||||||
[
|
{
|
||||||
{
|
"scopes": [
|
||||||
"name": "core-chain",
|
"core-chain",
|
||||||
|
"core-ibc",
|
||||||
|
"crypto-mpc",
|
||||||
|
"crypto-ucan",
|
||||||
|
"crypto-zkp",
|
||||||
|
"sonr-hway",
|
||||||
|
"sonr-orm",
|
||||||
|
"sonr-motr",
|
||||||
|
"sonr-chat",
|
||||||
|
"x-did",
|
||||||
|
"x-dwn",
|
||||||
|
"x-svc",
|
||||||
|
"ci-cd",
|
||||||
|
"dev-ops",
|
||||||
|
"wasm-worker"
|
||||||
|
],
|
||||||
"docs": [
|
"docs": [
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"workflows",
|
||||||
|
"syntax"
|
||||||
|
],
|
||||||
|
"url": "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"cosmos",
|
||||||
|
"tooling",
|
||||||
|
"cosmovisor"
|
||||||
|
],
|
||||||
|
"url": "https://docs.cosmos.network/v0.50/build/tooling/cosmovisor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"process-compose",
|
||||||
|
"configuration"
|
||||||
|
],
|
||||||
|
"url": "https://f1bonacc1.github.io/process-compose/configuration/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"taskfile",
|
||||||
|
"cli",
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"url": "https://taskfile.dev/reference/cli"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [],
|
||||||
|
"url": "https://taskfile.dev/reference/schema"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"taskfile",
|
||||||
|
"templating",
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"url": "https://taskfile.dev/reference/templating/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"mkdocs",
|
||||||
|
"material",
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"url": "https://squidfunk.github.io/mkdocs-material/reference/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"pkl",
|
||||||
|
"language",
|
||||||
|
"reference"
|
||||||
|
],
|
||||||
|
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"pwa",
|
||||||
|
"service-workers",
|
||||||
|
"web"
|
||||||
|
],
|
||||||
|
"url": "https://web.dev/learn/pwa/service-workers/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"service-workers",
|
||||||
|
"web",
|
||||||
|
"api"
|
||||||
|
],
|
||||||
|
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"web-authentication",
|
||||||
|
"web",
|
||||||
|
"api"
|
||||||
|
],
|
||||||
|
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"sdk",
|
"sdk",
|
||||||
@@ -49,12 +148,7 @@
|
|||||||
"sdk"
|
"sdk"
|
||||||
],
|
],
|
||||||
"url": "https://docs.cosmos.network/v0.50/build/building-modules/depinject"
|
"url": "https://docs.cosmos.network/v0.50/build/building-modules/depinject"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "core-ibc",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ibc",
|
"ibc",
|
||||||
@@ -136,12 +230,7 @@
|
|||||||
"assets"
|
"assets"
|
||||||
],
|
],
|
||||||
"url": "https://docs.nomic.io/nbtc"
|
"url": "https://docs.nomic.io/nbtc"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "crypto-mpc",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"mpc",
|
"mpc",
|
||||||
@@ -151,12 +240,7 @@
|
|||||||
"invokation"
|
"invokation"
|
||||||
],
|
],
|
||||||
"url": "https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf"
|
"url": "https://csrc.nist.gov/CSRC/media/Events/NTCW19/papers/paper-DKLS.pdf"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "crypto-ucan",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ucan",
|
"ucan",
|
||||||
@@ -165,12 +249,7 @@
|
|||||||
"authorization"
|
"authorization"
|
||||||
],
|
],
|
||||||
"url": "https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md"
|
"url": "https://raw.githubusercontent.com/ucan-wg/spec/refs/heads/main/README.md"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "crypto-zkp",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"zero-knowledge",
|
"zero-knowledge",
|
||||||
@@ -179,17 +258,12 @@
|
|||||||
"privacy"
|
"privacy"
|
||||||
],
|
],
|
||||||
"url": "https://eprint.iacr.org/2021/1672.pdf"
|
"url": "https://eprint.iacr.org/2021/1672.pdf"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "sonr-hway",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"gateway",
|
"gateway",
|
||||||
"http",
|
"http",
|
||||||
"sse",
|
"sse"
|
||||||
],
|
],
|
||||||
"url": "https://echo.labstack.com/docs/cookbook/sse"
|
"url": "https://echo.labstack.com/docs/cookbook/sse"
|
||||||
},
|
},
|
||||||
@@ -197,7 +271,7 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"gateway",
|
"gateway",
|
||||||
"http",
|
"http",
|
||||||
"websocket",
|
"websocket"
|
||||||
],
|
],
|
||||||
"url": "https://echo.labstack.com/docs/cookbook/websocket"
|
"url": "https://echo.labstack.com/docs/cookbook/websocket"
|
||||||
},
|
},
|
||||||
@@ -205,15 +279,10 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"gateway",
|
"gateway",
|
||||||
"http",
|
"http",
|
||||||
"subdomain",
|
"subdomain"
|
||||||
],
|
],
|
||||||
"url": "https://echo.labstack.com/docs/cookbook/subdomain"
|
"url": "https://echo.labstack.com/docs/cookbook/subdomain"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "sonr-orm",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"tigerbeetle",
|
"tigerbeetle",
|
||||||
@@ -302,12 +371,7 @@
|
|||||||
"injective"
|
"injective"
|
||||||
],
|
],
|
||||||
"url": "https://docs.substreams.dev/tutorials/cosmos/injective/foundational"
|
"url": "https://docs.substreams.dev/tutorials/cosmos/injective/foundational"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "sonr-motr",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"worker",
|
"worker",
|
||||||
@@ -333,12 +397,7 @@
|
|||||||
"api"
|
"api"
|
||||||
],
|
],
|
||||||
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
|
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "sonr-chat",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"synapse",
|
"synapse",
|
||||||
@@ -347,12 +406,7 @@
|
|||||||
"usage"
|
"usage"
|
||||||
],
|
],
|
||||||
"url": "https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html"
|
"url": "https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "x-did",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"cosmos",
|
"cosmos",
|
||||||
@@ -379,12 +433,7 @@
|
|||||||
"bank"
|
"bank"
|
||||||
],
|
],
|
||||||
"url": "https://docs.cosmos.network/v0.50/build/modules/bank"
|
"url": "https://docs.cosmos.network/v0.50/build/modules/bank"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "x-dwn",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"cosmos",
|
"cosmos",
|
||||||
@@ -420,12 +469,7 @@
|
|||||||
"sdk"
|
"sdk"
|
||||||
],
|
],
|
||||||
"url": "https://docs.cosmos.network/v0.50/build/modules/staking"
|
"url": "https://docs.cosmos.network/v0.50/build/modules/staking"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "x-svc",
|
|
||||||
"docs": [
|
|
||||||
{
|
{
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"cosmos",
|
"cosmos",
|
||||||
@@ -454,103 +498,4 @@
|
|||||||
"url": "https://docs.cosmos.network/v0.50/build/modules/nft"
|
"url": "https://docs.cosmos.network/v0.50/build/modules/nft"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"name": "ci-cd",
|
|
||||||
"docs": [
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"workflows",
|
|
||||||
"syntax"
|
|
||||||
],
|
|
||||||
"url": "https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"cosmos",
|
|
||||||
"tooling",
|
|
||||||
"cosmovisor"
|
|
||||||
],
|
|
||||||
"url": "https://docs.cosmos.network/v0.50/build/tooling/cosmovisor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"process-compose",
|
|
||||||
"configuration"
|
|
||||||
],
|
|
||||||
"url": "https://f1bonacc1.github.io/process-compose/configuration/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"taskfile",
|
|
||||||
"cli",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"url": "https://taskfile.dev/reference/cli"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [],
|
|
||||||
"url": "https://taskfile.dev/reference/schema"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"taskfile",
|
|
||||||
"templating",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"url": "https://taskfile.dev/reference/templating/"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "dev-ops",
|
|
||||||
"docs": [
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"mkdocs",
|
|
||||||
"material",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"url": "https://squidfunk.github.io/mkdocs-material/reference/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"pkl",
|
|
||||||
"language",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"url": "https://pkl-lang.org/main/current/language-reference/index.html"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "wasm-worker",
|
|
||||||
"docs": [
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"pwa",
|
|
||||||
"service-workers",
|
|
||||||
"web"
|
|
||||||
],
|
|
||||||
"url": "https://web.dev/learn/pwa/service-workers/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"service-workers",
|
|
||||||
"web",
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"keywords": [
|
|
||||||
"web-authentication",
|
|
||||||
"web",
|
|
||||||
"api"
|
|
||||||
],
|
|
||||||
"url": "https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|||||||
@@ -1,70 +1,109 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
ROOT_DIR=$(git rev-parse --show-toplevel)
|
ROOT_DIR=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
# Extract scope name and path using jq, and pass it to fzf for selection
|
select_scope() {
|
||||||
SCOPE=$(cat "$ROOT_DIR/.github/scopes.json" | jq -r '.[] | "\(.name)"' | fzf --prompt "Select scope:")
|
cat "$ROOT_DIR/.github/scopes.json" | jq -r '.scopes[]' | fzf --prompt "Select scope:"
|
||||||
DOCS=$(cat "$ROOT_DIR/.github/scopes.json" | jq -r ".[] | select(.name == \"$SCOPE\") | .docs[].url")
|
}
|
||||||
|
|
||||||
# Write Title
|
get_title() {
|
||||||
TITLE=$(gum input --placeholder "Issue Title...")
|
gum input --placeholder "Issue Title..."
|
||||||
|
}
|
||||||
|
|
||||||
# Write Goal
|
add_requirement() {
|
||||||
GOAL=$(mods --role "determine-issue-goal" "$SCOPE $TITLE")
|
requirement=$(gum input --placeholder "Add a requirement...")
|
||||||
|
if [ -n "$requirement" ]; then
|
||||||
|
REQUIREMENTS="$REQUIREMENTS
|
||||||
|
$requirement"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
# Input Requirements
|
collect_requirements() {
|
||||||
REQUIREMENTS=()
|
REQUIREMENTS=""
|
||||||
while true; do
|
req_count=0
|
||||||
if [ ${#REQUIREMENTS[@]} -ge 2 ]; then
|
while true; do
|
||||||
if ! gum confirm "Do you want to add another requirement?"; then
|
if add_requirement; then
|
||||||
|
req_count=$((req_count + 1))
|
||||||
|
if [ $req_count -ge 2 ] && ! gum confirm "Do you want to add another requirement?"; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
fi
|
else
|
||||||
REQUIREMENT=$(gum input --placeholder "Add a requirement...")
|
if [ $req_count -ge 2 ]; then
|
||||||
if [ -n "$REQUIREMENT" ]; then
|
break
|
||||||
REQUIREMENTS+=("$REQUIREMENT")
|
|
||||||
else
|
else
|
||||||
echo "Requirement cannot be empty. Please enter a valid requirement."
|
echo "Requirement cannot be empty. Please enter a valid requirement."
|
||||||
fi
|
fi
|
||||||
done
|
fi
|
||||||
|
|
||||||
create_body() {
|
|
||||||
echo "### Goal(s):"
|
|
||||||
echo "$GOAL"
|
|
||||||
echo "### Requirements:"
|
|
||||||
for i in "${!REQUIREMENTS[@]}"; do
|
|
||||||
echo "$(($i + 1)). ${REQUIREMENTS[$i]}"
|
|
||||||
done
|
done
|
||||||
echo "### Resources:"
|
|
||||||
while IFS= read -r doc; do
|
|
||||||
echo "- $doc"
|
|
||||||
done <<< "$DOCS"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ISSUE_BODY=$(create_body)
|
get_docs() {
|
||||||
|
docs=$(cat "$ROOT_DIR/.github/scopes.json" | jq -c '.docs')
|
||||||
|
mods --role "determine-issue-docs" "$SCOPE" "$TITLE" "$docs"
|
||||||
|
}
|
||||||
|
|
||||||
# Function to collect output
|
get_goal() {
|
||||||
preview_output() {
|
mods --role "determine-issue-goal" "$SCOPE $TITLE"
|
||||||
|
}
|
||||||
|
|
||||||
|
format_requirements() {
|
||||||
|
i=1
|
||||||
|
echo "$REQUIREMENTS" | while IFS= read -r req; do
|
||||||
|
if [ -n "$req" ]; then
|
||||||
|
echo "$i. $req"
|
||||||
|
i=$((i + 1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
create_body() {
|
||||||
|
goal=$(get_goal)
|
||||||
|
docs=$(get_docs)
|
||||||
|
|
||||||
|
echo "### Goal(s):"
|
||||||
|
echo "$goal"
|
||||||
|
echo
|
||||||
|
echo "### Requirements:"
|
||||||
|
format_requirements
|
||||||
|
echo
|
||||||
|
echo "### Resources:"
|
||||||
|
echo "$docs"
|
||||||
|
}
|
||||||
|
|
||||||
|
preview_issue() {
|
||||||
echo "# ($SCOPE) $TITLE"
|
echo "# ($SCOPE) $TITLE"
|
||||||
echo "$ISSUE_BODY"
|
echo "$ISSUE_BODY"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Display the formatted output
|
create_github_issue() {
|
||||||
preview_output | gum format
|
draft_flag=""
|
||||||
|
if gum confirm "Assign this issue to yourself?"; then
|
||||||
# Confirm to create a GitHub issue
|
draft_flag="-a @me"
|
||||||
if gum confirm "Do you want to create a new GitHub issue with this information?"; then
|
|
||||||
# Ask if this should be a draft issue
|
|
||||||
if gum confirm "Create as draft issue?"; then
|
|
||||||
# Create a draft GitHub issue
|
|
||||||
gh issue create --repo onsonr/sonr --title "($SCOPE) $TITLE" --body "$ISSUE_BODY"
|
|
||||||
else
|
|
||||||
# Create a regular GitHub issue
|
|
||||||
gh issue create --repo onsonr/sonr --title "($SCOPE) $TITLE" --body "$ISSUE_BODY" -a @me
|
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
exit 1
|
gh issue create \
|
||||||
fi
|
--repo onsonr/sonr \
|
||||||
|
--title "[$SCOPE] $TITLE" \
|
||||||
|
--body "$ISSUE_BODY" \
|
||||||
|
$draft_flag
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
SCOPE=$(select_scope)
|
||||||
|
TITLE=$(get_title)
|
||||||
|
collect_requirements
|
||||||
|
ISSUE_BODY=$(create_body)
|
||||||
|
|
||||||
|
preview_issue | gum format
|
||||||
|
|
||||||
|
if gum confirm "Do you want to create a new GitHub issue with this information?"; then
|
||||||
|
create_github_issue
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user