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
35 lines
995 B
TypeScript
35 lines
995 B
TypeScript
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: [
|
|
{
|
|
entryPoints: ["src/index.ts"],
|
|
bundle: true,
|
|
target: "firefox128",
|
|
outfile: ".scaffold/build/addon/content/scripts/index.js",
|
|
},
|
|
],
|
|
},
|
|
server: {
|
|
asProxy: true,
|
|
},
|
|
release: {
|
|
bumpp: {
|
|
execute: "npm run build",
|
|
},
|
|
},
|
|
});
|