Closed globau closed 5 months ago
@globau Thank you for putting so much work into describing the problem. I agree that not everything was clear and the scripts were poorly prepared for external contributing. I made few changes. You can see them on branch feature/1.6.4.
FYI #67 will be fixed in next version ;)
Merged
Feature description
While I know Javascript, I generally don't follow the JS web ecosystem so I wasn't sure how to build the add-on in order to contribute. The current
CONTRIBUTING.md
simply saysMake your changes
with zero details about the build environment or requirements,.Here's my journey through figuring things out and working around issues encountered.
Makefile
so I assume there's annpm
script I need to run.npm run
seems like a reasonable place to startnpx
is all sorts of amazing so this looks like an easy fix: change calls such asrimraf --glob ./public/*
tonpx -y rimraf --glob ./public/*
package.json
to usenpx
to runyarn
,rimraf
,cross-env
,license-report
, andweb-ext
nvm
and installednode 20.9.0
mkdir public
npm run firefox-dev
?.env
cp .env.example .env
and set it tohttp://localhost/
WS_URL
getshttp://localhost/
tooLOCO_KEY
tosecret
.powershell
is windows specific and doesn't exist on macOSpowershell Compress-Archive ./public/* ./build/firefox_ext_%npm_package_version%.zip
bestzip
:npx -y bestzip ./build/firefox_ext_%npm_package_version%.zip ./public/*
mkdir build
firefox_ext_%npm_package_version%.zip
public/
prefix which is probably wrong.cd public && npx -y bestzip ../build/firefox_ext_%npm_package_version%.zip .
For completeness here's the changes I made to the Firefox specific lines in
package.json
npm run firefox-run
results inerrorStorageCorruptedMessage
--devtools
to theweb-ext run
command shows meCross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost//browser_extensions. (Reason: CORS request did not succeed). Status code: (null).
storage.keys
only containspublicKey
, and is missingprivateKey
andextensionID
SDK
needs valid urls and I have no idea what they shouldAPI_URL=https://api2.2fas.com
, using thatIn summary I recommend:
nvm
as a solution.env
needs to be created and configured, including sample valid URLs (and descriptions for the 3 variables)npx -y
to run all commands instead of assuming they are available globallynpx -y bestzip
instead ofpowershell Compress-Archive
, which should work on any platform[edit]
WS_URL
and/orLOCO_KEY
Motivation
I want to fix a bug, found zero documentation on how to setup the development environment, as well as several incorrect system-level assumptions.
Acknowledgements