Replace outdated readme examples of using pnpm (#35064)

This commit is contained in:
Sam Seay 2022-10-14 16:14:45 +13:00 committed by GitHub
parent 6b85482f34
commit 9b9abd1eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 17 deletions

View File

@ -26,23 +26,23 @@ Here are some examples of the ways you can use Turborepo / pnpm commands:
pnpm run -r lint && pnpm run build pnpm run -r lint && pnpm run build
# Build WooCommerce Core and all of its dependencies # Build WooCommerce Core and all of its dependencies
pnpm run build --filter='woocommerce' pnpm run --filter='woocommerce' build
# Lint the @woocommerce/components package - note the different argument order, turbo scripts # Lint the @woocommerce/components package - note the different argument order, turbo scripts
# are not running lints at this point in time. # are not running lints at this point in time.
pnpm run -r --filter='@woocommerce/components' lint pnpm run -r --filter='@woocommerce/components' lint
# Test all of the @woocommerce scoped packages # Test all of the @woocommerce scoped packages
pnpm run test --filter='@woocommerce/*' pnpm run --filter='@woocommerce/*' test
# Build all of the JavaScript packages # Build all of the JavaScript packages
pnpm run build --filter='./packages/js/*' pnpm run --filter='./packages/js/*' build
# Build everything except WooCommerce Core # Build everything except WooCommerce Core
pnpm run build --filter='!woocommerce' pnpm run --filter='!woocommerce' build
# Build everything that has changed since the last commit # Build everything that has changed since the last commit
pnpm run build --filter='[HEAD^1]' pnpm run --filter='[HEAD^1]' build
``` ```
### Cache busting Turbo ### Cache busting Turbo
@ -53,7 +53,7 @@ e.g.
```bash ```bash
# Force an uncached build of WooCommerce Core and all of its dependencies # Force an uncached build of WooCommerce Core and all of its dependencies
TURBO_FORCE=true pnpm run build --filter='woocommerce' TURBO_FORCE=true pnpm run --filter='woocommerce' build
``` ```
## Other Commands ## Other Commands

View File

@ -19,7 +19,7 @@ Please make sure you follow the [repository's getting started guide](../../READM
```bash ```bash
# Make sure that WooCommerce Core and all of its dependencies are built # Make sure that WooCommerce Core and all of its dependencies are built
pnpm run build --filter=woocommerce pnpm run --filter=woocommerce build
# Make sure you're in the WooCommerce Core directory # Make sure you're in the WooCommerce Core directory
cd plugins/woocommerce cd plugins/woocommerce
# Start the development environment # Start the development environment
@ -39,9 +39,9 @@ This directory contains the CSS and jQuery code for WooCommerce.
```bash ```bash
# Build the assets. # Build the assets.
pnpm run build --filter=woocommerce/client/legacy pnpm run --filter=woocommerce/client/legacy build
# Lint the assets. # Lint the assets.
pnpm run lint --filter=woocommerce/client/legacy pnpm run --filter=woocommerce/client/legacy lint
``` ```
### `plugins/woocommerce-admin` ### `plugins/woocommerce-admin`
@ -50,11 +50,11 @@ This directory contains the React-based admin interface.
```bash ```bash
# Build the React-based admin client. # Build the React-based admin client.
pnpm run build --filter=woocommerce/client/admin pnpm run --filter=woocommerce/client/admin build
# Lint the React-based admin client. # Lint the React-based admin client.
pnpm run lint --filter=woocommerce/client/admin pnpm run --filter=woocommerce/client/admin lint
# Test the React-based admin client. # Test the React-based admin client.
pnpm run test --filter=woocommerce/client/admin pnpm run --filter=woocommerce/client/admin test
``` ```
#### Helper Scripts #### Helper Scripts
@ -63,13 +63,13 @@ Here is a collection of scripts that can help when developing the React-based ad
```bash ```bash
# Create a develoment build of the React-based admin client. # Create a develoment build of the React-based admin client.
pnpm dev --filter=woocommerce/client/admin pnpm --filter=woocommerce/client/admin dev
# Create and watch a development build of the React-based admin client. # Create and watch a development build of the React-based admin client.
pnpm start --filter=woocommerce/client/admin pnpm --filter=woocommerce/client/admin start
# Watch the tests of the React-based admin client. # Watch the tests of the React-based admin client.
pnpm test:watch --filter=woocommerce/client/admin pnpm --filter=woocommerce/client/admin test:watch
# Run a type check over the React-based admin client's TypeScript files. # Run a type check over the React-based admin client's TypeScript files.
pnpm ts:check --filter=woocommerce/client/admin pnpm --filter=woocommerce/client/admin ts:check
``` ```
## Documentation ## Documentation

View File

@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: This is just a documentation change

View File

@ -73,7 +73,7 @@ export const scanForChanges = async (
// Note doing the minimal work to get a DB scan to work, avoiding full build for speed. // Note doing the minimal work to get a DB scan to work, avoiding full build for speed.
await execAsync( 'composer install', { cwd: pluginPath } ); await execAsync( 'composer install', { cwd: pluginPath } );
await execAsync( await execAsync(
'pnpm run build:feature-config --filter=woocommerce', 'pnpm run --filter=woocommerce build:feature-config',
{ {
cwd: pluginPath, cwd: pluginPath,
} }