npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wikiploy

v2.1.2

Published

User scripts and gadgets deployment for MediaWiki (Wikipedia).

Downloads

92

Readme

Wikiploy

Wikiploy is a one-click solution to deploy JS and CSS to Wikipedia.

After the initial setup, you can quickly build and deploy your user scripts and gadgets. Though this was designed to work with Wikipedia, you should be able to deploy to any MediaWiki-based wiki. You can even deploy to multiple websites with just one click on your commandbar. Your only limitation is your access level to the wikis.

See also:

New capabilities

setupSummary (v2.1)

A helper function that can replace your usages of userPrompt. It prompts a user running wikiploy for a summary of changes. It can optionally add a version number to the full summary of your edits (deploy-edits).

Parameters

The setupSummary function requires a Wikiploy bot object and optionally takes a gadget version and a standard summary text.

  • ployBot: A Wikiploy bot object. This is required to setup the summary() function.
  • version (optional): The version of your gadget. Defaults to an empty string if not provided.
  • standardSummary (optional): A string that provides a standard summary (aside from the version). Defaults to "changes from Github".

If your answer to the prompt would be: "fixed bug #123", you would get a full summary: "v5.6.0: fixed bug #123" (v${version}: ${summary}). For no answer you would get: "v5.6.0: changes from Github".

Usage

Basic usage:

// custom summary from a prompt
await setupSummary(ployBot);

Version from package:

(async () => {
	// custom summary from a prompt
	let version = await readVersion('package.json');
	await setupSummary(ployBot, version);
	
	// [...]

	await ployBot.deploy(configs);
})().catch(err => {
	console.error(err);
	process.exit(1);
});

Lightweight Dependencies (v2.0)

We had a good run, but it's time to bid farewell to Puppeteer and free the puppets ;). Obviously, this might be a breaking change if you really need to use it. However, the Wikiploy API doesn't really change...

The only change is that you need to provide bot configuration to Wikiploy (as already described for WikiployLite). It's not nothing, but you only need to follow few steps from the Botpass configuration section. You only need to do it once and then use in all your user scripts.

WikiployLite is now synonymous with Wikiploy. You can use either of the class names.

userPrompt (v1.8)

Use the userPrompt helper function to prompt for a summary in your Wikiploy script. This is only a helper. You can still set up a static summary, but a prompt helps to ensure you don't forget to change the summary.

Note that when using userPrompt you have to use an interactive terminal. This might be a bit more tricky to set up but can still function as a one-click build from a commandbar (see README: building your project).

nowiki (v1.7)

The nowiki property is a new option in DeployConfig since Wikiploy v1.7. It is now recommended to use nowiki: true for all JS files.

	configs.push(new DeployConfig({
		src: 'dist/test.js',
		dst: '~/test.js',
		nowiki: true,
	})); 

JavaScript page is still a wiki page... Kind of. It can be added to a category or link to other pages. To avoid this use the nowiki option.

Don't add this option to CSS though. It won't work correctly.

Using Wikiploy

Either use Wikiploy project template or add Wikiploy to your project:

# npm install wikiploy --save-dev
npm i wikiploy -D

The Wikiploy class can be used to help deploy scripts. It is using a bot API to do that, but don't worry, you don't need to be a bot ;).

You do need to setup a bot password though (on [[Special:BotPasswords]]). It's not as hard as it might seem as you can do this on any Wikimedia wiki and it will work for all WMF wikis. You don't need a bot account for this to work. You will just create an alias for your standard account and a special password just for your scripts.

Botpass configuration

A bot password is essentially a sub-account, designed to help keep your activities separated and secure. Setting up a sub-account is straightforward, and nearly anyone can do it.

  1. Begin by setting up your sub-account on this page: test.wikipedia.org/wiki/Special:BotPasswords.
  2. Choose a name and specify the permissions for your sub-account. For instance, you should grant rights necessary for deploying gadgets (if applicable). You can refer to this example screenshot for setting up rights: assets\Bot passwords - Test Wikipedia.png.
  3. Next, create your bot.config.mjs file. An example configuration file can be found here: assets\public--bot.config.mjs.

Warning! Never, ever publish your bot password. If you do spill your password, reset/remove the password ASAP (on Special:BotPasswords).

Different wiki sites

Wikiploy defaults to deployments on pl.wikipedia.org.

You can change the default like so:

ployBot.site = "en.wikipedia.org"; 

You can also set a site for an indvidual DeployConfig like so:

configs.push(new DeployConfig({
	src: 'test.js',
	site: "de.wikipedia.org",
}));

External links