arc-block-scripts
v1.0.0
Published
utilities for managing arc blocks
Readme
Block Scripts
Command line utilities for managing Arc blocks.
Installation
npm install @wpmedia/block-scripts
Usage
Fork a Single Block
Copy a block from the Arc Blocks repository into your local codebase:
node block-scripts.js fork-block --block <block-name> [--version <version>]
Example:
node block-scripts.js fork-block --block header-nav-block --version 2.5.0
Fork All Blocks
Copy all blocks listed in your blocks.json file:
node block-scripts.js fork-all-blocks [--version <version>]
Example:
node block-scripts.js fork-all-blocks --version 2.5.0
Check GitHub Rate Limit
Monitor your GitHub API rate limit status:
node block-scripts.js check-rate-limit
Authentication
These scripts use the GitHub API and are subject to rate limiting:
- Authenticated requests: 5,000 requests per hour
- Unauthenticated requests: 60 requests per hour
The script will automatically use your GitHub token from .npmrc if available. If no token is found, it will run unauthenticated with lower rate limits.
File Structure
Blocks will be copied into your codebase following this structure:
- Content Sources:
content/sources/<block-name> - Chains:
components/chains/<block-name> - Layouts:
components/layouts/<block-name> - Output Types:
components/output-types/<block-name> - Features:
components/features/<block-name>
Troubleshooting
Rate Limits
If you hit a rate limit:
- Run
node block-scripts.js check-rate-limitto see when the limit resets - Wait until after the reset time
- Resume your operation
OR add a GitHub token to your .npmrc file:
@wpmedia:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken={your-token}