Skip to content

Commit

Permalink
Merge branch '4.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Oct 3, 2024
2 parents 05f7f1a + fdc8851 commit 0ff4072
Show file tree
Hide file tree
Showing 10 changed files with 277 additions and 35 deletions.
11 changes: 11 additions & 0 deletions .changes/4.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

## 4.0.0 - 2024-10-03

Read the [first release candidate](https://github.com/llaville/box-manifest/releases/tag/4.0.0-rc.1) notes of this major version
to learn more about changes since 3.5.1

### Fixed

- [GH-13](https://github.com/llaville/box-manifest/issues/13) : v4.0.0-rc.1 does not support correctly the BOX `dump-autoload` setting

**Full Changelog**: [4.0.0-rc.1...4.0.0](https://github.com/llaville/box-manifest/compare/4.0.0-rc.1...4.0.0)
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- # https://github.com/ramsey/composer-install
name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: "--prefer-dist"

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ sbom.xml
sbom.cdx.json
sbom.cdx.xml
custom.bin
stub.php

###### PHPLint ######
.phplint-cache
Expand Down
3 changes: 1 addition & 2 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENABLE:
- PHP
- YAML
DISABLE_LINTERS:
- JSON_JSONLINT
- JSON_PRETTIER
- JSON_V8R
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
- MARKDOWN_MARKDOWN_LINK_CHECK
Expand All @@ -23,7 +23,6 @@ DISABLE_LINTERS:
ACTION_ACTIONLINT_ARGUMENTS: "-shellcheck"
DOCKERFILE_HADOLINT_ARGUMENTS: "-t error"
EDITORCONFIG_EDITORCONFIG_CHECKER_CLI_LINT_MODE: project
JSON_PRETTIER_FILTER_REGEX_EXCLUDE: "(composer\\.json||box\\.json||sbom\\.json)"
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: ".markdown-lint.json"
MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE: "(\\.github)"
PHP_PHPSTAN_CLI_LINT_MODE: project # to avoid https://github.com/nvuillam/mega-linter/issues/725
Expand Down
219 changes: 219 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).

## 4.0.0 - 2024-10-03

Read the [first release candidate](https://github.com/llaville/box-manifest/releases/tag/4.0.0-rc.1) notes of this major version
to learn more about changes since 3.5.1

### Fixed

- [GH-13](https://github.com/llaville/box-manifest/issues/13) : v4.0.0-rc.1 does not support correctly the BOX `dump-autoload` setting

**Full Changelog**: [4.0.0-rc.1...4.0.0](https://github.com/llaville/box-manifest/compare/4.0.0-rc.1...4.0.0)

## 4.0.0-rc.1 - 2024-09-04

**Road to stable version 4.0**
Expand Down Expand Up @@ -48,3 +59,211 @@ So, if you want to improve this package before final stable version 4.0, please
- [#11](https://github.com/llaville/box-manifest/issues/11) : No longer require `phar.readonly` to be off for using PHPUnit

**Full Changelog**: [3.5.1...4.0.0-rc.1](https://github.com/llaville/box-manifest/compare/3.5.1...4.0.0-rc.1)

## 3.5.1 - 2023-10-13

IMPORTANT: This bugfix release mark the latest version that will support BOX v4 and development is stopped !

### Changed

- update `humbug/box` constraint to restrict BOX v4 support to 4.3.x
- use latest SBOM spec version (1.5) on `manifest:build` command

### Fixed

- #10: `box:validate` command support now the recommendation color style formatter

**Full Changelog**: [3.5.0...3.5.1](https://github.com/llaville/box-manifest/compare/3.5.0...3.5.1)

## 3.5.0 - 2023-04-16

**CAUTION** : if you want to use the new `PostInstallStrategy`, please read <https://github.com/composer/composer/discussions/11430> first.

### Added

- `PostInstallStrategy` to keep your manifests synchronized with dependencies installed.

### Changed

- Refactor code to add strategy pattern on manifest build process

**Full Changelog**: [3.4.0...3.5.0](https://github.com/llaville/box-manifest/compare/3.4.0...3.5.0)

## 3.4.0 - 2023-04-10

### Added

- `box:info` command display information about stub used

**Full Changelog**: [3.3.2...3.4.0](https://github.com/llaville/box-manifest/compare/3.3.2...3.4.0)

## 3.3.2 - 2023-04-04

### Fixed

- Cannot run application when command is launched from `vendor/bin/box-manifest` (composer `bin-dir` config)

**WARNING** Unless Composer added support to Symfony/Runtime, do not use `vendor/bin/box-manifest`
that will lead to a fatal error : see <https://github.com/composer/composer/issues/11416> for details

**Full Changelog**: [3.3.1...3.3.2](https://github.com/llaville/box-manifest/compare/3.3.1...3.3.2)

## 3.3.1 - 2023-04-01

Same contents of release 3.3.0

### Fixed

- PHAR distribution was not built during Release GitHub Workflow.

**Full Changelog**: [3.3.0...3.3.1](https://github.com/llaville/box-manifest/compare/3.3.0...3.3.1)

## 3.3.0 - 2023-04-01

### Added

- `box:compile` and `box:info` are now able to add and display manifest files
- API: introduces `ManifestFormat` enumeration to replace hard-coded values

### Changed

- Ascii Logo and text look like BOX logo
- Displays long version without logo
- SBOM manifests format identify now the BOX Manifest application as tool
- The `manifest:stub` command is now able to use resources list defined by the BOX map settings
- API: `Manifest` enum renamed to `ManifestFile`
- BC breaks: `ManifestFactory` did not used anymore the Box instance (affect class constructor and static create method)

**Full Changelog**: [3.2.1...3.3.0](https://github.com/llaville/box-manifest/compare/3.2.1...3.3.0)

## 3.2.1 - 2023-03-28

### Fixed

- `resources` directory was missing on Docker and PHAR distributions.

**Full Changelog**: [3.2.0...3.2.1](https://github.com/llaville/box-manifest/compare/3.2.0...3.2.1)

## 3.2.0 - 2023-03-28

### Added

- Add new console format to print manifest in a Symfony Console Table format
- Random Serial Number on BOM format (raise Composer constraint to support library version 2.1+)
- created DateTime metadata on BOM format

### Changed

- Application was recombined to form a native 3 Symfony Commands (two native from BOX Manifest itself and three others from BOX Application)
- ManifestFactory may be able to enable or disable the ANSI color code decoration
- ManifestFactory build console output results on auto format detection (by default)

### Fixed

- Respect now the switches off debug mode (`--no-debug`)

**Full Changelog**: [3.1.1...3.2.0](https://github.com/llaville/box-manifest/compare/3.1.1...3.2.0)

## 3.1.1 - 2023-03-23

### Changed

- Replace simple key-value pairs TEXT manifest by highlighted version in PHAR `box-*` commands

### Fixed

- [#6](https://github.com/llaville/box-manifest/issues/6) : Symfony BOX styles are not applied on `box-compile` command
- [#7](https://github.com/llaville/box-manifest/issues/7) : Display manifest at runtime do not respect `--no-ansi` console option rule

**Full Changelog**: [3.1.0...3.1.1](https://github.com/llaville/box-manifest/compare/3.1.0...3.1.1)

## 3.1.0 - 2023-03-22

### Changed

- box-stub command: stub code is no more hard coded and may be changed at runtime with `--template` option
- box-stub command: manifest files is no more hard coded and may be changed at runtime with `--resource` option
- Optimize size of PHAR distributions for box-* commands

### Fixed

- Release workflow was fixed to avoid wrong resource files list to use

**Full Changelog**: [3.0.0...3.1.0](https://github.com/llaville/box-manifest/compare/3.0.0...3.1.0)

## 3.0.0 - 2023-03-21

**BC breaks with this major version**

- Do not use anymore the `cweagans/composer-patches` composer-plugin to patch `humbug/box` at install time.
- This is a real standalone application with three distinct binary commands: `box-manifest`, `box-stub` and `box-compile`

Don't forget to read the documentation and its tutorial that will guide you to create your first manifest with its stub and compile in a PHAR.

### Added

- new Docker workflow to publish docker images to GitHub repository

### Changed

- Entrypoint in Dockerfile refer now to multiple commands
- org.opencontainers.image.version label is generated by docker workflow now (avoid hard-coding and outdated version number)

**Full Changelog**: [2.3.1...3.0.0](https://github.com/llaville/box-manifest/compare/2.3.1...3.0.0)

## 2.3.1 - 2023-03-08

### Changed

- update humbug/box composer constraint to avoid installation of Box 4.3.x not yet supported

**Full Changelog**: [2.3.0...2.3.1](https://github.com/llaville/box-manifest/compare/2.3.0...2.3.1)

## 2.3.0 - 2023-02-17

### Added

- PHPUnit 10 support : phpunit.xml.dist configuration migration

### Fixed

- [#4](https://github.com/llaville/box-manifest/issues/4) : Prevent error when Composer installation does not exists
- [#5](https://github.com/llaville/box-manifest/issues/5) : Prevent Fatal error when root package installed as none version published

**Full Changelog**: [2.2.1...2.3.0](https://github.com/llaville/box-manifest/compare/2.2.1...2.3.0)

## 2.2.1 - 2023-01-14

### Fixed

- regression with previous version 2.2.0 when dependency version have an alias

**Full Changelog**: [2.2.0...2.2.1](https://github.com/llaville/box-manifest/compare/2.2.0...2.2.1)

## 2.2.0 - 2023-01-14

### Changed

- When package version is a branch alias, print branch name with commit reference for SimpleText in same way as DecorateText manifest builder

### Fixed

- update in the Getting Started guide the docker run syntax

**Full Changelog**: [2.1.0...2.2.0](https://github.com/llaville/box-manifest/compare/2.1.0...2.2.0)

## 2.1.0 - 2022-11-28

### Added

- [#3](https://github.com/llaville/box-manifest/issues/3) : New Composer manifest builder to highlight dependencies constraints and versions

**Full Changelog**: [2.0.0...2.1.0](https://github.com/llaville/box-manifest/compare/2.0.0...2.1.0)

## 2.0.0 - 2022-11-24

### Added

- [#2](https://github.com/llaville/box-manifest/issues/2) : Add support to BOX v4

**Full Changelog**: [1.2.0...2.0.0](https://github.com/llaville/box-manifest/compare/1.2.0...2.0.0)
27 changes: 0 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,6 @@ All the documentation is available on [website][docs-website], generated from th

- Laurent Laville (Lead Developer)

## Roadmap

```mermaid
%%{init: { 'gitGraph': {'mainBranchName': 'master', 'rotateCommitLabel': false, 'mainBranchOrder': 1}} }%%
gitGraph TB:
commit id: "5a1721a" type: HIGHLIGHT tag: "3.5.1"
commit id: "(fixed issue #11) 8f2bd10"
branch 4.x
commit id: "(only keep manifest:* commands and removed legacy box:* commands) cb90b40"
commit id: "(replaced deprecated import about fidry/console) 2794e2d"
commit id: "(add shorcut for bootstrap option) dd5766f"
commit id: "(rename format option to output-format) 4d3d306"
commit id: "(add shortcut for resource option) c2aba93"
commit id: "(upgrade cyclonedx/cyclonedx-library constraint to use major version 3) 8a1e05d"
commit id: "(use SBOM spec 1.6 as default for sbom-json and sbom-xml output format) 29e0b2c"
commit id: "(consider serialNumber as optional and do not stop SBOM generation by Exception) f33bc49"
commit id: "(add alias on legacy command and renamed it to shortnames) 670500f"
commit id: "(build ansi format first rather than console with new render) 42e8c93"
commit id: "(add link to Packagist homepage of each dependency into console table format) 26b3262"
commit id: "(version of BOX Manifest used to generate stub (from template) is now identified) 39eb52e"
commit id: "(introduces auto detection by filename ansi.txt) 5a174e2"
commit id: "(introduces new make command to replace legacy commands) 734ecb6"
commit id: "(introduces new inspect command) 36e0540"
checkout master
commit id: "upcoming major version" type: HIGHLIGHT tag: "4.0.0"
```

[php-phar]: https://www.php.net/phar
[box-project]: https://github.com/box-project/box
[cyclonedx]: https://github.com/CycloneDX
Expand Down
9 changes: 7 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"dist",
"vendor-bin"
],
"directories": ["bin", "src", "vendor"],
"directories": [
"bin",
"src",
"vendor"
],
"directories-bin": [
"vendor/humbug/box/res/requirement-checker",
"resources"
Expand All @@ -22,5 +26,6 @@
"files-bin": [
"vendor/humbug/php-scoper/vendor-hotfix/.gitkeep"
],
"stub": "stub.php"
"stub": "stub.php",
"dump-autoload": true
}
2 changes: 1 addition & 1 deletion box.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
".box.manifests.bin"
],
"stub": "stub.php",
"dump-autoload": false,
"dump-autoload": true,
"map": [
{
"console-table.txt": ".box.manifests/console-table.txt"
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline/ConfigureStage.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __invoke(array $payload): array

// @link Due to issue https://github.com/box-project/box/issues/580
// @see https://github.com/box-project/box/issues/580#issuecomment-2326577684
$configs['dump-autoload'] = false;
$configs['dump-autoload'] ??= false; // should be applied only if not previously defined

if (!isset($configs['files-bin'])) {
$configs['files-bin'] = [];
Expand Down
36 changes: 36 additions & 0 deletions stub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

// default stub template @generated by BOX Manifest 4.x-dev@05f7f1a

$withManifest = array_search('--manifest', $argv);
$withoutAnsi = array_search('--no-ansi', $argv);

if ($withManifest !== false) {
$manifestDir = '.box.manifests/';
$resources = (($argc - 1 > $withManifest) && !str_starts_with($argv[$withManifest + 1], '-')) ? [$argv[$withManifest + 1]] : ['console-table.txt', 'plain.txt', 'sbom.json'];

foreach ($resources as $resource) {
$res = str_replace($manifestDir, '', $resource);
$filename = "phar://" . __FILE__ . "/$manifestDir$res";
if (file_exists($filename)) {
$manifest = file_get_contents($filename);
if ($withoutAnsi !== false) {
$manifest = preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $manifest);
}
echo $manifest, PHP_EOL;
exit(0);
} elseif (count($resources) === 1) {
echo sprintf('Manifest "%s" is not available in this PHP Archive.', $resource), PHP_EOL;
exit(2);
}
}
echo 'No manifest found in this PHP Archive', PHP_EOL;
exit(1);
}



// No PHAR config

__HALT_COMPILER(); ?>

0 comments on commit 0ff4072

Please sign in to comment.