diff --git a/.husky/pre-commit b/.husky/pre-commit index fcbf954f..79429209 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,4 @@ #!/bin/sh -. .husky/pre-commit-phpcbf.sh \ No newline at end of file +. .husky/pre-commit-phpcbf.sh +composer normalize +npm run sort-package-json \ No newline at end of file diff --git a/bin/prepare-release.php b/bin/prepare-release.php new file mode 100644 index 00000000..eb00cf9d --- /dev/null +++ b/bin/prepare-release.php @@ -0,0 +1,321 @@ +#!/usr/bin/env php +check_requirements(); + $this->build_assets(); + $this->run_tests(); + $this->generate_docs(); + $this->commit_changes(); + + $current_version = $this->get_current_version(); + $latest_tag = $this->get_latest_tag(); + + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo "\nCurrent version: {$current_version}"; + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo "\nLatest tag: {$latest_tag}\n"; + + $new_version = $this->prompt_for_version(); + $this->validate_version( $new_version ); + + $changelog = $this->get_changelog( $new_version ); + if ( $changelog ) { + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo "\nChangelog found for {$new_version}:\n\n{$changelog}\n"; + if ( ! $this->confirm( 'Is this changelog correct?' ) ) { + exit( 1 ); + } + } elseif ( ! $this->confirm( "No changelog found for {$new_version}. Is this expected?" ) ) { + exit( 1 ); + } + + $this->update_version( $new_version ); + $this->commit_version( $new_version ); + + $current_stable = $this->get_stable_tag(); + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo "\nCurrent stable tag: {$current_stable}\n"; + if ( $this->confirm( "Update stable tag to {$new_version}?" ) ) { + $this->update_stable_tag( $new_version ); + $this->commit_stable_tag( $new_version ); + } + + if ( $this->confirm( 'Create PR for this release?' ) ) { + $this->create_pr( $new_version, $changelog ); + } + + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + echo "\nRelease preparation complete!\n"; + } + + /** + * Check if required tools are available + */ + private function check_requirements() { + $required = array( 'npm', 'composer', 'gh' ); + foreach ( $required as $tool ) { + exec( "which {$tool}", $output, $return ); + if ( 0 !== $return ) { + echo "Error: {$tool} is required but not found\n"; + exit( 1 ); + } + } + } + + /** + * Build assets using npm + */ + private function build_assets() { + echo "Installing npm dependencies...\n"; + passthru( 'npm install', $return ); + if ( 0 !== $return ) { + exit( $return ); + } + + echo "Building assets...\n"; + passthru( 'npm run build', $return ); + if ( 0 !== $return ) { + exit( $return ); + } + } + + /** + * Run tests + */ + private function run_tests() { + echo "Running tests...\n"; + passthru( 'composer test', $return ); + if ( 0 !== $return ) { + exit( $return ); + } + } + + /** + * Generate documentation + */ + private function generate_docs() { + echo "Generating documentation...\n"; + passthru( 'composer docs', $return ); + if ( 0 !== $return ) { + exit( $return ); + } + } + + /** + * Commit any changes from build/tests/docs + */ + private function commit_changes() { + exec( 'git status --porcelain', $output ); + if ( ! empty( $output ) ) { + echo "Committing changes...\n"; + passthru( 'git add .', $return ); + if ( 0 !== $return ) { + exit( $return ); + } + passthru( 'git commit -m "Build assets and documentation"', $return ); + if ( 0 !== $return ) { + exit( $return ); + } + } + } + + /** + * Get current version from plugin file + */ + private function get_current_version() { + $plugin_data = file_get_contents( self::PLUGIN_FILE ); + preg_match( '/\$version = \'([^\']+)\'/', $plugin_data, $matches ); + return $matches[1] ?? 'unknown'; + } + + /** + * Get latest git tag + */ + private function get_latest_tag() { + exec( 'git describe --tags --abbrev=0', $output, $return ); + return 0 === $return ? $output[0] : 'none'; + } + + /** + * Prompt for new version + */ + private function prompt_for_version() { + echo 'Enter new version number: '; + $handle = fopen( 'php://stdin', 'r' ); + $version = trim( fgets( $handle ) ); + fclose( $handle ); + return $version; + } + + /** + * Validate version format + * + * @param string $version Version string to validate. + */ + private function validate_version( $version ) { + if ( ! preg_match( '/^\d+\.\d+\.\d+(?:-beta\d+)?$/', $version ) ) { + echo "Error: Invalid version format. Expected X.Y.Z or X.Y.Z-betaN\n"; + exit( 1 ); + } + } + + /** + * Get changelog entry for version + * + * @param string $version Version to get changelog for. + * @return string Changelog entry or empty string if not found. + */ + private function get_changelog( $version ) { + $readme = file_get_contents( 'readme.txt' ); + if ( preg_match( "/= {$version} =\s*\n(.*?)(?=\n=|$)/s", $readme, $matches ) ) { + return trim( $matches[1] ); + } + return ''; + } + + /** + * Update version in plugin file + * + * @param string $version New version number. + */ + private function update_version( $version ) { + $plugin_data = file_get_contents( self::PLUGIN_FILE ); + + // Update version in docblock using line-by-line replacement + $lines = explode( "\n", $plugin_data ); + foreach ( $lines as &$line ) { + if ( strpos( $line, '* Version:' ) !== false ) { + $line = ' * Version: ' . $version; + } + } + $plugin_data = implode( "\n", $lines ); + + // Update version property + $plugin_data = preg_replace( + '/public \$version = \'[^\']+\'/', + 'public $version = \'' . $version . '\'', + $plugin_data + ); + + file_put_contents( self::PLUGIN_FILE, $plugin_data ); + } + + /** + * Commit version update + * + * @param string $version Version being committed. + */ + private function commit_version( $version ) { + passthru( 'git add ' . self::PLUGIN_FILE ); + passthru( "git commit -m 'Update version to {$version}'" ); + } + + /** + * Get current stable tag from readme.txt + */ + private function get_stable_tag() { + $readme = file_get_contents( 'readme.txt' ); + if ( preg_match( '/Stable tag: ([^\s\n]+)/', $readme, $matches ) ) { + return $matches[1]; + } + return 'unknown'; + } + + /** + * Update stable tag in readme.txt + * + * @param string $version Version to set as stable. + */ + private function update_stable_tag( $version ) { + $readme = file_get_contents( 'readme.txt' ); + $readme = preg_replace( + '/(Stable tag: )[^\s\n]+/', + '$1' . $version, + $readme + ); + file_put_contents( 'readme.txt', $readme ); + } + + /** + * Commit stable tag update + * + * @param string $version Version being set as stable. + */ + private function commit_stable_tag( $version ) { + passthru( 'git add readme.txt' ); + passthru( "git commit -m 'Update stable tag to {$version}'" ); + } + + /** + * Create PR using gh cli + * + * @param string $version Version being released. + * @param string $changelog Changelog content for the PR body. + */ + private function create_pr( $version, $changelog ) { + $title = "Prepare {$version} Release"; + $body = $changelog ? $changelog : "Changelog entry pending for {$version}"; + + passthru( "gh pr create --title \"{$title}\" --body \"{$body}\"" ); + } + + /** + * Prompt for confirmation + * + * @param string $message Message to display. + * @return bool True if confirmed, false otherwise. + */ + private function confirm( $message ) { + echo "{$message} [y/N] "; + $handle = fopen( 'php://stdin', 'r' ); + $line = strtolower( trim( fgets( $handle ) ) ); + fclose( $handle ); + return 'y' === $line; + } +} + +// Run the script +$preparation = new Release_Preparation(); +$preparation->run(); diff --git a/composer.json b/composer.json index b3a177fa..cc41d7a8 100644 --- a/composer.json +++ b/composer.json @@ -1,44 +1,41 @@ { "name": "wordpress/secure-custom-fields", "description": "Secure Custom Fields", - "type": "wordpress-plugin", "license": "GPL-2.0-or-later", + "type": "wordpress-plugin", "authors": [ { "name": "WordPress.org" } ], + "require": { + "php": ">=7.4" + }, + "require-dev": { + "automattic/wordbless": "^0.5.0", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.45", + "nikic/php-parser": "^4.0", + "phpcompatibility/phpcompatibility-wp": "^2.1.3", + "phpunit/phpunit": "^9.6", + "sirbrillig/phpcs-changed": "^2.11", + "symfony/finder": "^5.0 || ^6.0", + "wp-coding-standards/wpcs": "^3.0", + "yoast/phpunit-polyfills": "^1.1.0" + }, "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, + "ergebnis/composer-normalize": true, "roots/wordpress-core-installer": true }, "platform": { "php": "7.4" } }, - "require": { - "php": ">=7.4" - }, - "require-dev": { - "yoast/phpunit-polyfills": "^1.1.0", - "phpunit/phpunit": "^9.6", - "wp-coding-standards/wpcs": "^3.0", - "phpcompatibility/phpcompatibility-wp": "^2.1", - "sirbrillig/phpcs-changed": "^2.11", - "nikic/php-parser": "^4.0", - "symfony/finder": "^5.0|^6.0", - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "phpcompatibility/phpcompatibility-wp": "^2.1.3", - "sirbrillig/phpcs-changed": "^2.11", - "automattic/wordbless": "^0.5.0" - }, "scripts": { - "docs:manifest": "php docs/bin/generate-manifest.php", - "docs:links": "php docs/bin/update-markdown-links.php", - "docs:parse": "php docs/bin/generate-parsed-md.php --output=${DOCS_OUTPUT_DIR:-docs/code-reference}", - "docs:fix": "npm run fix:md", - "docs:lint": "npm run lint:md", + "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", + "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy", "docs": [ "@docs:parse", "@docs:links", @@ -46,13 +43,27 @@ "@docs:lint", "@docs:manifest" ], - "test": "@test:php", - "test:php": "phpunit", + "docs:fix": "npm run fix:md", + "docs:links": "php docs/bin/update-markdown-links.php", + "docs:lint": "npm run lint:md", + "docs:manifest": "php docs/bin/generate-manifest.php", + "docs:parse": "php docs/bin/generate-parsed-md.php --output=${DOCS_OUTPUT_DIR:-docs/code-reference}", + "format": [ + "@format:php", + "@format:packages" + ], + "format:packages": [ + "composer normalize", + "npm run sort-package-json" + ], + "format:php": "phpcbf", "lint": "@lint:php", "lint:php": "phpcs", - "format": "@format:php", - "format:php": "phpcbf", - "post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy", - "post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy" + "prepare-release": [ + "@format:packages", + "php bin/prepare-release.php" + ], + "test": "@test:php", + "test:php": "phpunit" } } diff --git a/composer.lock b/composer.lock index 59028b4d..058555af 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1b720c227016c7d33d6d98c810b8ed6a", + "content-hash": "b0dbcb52c8c469c2f9bcc152f8f03ec9", "packages": [], "packages-dev": [ { @@ -200,6 +200,772 @@ ], "time": "2022-12-30T00:15:36+00:00" }, + { + "name": "ergebnis/composer-normalize", + "version": "2.45.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/composer-normalize.git", + "reference": "bb82b484bed2556da6311b9eff779fa7e73ce937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/bb82b484bed2556da6311b9eff779fa7e73ce937", + "reference": "bb82b484bed2556da6311b9eff779fa7e73ce937", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0.0", + "ergebnis/json": "^1.4.0", + "ergebnis/json-normalizer": "^4.8.0", + "ergebnis/json-printer": "^3.7.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", + "localheinz/diff": "^1.2.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "composer/composer": "^2.8.3", + "ergebnis/license": "^2.6.0", + "ergebnis/php-cs-fixer-config": "^6.39.0", + "ergebnis/phpunit-slow-test-detector": "^2.17.0", + "fakerphp/faker": "^1.24.1", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.12", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.1", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.20", + "rector/rector": "^1.2.10", + "symfony/filesystem": "^5.4.41" + }, + "type": "composer-plugin", + "extra": { + "class": "Ergebnis\\Composer\\Normalize\\NormalizePlugin", + "branch-alias": { + "dev-main": "2.44-dev" + }, + "plugin-optional": true, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Composer\\Normalize\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides a composer plugin for normalizing composer.json.", + "homepage": "https://github.com/ergebnis/composer-normalize", + "keywords": [ + "composer", + "normalize", + "normalizer", + "plugin" + ], + "support": { + "issues": "https://github.com/ergebnis/composer-normalize/issues", + "security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/composer-normalize" + }, + "time": "2024-12-04T18:36:37+00:00" + }, + { + "name": "ergebnis/json", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json.git", + "reference": "7656ac2aa6c2ca4408f96f599e9a17a22c464f69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json/zipball/7656ac2aa6c2ca4408f96f599e9a17a22c464f69", + "reference": "7656ac2aa6c2ca4408f96f599e9a17a22c464f69", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.18", + "rector/rector": "^1.2.10" + }, + "type": "library", + "extra": { + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Json\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides a Json value object for representing a valid JSON string.", + "homepage": "https://github.com/ergebnis/json", + "keywords": [ + "json" + ], + "support": { + "issues": "https://github.com/ergebnis/json/issues", + "security": "https://github.com/ergebnis/json/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json" + }, + "time": "2024-11-17T11:51:22+00:00" + }, + { + "name": "ergebnis/json-normalizer", + "version": "4.8.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-normalizer.git", + "reference": "e3a477b62808f377f4fc69a50f9eb66ec102747b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/e3a477b62808f377f4fc69a50f9eb66ec102747b", + "reference": "e3a477b62808f377f4fc69a50f9eb66ec102747b", + "shasum": "" + }, + "require": { + "ergebnis/json": "^1.2.0", + "ergebnis/json-pointer": "^3.4.0", + "ergebnis/json-printer": "^3.5.0", + "ergebnis/json-schema-validator": "^4.2.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "composer/semver": "^3.4.3", + "ergebnis/composer-normalize": "^2.44.0", + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.19", + "rector/rector": "^1.2.10" + }, + "suggest": { + "composer/semver": "If you want to use ComposerJsonNormalizer or VersionConstraintNormalizer" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.8-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Normalizer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides generic and vendor-specific normalizers for normalizing JSON documents.", + "homepage": "https://github.com/ergebnis/json-normalizer", + "keywords": [ + "json", + "normalizer" + ], + "support": { + "issues": "https://github.com/ergebnis/json-normalizer/issues", + "security": "https://github.com/ergebnis/json-normalizer/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-normalizer" + }, + "time": "2024-12-04T16:48:55+00:00" + }, + { + "name": "ergebnis/json-pointer", + "version": "3.6.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-pointer.git", + "reference": "4fc85d8edb74466d282119d8d9541ec7cffc0798" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-pointer/zipball/4fc85d8edb74466d282119d8d9541ec7cffc0798", + "reference": "4fc85d8edb74466d282119d8d9541ec7cffc0798", + "shasum": "" + }, + "require": { + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.43.0", + "ergebnis/data-provider": "^3.2.0", + "ergebnis/license": "^2.4.0", + "ergebnis/php-cs-fixer-config": "^6.32.0", + "ergebnis/phpunit-slow-test-detector": "^2.15.0", + "fakerphp/faker": "^1.23.1", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.19", + "rector/rector": "^1.2.10" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.6-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Pointer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides an abstraction of a JSON pointer.", + "homepage": "https://github.com/ergebnis/json-pointer", + "keywords": [ + "RFC6901", + "json", + "pointer" + ], + "support": { + "issues": "https://github.com/ergebnis/json-pointer/issues", + "security": "https://github.com/ergebnis/json-pointer/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-pointer" + }, + "time": "2024-11-17T12:37:06+00:00" + }, + { + "name": "ergebnis/json-printer", + "version": "3.7.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-printer.git", + "reference": "ced41fce7854152f0e8f38793c2ffe59513cdd82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/ced41fce7854152f0e8f38793c2ffe59513cdd82", + "reference": "ced41fce7854152f0e8f38793c2ffe59513cdd82", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.1", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.21", + "rector/rector": "^1.2.10" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Printer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides a JSON printer, allowing for flexible indentation.", + "homepage": "https://github.com/ergebnis/json-printer", + "keywords": [ + "formatter", + "json", + "printer" + ], + "support": { + "issues": "https://github.com/ergebnis/json-printer/issues", + "security": "https://github.com/ergebnis/json-printer/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-printer" + }, + "time": "2024-11-17T11:20:51+00:00" + }, + { + "name": "ergebnis/json-schema-validator", + "version": "4.4.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-schema-validator.git", + "reference": "85f90c81f718aebba1d738800af83eeb447dc7ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-schema-validator/zipball/85f90c81f718aebba1d738800af83eeb447dc7ec", + "reference": "85f90c81f718aebba1d738800af83eeb447dc7ec", + "shasum": "" + }, + "require": { + "ergebnis/json": "^1.2.0", + "ergebnis/json-pointer": "^3.4.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.44.0", + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.20", + "rector/rector": "^1.2.10" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.4-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\Json\\SchemaValidator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides a JSON schema validator, building on top of justinrainbow/json-schema.", + "homepage": "https://github.com/ergebnis/json-schema-validator", + "keywords": [ + "json", + "schema", + "validator" + ], + "support": { + "issues": "https://github.com/ergebnis/json-schema-validator/issues", + "security": "https://github.com/ergebnis/json-schema-validator/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-schema-validator" + }, + "time": "2024-11-18T06:32:28+00:00" + }, + { + "name": "icecave/parity", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/icecave/parity.git", + "reference": "4fe835483e0f89f0f96763c47cb9fdca26c24bdc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/icecave/parity/zipball/4fe835483e0f89f0f96763c47cb9fdca26c24bdc", + "reference": "4fe835483e0f89f0f96763c47cb9fdca26c24bdc", + "shasum": "" + }, + "require": { + "icecave/repr": "^4", + "php": ">=7.3" + }, + "require-dev": { + "eloquent/liberator": "^2", + "eloquent/phony": "^5", + "eloquent/phony-phpunit": "^7", + "friendsofphp/php-cs-fixer": "^2", + "phpunit/phpunit": "^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "Icecave\\Parity\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "James Harris", + "email": "mailjamesharris@gmail.com", + "homepage": "https://github.com/jmalloc" + } + ], + "description": "A customizable deep comparison library.", + "homepage": "https://github.com/icecave/parity", + "keywords": [ + "compare", + "comparison", + "equal", + "equality", + "greater", + "less", + "sort", + "sorting" + ], + "support": { + "issues": "https://github.com/icecave/parity/issues", + "source": "https://github.com/icecave/parity/tree/3.0.1" + }, + "time": "2021-02-04T05:51:24+00:00" + }, + { + "name": "icecave/repr", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/icecave/repr.git", + "reference": "3dad35ee43394404ae0f1926d754e7b7820da8e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/icecave/repr/zipball/3dad35ee43394404ae0f1926d754e7b7820da8e4", + "reference": "3dad35ee43394404ae0f1926d754e7b7820da8e4", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "eloquent/phony-phpunit": "^6", + "friendsofphp/php-cs-fixer": "^2", + "phpunit/phpunit": "^8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Icecave\\Repr\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "James Harris", + "email": "mailjamesharris@gmail.com", + "homepage": "https://github.com/jmalloc" + } + ], + "description": "A library for generating string representations of any value, inspired by Python's reprlib library.", + "homepage": "https://github.com/icecave/repr", + "keywords": [ + "human", + "readable", + "repr", + "representation", + "string" + ], + "support": { + "issues": "https://github.com/icecave/repr/issues", + "source": "https://github.com/icecave/repr/tree/4.0.0" + }, + "time": "2020-08-25T02:05:11+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/jsonrainbow/json-schema.git", + "reference": "f7d78c345d5f8954f32cef5381fb6f8748b60690" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/f7d78c345d5f8954f32cef5381fb6f8748b60690", + "reference": "f7d78c345d5f8954f32cef5381fb6f8748b60690", + "shasum": "" + }, + "require": { + "ext-json": "*", + "icecave/parity": "^3.0", + "marc-mabe/php-enum": "^4.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20 || ~2.19.0", + "json-schema/json-schema-test-suite": "1.2.0", + "marc-mabe/php-enum-phpstan": "^2.0", + "phpspec/prophecy": "^1.19", + "phpstan/phpstan": "^1.12", + "phpunit/phpunit": "^8.5" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/jsonrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/6.1.0" + }, + "time": "2025-02-04T11:13:26+00:00" + }, + { + "name": "localheinz/diff", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/localheinz/diff.git", + "reference": "ec413943c2b518464865673fd5b38f7df867a010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/localheinz/diff/zipball/ec413943c2b518464865673fd5b38f7df867a010", + "reference": "ec413943c2b518464865673fd5b38f7df867a010", + "shasum": "" + }, + "require": { + "php": "~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5.0 || ^8.5.23", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Fork of sebastian/diff for use with ergebnis/composer-normalize", + "homepage": "https://github.com/localheinz/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/localheinz/diff/issues", + "source": "https://github.com/localheinz/diff/tree/1.2.0" + }, + "time": "2024-12-04T14:16:01+00:00" + }, + { + "name": "marc-mabe/php-enum", + "version": "v4.7.1", + "source": { + "type": "git", + "url": "https://github.com/marc-mabe/php-enum.git", + "reference": "7159809e5cfa041dca28e61f7f7ae58063aae8ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/marc-mabe/php-enum/zipball/7159809e5cfa041dca28e61f7f7ae58063aae8ed", + "reference": "7159809e5cfa041dca28e61f7f7ae58063aae8ed", + "shasum": "" + }, + "require": { + "ext-reflection": "*", + "php": "^7.1 | ^8.0" + }, + "require-dev": { + "phpbench/phpbench": "^0.16.10 || ^1.0.4", + "phpstan/phpstan": "^1.3.1", + "phpunit/phpunit": "^7.5.20 | ^8.5.22 | ^9.5.11", + "vimeo/psalm": "^4.17.0 | ^5.26.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.2-dev", + "dev-master": "4.7-dev" + } + }, + "autoload": { + "psr-4": { + "MabeEnum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Marc Bennewitz", + "email": "dev@mabe.berlin", + "homepage": "https://mabe.berlin/", + "role": "Lead" + } + ], + "description": "Simple and fast implementation of enumerations with native PHP", + "homepage": "https://github.com/marc-mabe/php-enum", + "keywords": [ + "enum", + "enum-map", + "enum-set", + "enumeration", + "enumerator", + "enummap", + "enumset", + "map", + "set", + "type", + "type-hint", + "typehint" + ], + "support": { + "issues": "https://github.com/marc-mabe/php-enum/issues", + "source": "https://github.com/marc-mabe/php-enum/tree/v4.7.1" + }, + "time": "2024-11-28T04:54:44+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.13.0", diff --git a/package-lock.json b/package-lock.json index ea2481af..c7f27b64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,11 +14,12 @@ "babel-loader": "^9.2.1", "css-loader": "^7.1.2", "css-minimizer-webpack-plugin": "^7.0.0", - "husky": "^9.0.11", + "husky": "^9.1.7", "markdownlint-cli": "^0.39.0", "mini-css-extract-plugin": "^2.9.1", "sass": "^1.79.5", "sass-loader": "^16.0.2", + "sort-package-json": "^2.14.0", "terser-webpack-plugin": "^5.3.10", "webpack": "^5.95.0", "webpack-cli": "^5.1.4", @@ -3032,6 +3033,16 @@ "node": ">=4.0.0" } }, + "node_modules/detect-indent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.1.tgz", + "integrity": "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + } + }, "node_modules/detect-libc": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", @@ -3044,6 +3055,19 @@ "node": ">=0.10" } }, + "node_modules/detect-newline": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", + "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -3369,6 +3393,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/git-hooks-list": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-3.2.0.tgz", + "integrity": "sha512-ZHG9a1gEhUMX1TvGrLdyWb9kDopCBbTnI8z4JgRMYxsijWipgjSEYoPWqBuIB0DnRnvqlQSEeVmzpeuPm7NdFQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/fisker/git-hooks-list?sponsor=1" + } + }, "node_modules/glob": { "version": "10.3.16", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz", @@ -3649,6 +3683,19 @@ "node": ">=0.12.0" } }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -5200,6 +5247,46 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/sort-object-keys": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-1.1.3.tgz", + "integrity": "sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/sort-package-json": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-2.14.0.tgz", + "integrity": "sha512-xBRdmMjFB/KW3l51mP31dhlaiFmqkHLfWTfZAno8prb/wbDxwBPWFpxB16GZbiPbYr3wL41H8Kx22QIDWRe8WQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-indent": "^7.0.1", + "detect-newline": "^4.0.0", + "get-stdin": "^9.0.0", + "git-hooks-list": "^3.0.0", + "is-plain-obj": "^4.1.0", + "semver": "^7.6.0", + "sort-object-keys": "^1.1.3", + "tinyglobby": "^0.2.9" + }, + "bin": { + "sort-package-json": "cli.js" + } + }, + "node_modules/sort-package-json/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5564,6 +5651,51 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", diff --git a/package.json b/package.json index e327c846..d860116c 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,16 @@ { + "scripts": { + "build": "webpack", + "clean": "rm -rf assets/build/js/*.js assets/build/css/*.css assets/build/js/*.map assets/build/css/*.map assets/build/css/*.js", + "fix:md": "markdownlint 'docs/**/*.md' --config .markdownlint.json --fix", + "lint:md": "markdownlint 'docs/**/*.md' --config .markdownlint.json", + "prepare": "husky", + "sort-package-json": "sort-package-json", + "watch": "webpack --watch" + }, + "dependencies": { + "md5": "^2.3.0" + }, "devDependencies": { "@babel/core": "^7.25.8", "@babel/preset-env": "^7.25.8", @@ -6,29 +18,19 @@ "babel-loader": "^9.2.1", "css-loader": "^7.1.2", "css-minimizer-webpack-plugin": "^7.0.0", - "husky": "^9.0.11", + "husky": "^9.1.7", + "markdownlint-cli": "^0.39.0", "mini-css-extract-plugin": "^2.9.1", "sass": "^1.79.5", "sass-loader": "^16.0.2", + "sort-package-json": "^2.14.0", "terser-webpack-plugin": "^5.3.10", "webpack": "^5.95.0", "webpack-cli": "^5.1.4", - "webpack-fix-style-only-entries": "^0.6.1", - "markdownlint-cli": "^0.39.0" - }, - "scripts": { - "build": "webpack", - "watch": "webpack --watch", - "clean": "rm -rf assets/build/js/*.js assets/build/css/*.css assets/build/js/*.map assets/build/css/*.map assets/build/css/*.js", - "prepare": "husky", - "lint:md": "markdownlint 'docs/**/*.md' --config .markdownlint.json", - "fix:md": "markdownlint 'docs/**/*.md' --config .markdownlint.json --fix" - }, - "dependencies": { - "md5": "^2.3.0" + "webpack-fix-style-only-entries": "^0.6.1" }, "engines": { - "node": ">=20.15.1", - "npm": ">=10.8.1" - } + "node": ">=20.15.1", + "npm": ">=10.8.1" + } }