- Create a Firefox Add-ons (AMO) account
- Install followings:
- WebExtensions enabled Firefox
- Node.js v16 or later. Package scripts need npm@7.
- Python 2.x for compiling
dtrace-provider
(web-ext
requires this as dependency)
Before you do anything else, login on GitHub and fork this repository
Install Git and clone your forked repository locally.
$ git clone https://github.com/<your-account>/copy-selection-as-markdown.git
The project uses Semantic Versioning 2.0.0 but you don't have to update package.json
nor manifest.json
as I will maintain release.
- Open your terminal, navigate to local repository directory
- Export AMO's API key and secret as environment variable
$ export WEB_EXT_API_KEY=... $ export WEB_EXT_API_SECRET=...
- Install dependencies
$ npm install
- Create a new topic branch
$ git checkout -b add-new-feature
- Run js bundler/watcher and firefox
$ npm run watch
- Modify source code and firefox will reload the extension automatically
- Run test cases
$ npm test
To make sure Turndown conversion remains intact after my modification for supporting MathJax, I use Jest snapshot testing. When you updated Turndown, you have to update snapshots.
- Comment out following line from
test.js
turndownService.use(turndownPluginMathJax);
- Update Jest snapshot
$ npm run test:core -- --updateSnapshot
- Revert
test.js
- Run test cases
$ npm test
- Commit your changes locally, rebase onto upstream/master, then push the changes to GitHub
$ git push origin add-new-feature
- Go to your fork on GitHub, switch to your topic branch, then click "Compare and pull request" button.
Run with npm run <script-name>
.
- Watchers
watch
: Run watch scripts
- Builds
build
: Build the extension with webpackgenerate
: Generate WebExtension artifactsformat
: format JS files by Prettier