Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks: introduce new package for block management #17100

Merged
merged 1 commit into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/blocks/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Files not needed to be distributed in the package.
.gitattributes export-ignore
phpunit.xml.dist export-ignore
tests/ export-ignore
3 changes: 3 additions & 0 deletions packages/blocks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
wordpress
composer.lock
22 changes: 22 additions & 0 deletions packages/blocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Jetpack Blocks

Register and manage blocks within a plugin. Used to manage block registration, enqueues, and more.

## Usage

## Development

Running tests requires working `svn`, `composer` and `yarn` commands.

Once these are installed, you install the composer dependencies by running:

```bash
$ composer install --ignore-platform-reqs
```

### Run PHP unit tests

On a local development environment run:
```bash
$ composer phpunit
```
31 changes: 31 additions & 0 deletions packages/blocks/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "automattic/jetpack-blocks",
"description": "Register and manage blocks within a plugin. Used to manage block registration, enqueues, and more.",
"type": "library",
"license": "GPL-2.0-or-later",
"require": {},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5",
"automattic/wordbless": "dev-master"
},
"autoload": {
"classmap": [
"src/"
]
},
"scripts": {
"phpunit": [
"@composer install",
"./vendor/phpunit/phpunit/phpunit --colors=always"
],
"post-update-cmd": "php -r \"copy('vendor/automattic/wordbless/src/dbless-wpdb.php', 'wordpress/wp-content/db.php');\""
},
"repositories": [
{
"type": "path",
"url": "../*"
}
],
"minimum-stability": "dev",
"prefer-stable": true
}
7 changes: 7 additions & 0 deletions packages/blocks/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<phpunit bootstrap="tests/php/bootstrap.php" backupGlobals="false" colors="true">
<testsuites>
<testsuite name="main">
<directory prefix="test" suffix=".php">tests/php</directory>
</testsuite>
</testsuites>
</phpunit>
23 changes: 23 additions & 0 deletions packages/blocks/src/class-blocks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/** Blocks package.
*
* @since 9.0.0
*
* This package lifts elements from Jetpack's Jetpack_Gutenberg class.
* It is now an standalone package reusable outside Jetpack.
*
* @package automattic/jetpack-blocks
*/

namespace Automattic\Jetpack;

/**
* Register and manage blocks within a plugin. Used to manage block registration, enqueues, and more.
*
* @since 9.0.0
*/
class Blocks {

}