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

@wp-blocks/make-pot

v1.2.0

Published

A Node.js script for generating a POT file from source code

Downloads

56

Readme

Make Pot

make-pot is a Node.js module designed to generate the .pot file for your WordPress plugin or theme. This file serves as the basis for internationalization, allowing translators to localize your plugin or theme into different languages.

Extract strings from your WordPress plugin or theme and generate a .pot file. Works with js, jx, ts, tsx, cjs, mjs, php, blade, txt, json with a custom schema for theme and block.json files.

Installation

You can install make-pot globally via npm:

npm install -g @wp-blocks/make-pot

Usage

npx @wp-blocks/make-pot [sourceDirectory] [destination] [options]

Positional Arguments:

  • sourceDirectory (optional): Specifies the source directory of your plugin or theme. If not provided, the .pot file root will be the source directory.
  • destination (optional): Specifies the destination directory where the .pot file will be generated. If not provided, the .pot file will be created in the source directory.

Options:

  • --version: Displays the version number of make-pot.
  • -h, --help: Displays help information.
  • --slug <slug>: Specifies the plugin or theme slug.
  • --domain <domain>: Specifies the text domain to look for in the source code.
  • --skip-js: Skips JavaScript files during processing.
  • --skip-php: Skips PHP files during processing.
  • --skip-blade: Skips Blade files during processing.
  • --skip-block-json: Skips block.json files during processing.
  • --skip-theme-json: Skips theme.json files during processing.
  • --skip-audit: Skips auditing of strings.
  • --headers <headers>: Specifies additional headers for the .pot file.
  • --file-comment <comment>: Specifies the file comment for the .pot file.
  • --package-name <name>: Specifies the package name.
  • --location: Includes location information in the .pot file.
  • --ignore-domain: Ignores text domain in the processing.
  • --mergePaths <paths>: Merges with existing POT file(s).
  • --subtractPaths <paths>: Subtracts strings from existing POT file(s).
  • --subtractAndMerge: Subtracts and merges strings from existing POT file(s).
  • --include <files>: Includes specific files for processing.
  • --exclude <files>: Excludes specific files from processing.
  • --silent: Suppresses output to stdout.
  • --json: Outputs the JSON gettext data.
  • --output: Outputs the gettext data.

As a build chain step

The make-pot module can be used as a build step in your build chain. To do so, create a build:makepot action in your package.json with the following content (refer to the options for more information):

{
	"build:makepot": "npx @wp-blocks/make-pot [sourceDirectory] [destination] [options]"
}

Credits

This module is heavily inspired by the original makepot command from WP-CLI. Special thanks to the maintainers in particular Swissspidy which has been very helpful with suggestions and tips on how to rebuild make-pot.

Feel free to contribute or report issues on GitHub.

This tool is licensed under the GNU General Public License v3.