From b52ae4edee789d01769c0b39e94f4b2ea8f0ddd3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 15 Jul 2023 01:45:13 +0000 Subject: [PATCH 1/2] Lock file maintenance --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index ab7be12..46c6ce9 100644 --- a/composer.lock +++ b/composer.lock @@ -2603,16 +2603,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.2.4", + "version": "10.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "68484779b5a2ed711fbdeba6ca01910d87acdff2" + "reference": "15a89f123d8ca9c1e1598d6d87a56a8bf28c72cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/68484779b5a2ed711fbdeba6ca01910d87acdff2", - "reference": "68484779b5a2ed711fbdeba6ca01910d87acdff2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/15a89f123d8ca9c1e1598d6d87a56a8bf28c72cd", + "reference": "15a89f123d8ca9c1e1598d6d87a56a8bf28c72cd", "shasum": "" }, "require": { @@ -2684,7 +2684,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.2.4" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.2.5" }, "funding": [ { @@ -2700,7 +2700,7 @@ "type": "tidelift" } ], - "time": "2023-07-10T04:06:08+00:00" + "time": "2023-07-14T04:18:47+00:00" }, { "name": "psalm/plugin-phpunit", From 06569ad86bcfc74a460008af09f4cbff052d972b Mon Sep 17 00:00:00 2001 From: George Steel Date: Sat, 15 Jul 2023 21:32:07 +0100 Subject: [PATCH 2/2] Fix README linting issues --- .markdownlint.json | 9 +++++++++ README.md | 9 +++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..71addb0 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,9 @@ +{ + "default": true, + "MD013": false, + "MD014": false, + "MD024": false, + "MD028": false, + "MD031": { "list_items": false }, + "MD034": false +} diff --git a/README.md b/README.md index 3250233..a288e2a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Probably re-inventing the wheel here, but I wanted to be able to rev front-end resource file names in a predictable way with options to automatically delete old revisions keeping either none of them or a specific number of the most recent ones. There are javascript tools that do this but at the time of writing, I couldn't find anything I liked in JS land that you could just fire off from an npm package script easily. There's plenty for Grunt and Gulp if you're using those. The main use-case for this lib is to be triggered by a script in your `package.json` something like this: + ```json { "scripts": { @@ -13,10 +14,12 @@ The main use-case for this lib is to be triggered by a script in your `package.j } ``` -## Install with composer: +## Install with composer + ```bash composer require netglue/revs ``` + In order to use the tools, make sure that you've `require`d composers `vendor/autoload.php`, or [use the shipped binary](#symfony-command) in `vendor/bin/rev` ## Operation @@ -37,6 +40,7 @@ var_dump($result->destination()); // Yields the full path and filename of the co ``` The options object can be fed an array like this: + ```php use Netglue\Revs\RevverOptions; $options = RevverOptions::fromArray([ @@ -80,7 +84,6 @@ $resultingString = Replacer::replaceInString($someString, $result, $count); Assuming you have somehow received notification that your JS is built to a file located in `/build/index.js` and you want that copied to `/public/assets` with a revved file name and all the html files in `/public` to be updated with the new file name: ```php - $options = RevverOptions::fromArray([ 'destinationDirectory' => '/public/assets', 'cleanUp' => true, @@ -100,7 +103,6 @@ foreach ($files as $html) { $count += Replacer::replaceInFile(sprintf('/public/%s', $html), $info); } printf('Replaced %d references over %d files', $count, count($files)); - ``` ## Symfony Command @@ -120,7 +122,6 @@ PR's are welcomed. Please write tests for new features. You're welcome to file issues, but please understand that finding the time to answer support requests is very limited so there might be a long wait for an answer. - ## About [Netglue makes websites and apps in Devon, England](https://netglue.uk).