Skip to content

Commit

Permalink
Blocks: introduce new package for block management (#17100)
Browse files Browse the repository at this point in the history
See #17099
  • Loading branch information
jeherve authored Sep 8, 2020
1 parent cde3db0 commit 73144ee
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
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 {

}


0 comments on commit 73144ee

Please sign in to comment.