Open
Conversation
migrate the `grunt test` task to package.json. `npm test` is the new alternative command. this is the first ( and easiest ) step to eliminating `grunt` as a dependency for the project.
There were 2 divergences in the `manifest.json` files : - `"applications"` block in the firefox manifest which specified the minimum supported version of the extension in the browser - different icon sizes in the default `manifest.json` This divergence seemed trivial to be maintained separately. Merging and running the extension from the merged `manifest.json` file did not throw any major errors in the running of the extension on Firefox as well as Chromium. It does not seem sensible to maintain 2 separate `manifest.json` files for the extension unless there are other chromium-based browsers who use the `"applications"` block specifically for something else or some other browser that accepts only one icon in the manifest.
Now that the only minor divergence in the source code have been merged, the `src` directory can be used as the single source of truth for both source code as well as distribution code. There is nothing that needs to be compiled or transpiled that would require a separate dedicated distribution directory.
because web-ext run already watches, live reloads and also serves the web extension to the desired browser described by `npm run -- serve:firefox` or `npm run -- serve:chromium`
`npm` has a built-in `pack` command that can compress the repository ( or specific `files` in the repository ) and generate a tarball. Additionally, it also adds some default files like the README, LICENSE and CHANGELOG for posterity. The output tarball is also aptly named in the format `<project-name>-<version-string>.tgz` reference : https://stackoverflow.com/a/55220535 While the tarball can be generated by running the `npm pack` command, for sake of backward-compatibility of existing `npm` scripts, it has been assigned to the `package` script replacing the `grunt package` alias.
remove all remaining traces of grunt from the project
`a0bc2c0` blindly migrated the `grunt` alias `test` without looking at the script's semantics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
web-ext is a tool that is designed specifically for the development
of web extensions. It provides functionality like auto-loading the web
extension in the browser and watching the source file for changes and
automatically reloading the web extension in the browser.
This supersedes the dependency on
gruntbecausegruntcannothandle the automatic loading of the web-extension into the browser.
And that is obviously because
gruntis a generic tool.When there is a tool that is designed specifically for the purpose of
development of web extensions that provides better functionality, we
should migrate to it.
web-exthas additional features that can be utilized, but I was onlytargeting existing feature-parity.
For example, it has an option where the path to a browser binary can
be provided and the tool will attempt to open the web extension with
that binary. This could be useful when one wants to test on other
chromium-based browsers like Opera, Edge Chromium, Brave, Vivaldi,
etc. I think using the
chromiumBinaryoption would probably work,but I have not tested it ( that is also why I have not changed the
Opera and Edge Chromium sections in the CONTRIBUTING document )