mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.65k stars 334 forks source link

Nested config settings can overwrite each other #3104

Closed dotproto closed 2 months ago

dotproto commented 3 months ago

Is this a feature request or a bug?

Bug

What is the current behavior?

  1. Add the following configuration to a WebExtension project.
    module.exports = {
      "lint": {
        "firefoxPreview": ['mv3'],
      },
      "run": {
        "firefoxPreview": ['']
      }
    };
  2. CD into that project's directory and run web-ext lint --firefox-preview.
  3. Observe that the following message is logged to the console. This is expected.
    Manifest Version 3 is now officially supported and "--firefox-preview=mv3" is no longer needed. In addition, the "mv3" value will be removed in the future.
  4. Run web-ext lint.
  5. Observe that the message from step 3 is not logged to the console.

What is the expected or desired behavior?

Command-specific settings declared in a configuration file should not interfere with each other.

Version information (for bug reports)

node --version && npm --version && web-ext --version
v21.6.2
10.2.4
master-e2bee027dee8e1a56dd49fd567edddc7ad75220c

This is a manually built version of web-ext that is very close to 8.0.0.

Rob--W commented 2 months ago

This is a bug specific to the --firefox-preview implementation. When the flag is empty, we default to mv3 being specified.

We're going to resolve this issue by dropping the --firefox-preview flag. Since this is a breaking change, we'd like to make this part of the 8.0.0 release.

willdurand commented 2 months ago

We removed --firefox-preview entirely.

ioanarusiczki commented 2 months ago

Updated to master-f814a6195ad8a40d3bca1fc8105473a94e79bdca - V8

With web-ext lint --firefox-preview the message is unknown argument

unknown arguments

ioanarusiczki commented 2 months ago

Ah to add , with web-ext lint ran for an extension , it looks good, should be as expected.

as expexted