{"id":30880219,"url":"https://github.com/maximeculea/gutenberg-patterns-sync","last_synced_at":"2025-09-08T06:49:01.140Z","repository":{"id":311938925,"uuid":"1045684396","full_name":"MaximeCulea/gutenberg-patterns-sync","owner":"MaximeCulea","description":"Export and import block patterns (wp_block) as JSON via WP-CLI. Dev‑oriented to sync local patterns with other environments (staging, production).","archived":false,"fork":false,"pushed_at":"2025-08-27T15:18:46.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-28T00:19:39.010Z","etag":null,"topics":["gutenberg","gutenberg-patterns","wordpress","wordpress-development","wp-cli","wpcli"],"latest_commit_sha":null,"homepage":"https://maximeculea.fr","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaximeCulea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-27T14:59:04.000Z","updated_at":"2025-08-27T15:19:31.000Z","dependencies_parsed_at":"2025-08-28T00:19:49.577Z","dependency_job_id":"e96268a0-0aa5-4bba-a1dc-e5393d9fa002","html_url":"https://github.com/MaximeCulea/gutenberg-patterns-sync","commit_stats":null,"previous_names":["maximeculea/gutenberg-patterns-sync"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MaximeCulea/gutenberg-patterns-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeCulea%2Fgutenberg-patterns-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeCulea%2Fgutenberg-patterns-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeCulea%2Fgutenberg-patterns-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeCulea%2Fgutenberg-patterns-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaximeCulea","download_url":"https://codeload.github.com/MaximeCulea/gutenberg-patterns-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeCulea%2Fgutenberg-patterns-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274146705,"owners_count":25230116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gutenberg","gutenberg-patterns","wordpress","wordpress-development","wp-cli","wpcli"],"created_at":"2025-09-08T06:48:57.146Z","updated_at":"2025-09-08T06:49:01.119Z","avatar_url":"https://github.com/MaximeCulea.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gutenberg Patterns Sync (Export/Import)\n\nDev‑oriented plugin to sync patterns from local with other environments (staging, production) by exporting and importing block patterns (wp_block) as JSON via WP‑CLI.\n\nBy default, stores these JSON files in the current theme's patterns/blocks-sync directory. It checks existing patterns to handle create/updates instead of hard‑deleting each time, which helps keep references in the DB and code stable.\n\nAlso, for each pattern, it keeps synced (or not) status, block categories.\n\n## Requirements\n- WordPress 6.0+\n- PHP 7.4+\n- WP-CLI available in the environment\n\n## Installation\n\n### As a regular plugin\n\nThis package is a regular WordPress plugin. You can install and activate it like any other plugin.\n\n- Copy this folder into `wp-content/plugins/gutenberg-patterns-sync` on your site.\n- In WP Admin → Plugins, activate “Gutenberg Patterns Sync”.\n\n### Via Composer (as MU‑plugin)\n\nYou can install by Composer, it is designed to be installed as a MU plugin under `wp-content/mu-plugins/` (developer‑oriented).\n\n#### From Packagist\n\nDo `composer require maximeculea/gutenberg-patterns-sync`\n\n#### From Github\n\n- Add into your composer.json `{ \"type\": \"vcs\", \"url\": \"https://github.com/MaximeCulea/gutenberg-patterns-sync\" }`\n- Include `\"maximeculea/gutenberg-patterns-sync\": \"dev-master\"` in your composer file as require\n- Before use, launch `composer update`\n\n## Commands\n\n- `wp patterns export` — Export all published patterns (`wp_block` posts) to JSON files.\n- `wp patterns import` — Import patterns (`wp_block` posts) from JSON files and optionally delete missing ones.\n\n### Export\n```\nwp patterns export [--dir=\u003cpath\u003e] [--no-pretty] [--prefix=\u003cslug-prefix\u003e]\n```\nOptions:\n- `--dir=\u003cpath\u003e`: Destination directory. Default is current theme: `\u003ctheme\u003e/patterns/blocks-sync`.\n- `--no-pretty`: Disable pretty-printed JSON (pretty-print is enabled by default).\n- `--prefix=\u003cslug-prefix\u003e`: Prefix for the `slug` field inside JSON (e.g. `mytheme`). Defaults to the active theme textdomain.\n\nOutput files are named `\u003cslug\u003e.json` and contain:\n```\n{\n  \"title\": \"...\",\n  \"slug\": \"\u003cprefix\u003e/\u003cslug\u003e\",\n  \"content\": \"...\",\n  \"categories\": [\"...\"],\n  \"syncStatus\": \"synced\" | \"unsynced\"\n}\n```\n\n### Import\n```\nwp patterns import [--dir=\u003cpath\u003e] [--dry-run] [--no-verbose]\n```\nOptions:\n- `--dir=\u003cpath\u003e`: Source directory. Default is current theme: `\u003ctheme\u003e/patterns/blocks-sync`.\n- `--dry-run`: Show actions without applying changes.\n- `--no-verbose`: Reduce log noise.\n\nBehavior:\n- Creates or updates by slug.\n- Assigns `wp_pattern_category` terms (creates them if missing).\n- Preserves sync status (`wp_pattern_sync_status` post meta).\n- Deletes existing `wp_block` posts not present in the source directory (unless `--dry-run` is used).\n\n## License\n© Maxime Culea. Gutenberg Patterns Sync is licensed under GPL-3.0+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximeculea%2Fgutenberg-patterns-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximeculea%2Fgutenberg-patterns-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximeculea%2Fgutenberg-patterns-sync/lists"}