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 yarn for plugin installation #756

Merged
merged 1 commit into from Nov 21, 2019
Merged

Conversation

karaggeorge
Copy link
Member

Fixes #753

Uses yarn for plugin installation. Unfortunately yarn doesn't support prune, so I kept the npm binary as well.

I tested locally can didn't get any errors. There wasn't specific STR, it just happened sometimes, so I'll do some more testing to make sure the issue is resolved

Copy link
Member

@sindresorhus sindresorhus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could reliably reproduce this issue in master, but it works perfectly now with this PR.

@karaggeorge karaggeorge merged commit bd50d27 into master Nov 21, 2019
@karaggeorge karaggeorge deleted the use-yarn-for-plugins branch November 21, 2019 17:28
@Codelica
Copy link

Just an FYI, as I was trying to debug issues with kap-nextcloud and my NextCloud server this morning and failing. :) This move to yarn will probably require an update to the docs here as npm link won't help.

For some reason yarn link wasn't working for me either though, not exactly sure why yet. I ran yarn link in my plugin directory, and can see the link via ls -al ~/.config/yarn/link/kap-nextcloud-dev, yet when Kap starts yarn errors. The following is in the yarn-error.log. It's as though the embedded yarn isn't respecting local system links.

Arguments:
  /Applications/Kap.app/Contents/MacOS/Kap /Applications/Kap.app/Contents/Resources/app.asar/node_modules/yarn/bin/yarn.js install --no-lockfile --registry https://registry.npmjs.org

PATH:
  /usr/bin:/bin:/usr/sbin:/sbin

Yarn version:
  1.19.1

Node version:
  12.4.0

Platform:
  darwin x64

Trace:
  Error: https://registry.npmjs.org/kap-nextcloud-dev: Not found
      at Request.params.callback [as _callback] (/Applications/Kap.app/Contents/Resources/app.asar/node_modules/yarn/lib/cli.js:66926:18)
      at Request.self.callback (/Applications/Kap.app/Contents/Resources/app.asar/node_modules/yarn/lib/cli.js:140564:22)
      at Request.emit (events.js:200:13)
      at Request.<anonymous> (/Applications/Kap.app/Contents/Resources/app.asar/node_modules/yarn/lib/cli.js:141536:10)
      at Request.emit (events.js:200:13)
      at IncomingMessage.<anonymous> (/Applications/Kap.app/Contents/Resources/app.asar/node_modules/yarn/lib/cli.js:141458:12)
      at Object.onceWrapper (events.js:288:20)
      at IncomingMessage.emit (events.js:205:15)
      at endReadableNT (_stream_readable.js:1154:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:9)

npm manifest:
  {"dependencies":{"kap-nextcloud-dev":"latest","kap-gifski":"latest"}}

yarn manifest:
  No manifest

Lockfile:
  No lockfile

@karaggeorge
Copy link
Member Author

@Codelica , when you run Kap built (prod mode) it runs npm prune and yarn install when it starts. If you want to test/develop plugins, my advice would be clone the kap repo, and run it in dev mode (yarn start). Then you should be able to follow the steps. I think npm link should still work, as long as you don't install/uninstall plugins from the UI while you are developing one locally.

@Codelica
Copy link

Ahh... thanks!

@karaggeorge
Copy link
Member Author

@Codelica Thinking about it, there should be a workaround using the built app. If you open Kap, then run npm link and add the plugin to the package.json, after the app has started, you should be able to open the preferences and see it there (again as long as you don't install/uninstall a plugin)

@connor4312
Copy link

Should probably update the plugins.md doc. I was trying this tonight and running into the same error that Codelica pointed out.

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

Successfully merging this pull request may close these issues.

Unable to install plugins w/ 3.0.0 ?
4 participants