Registry / devops / ts-wp-payload-migration

ts-wp-payload-migration

JSON →
library1.0.9jsnpmunverified

A TypeScript CLI tool (v1.0.9, MIT license) for analyzing WordPress sites and generating detailed migration effort estimation, reports, and scripts for transitioning to Payload CMS. Automatically discovers WordPress configuration, scans database schemas, plugins, themes, and custom content types, then produces multi-format reports (PDF, HTML, JSON, CSV, Markdown). Features AI-powered effort estimation, risk assessment, and migration script generation. Differentiates from generic migration tools by focusing specifically on Payload CMS, including plugin compatibility mapping and custom post type detection. Requires Node.js >=18 and TypeScript 5.8.3+.

npm install ts-wp-payload-migration
INSTALL
IMPORT
SIG · TS-WP-PAYLOAD-MIGR
T
ts-wp-payload-migration
devopsjavascriptv1.0.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
import { cli } from 'ts-wp-payload-migration'
const cli = require('ts-wp-payload-migration')
ESM-only package; TypeScript types are bundled. Use default import for the cli function.
analyze
import { analyze } from 'ts-wp-payload-migration/lib/analyze'
import { analyze } from 'ts-wp-payload-migration'
The analyze function is re-exported from the main entry, but direct import from lib is also supported.
generateReport
import { generateReport } from 'ts-wp-payload-migration'
Named export, available at package root. Use for programmatic report generation.
MigrationConfig
import type { MigrationConfig } from 'ts-wp-payload-migration'
import { MigrationConfig } from 'ts-wp-payload-migration'
TypeScript type only; use 'import type' to avoid runtime errors in bundlers.

Shows how to run the CLI programmatically or use the analyze function directly with configuration options.

import { cli } from 'ts-wp-payload-migration'; // Run CLI programmatically await cli(['analyze', '--wp-root', './wordpress', '--format', 'json,html', '--output', './reports']); // Or analyze directly import { analyze } from 'ts-wp-payload-migration'; const result = await analyze({ wpRoot: './wordpress', formats: ['json', 'html'], outputDir: './reports', }); console.log('Estimated hours:', result.estimatedHours); console.log('Migration plan:', result.migrationPlan);
Debug
Known issues
breakingESM-only package – CommonJS require() will fail. Must use dynamic import or ESM context.
fix
Set `"type": "module"` in package.json or use dynamic import: `const m = await import('ts-wp-payload-migration')`.
affects: >=1.0.0
deprecatedv1.0.0-alpha used a different CLI command `migrate`; renamed to `analyze` in v1.0.0.
fix
Replace `ts-wp-payload-migration migrate` with `ts-wp-payload-migration analyze`.
affects: >=0.9.0 <1.0.0
gotchaMySQL root password exposure: CLI may log database credentials if `--verbose` is used.
fix
Use `--silent` or `--log-level error` to suppress credential output.
affects: >=1.0.0
breakingNode.js 18+ required. No polyfill for older versions.
fix
Upgrade to Node.js 18 or newer, or use a transpiler that targets Node 16 as a workaround.
affects: >=1.0.0
gotchaAuto-discovery of wp-config.php only works when run from the WordPress root directory.
fix
Always specify `--wp-root` if not running from the WordPress document root.
affects: >=1.0.0
deprecatedThe `--csv-tables` option is deprecated in favor of `--export` in v1.0.8+.
fix
Use `--export tables` instead of `--csv-tables`.
affects: >=1.0.0 <1.0.8
Errors
Common errors & fixes
Cannot find module 'ts-wp-payload-migration'
Installed globally but not linked or not in node_modules.
fix
Install locally: `npm install ts-wp-payload-migration --save-dev` and use npx: `npx ts-wp-payload-migration analyze`
Error: Cannot find module 'mysql2'
Missing dependency mysql2 when using the library programmatically without installing peer deps.
fix
Run `npm install mysql2` in your project.
SyntaxError: Cannot use import statement outside a module
Trying to import in CommonJS without ESM context.
fix
Set `"type": "module"` in package.json or use `require('ts-wp-payload-migration')` is not supported; switch to dynamic import: `import('ts-wp-payload-migration')`
Upgrade
Version history
1.0.9latest on npm
Audit
Dependencies
commanderrequiredCLI command parsing
mysql2requiredMySQL database connection for WordPress analysis
Agent activity
4 hits · last 30 days
node
4
Resources