-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert bin/xpi.sh into cross-env Node type script? #60
Comments
Thanks for looking into this. I LIVE HARDCORE BASH. But... legacy addons are dead, and I have a replacement script!
Under WebExtensionsExperiments all this build garbage just goes away. |
(In the past, we have also MADE DECISIONS about a few of these things.
Most of what you suggest sound like really good things to check that |
Not all the build stuff, i reckon... We'd still need the mustache transforms, and copying stray files like PioneerUtils.jsm from node_modules into somewhere. Awesome, I'll wait until we shift to WEE and I can tinker w/ the new and improved build scripts. |
Closing. This was fixed in #73 |
Currently /bin/xpi.sh is some pretty hardcore Bash-ism. Not sure if it'd be easier to rewrite as Node, or if that'd just be a lot more verbose for not a lot of gain. Not sure how many shield study authors are on a Windows environment, or how much customizing people are doing to the xpi.sh file to tweak for specific projects.
I took a quick stab at the conversion, which is a bit more verbose than the Bash version, but maybe is something we could consider publishing to npm if we can agree on the correct dials and knobs.
For example, this will create a /dist/addon-2.0.0.xpi file (but is easy enough to remove the version number from the filename and always write as dist/addon.xpi):
I think the one thing it doesn't currently account for is copying arbitrary files before zipping, a la:
But we can do something like
require.resolve()
to get paths to file names we want to copy from ./node_modules/:We could probably just add some
extraFiles[]
array to the options Object which lists arbitrary files to copy over from ./node_modules/ or wherever.Oh, and there isn't an easy way currently to list files you DON'T want in the generated XPI/ZIP file. I think cpr (after
cp -r
, presumably) supports a filter function/regex for preventing certain files from being copied over. I was hoping we could use web-ext to create the XPI, but not sure if that is fully supported.Another option is looking to see if we can replace a few of these dependencies with shelljs. It MAY be able to replace at least one of these dependencies:
I'm probably overlooking something obvious and there is a much better solution (like Webpack or something) for copying/moving/templating files. I'm a bit reluctant to add Grunt or Gulp just for builds, as I don't know how simple it'd be to publish some "make-xpi" module that can be shared between projects.
The text was updated successfully, but these errors were encountered: