2.0.32 • Published 12 months ago

zotero-plugin v2.0.32

Weekly downloads
119
License
ISC
Repository
github
Last release
12 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.28

1 year ago

2.0.29

1 year ago

2.0.31

12 months ago

2.0.32

12 months ago

2.0.30

1 year ago

2.0.16

1 year ago

2.0.19

1 year ago

2.0.17

1 year ago

2.0.18

1 year ago

2.0.26

1 year ago

2.0.27

1 year ago

2.0.24

1 year ago

2.0.25

1 year ago

2.0.22

1 year ago

2.0.23

1 year ago

2.0.20

1 year ago

2.0.21

1 year ago

2.0.15

1 year ago

2.0.14

2 years ago

2.0.13

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.10

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

1.4.22

2 years ago

2.0.8

2 years ago

1.4.24

2 years ago

1.4.23

2 years ago

1.4.26

2 years ago

1.4.25

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.4.20

2 years ago

1.4.21

2 years ago

1.4.12

3 years ago

1.4.15

3 years ago

1.4.14

3 years ago

1.4.17

3 years ago

1.4.16

3 years ago

1.4.19

2 years ago

1.4.18

2 years ago

1.4.11

3 years ago

1.4.10

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.7

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.3

4 years ago

1.2.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.49

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.52

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.33

5 years ago

1.0.35

5 years ago

1.0.32

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.19

5 years ago

1.0.20

5 years ago

1.0.18

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

0.0.99

6 years ago

0.0.98

6 years ago

0.0.97

6 years ago

0.0.96

6 years ago

0.0.95

6 years ago

0.0.93

6 years ago

0.0.91

6 years ago

0.0.90

6 years ago

0.0.89

6 years ago

0.0.88

6 years ago

0.0.87

6 years ago

0.0.85

6 years ago

0.0.83

6 years ago

0.0.82

6 years ago

0.0.81

6 years ago

0.0.80

6 years ago

0.0.79

6 years ago

0.0.78

6 years ago

0.0.77

6 years ago

0.0.76

6 years ago

0.0.75

6 years ago

0.0.74

6 years ago

0.0.73

6 years ago

0.0.72

7 years ago

0.0.71

7 years ago

0.0.70

7 years ago

0.0.69

7 years ago

0.0.68

7 years ago

0.0.67

7 years ago

0.0.65

7 years ago

0.0.64

7 years ago

0.0.63

7 years ago

0.0.61

7 years ago

0.0.60

7 years ago

0.0.59

7 years ago

0.0.58

7 years ago

0.0.57

7 years ago

0.0.56

7 years ago

0.0.55

7 years ago

0.0.54

7 years ago

0.0.53

7 years ago

0.0.52

7 years ago

0.0.49

7 years ago

0.0.48

7 years ago

0.0.47

7 years ago

0.0.46

7 years ago

0.0.44

7 years ago

0.0.42

7 years ago

0.0.41

7 years ago

0.0.40

7 years ago

0.0.39

7 years ago

0.0.38

7 years ago

0.0.37

7 years ago

0.0.36

7 years ago

0.0.35

7 years ago

0.0.34

7 years ago

0.0.31

7 years ago

0.0.30

7 years ago

0.0.26

8 years ago

0.0.24

8 years ago

0.0.23

8 years ago

0.0.22

8 years ago

0.0.21

8 years ago

0.0.20

8 years ago

0.0.19

8 years ago

0.0.18

8 years ago

0.0.17

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago