44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
from typing import TypedDict
|
|
|
|
|
|
class RegistryEntry(TypedDict, total=False):
|
|
repo: str
|
|
path: str
|
|
ref: str
|
|
dest: str
|
|
|
|
|
|
# Manage your repositories, files, and folders here.
|
|
# Key = addon name you pass to `jeaddons add <name>`.
|
|
REGISTRY: dict[str, RegistryEntry] = {
|
|
"AddOn_CYCLE800_Turning": {
|
|
"repo": "xxx",
|
|
"path": "AddOn_CYCLE800_Turning/",
|
|
"ref": "main",
|
|
"dest": "AddOn/AddOn_CYCLE800_Turning/",
|
|
}
|
|
# "button": {
|
|
# "repo": "https://github.com/your-org/templates.git",
|
|
# "path": "src/components/Button.tsx",
|
|
# "ref": "main",
|
|
# "dest": "src/components",
|
|
# },
|
|
# "ui": {
|
|
# "repo": "https://github.com/your-org/templates.git",
|
|
# "path": "src/components/ui",
|
|
# "ref": "v1.2.0",
|
|
# "dest": "src/components",
|
|
# },
|
|
}
|
|
|
|
|
|
def load_registry() -> dict[str, RegistryEntry]:
|
|
return REGISTRY
|
|
|
|
|
|
def get_registry_entry(name: str) -> RegistryEntry:
|
|
registry = load_registry()
|
|
if name not in registry:
|
|
raise KeyError(name)
|
|
return registry[name]
|