Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use zotero-plugin-scaffold? #272

Closed
diegodlh opened this issue Jul 16, 2024 · 6 comments
Closed

Use zotero-plugin-scaffold? #272

diegodlh opened this issue Jul 16, 2024 · 6 comments
Labels

Comments

@diegodlh
Copy link
Owner

Hey, @Dominic-DallOsto! So I finally managed to install Node 18 on my computer, so I'm now ready to start trying what you've doing to support Zotero 7 (#257).

First thing I came up with when trying npm start is an error because my Zotero profile doesn't have an extensions folder yet.

Of course this could be fixed by manually adding that folder, but apparently it was already fixed in zotero-plugin-template: windingwind/zotero-plugin-template#113

Which made me think of: how can we benefit from this and future upgrades to zotero-plugin-template?

I'm just beginning to understand how this zotero-plugin-template works, but it looks to me that they may have recently moved (note the zotero-plugin-scaffold requirement in their package.json file) the build, serve, etc scripts to a separate repo made exactly for that: "so that downstream developers can follow along". https://github.com/northword/zotero-plugin-scaffold

Do you think it may make sense to use this zotero-plugin-scaffold package too?

@Dominic-DallOsto
Copy link
Collaborator

Ahh yeah that makes sense - I'll look at changing things over to use zotero-plugin-scaffold

@Dominic-DallOsto
Copy link
Collaborator

@diegodlh When you have the chance could you test the version in the PR?

@diegodlh
Copy link
Owner Author

I tested the version in the PR and it seems to work. Great! Left my comments there.

On the other hand, I assume that by depending on zotero-plugin-scaffold, some dependencies may no longer be required by us directly, right?

For example, I assume replace-in-file may have been added as a development dependency when copying over from zotero-plugin-template, but now that we depend on zotero-plugin-scaffold, which in turn depends on replace-in-file, we may simplify our package.json by removing this dependency on our side. Correct?

I used depcheck to see which other dependencies where no longer necessary, and this is what I got:

Unused dependencies
* querystring-es3
* react-intl
Unused devDependencies
* @typescript-eslint/eslint-plugin
* @typescript-eslint/parser
* chokidar
* compressing
* esbuild
* eslint-config-prettier
* release-it
* replace-in-file
* zotero-types
Missing dependencies
* @eslint/js: ./eslint.config.mjs
* zotero@zotero: ./src/dialogs/citation-importer/index.tsx

However I don't trust this 100%:

First because I'm still beginning to understand how zotero-plugin-scaffold works.

Second because there is dependency release-it, which I expected zotero-plugin-scaffold to depend on (as I assume it is used when running zotero-plugin release; is it?). But it doesn't seem to be a dependency of zotero-plugin-scaffold.

Third because there is zotero@zotero "dependency", which I'm not sure what it is (probably related to Zotero types?) and says to be missing.

What do you think? Do you think it makes sense to remove the dependencies identified by depcheck to simplify our package.json now that we are relying on zotero-plugin-scaffold instead?

@northword
Copy link

* @typescript-eslint/eslint-plugin
* @typescript-eslint/parser
* eslint-config-prettier

These dependencies are deprecated by the eslint update and can be safely removed just by referring to package.json in the zotero-plugin-template repository to add new dependencies on eslint.

* chokidar
* compressing
* esbuild
* release-it
* replace-in-file

These dependencies are dependencies of scaffold, and when scaffold is installed, these packages are automatically installed and you do not need to explicitly install them again in your project.

zotero-types

This package is a type file for zotero and is necessary for typescript to work.

@northword
Copy link

release-it: scaffold doesn't use release-it now, it uses bumpp to promote version numbers, git commits, git tags, and git pushes. scaffold then implements the ability to create GitHub releases itself.

When running zotero-plugin release locally (non-CI), scaffold will bump version, git commit, git tag, git push. zotero-plugin-template repository has a companion release.yml GitHub Action workflow file, when Action receives tag event, it will execute zotero-plugin release again, at this time (CI environment), scaffold will create github release.

(Sorry for the lack of documentation)

@diegodlh
Copy link
Owner Author

Hi, @northword! Thank you so much for your detailed replies and clarifications! No need to apologize for the missing documentation. Instead, thank you for your work in making the great zotero-plugin-template even more usable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants