diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 6db691137..20f7f01c5 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,10 +5,10 @@ on: types: [opened, synchronize, reopened] jobs: - lint: + lint-and-dedupe: runs-on: ubuntu-latest - name: Lint on node 10.x and ubuntu-latest + name: Lint & Deduplicate deps on node 10.x and ubuntu-latest steps: - uses: actions/checkout@v1 @@ -23,6 +23,9 @@ jobs: - name: Lint codebase run: yarn lint:post-build + - name: Deduplicate dependencies + run: yarn deduplicate:check + test: runs-on: ${{ matrix.os }} diff --git a/package.json b/package.json index 659f4bcb3..03174c905 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "test:post-build": "node dist/index.js test", "start": "tsc -p tsconfig.json --watch", "release": "np", - "deduplicate": "npx yarn-deduplicate -s fewer yarn.lock" + "deduplicate": "yarn-deduplicate -s fewer yarn.lock", + "deduplicate:check": "yarn-deduplicate -s fewer yarn.lock --list --fail" }, "files": [ "dist", @@ -125,11 +126,12 @@ "rollup-plugin-postcss": "^2.5.0", "styled-components": "^5.0.1", "tiny-invariant": "^1.1.0", - "tiny-warning": "^1.0.3" + "tiny-warning": "^1.0.3", + "yarn-deduplicate": "^2.1.1" }, "husky": { "hooks": { - "pre-commit": "pretty-quick --staged --pattern '!test/tests/lint/**' && yarn lint && doctoc README.md" + "pre-commit": "pretty-quick --staged --pattern '!test/tests/lint/**' && yarn lint && yarn deduplicate:check && doctoc README.md" } }, "prettier": { diff --git a/yarn.lock b/yarn.lock index 61568705b..534317ae6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1391,6 +1391,11 @@ semver "^6.3.0" tsutils "^3.17.1" +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + abab@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" @@ -2376,6 +2381,11 @@ commander@^2.11.0, commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" + integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== + commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" @@ -7322,10 +7332,10 @@ semver@6.x, semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.1.1.tgz#29104598a197d6cbe4733eeecbe968f7b43a9667" - integrity sha512-WfuG+fl6eh3eZ2qAf6goB7nhiCd7NPXhmyFxigB/TOkQyeLP8w8GsVehvtGNtnNmyboz4TgeK40B1Kbql/8c5A== +semver@^7.1.1, semver@^7.3.2: + version "7.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" + integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== serialize-javascript@^1.7.0: version "1.9.1" @@ -8577,3 +8587,12 @@ yargs@^15.3.1: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^18.1.1" + +yarn-deduplicate@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/yarn-deduplicate/-/yarn-deduplicate-2.1.1.tgz#500a3010e4bdee3c3250936e210910c7cae3d75d" + integrity sha512-lbFJGOMnqG/ncGjNBUt+JG4qfAGqeh8o9i4i5LXqNBdQ8ov8av6T1jizWQqr+zLPLCOqp/BYBZz8FymPQSR4RA== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + commander "^5.1.0" + semver "^7.3.2"