Amaimersion / remove-files-webpack-plugin

A plugin for webpack that removes files and folders before and after compilation.

Home Page:https://www.npmjs.com/package/remove-files-webpack-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix wording of error message

charliematters opened this issue · comments

Bug Report

The error message when no files are found does not make sense, or is not clear

Environment

  • plugin version: 1.4.1
  • system and its version:
  • webpack version:4.43.0
  • node version: 10.15.3

Expected Behavior

remove-files-plugin@1.4.1:
No items found to remove 

Or similar!

Actual Behavior

remove-files-plugin@1.4.1:
An items for permanent removing not found

Configuration

new RemovePlugin({
    before: { include: ['./dist'] },
    after: {}
})

Additional Information

The phrase An items implies that an item was found, which isn't the case, and I couldn't immediately work out whether it meant

Any items for permanent removing not found

which just means the folder is already clean, or

An item requested for permanent removing could not be found

which would be an actual error

Hello!

Sorry for late response.

You are right about unclear meaning of An items. Though, it was always clear to me because i'm creator of the plugin, and i'm not native English (there is always a little bit of "conversion" to actual meaning even if the phrase is not clear enough) :)

As for "items", by itself it means "folders or files". It is just simplification in order to not write everywhere "Following folders or files will be removed in trash" (and so on).

Also, the plugin have two similar messages at that stage: Following items will be removed in trash in case of not emulation and Following items have been removed in trash. "removed in trash" will be replaced with "permanently removed" in case of trash: false. So, i need to keep consistent format of messages in order to simplify reading of messages for another developers.

New messages

  • Requested items for removing in trash were not found
  • Requested items for permanent removing were not found

What do you think about this variant? It is clear to you?

Hi!

No worries about English - it's a strange language.

I like the new variants more, but I think the use of the present+past tense ("removing"=present, "were not"=past) and 'not' make the sentences a bit strange.

"removed in trash" isn't quite right - you can "move something to the trash", or you could "move something to trash" which makes the idea of trash sound less like a physical thing

"not emulation" is also a bit awkward - It's not an easy phrase to replace, so I'd try and work around it.

With that said (and it's personal preference), I would use these phrases:

Following items will be removed in trash in case of not emulation
The following items would have been moved to (the) trash

Following items will be permanently removed in case of not emulation
The following items would have been permanently removed

"would have been" shows that they haven't actually moved. You could add some hint at the end, like "(emulate is set to true)" perhaps

Following items have been removed in trash
The following items have been moved to (the) trash

Following items have been permanently removed
The following items have been permanently removed

Requested items for removing in trash were not found
Requested items for permanent removing were not found
Could not find any items to remove

As there are no items, it doesn't matter what you were going to do with them, and the warning message is more direct

Thank you very much for detailed explanation.

in/to trash

It was really a pain for me which one to use. For some reasons i ended up with in, but looks like to is a right choice.

the

Also a big pain. Hard to decide when to use this. There is no such thing in Russian :)

Messages

1

The following items would have been moved to (the) trash
The following items would have been permanently removed

The following items would have been moved to the trash if it hadn't been an emulation
The following items would have been permanently removed if it hadn't been an emulation

Final message is big, yes. But emulation will be not used so often, and it is important to point on if

2

The following items have been moved to (the) trash
The following items have been permanently removed

The following items have been moved to the trash
The following items have been permanently removed

3

Could not find any items to remove

Could not find any items to move to the trash
Could not find any items to permanently remove

I think it is always important to point which option (permanent or trash) a developer is using. If by any chance developer wanted a trash removing, but he forgot to enable it, there will be a big problem (it is removing after all, there can be an important items). And also it is a way to indicate that the plugin knows which removing method to use and everything goes according to the plan (at least from the plugin side (: ).

I know there is a problems with messages that intended for debugger logger. Don't pay attention to them. i know how to interpretate them.

What do you think? Now the plugin messages looks fine?

Looks great!