diff --git a/.gitignore b/.gitignore index ac3eb961f..bda372138 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ firefox cache build npm-debug.log +yarn-error.log crowdin.yml .*~ add-on/dist diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d04584fc8..e7ff2311f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,9 +58,9 @@ Each `npm` task can be run separately. The most useful ones are: - `npm install` -- install all NPM dependencies - `npm run build` -- build the add-on (copy external libraries, create `.zip` bundle) -- `npm test` -- run entire test suite (both unit and functional tests) -- `npm test:unit` -- run unit tests only -- `npm test:functional` -- run functional tests only +- `npm run yarn-build` -- fast install+build with yarn +- `npm run docker-build` -- reproducible build using yarn.lock and specific version of yarn and node +- `npm test` -- run entire test suite - `npm run lint` -- check for potential syntax problems (run all linters) - `npm run lint:standard` -- run [standard](http://standardjs.com) linter ([IPFS JavaScript projects default to standard code style](https://github.com/ipfs/community/blob/master/js-project-guidelines.md#linting--code-style)) - `npm run lint:web-ext` -- run [addons-linter](https://github.com/mozilla/addons-linter) shipped with `web-ext` tool diff --git a/package.json b/package.json index dec8e42c2..25fb5844f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,9 @@ "postmerge": "run-s postcheckout", "precommit": "run-s -s clean build lint", "prepush": "run-s -s precommit test build", - "firefox": "web-ext run -s add-on/ --browser-console" + "firefox": "web-ext run -s add-on/ --browser-console", + "yarn-build": "npx yarn@1.2.1 && npx yarn@1.2.1 build", + "docker-build": "docker run -it --rm --name ipfs-companion-build -v \"$PWD\":/src -w /src node:8.9.1 /bin/bash -c \"npm run yarn-build\"" }, "private": true, "preferGlobal": false,