Search by

rmb32 / barnscaff

rogerbarnfather

Filesystem projection for Barncept concept graphs

Package info

bitbucket.org/rmb32/barnscaff

pkg:composer/rmb32/barnscaff

Statistics

Installs: 11

Dependents: 4

Suggesters: 0

v1.0.0 2026-10-07 12:22 UTC

This package is auto-updated.

Last update: 2026-10-07 18:34:36 UTC


README

Part of BarnSuite.

Turn a Barncept concept graph into real folders and files — and check that an existing folder still matches it. Use it from PHP, or from the command line via barnscaff-cli.

Requirements

Installation

composer require rmb32/barnscaff

Command line

Install barnscaff-cli to get barnscaff:

composer require rmb32/barnscaff-cli

vendor/bin/barnscaff scaffold library Root ./generated           # preview the plan
vendor/bin/barnscaff scaffold library Root ./generated --apply   # write it
vendor/bin/barnscaff scan library Root ./generated               # exit 0 if conformant, 1 otherwise

PHP usage

use Rmb32\Barncept\Api\Factory\ResolverFactory;
use Rmb32\Barncept\Api\Factory\SchemaFactory;
use Rmb32\Barncept\Api\ValueObject\Key\ImplementationKey;
use Rmb32\Barnscaff\Api\Factory\ScaffolderFactory;
use Rmb32\Barnscaff\Api\Factory\ScannerFactory;

$schema = new SchemaFactory()->create($data);
$instance = new ResolverFactory()->create()
    ->resolve($schema, ImplementationKey::new('Root'));

$scaffolder = new ScaffolderFactory()->create();
$plan = $scaffolder->plan($instance, '/path/to/project');
$scaffolder->apply($plan); // writes to disk

$report = new ScannerFactory()->create()->scan($instance, '/path/to/project');
$report->isConformant(); // true

To load a schema straight from a JSON file:

use Rmb32\Barnscaff\Api\Factory\SchemaFileLoaderFactory;

$schema = new SchemaFileLoaderFactory()->create()->load('/path/to/schema.json');

Related packages

  • Barncept — defines the schemas and resolves them into the graph Barnscaff realises.
  • Barnscaff CLI — the barnscaff scaffold / barnscaff scan commands.
  • Barnark — architecture templates, built on Barncept and Barnscaff.

More docs

Internals · History · Known issues

License

Proprietary. See LICENSE. Copyright (c) Roger Barnfather.