@achttienvijftien/wp-packages-update
v1.0.1
Published
A tool to update WordPress packages to their latest version or a specified distribution tag
Readme
WordPress Packages Updater
A tool to update WordPress packages (@wordpress/*) in your project to their latest version or a specified distribution tag using Yarn.
Requirements
- Node.js v22 or higher
Installation
Global Installation
yarn global add @1815/wp-packages-updateLocal Installation
yarn add @1815/wp-packages-update --devUsage
Command Line Interface
If installed globally:
wp-packages-update [--dist-tag=<tag>]If installed locally:
npx wp-packages-update [--dist-tag=<tag>]Options
--dist-tag: Distribution tag to use (default: 'latest')
Programmatic Usage
import { PackagesUpdater } from 'wp-packages-updater';
async function updatePackages() {
const updater = new PackagesUpdater({
distTag: 'next', // Optional, defaults to 'latest'
packageJsonPath: '/path/to/package.json' // Optional, defaults to process.cwd() + '/package.json'
});
const exitCode = await updater.run();
console.log(`Update completed with exit code: ${exitCode}`);
}
updatePackages();API
PackagesUpdater
Constructor
new PackagesUpdater(options)Parameters
options(Object): Configuration optionsdistTag(string, optional): Distribution tag to use (default: 'latest')packageJsonPath(string, optional): Path to package.json file (default: process.cwd() + '/package.json')
Methods
run()
Runs the update process.
updater.run()Returns: Promise - Exit code (0 for success, non-zero for failure)
