Introduce dedicated npm command for generating files for extension
Background / User story
WebExt would like us to stop using the "postinstall" npm hook because:
- We'd like to separate the step in which dependencies are installed and the step that builds the contents of the extension.
- We are concerned about the performance of
npm install
. - We need to be able to run
npm install
on native Windows (cmd.exe, PowerShell). While it isn't ideal that building the UI requires a UNIX environment in the first place, we can work around it as long as it's done separately fromnpm install
.
We use that hook to ensure that all bundles, fonts and other assets are being generated before creating the extension bundles. Therefore we should expose an npm command that's dedicated to that task so that it can be called explicitly.
What to change
- Design: N/A
- Research: N/A
- Spec: N/A
-
Development:
- Rename "postinstall" npm command to "dist".
- Update adblockpluschrome fork to call the "dist" command.
- Update documentation.
Hints for testers
Extension builds should be generated successfully.
In order to build the extension, it's not possible to simply run build.py
while eyeo/adblockplus/adblockpluschrome!173 (merged) is still being worked on. Instead, the following commands need to be run in order:
- adblockluschrome:
ensure_dependencies.py
- adblockplusui:
npm run dist
- adblockpluschrome:
build.py devenv -t <platform>
That's because build.py
automatically calls ensure_dependencies.py
and that particular MR is going to stop that. Therefore build.py
is no longer expected to ensure that all dependencies have been resolved after that MR lands.
Hints for translators
N/A
Integration notes
After this change, UI files will no longer be generated automatically by calling either npm install
, ensure_dependencies.py
or build.py
. Therefore npm run dist
needs to be called before generating any extension builds with build.py
.
Updates page (optional)
N/A