2.0.14 • Published 3 months ago

zotero-plugin v2.0.14

Weekly downloads
119
License
ISC
Repository
github
Last release
3 months ago

zotero-plugin

Utility scripts for releasing zotero plugins on github. See also https://github.com/retorquere/generator-zotero-plugin/

zotero-plugin-release will release your plugin as a github release. When it is ran on master/main, and it detects a tagged build in a Github Action, it will issue a new release. When it is ran on a branch named gh-<number>, it will publish the plugin to a pre-release named builds, and will announce the new build on issue number <number> in your repo.

For this to work you must have a variable named GITHUB_TOKEN in your GH Actions environment with a github token with repo rights. You are allowed one bot account by github; I use this to do the announcements, but you can use one from your own account if you want.

The release script will create two releases if they don't exist; builds for temporary builds, mostly for debugging, and release for the update.rdf, which needs to be at a stable URL for plugin updates to work.

If you're doing a push on a branch named gh-<number> but you do not want the build to be announced, include #norelease in the commit message. If you want to announce on other issues in addition to the current branch (or maybe your branch isn't named gh-<number>, add #<number> to the commit message.

Releasing a new version

Add the folowing to your scripts section in package.json:

"postversion": "git push --follow-tags",

and install this github actions workflow

name: release

on:
  push:

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: install node
      uses: actions/setup-node@v1
      with:
        node-version: 14.x
    - name: Cache node dependencies
      uses: actions/cache@v2
      env:
        cache-name: cache-dependencies
      with:
        path: |
          ~/.npm
        key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
    - name: install node dependencies
      run: npm install
    - name: build
      run: npm run build
    - name: release
      run: npm run release
      env:
        GITHUB_TOKEN: ${{ github.token }}

You can now release new versions by issuing npm version <major|minor|patch>.

Allowing your user to send debug information

In your plugin, add import { DebugLog } from 'zotero-plugin/debug-log' to your startup file, then after Zotero.Schema.updateSchemaPromise clears, call

DebugLog.register('your plugin name', ['extensions.zotero.<your plugin extension root>.'])

the array is a list of either full names of preferences you want to know about, or a name ending in . which means "all keys directly under this".

The Help menu will now have an entry "send debug log to file.io"; when your user selects that, the error log and the selected settings will be sent to file.io; if any items are selected, when that is clicked, a copy of those items will be included in RDF format.

The user will get an ID that looks like C3WvhYgA8RDM-2XZGASLV; the first part is the file.io ID, so you would go to https://file.io/C3WvhYgA8RDM to retrieve the download; the zipfile you get there will be 2XZGASLV.zip.

Starting Zotero with your plugin loaded

Note it is much adviced to create a separate Zotero profile for testing!

You will need to have python3 installed to use this.

Create a file called zotero-plugin.ini with the following contents:

[profile]
name = <your test profile name> # optional. when not present, the profile picker will popup, where you can select the test profile
path = <your test profile absolute path>

[zotero]
path = <explicit path to zotero binary> # optional
log = <file name to write log output to> # optional
db = <path to zotero.sqlite you want to populate the profile with> # optional

[plugin]
source = <plugin source directory> # optional
build = <command to build your plugin, or false if no build is needed> # optional

[preferences]
extensions.zotero.<your extension>.<some setting> = <value>
extensions.zotero.<your extension>.<some other setting> = <value>

and add this script to your package.json:

  "start": "zotero-start"

then when you execute npm start, zotero will start up with the latest build of your plugin installed, and the given preferences set.

DO CREATE A BACKUP OF YOUR ZOTERO DATA AND YOUR ZOTERO PROFILE BEFORE USING THIS THE FIRST TIME

zotero-start will blindly trust you've set it up right and will alter data in the profile

2.0.14

3 months ago

2.0.13

4 months ago

2.0.11

7 months ago

2.0.12

6 months ago

2.0.10

7 months ago

2.0.3

9 months ago

2.0.2

9 months ago

2.0.5

9 months ago

2.0.4

9 months ago

2.0.7

8 months ago

2.0.6

9 months ago

2.0.9

8 months ago

1.4.22

12 months ago

2.0.8

8 months ago

1.4.24

10 months ago

1.4.23

11 months ago

1.4.26

9 months ago

1.4.25

10 months ago

2.0.1

9 months ago

2.0.0

9 months ago

1.4.20

12 months ago

1.4.21

12 months ago

1.4.12

1 year ago

1.4.15

1 year ago

1.4.14

1 year ago

1.4.17

1 year ago

1.4.16

1 year ago

1.4.19

1 year ago

1.4.18

1 year ago

1.4.11

1 year ago

1.4.10

1 year ago

1.4.9

1 year ago

1.4.8

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.7

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.3

2 years ago

1.2.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.0.65

2 years ago

1.0.64

2 years ago

1.0.63

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.55

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.49

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.52

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.40

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.37

3 years ago

1.0.33

3 years ago

1.0.35

3 years ago

1.0.32

3 years ago

1.0.30

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

0.0.99

4 years ago

0.0.98

4 years ago

0.0.97

4 years ago

0.0.96

4 years ago

0.0.95

4 years ago

0.0.93

5 years ago

0.0.91

5 years ago

0.0.90

5 years ago

0.0.89

5 years ago

0.0.88

5 years ago

0.0.87

5 years ago

0.0.85

5 years ago

0.0.83

5 years ago

0.0.82

5 years ago

0.0.81

5 years ago

0.0.80

5 years ago

0.0.79

5 years ago

0.0.78

5 years ago

0.0.77

5 years ago

0.0.76

5 years ago

0.0.75

5 years ago

0.0.74

5 years ago

0.0.73

5 years ago

0.0.72

5 years ago

0.0.71

5 years ago

0.0.70

5 years ago

0.0.69

5 years ago

0.0.68

5 years ago

0.0.67

5 years ago

0.0.65

5 years ago

0.0.64

5 years ago

0.0.63

5 years ago

0.0.61

5 years ago

0.0.60

5 years ago

0.0.59

5 years ago

0.0.58

6 years ago

0.0.57

6 years ago

0.0.56

6 years ago

0.0.55

6 years ago

0.0.54

6 years ago

0.0.53

6 years ago

0.0.52

6 years ago

0.0.49

6 years ago

0.0.48

6 years ago

0.0.47

6 years ago

0.0.46

6 years ago

0.0.44

6 years ago

0.0.42

6 years ago

0.0.41

6 years ago

0.0.40

6 years ago

0.0.39

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.31

6 years ago

0.0.30

6 years ago

0.0.26

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago