Skip to content

Commit

Permalink
finally dropped (definitively) legacy commands
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Aug 26, 2024
1 parent 35d7030 commit 0db3d19
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 423 deletions.
4 changes: 0 additions & 4 deletions bin/box-manifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@

use Bartlett\BoxManifest\Console\Application;
use Bartlett\BoxManifest\Console\Command\Inspect;
use Bartlett\BoxManifest\Console\Command\ManifestBuild;
use Bartlett\BoxManifest\Console\Command\ManifestStub;
use Bartlett\BoxManifest\Console\Command\Make;

gc_disable(); // performance boost

require_once dirname(__DIR__) . '/autoload.php';

$application = new Application();
$application->add(new ManifestBuild());
$application->add(new ManifestStub());
$application->add(new Make());
$application->add(new Inspect());
$application->run();
14 changes: 7 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

## Features at a glance

| Feature | Legacy Command | Pipeline Command |
|-----------------------------------------------------------------|:------------------------:|:------------------------------------------:|
| Creates a manifest of your software components and dependencies | `build` :material-check: | `make build` [^1] :material-check: |
| Generates a stub for your manifest application | `stub` :material-check: | `make stub` :material-check: |
| Generates a final BOX configuration file | :material-close: | `make configure` :material-check: |
| Compiles an application into a PHAR | :material-close: | `make compile` [^2] :material-check: |
| Adds custom action easily | :material-close: | `make MyCustomStage` [^3] :material-check: |
| Feature | Legacy Command | Pipeline Command |
|-----------------------------------------------------------------|:---------------------------------:|:------------------------------------------:|
| Creates a manifest of your software components and dependencies | `manifest:build` :material-check: | `make build` [^1] :material-check: |
| Generates a stub for your manifest application | `manifest:stub` :material-check: | `make stub` :material-check: |
| Generates a final BOX configuration file | :material-close: | `make configure` :material-check: |
| Compiles an application into a PHAR | :material-close: | `make compile` [^2] :material-check: |
| Adds custom action easily | :material-close: | `make MyCustomStage` [^3] :material-check: |

[^1]: You can create multiple manifest on same pipeline command, while legacy command allowed only once at a time.
[^2]: Easy launcher of [BOX project][box-project] binary command (`vendor/bin/box`)
Expand Down
4 changes: 2 additions & 2 deletions docs/Tutorial/generate-manifest-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ In [Part 3](./generate-box-json-dist.md) of the tutorial, we will see how to dyn
Then finally, compile your PHP Archive with `box compile` command,
the metadata contents is only used as fallback contents in case you forgot to declare `files-bin` entries.

=== "Command"
=== "Pipeline Command"

```shell
vendor/bin/box compile --config app-fixtures.box.json.dist
box-manifest make --config app-fixtures.box.json.dist -vv compile
```

=== "Output"
Expand Down
6 changes: 5 additions & 1 deletion docs/UseCases/ConsoleTextFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
## :material-numeric-1-box: With legacy command

> [!WARNING]
>
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Command"

```shell
box-manifest build -f console-table
box-manifest manifest:build -f console
```

