fix: patch scaffold URL parser to support self-hosted Gitea (.eu TLD)

zotero-plugin-scaffold hardcodes a .com-only regex in parseRepoUrl,
causing build failures with non-.com repository URLs. Add:
- scripts/patch-scaffold.mjs: postinstall script that fixes the regex
- zotero-plugin.config.ts: explicit xpiDownloadLink and updateURL
  so scaffold generates correct update.json without relying on the parser
This commit is contained in:
Ignacio Ballesteros
2026-02-17 22:42:48 +01:00
parent d319087c44
commit e356f50927
3 changed files with 53 additions and 1 deletions

View File

@@ -1,12 +1,18 @@
import { defineConfig } from "zotero-plugin-scaffold";
import pkg from "./package.json";
const GITEA_BASE = "https://gitea.bueso.eu/ignacio.ballesteros/zotero-notes-export-org";
export default defineConfig({
source: ["src", "addon"],
dist: ".scaffold/build",
name: pkg.config.addonName,
id: pkg.config.addonID,
namespace: pkg.config.addonRef,
// Explicit URLs are required because zotero-plugin-scaffold's URL parser
// only handles .com domains and cannot parse our self-hosted Gitea instance.
xpiDownloadLink: `${GITEA_BASE}/releases/download/v{{version}}/{{xpiName}}.xpi`,
updateURL: `${GITEA_BASE}/releases/download/release/{{updateJson}}`,
build: {
esbuildOptions: [
{