A powerful development tool that extends wp-now with WooCommerce-specific defaults and features. This package provides a streamlined way to spin up WordPress environments with WooCommerce pre-configured, including sample products, development tools, and the ability to clone products from existing stores.
- 🚀 Quick Start: Get a WooCommerce development environment running in seconds
- 🛍️ Pre-configured WooCommerce: Includes sensible defaults for WooCommerce settings
- 📦 Product Import: Clone products from any existing WooCommerce store
- 🔧 Developer Tools: Includes Query Monitor for debugging
- 🎨 Blueprint Support: Merge custom blueprints with our defaults
- 🐛 Debug Mode: WordPress debug constants pre-configured for development
You don't need to install this package globally. Use it directly with npx:
npx wc-now start
Or install globally:
npm install -g wc-now
Start a WooCommerce playground with default settings:
npx wc-now start
This will:
- Install WordPress (latest version) with PHP 8.0
- Install and activate WooCommerce
- Configure WooCommerce with sensible defaults
- Import sample products
- Set up pretty permalinks
- Enable debug mode
Import products from any WooCommerce store that has the REST API enabled:
npx wc-now start --source-url=https://example-store.com
This will fetch up to 10 products from the source store and import them with their:
- Names and descriptions
- Prices (regular and sale)
- Categories
- Images
- Stock status
- SKUs
Merge your own blueprint with our defaults:
npx wc-now start --blueprint=my-custom-blueprint.json
Your custom blueprint will be merged with our defaults, allowing you to:
- Add additional plugins or themes
- Override settings
- Add custom steps
- Change PHP/WordPress versions
Example custom blueprint:
{
"preferredVersions": {
"php": "7.4",
"wp": "6.3"
},
"plugins": [
"woocommerce-subscriptions",
"woocommerce-memberships"
],
"steps": [
{
"step": "installPlugin",
"pluginData": {
"resource": "wordpress.org/plugins",
"slug": "wordpress-seo"
}
}
]
}
npx wc-now start [options]
Additional Options:
--blueprint=<path> Path to a custom blueprint.json to merge with defaults
--source-url=<url> URL of a WooCommerce store to clone products from
--site-name=<name> Name for the WooCommerce store (default: "My WooCommerce Store")
All wp-now options are also supported:
--path=<path> Path to the WordPress project
--php=<version> PHP version (default: 8.0)
--wp=<version> WordPress version (default: latest)
--port=<port> Port number (default: 8881)
--reset Reset the WordPress installation
--skip-browser Skip opening the browser
- WooCommerce - The core e-commerce plugin
- Currency: USD
- Country: United States (New York)
- Tax calculations enabled
- Coupons enabled
- Guest checkout enabled
- Account registration enabled
- Stock management enabled
- All payment methods enabled (Check, COD, Bank Transfer)
WP_DEBUG
: trueWP_DEBUG_LOG
: trueWP_DEBUG_DISPLAY
: falseSCRIPT_DEBUG
: trueWP_ENVIRONMENT_TYPE
: 'development'
You can also use this package programmatically:
import { generateWooCommerceBlueprint, transformWooCommerceProducts } from 'wc-now';
import { WCStoreApiClient } from 'wc-now/wc-public-api';
// Generate a blueprint
const blueprint = generateWooCommerceBlueprint({
siteName: 'My Store',
php: '8.2',
wp: '6.4',
additionalPlugins: ['wordpress-seo'],
products: [] // Your product data
});
// Fetch products from a store
const client = new WCStoreApiClient('https://example-store.com');
const response = await client.getProducts({ per_page: 20 });
const products = transformWooCommerceProducts(response.data);
The generated blueprint includes:
- Plugin Installation: WooCommerce and development tools
- Plugin Activation: All plugins are automatically activated
- Permalinks: Pretty permalinks are configured
- Site Options: All WooCommerce settings are configured
- Debug Constants: Development constants are defined
- Product Import: Either from source URL or default sample data
- Helper Scripts: MU-plugins for development assistance
This package includes comprehensive tests:
# Run unit tests
npm test
# Run integration tests (requires building first)
npm run build
npm run test:integration
# Run all tests
npm run test:all
# Run tests in watch mode
npm run test:watch
- Unit Tests: Test blueprint generation and product transformation
- Smoke Tests: Verify CLI functionality without starting a server
- Integration Tests: Test the full CLI by starting an actual wp-now instance
- Node.js 20 or higher
- npm or pnpm
Contributions are welcome! Please feel free to submit a Pull Request.
ISC