=== "Output"
Expand Down
6 changes: 5 additions & 1 deletion docs/UseCases/CustomFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ either by your autoloader or with bootstrap helper feature (see `--bootstrap|-b`
## :material-numeric-1-box: With legacy command

> [!WARNING]
>
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Command"

```shell
box-manifest build -f MyCustomFormat -b bootstrap.php
box-manifest manifest:build -f MyCustomFormat -b bootstrap.php
```

=== "Output"
Expand Down
6 changes: 5 additions & 1 deletion docs/UseCases/DecoratedTextFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
## :material-numeric-1-box: With legacy command

> [!WARNING]
>
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Command"

```shell
box-manifest build -f console-style
box-manifest manifest:build -f ansi
```

=== "Output"
Expand Down
6 changes: 5 additions & 1 deletion docs/UseCases/PlainTextFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
## :material-numeric-1-box: With legacy command

> [!WARNING]
>
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Command"

```shell
box-manifest build -f plain
box-manifest manifest:build -f plain
```

=== "Output"
Expand Down
6 changes: 5 additions & 1 deletion docs/UseCases/SBomJsonFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
## :material-numeric-1-box: With legacy command

> [!WARNING]
>
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Command"

```shell
box-manifest build -f sbom-json
box-manifest manifest:build -f sbom-json
```

=== "Output"
Expand Down
6 changes: 5 additions & 1 deletion docs/UseCases/SBomXmlFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
## :material-numeric-1-box: With legacy command

> [!WARNING]
>
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Command"

```shell
box-manifest build -f sbom-xml
box-manifest manifest:build -f sbom-xml
```

=== "Output"
Expand Down
12 changes: 3 additions & 9 deletions docs/build-your-manifests.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<!-- markdownlint-disable MD013 MD028 -->
# Build your manifests

To help Users in a smooth usage migration, we have not yet removed legacy commands.

- `manifest:build` now an alias of `build` command

So, we are show here both usages with legacy and new pipeline commands !

> [!CAUTION]
> [!WARNING]
>
> We recommend to learn the new pipeline syntax, because legacy commands will be dropped in next version 4.1
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Pipeline Command"

Expand All @@ -20,7 +14,7 @@ So, we are show here both usages with legacy and new pipeline commands !
=== "Legacy Command"

```shell
box-manifest build -f plain -o manifest.txt
box-manifest manifest:build -f plain -o manifest.txt
```

This will create, the `manifest.txt` file, with a plain text format of your dependencies inventory.
Expand Down
12 changes: 3 additions & 9 deletions docs/build-your-stub.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
<!-- markdownlint-disable MD013 MD028 -->
# Build your stub

To help Users in a smooth usage migration, we have not yet removed legacy commands.

- `manifest:stub` now an alias of `stub` command

So, we are show here both usages with legacy and new pipeline commands !

> [!CAUTION]
> [!WARNING]
>
> We recommend to learn the new pipeline syntax, because legacy commands will be dropped in next version 4.1
> We've dropped legacy commands, but we still show syntax usage to help Users of version 3 for a smooth migration.
=== "Pipeline Command"

Expand All @@ -20,7 +14,7 @@ So, we are show here both usages with legacy and new pipeline commands !
=== "Legacy Command"

```shell
box-manifest stub -r console-table.txt -r manifest.txt -r sbom.json -o stub.php
box-manifest manifest:stub -r console-table.txt -r manifest.txt -r sbom.json -o stub.php
```

This will create, the `stub.php` file, where manifests order is preserved and deterministic.
5 changes: 3 additions & 2 deletions src/Composer/PostInstallStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Bartlett\BoxManifest\Composer;

use Bartlett\BoxManifest\Console\Application;
use Bartlett\BoxManifest\Console\Command\Make;
use Bartlett\BoxManifest\Console\Command\ManifestBuild;
use Bartlett\BoxManifest\Helper\BoxHelper;

Expand Down Expand Up @@ -94,14 +95,14 @@ public static function postUpdate(Event $event): void
false
);

$inputDefinition = (new ManifestBuild())->getDefinition();
$inputDefinition = (new Make())->getDefinition();

$map = $config->getFileMapper()->getMap();

foreach ($map as $mapFile) {
foreach ($mapFile as $source => $target) {
if (str_starts_with($target, '.box.manifests/')) {
$arrayInput = new ArrayInput(['--format' => 'auto', '--output-file' => $source], $inputDefinition);
$arrayInput = new ArrayInput(['--output-format' => 'auto', '--output-file' => $source], $inputDefinition);
$boxIO = new IO($arrayInput, new NullOutput());
$manifest = $factory->build(new ManifestOptions($boxIO));

Expand Down
Loading

0 comments on commit 0db3d19

Please sign in to comment.