Closed vancleve closed 1 year ago
Thanks for reporting, I'll fix the templates, but for now just make the following changes to bootstrap.js: for each of the lines
async function install() {
async function startup({ id, version, resourceURI, rootURI = resourceURI.spec }) {
function shutdown() {
function uninstall() {
add export
in front of it.
New version is out, but it will just do what I described in the previous comment.
Great, thank you so much for the rapid response!!!
I installed the new generator-zotero-pluging
but this error below from the linter:
Is this normal for make-it-red template?
Also, I'm very new to javascript, typescript and npm, so I'll try ask a minimum of very basic questions, but I wanted to pose one regarding the zotero-plugin
build system vis-a-via what I see in the make-it-red template. Should I expect to see the contents of the make-it-red bootstrap.js
in the build/bootstrap.js
after running npm run build
?
thanks again!
Is this normal for make-it-red template?
It shouldn't be normal, I think. I tried to make minimal changes to the MiR template, but having it error out is perhaps too pedantic. A new version is up, but I can also just explain what changes I made if you want to keep what you have.
I'm still working to add the src-1.0 template, which I've just found out is a better base than the src-1.1 template. Disappointing, but it is what it is.
Also, I'm very new to javascript, typescript and npm, so I'll try ask a minimum of very basic questions
Don't worry about it, ask away.
I wanted to pose one regarding the zotero-plugin build system vis-a-via what I see in the make-it-red template. Should I expect to see the contents of the make-it-red bootstrap.js in the build/bootstrap.js after running npm run build?
Sort of. It should be recognizable but not exactly the same; it should have the exact same result when ran. But you should really only look at the generated javascript when debugging. For authoring, the typescript sources are what you'd be working with.
I realize this is a heavily opinionated choice, but I much prefer typescript over javascript, it has saved me from so much problems, and I do use the generator myself to bootstrap (ha!) new plugins.
You can use the make-it-red template from Zotero as-is together with the zotero-plugin
package. You don't need to use typescript if it's not a good match for how you work.
Ah ok, got it I think :-). I'm happy to go with typescript and the development tools that comes with it. Thanks again!
Ok, great, got the make-it-red working! Onto learning more about zotero and typescript and plugins!
I'm trying to building a new plugin using the generator and the make-it-red template and with no changes to the template, it doesn't seem to be building the
bootstrap.js
file correctly.I follow the instructions to
install
yo
install
generator-zotero-plugin
(version 3.1.2)run
yo zotero-plugin
in my plugin directory (see below for options selected)create the following
zotero-plugin.ini
[zotero] path = /Applications/Zotero7.app/Contents/MacOS/zotero
[plugin] source = build
var Zotero;
var { } = (() => { })();