Hyper: Hyper local plugin installation

Created on 4 Jan 2018  路  3Comments  路  Source: vercel/hyper

Hello,
I am looking for a development documentation and local testing strategy for hyper plugin. I am willing to develop plugin but unable to find any source which I can refer for development and testing. And as well as is there any forum where I can talk to active developers for hyper?

Most helpful comment

Best strategy is:

  • Run Hyper on dev mode (built from source after cloning repository) like explained in Contribute section in Readme: https://github.com/zeit/hyper#contribute
  • Copy your config file .hyper.js in cloned repository root directory. Hyper in dev mode will use this one. That means that you can continue to use installed Hyper with your day-to-day config.
  • After a first run, Hyper on dev mode will have created a new .hyper_plugins in your repository root. Go to <repository_root>/.hyper_plugins/local and create/clone your plugin repo (or make a symlink)
  • Edit your dev config, and add your plugin name (directory name in your local directory) in localPlugins array.
  • That's it.

Good to know: when you put a console.log() in your plugin code, it will be displayed in App's devtools only if it is executed in a renderer method, like component decorators. If it is located in Electron main process method, like onApp handler, it will be displayed in your terminal where you made your yarn run app.

Feel free to ask anything which you are struggling with.

We definitly need some documentation/tutorial around plugin developpment with dev environnement setup and best practices.

All 3 comments

Best strategy is:

  • Run Hyper on dev mode (built from source after cloning repository) like explained in Contribute section in Readme: https://github.com/zeit/hyper#contribute
  • Copy your config file .hyper.js in cloned repository root directory. Hyper in dev mode will use this one. That means that you can continue to use installed Hyper with your day-to-day config.
  • After a first run, Hyper on dev mode will have created a new .hyper_plugins in your repository root. Go to <repository_root>/.hyper_plugins/local and create/clone your plugin repo (or make a symlink)
  • Edit your dev config, and add your plugin name (directory name in your local directory) in localPlugins array.
  • That's it.

Good to know: when you put a console.log() in your plugin code, it will be displayed in App's devtools only if it is executed in a renderer method, like component decorators. If it is located in Electron main process method, like onApp handler, it will be displayed in your terminal where you made your yarn run app.

Feel free to ask anything which you are struggling with.

We definitly need some documentation/tutorial around plugin developpment with dev environnement setup and best practices.

Thank you @chabou. I have started with a plugin development on Hyper. I am developing on Mac. For now My repo is symlink at ~/.hyper_plugins/local/ directory and added it at localPlugins array on config. Seems like it is trying to load the app, but getting some error like

plugin <PLUGIN_NAME> does not exposed any hyper extension API methods

Could you tell me what exactly I am missing. Currently my index.js contains these lines,

const commands = require('./commands.json');
const args = require("args");

Please let me know what am I missing here.

Your plugin must expose at least one hyper extension API method to be loaded.
Methods are listed here: https://github.com/zeit/hyper/blob/canary/app/plugins/extensions.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hxnt picture hxnt  路  3Comments

juicygoose picture juicygoose  路  3Comments

cilice picture cilice  路  3Comments

yvan-sraka picture yvan-sraka  路  3Comments

rauchg picture rauchg  路  3Comments