Skip to content

Eccenux/wikiploy-rollout-example

Repository files navigation

Gadget example with Wikiploy

A rollout/deployment example that includes:

  • Recommended setup for building scripts: Bundling multiple files into a single JS file (from src to dist).
  • Visual Studio Code setup: Tasks and command bar for a one-click build.
  • Deploy scripts: Separate developer and release deployments.
  • Example gadget: Gadget with hooks and a link in the toolbar (Tool menu of articles).
  • Full setup of unit testing: Simple parser class with a test. VSC is set up for test debugging.

Testing Wikiploy

As a startup for your project, you can simply download a copy of this repository (treat it as a template). For quick steps see: README: dev-usage

Otherwise, you should follow recommendations in the README: building your project, Wikiploy.

Preparing deployment

Step. 1. Create deployment script. You can start with a basic script below or with wikiploy.mjs and wikiploy-dev.mjs provided in this repository.

Step. 2. Prepare bot password and config. A bot password is simply a sub-account. This sub-account has a specific name and a separate password. You can also choose specific actions this sub-account is allowed to perform (it can have fewer permissions than your normal account).

/**
	Bot with edit&create rights.
	
	You can create the bot account on any wiki. E.g. on the test wiki:
	https://test.wikipedia.org/wiki/Special:BotPasswords
*/
export const username = '...@...';	// e.g. Nux@Wikiploy
export const password = '...';	// bot pass

Step. 3. Make sure bot.config.mjs is not public. Never ever push you passwords to repository, even if the repository is "private". Change your password ASAP if you expose your password by accident.

Wikploy concepts

README: wikiploy-concepts

Contents:

  • Basic Wikiploy script:
    • Example code to deploy a JS script.
    • Wikiploy code explained.
  • Destination URL (dst and site property):
    • Explicit dst page.
    • Logged in user shorthand.
    • Non-default site as destination.

See also

About

Wikipedia gadget example with Browserify as a build tool and Wikiploy for deployments.

Topics

Resources

Stars

Watchers

Forks