From 8671e1edc98067830c2e86d4b683c4cb6f047676 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Thu, 30 May 2024 11:02:11 +0800 Subject: [PATCH] update: add link to latest version in readme --- README.md | 3 ++- package-lock.json | 1 + package.json | 1 + zotero-plugin.config.ts | 35 +++++++++++++++++------------------ 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 888ec3f..3928162 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,9 @@ and: ## 👋 Install -- Download the latest release (.xpi file) from: +- Download the plugin (.xpi file) from below. For Zotero 7 beta, please always use the latest beta version. + - [Latest Version: 1.1.4-beta.75](https://github.com/windingwind/zotero-better-notes/releases/download/v1.1.4-beta.75/better-notes-for-zotero.xpi) - [Latest Stable](https://github.com/windingwind/zotero-better-notes/releases/latest) - [v1.0.4](https://github.com/windingwind/zotero-better-notes/releases/tag/1.0.4) (last for Zotero 6) - [v0.8.9](https://github.com/windingwind/zotero-better-notes/releases/tag/0.8.9) (last with auto-insert, tag-insert, math-ocr, for Zotero 6) diff --git a/package-lock.json b/package-lock.json index fff5867..725e260 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,6 +60,7 @@ "prosemirror-state": "^1.4.3", "prosemirror-transform": "^1.8.0", "prosemirror-view": "^1.32.6", + "replace-in-file": "^7.2.0", "typescript": "^5.3.3", "xslt3": "^2.6.0", "zotero-plugin-scaffold": "^0.0.26", diff --git a/package.json b/package.json index 3265eb0..947cc36 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "prosemirror-state": "^1.4.3", "prosemirror-transform": "^1.8.0", "prosemirror-view": "^1.32.6", + "replace-in-file": "^7.2.0", "typescript": "^5.3.3", "xslt3": "^2.6.0", "zotero-plugin-scaffold": "^0.0.26", diff --git a/zotero-plugin.config.ts b/zotero-plugin.config.ts index bef7bd2..b45ddf3 100644 --- a/zotero-plugin.config.ts +++ b/zotero-plugin.config.ts @@ -1,6 +1,6 @@ -import { defineConfig } from "zotero-plugin-scaffold"; import pkg from "./package.json"; -import { copyFileSync } from "fs"; +import { defineConfig } from "zotero-plugin-scaffold"; +import { replaceInFile } from "replace-in-file"; export default defineConfig({ source: ["src", "addon"], @@ -43,24 +43,23 @@ export default defineConfig({ outdir: "build/addon/chrome/content/scripts", bundle: true, target: ["firefox115"], - } + }, ], - // If you want to checkout update.json into the repository, uncomment the following lines: - // makeUpdateJson: { - // hash: false, - // }, - // hooks: { - // "build:makeUpdateJSON": (ctx) => { - // copyFileSync("build/update.json", "update.json"); - // copyFileSync("build/update-beta.json", "update-beta.json"); - // }, - // }, + hooks: { + "build:replace": (ctx) => { + return replaceInFile({ + files: ["README.md"], + from: /^ {2}- \[Latest Version.*/gm, + to: ` - [Latest Version: ${ctx.version}](${ctx.xpiDownloadLink})`, + }) as Promise; + }, + }, + }, + release: { + bumpp: { + execute: "npm run build", + }, }, - // release: { - // bumpp: { - // execute: "npm run build", - // }, - // }, // If you need to see a more detailed build log, uncomment the following line: // logLevel: "trace",