dripfeed is a browser extension which manipulates DOM elements of social
media websites, helping stem the tide of content that we're exposed to.
To get started with dripfeed extending or enhancing dripfeed, you'll need to set your environment up.
Assuming you have nodejs installed, this can be done like so:
git clone git@github.com:Darianisak/dripfeed.git
cd dripfeed
npm ciThen, to ensure you're able to run all the formatting tools, you'll need a Python Virtual Environment:
python3 -m venv pydeps
source pydeps/bin/activate
pip3 install --requirement requirements.txtAnd finally, to ensure that you can run the full test suite, you'll need to install our Ruby dependencies:
But what if Ruby isn't installed?
This project assumes that Ruby will be installed and managed via mise.
Check out the installation docs, here.
./bin/bundle install
Once you've made changes, you can:
- Ensure
prettierformatting is applied withnpm run format. - Use
eslintwithnpm run lint. - Use
yamllintwithnpm run yaml. - Use
rubocopwithnpm run rubocopto format and lint Ruby test code.
JavaScript unit tests can be run with:
npm run testTests are most easily debugged with VSCode's "JavaScript Debug Terminal".
Ruby browser integration tests can be run with:
npm run rspecOr, if you'd like to run these tests with a debugger directive, use:
./bin/bundle exec rdbg -- ./bin/bundle exec rspecIf you'd like to run the Sinatra server so that you can view your fixtures:
npm run sinatraAnd then:
open http://localhost:4567/${ROUTE_NAME}If you'd like to create atomic removal tests for a new page or website:
- Head to the page.
- Download the pages HTML content. This could be done with
curl, too. - Save the content in a meaningful location within
view/. - Change the file extension from
.htmlto.erb. - Add a route in
sinatra.rb. - Add a script tag to the HTML document's
<head>to load the desired JavaScript module. I.e.,<script type="module" src="/reddit/index.js"></script>.
With the HTML fixture set up, go ahead and add new tests under spec/features/*.
The extension ZIP can be built with:
npm run buildThis project uses:
eslintfor JavaScript code quality enforcement.jestfor unit testing.prettierfor JavaScript formatting.web-extfor extension testing.yamllintfor YAML linting.miseto manage Ruby installations.rubocopto enforce Ruby best-practice.sinatrafor serving test fixtures.rspecandcapybarafor atomic integration tests.