Skip to content

Commit

Permalink
Added a manifest.json to flow monorepo (#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech authored Jan 11, 2025
1 parent 63df803 commit e40fa45
Show file tree
Hide file tree
Showing 7 changed files with 230 additions and 4 deletions.
145 changes: 145 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
"name": "Flow PHP",
"packages": [
{
"name" : "flow-php/etl",
"path": "src/core/etl",
"type": "core"
},
{
"name" : "flow-php/cli",
"path": "src/cli",
"type": "cli"
},
{
"name" : "flow-php/etl-adapter-avro",
"path": "src/adapter/etl-adapter-avro",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-chartjs",
"path": "src/adapter/etl-adapter-chartjs",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-csv",
"path": "src/adapter/etl-adapter-csv",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-doctrine",
"path": "src/adapter/etl-adapter-doctrine",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-elasticsearch",
"path": "src/adapter/etl-adapter-elasticsearch",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-google-sheet",
"path": "src/adapter/etl-adapter-google-sheet",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-http",
"path": "src/adapter/etl-adapter-http",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-json",
"path": "src/adapter/etl-adapter-json",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-logger",
"path": "src/adapter/etl-adapter-logger",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-meilisearch",
"path": "src/adapter/etl-adapter-meilisearch",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-parquet",
"path": "src/adapter/etl-adapter-parquet",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-text",
"path": "src/adapter/etl-adapter-text",
"type": "adapter"
},
{
"name" : "flow-php/etl-adapter-xml",
"path": "src/adapter/etl-adapter-xml",
"type": "adapter"
},
{
"name" : "flow-php/filesystem-async-aws-bridge",
"path": "src/bridge/filesystem/async-aws",
"type": "bridge"
},
{
"name" : "flow-php/filesystem-azure-bridge",
"path": "src/bridge/filesystem/azure",
"type": "bridge"
},
{
"name" : "flow-php/monolog-http-bridge",
"path": "src/bridge/monolog/http",
"type": "bridge"
},
{
"name" : "flow-php/symfony-http-foundation",
"path": "src/bridge/symfony/http-foundation",
"type": "bridge"
},
{
"name" : "flow-php/array-dot",
"path": "src/lib/array-dot",
"type": "lib"
},
{
"name" : "flow-php/azure-sdk",
"path": "src/lib/azure-sdk",
"type": "lib"
},
{
"name" : "flow-php/doctrine-dbal-bulk",
"path": "src/lib/doctrine-dbal-bulk",
"type": "lib"
},
{
"name" : "flow-php/dremel",
"path": "src/lib/dremel",
"type": "lib"
},
{
"name" : "flow-php/filesystem",
"path": "src/lib/filesystem",
"type": "lib"
},
{
"name" : "flow-php/parquet",
"path": "src/lib/parquet",
"type": "lib"
},
{
"name" : "flow-php/parquet-viewer",
"path": "src/lib/parquet-viewer",
"type": "lib"
},
{
"name" : "flow-php/rdsl",
"path": "src/lib/rdsl",
"type": "lib"
},
{
"name" : "flow-php/snappy",
"path": "src/lib/snappy",
"type": "lib"
}
]
}
6 changes: 2 additions & 4 deletions src/core/etl/src/Flow/ETL/Row/Entry/StringEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use function Flow\ETL\DSL\type_string;
use Flow\ETL\Exception\InvalidArgumentException;
use Flow\ETL\PHP\Type\Native\StringType;
use Flow\ETL\PHP\Type\Type;
use Flow\ETL\Row\Schema\Definition;
use Flow\ETL\Row\{Entry, Reference, Schema\Metadata};
Expand All @@ -19,10 +20,7 @@ final class StringEntry implements Entry

private bool $fromNull = false;

/**
* @var Type<string>
*/
private readonly Type $type;
private readonly StringType $type;

/**
* @throws InvalidArgumentException
Expand Down
8 changes: 8 additions & 0 deletions src/core/etl/tests/Flow/ETL/Tests/FlowTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,12 @@ final public static function assertExtractedRowsEquals(

static::assertEquals($expectedRows, $extractedRows, $message);
}

/**
* Root of the project monorepo.
*/
public function repositoryRoot() : string
{
return \dirname(__DIR__, 7);
}
}
28 changes: 28 additions & 0 deletions src/tools/documentation/src/Flow/Documentation/Manifest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Flow\Documentation;

use Flow\Documentation\Manifest\{Package, Type};

final readonly class Manifest
{
/**
* @var array<Package>
*/
public array $packages;

public function __construct(Package ...$packages)
{
$this->packages = $packages;
}

public static function fromJson(string $json) : self
{
return new self(...\array_map(
static fn (array $package) => new Package($package['name'], $package['path'], Type::from($package['type'])),
\json_decode($json, true, 512, \JSON_THROW_ON_ERROR)['packages']
));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Flow\Documentation\Manifest;

final readonly class Package
{
public function __construct(public string $name, public string $path, public Type $type)
{
}
}
14 changes: 14 additions & 0 deletions src/tools/documentation/src/Flow/Documentation/Manifest/Type.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

namespace Flow\Documentation\Manifest;

enum Type : string
{
case ADAPTER = 'adapter';
case BRIDGE = 'bridge';
case CLI = 'cli';
case CORE = 'core';
case LIB = 'lib';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace Flow\Documentation\Tests\Integration;

use Flow\Documentation\Manifest;
use Flow\ETL\Tests\FlowTestCase;

final class ManifestTest extends FlowTestCase
{
public function test_manifest() : void
{
$manifest = Manifest::fromJson(\file_get_contents($this->repositoryRoot() . '/manifest.json'));
self::assertCount(28, $manifest->packages);

foreach ($manifest->packages as $package) {
self::assertFileExists($this->repositoryRoot() . '/' . $package->path);
}
}
}

0 comments on commit e40fa45

Please sign in to comment.