Skip to content

Commit 4d12370

Browse files
committed
Release of mage-os/magento-cache-clean 1.1.0
1 parent 866d492 commit 4d12370

File tree

9 files changed

+172
-182
lines changed

9 files changed

+172
-182
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ debug-build:
1313
chmod +x bin/cache-clean.js
1414

1515
install-dev-dir:
16-
rsync -a ./ $(HOME)/.composer/vendor/mage2tv/magento-cache-clean/
16+
rsync -a ./ $(HOME)/.composer/vendor/mage-os/magento-cache-clean/
1717

1818
install-debug: debug-build install-dev-dir
1919

bin/cache-clean.js

Lines changed: 135 additions & 135 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "mage2tv/magento-cache-clean",
2+
"name": "mage-os/magento-cache-clean",
33
"description": "A faster drop in replacement for bin/magento cache:clean with file watcher",
44
"type": "library",
55
"keywords": [
66
"magento",
77
"development",
88
"utility"
99
],
10-
"homepage": "https://github.com/mage2tv/magento-cache-clean",
10+
"homepage": "https://github.com/mage-os/magento-cache-clean",
1111
"license": "BSD-3-Clause",
1212
"authors": [
1313
{
@@ -17,10 +17,7 @@
1717
}
1818
],
1919
"support": {
20-
"issues": "https://github.com/mage2tv/magento-cache-clean/issues"
21-
},
22-
"suggest": {
23-
"magento/project-community-edition": "*"
20+
"issues": "https://github.com/mage-os/magento-cache-clean/issues"
2421
},
2522
"bin": [
2623
"bin/cache-clean.js"

doc/docker-and-vm.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ In many situations the cache watcher "just works" when run inside the container.
77
For example, if you are using [Warden](https://warden.dev), you can run the utility
88
after running `warden shell`:
99
```
10-
$ composer global require mage2tv/magento-cache-clean
10+
$ composer global require mage-os/magento-cache-clean
1111
$ ~/.composer/vendor/bin/cache-clean.js -w
1212
```
1313

1414
Or, if you want to execute the commands from the host machine:
1515

1616
```
17-
$ warden env exec php-fpm composer global require mage2tv/magento-cache-clean
17+
$ warden env exec php-fpm composer global require mage-os/magento-cache-clean
1818
$ warden env exec php-fpm /home/www-data/.composer/vendor/bin/cache-clean.js -w
1919
```
2020

@@ -24,7 +24,7 @@ be done once for all projects.
2424
Simon Sprankel provided [a screenshot of the PHPStorm settings](https://github.com/davidalger/warden/issues/258#issuecomment-723576699) on how the command can be run automatically.
2525

2626
However, there are a couple of common issues that can arrise when working
27-
with a virtualized environment in regards to the `cache-clean.js` watcher.
27+
with a virtualized environment in regard to the `cache-clean.js` watcher.
2828

2929
For example, when the node based watcher is run in a different container than
3030
PHP based Magento, the file system path to the Magento directory might be
@@ -85,9 +85,9 @@ The script assumes it is run in a Magento base directory, or the Magento
8585
directory can be passed as an argument:
8686

8787
```bash
88-
$ php vendor/mage2tv/magento-cache-clean/bin/generate-cache-clean-config.php
88+
$ php vendor/mage-os/magento-cache-clean/bin/generate-cache-clean-config.php
8989
# or
90-
$ php vendor/mage2tv/magento-cache-clean/bin/generate-cache-clean-config.php path/to/magento
90+
$ php vendor/mage-os/magento-cache-clean/bin/generate-cache-clean-config.php path/to/magento
9191
```
9292

9393
The configuration dump is written to the file `var/cache-clean-config.json`.

doc/using-via-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The API should be considered *beta* stability. It might still change in future i
66
### Quickstart
77

88
```js
9-
require('./vendor/mage2tv/magento-cache-clean/export/watcher');
9+
require('./vendor/mage-os/magento-cache-clean/export/watcher');
1010

1111
const mageBaseDir = './';
1212
const logLevel = 2; // Log Levels: {debug: 3, info: 2, notice: 1, error: 0}
@@ -22,7 +22,7 @@ First, the file with the exported functions needs to be included.
2222
Assuming the package is installed as a Magento development composer dependency, and the current working directory is that Magento base dir, the functions can be imported into the global namespace via:
2323

2424
```js
25-
require('./vendor/mage2tv/magento-cache-clean/export/watcher');
25+
require('./vendor/mage-os/magento-cache-clean/export/watcher');
2626
```
2727

2828
Since the watcher is not a native node application, the exports are global functions on the `cache.watcher` pseudo "namespace".

export/watcher.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readme.md

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
A faster drop in replacement for `bin/magento cache:clean` with a file watcher.
66

7-
The file watcher automatically cleans affected cache types in the Magento 2
8-
cache during development.
7+
The file watcher automatically cleans affected cache types in the Magento 2 cache during development.
98
For example, if you make a change to a template, it only cleans the
109
`block_html` and `full_page` caches, not the `config` or `layout` caches.
1110

1211
The project is only tested on MacOS and Linux.
13-
Please report bugs by opening an issue on the [GitHub issue tracker](https://github.com/mage2tv/magento-cache-clean/issues).
14-
12+
Please report bugs by opening an issue on the [GitHub issue tracker](https://github.com/mage-os/magento-cache-clean/issues).
1513

1614
## Features
1715

@@ -26,13 +24,13 @@ Please report bugs by opening an issue on the [GitHub issue tracker](https://git
2624
Installation:
2725

2826
``` shell
29-
composer require --dev mage2tv/magento-cache-clean
27+
composer require --dev mage-os/magento-cache-clean
3028
```
3129

3230
Update:
3331

3432
``` shell
35-
composer update --dev mage2tv/magento-cache-clean
33+
composer update --dev mage-os/magento-cache-clean
3634
```
3735

3836
The tool is commonly installed globally using `composer global require ...`.
@@ -50,13 +48,12 @@ For example:
5048
``` shell
5149
vendor/bin/cache-clean.js config full_page
5250
```
53-
(It's quicker because the start up time of `bin/magento` is so slow.)
51+
(It's quicker because the start-up time of `bin/magento` is so slow.)
5452

5553
There are several options to customize the behavior:
5654

5755
```
5856
vendor/bin/cache-clean.js --help
59-
Sponsored by https://www.mage2.tv
6057
6158
Usage: cache-clean.js [options and flags] [cache-types...]
6259
Clean the given cache types. If none are given, clean all cache types.
@@ -73,9 +70,8 @@ Clean the given cache types. If none are given, clean all cache types.
7370
--help|-h This help message
7471
```
7572

76-
Usually I run the command once with the `--watch` switch when I start
77-
development, and when I make a change that isn't automatically detected (yet),
78-
I run `vendor/bin/cache-clean.js` with the given cache types as a drop in
73+
Usually I run the command once with the `--watch` switch (or `-w`) when I start development, and when I make a change
74+
that isn't automatically detected (yet), I run `vendor/bin/cache-clean.js` with the given cache types as a drop in
7975
replacement for `bin/magento cache:clean`.
8076

8177
### Hotkeys
@@ -104,17 +100,16 @@ Use the `--keep-generated` switch if you want files in `generated/code` to remai
104100

105101
### Prerequisites:
106102

107-
* `node.js` (built on 10, but should work with older 8.x versions, too).
108-
* It probably is a good idea to turn on all Magento caches
109-
`bin/magento cache:enable` to get the full benefit.
103+
* `node.js` (built on 18, but should work with older 10.x versions, too).
104+
* It's a good idea to turn on all Magento caches `bin/magento cache:enable` to get the full benefit.
110105

111106

112107
## Known issues
113108

114109
* Currently, the watcher has to be restarted after a new theme is added, so it
115110
is added to the watchlist.
116111

117-
* Changes to files on NFS mounts (e.g. in vagrant) do not trigger the watches.
112+
* Changes to files on NFS mounts (e.g. in vagrant) do **not** trigger the watches.
118113
Depending on a given setup, it might be possible to run the watcher on the
119114
host system instead.
120115

@@ -141,31 +136,29 @@ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo s
141136

142137
## More information
143138

144-
* Some words on using the watcher with [Docker & VMs](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/docker-and-vm.md).
139+
* Some words on using the watcher with [Docker & VMs](https://github.com/mage-os/magento-cache-clean/blob/main/doc/docker-and-vm.md).
145140

146-
* [Running the watcher from code](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/using-via-code.md).
141+
* [Running the watcher from code](https://github.com/mage-os/magento-cache-clean/blob/main/doc/using-via-code.md).
147142

148-
* The [rationale](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/rationale.md) explains the reasons I wrote the utility.
143+
* The [rationale](https://github.com/mage-os/magento-cache-clean/blob/main/doc/rationale.md) explains the reasons I wrote the utility.
149144

150-
* How to [build](https://github.com/mage2tv/magento-cache-clean/blob/master/doc/building.md) the tool from source.
145+
* How to [build](https://github.com/mage-os/magento-cache-clean/blob/main/doc/building.md) the tool from source.
151146

152-
* Integrating the watcher with PHPStorm:
153-
* [Mage2 TV] [How to set up the watcher as a PHPStorm startup task](https://www.mage2.tv/content/fundamentals/magento-cli-tool/configuring-the-magento-cache-clean.js-utility-phpstorm-startup-task/).
154-
* [Mage2 TV] [How to enable the hotkeys in PHPStorm](https://www.mage2.tv/content/fundamentals/magento-cli-tool/enabling-the-hotkeys-for-the-cache-clean.js-utility-in-phpstorm/).
147+
* This package used to be called `mage2tv/magento-cache-clean`, but now it is part of Mage-OS, and thus the package name
148+
is `mage-os/magento-cache-clean`. The original package still works as it now is an empty wrapper that requires this
149+
package. Existing installations should continue to work.
155150

156151
## Thanks
157152

158153
This script was inspired by [Timon de Groot](https://twitter.com/TimonGreat)'s
159-
[blog post](https://blog.timpack.org/speed-up-magento-development) where he
160-
describes the idea to use a file watcher in PHPStorm to call `redis-cli` to
161-
clear the complete cache whenever a XML file is modified.
162-
The only downside of that solution is that it always flushes the full cache and
163-
only works with redis.
154+
[blog post](https://blog.timpack.org/speed-up-magento-development) where he describes the idea to use a file watcher in
155+
PHPStorm to call `redis-cli` to clear the complete cache whenever a XML file is modified.
156+
The only downside of that solution is that it always flushes the full cache and only works with redis.
164157

165-
Thank you also to everybody who gave feedback, shared ideas and helped test new
166-
features! This tool would be impossible without you!
158+
Thank you also to everybody who gave feedback, shared ideas and helped test new features! This tool would be impossible
159+
without you!
167160

168161
## Copyright & License
169162

170163
Copyright 2019 - present by Vinai Kopp, distributed under the BSD-3-Clause license (see
171-
the [LICENSE](https://github.com/mage2tv/magento-cache-clean/blob/master/LICENSE) file).
164+
the [LICENSE](https://github.com/mage-os/magento-cache-clean/blob/main/LICENSE) file).

src/cache/core.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
(set! *warn-on-infer* true)
99

10-
(defonce version "1.0.55")
10+
(defonce version "1.1.0")
1111

1212
(defn node-version-str []
1313
(let [proc ^js/process (js/require "process")]

src/magento/app.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
(file-cache-backend? config)
126126
(fpc-dir-bug-present? base-dir))
127127
(log/notice :without-time (str "NOTICE: Workaround for FPC cache dir bug enabled!\n"
128-
"Please read https://github.com/mage2tv/magento-cache-clean/blob/master/doc/fpc-dir-bug.md"))
128+
"Please read https://github.com/mage-os/magento-cache-clean/blob/master/doc/fpc-dir-bug.md"))
129129
true))
130130

131131
(defn missing-cache-dir? [base-dir config cache-type]

0 commit comments

Comments
 (0)