Skip to content
This repository was archived by the owner on Apr 11, 2026. It is now read-only.

Commit 958bc34

Browse files
committed
init commit
0 parents  commit 958bc34

21 files changed

Lines changed: 5019 additions & 0 deletions

.devcontainer/devcontainer.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Zotero Plugins Marketplace",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
"features": {
10+
"ghcr.io/devcontainers-contrib/features/pnpm:2": {}
11+
},
12+
13+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
14+
// "forwardPorts": [5173, 4173],
15+
// "portsAttributes": {},
16+
17+
// Use 'postCreateCommand' to run commands after the container is created.
18+
"postCreateCommand": "pnpm i",
19+
// "postStartCommand": "pnpm docs:dev",
20+
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
"vscode": {
24+
// Set *default* container specific settings.json values on container create.
25+
"extensions": [
26+
"dbaeumer.vscode-eslint",
27+
"esbenp.prettier-vscode",
28+
"davidanson.vscode-markdownlint"
29+
]
30+
},
31+
"codespaces": {
32+
"openFiles": ["./README.md"]
33+
}
34+
}
35+
36+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
37+
// "remoteUser": "root"
38+
}

.github/renovate.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["local>zotero-chinese/renovate-config"]
4+
}

.github/workflows/autofix.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: autofix.ci # needed to securely identify the workflow
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
autofix:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: pnpm/action-setup@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: pnpm
22+
- run: pnpm install
23+
- run: pnpm run lint:fix
24+
- uses: autofix-ci/action@main

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
3+
plugins/**
4+
!plugins/*
5+
!plugins/*/meta.json
6+
7+
plugins-index.json
8+
.cache.json

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint-staged

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3+
}

.vscode/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"json.schemas": [
3+
{
4+
"fileMatch": ["plugins/**/meta.json"],
5+
"url": "./schemas/meta.schema.json"
6+
}
7+
],
8+
9+
"editor.formatOnSave": true,
10+
"editor.formatOnType": false,
11+
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
12+
"editor.tabSize": 2,
13+
"editor.codeActionsOnSave": {
14+
"source.fixAll.prettier": "never",
15+
"source.fixAll.eslint": "always",
16+
"source.fixAll": "always",
17+
"source.organizeImports": "never"
18+
}
19+
}

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Zotero Plugin Registry
2+
3+
> A self-hosted registry and store for Zotero plugins based on their `update.json` manifests.
4+
5+
## Overview
6+
7+
Zotero Plugin Registry is a self-hosted platform that aggregates Zotero plugins by collecting developers' self-hosted `update.json` files.
8+
It provides a unified service for users to browse, search, and get version and compatibility information about Zotero plugins.
9+
10+
## Project Structure
11+
12+
```plain
13+
main/
14+
└── plugins/
15+
└── <plugin-id>/
16+
├── meta.json # Base plugin metadata (manually maintained)
17+
├── meta.generated.json # Generated metadata including versions
18+
├── latest.json # Generated latest version info
19+
└── icon.png # Optional plugin icon
20+
scripts/
21+
└── build.ts # Build script to generate aggregated data
22+
.gitignore # Ignore generated JSON files
23+
package.json # Project config and dependencies
24+
README.md # This document
25+
```
26+
27+
## Quick Start
28+
29+
1. Clone the repository and install dependencies
30+
31+
```bash
32+
git clone https://github.com/zotero-plugin-dev/zotero-plugin-registry.git
33+
cd zotero-plugin-registry
34+
pnpm install
35+
```
36+
37+
2. Add plugin metadata in `main/plugins/<plugin-id>/meta.json`, example:
38+
39+
```json
40+
{
41+
42+
"name": "Zotero Format Metadata",
43+
"update_json": "https://example.com/path/to/update.json",
44+
"description": "A useful Zotero plugin.",
45+
"homepage": "https://github.com/northword/zotero-format-metadata",
46+
"tags": ["metadata"]
47+
}
48+
```
49+
50+
3. Run the build script to generate aggregated data
51+
52+
```bash
53+
pnpm run build
54+
```
55+
56+
4. After building, `meta.generated.json` and `latest.json` files will be created inside each plugin directory, ready for deployment or frontend consumption.
57+
58+
## Build Script Usage
59+
60+
- Build all plugins:
61+
62+
```bash
63+
pnpm run build
64+
```
65+
66+
- Build a specific plugin by ID:
67+
68+
```bash
69+
pnpx ts-node scripts/build.ts --only [email protected]
70+
```
71+
72+
## Contributing
73+
74+
Contributions of plugin metadata files are welcome!
75+
Please keep the repository clean and comply with the MIT license.
76+
77+
## License
78+
79+
MIT © Northword
80+
81+
## Contact
82+
83+
For questions or suggestions, please open an issue on GitHub.

eslint.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import antfu from "@antfu/eslint-config";
2+
3+
export default antfu({
4+
stylistic: false,
5+
});
6+
7+
// TODO: sort meta.json

package.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"name": "zotero-plugin-registry",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"private": "true",
6+
"packageManager": "[email protected]",
7+
"description": "Zotero Plugin Registry",
8+
"author": "northword",
9+
"license": "MIT",
10+
"homepage": "https://github.com/zotero-plugin-dev/zotero-plugin-registry#readme",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/zotero-plugin-dev/zotero-plugin-registry.git"
14+
},
15+
"scripts": {
16+
"run": "tsx scripts/build.ts",
17+
"build": "pnpm dev --all",
18+
"check-pr": "pnpm dev --pr",
19+
"generate-schema": "bash scripts/schema.sh",
20+
"lint:fix": "eslint . --fix",
21+
"lint:check": "eslint .",
22+
"prepare": "husky",
23+
"test": "echo \"Error: no test specified\" && exit 1"
24+
},
25+
"devDependencies": {
26+
"@antfu/eslint-config": "^4.16.1",
27+
"@types/adm-zip": "^0.5.7",
28+
"@types/fs-extra": "^11.0.4",
29+
"@types/node": "^22.15.34",
30+
"adm-zip": "^0.5.16",
31+
"axios": "^1.10.0",
32+
"consola": "^3.4.2",
33+
"cross-env": "7.0.3",
34+
"es-toolkit": "^1.39.5",
35+
"eslint": "^9.30.0",
36+
"fs-extra": "^11.3.0",
37+
"globby": "^14.1.0",
38+
"husky": "^9.1.7",
39+
"jsonc": "^2.0.0",
40+
"lint-staged": "^16.1.2",
41+
"octokit": "^5.0.3",
42+
"ofetch": "^1.4.1",
43+
"prettier": "^3.6.2",
44+
"ts-json-schema-generator": "^2.4.0",
45+
"tsx": "^4.20.3",
46+
"typescript": "^5.8.3"
47+
},
48+
"lint-staged": {
49+
"*.*": "eslint --fix"
50+
}
51+
}

0 commit comments

Comments
 (0)