From d30c50f46237af2fdef0a8a21fb547ed8e6c4d80 Mon Sep 17 00:00:00 2001 From: Brandon Mills Date: Wed, 25 Nov 2020 23:39:22 -0500 Subject: [PATCH] Chore: Automatically install example dependencies (#164) Previously, CI was explicitly running the `install-examples` script as its own step. This was also necessary but not documented locally, so `git clone; npm install; npm test` would show a couple failures when the examples inherited the wrong ESLint dependency. The examples' dependencies should now be installed automatically when running `npm install` locally without any arguments. Originally reported in #163. --- .github/workflows/ci.yml | 2 +- package.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b867176..3cd4732e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Install Packages - run: npm install && npm run install-examples + run: npm install env: CI: true - name: Test diff --git a/package.json b/package.json index 4fd5ec0f..1066683d 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,14 @@ "linter" ], "scripts": { - "install-examples": "for example in examples/*; do (cd \"$example\" && npm install); done", "lint": "eslint --ext js,md .", + "prepare": "for example in examples/*; do (cd \"$example\" && npm install); done", "test": "npm run lint && npm run test-cov", "test-cov": "nyc _mocha -- -c tests/{examples,lib}/**/*.js", - "generate-release": "npm run install-examples && eslint-generate-release", - "generate-alpharelease": "npm run install-examples && eslint-generate-prerelease alpha", - "generate-betarelease": "npm run install-examples && eslint-generate-prerelease beta", - "generate-rcrelease": "npm run install-examples && eslint-generate-prerelease rc", + "generate-release": "eslint-generate-release", + "generate-alpharelease": "eslint-generate-prerelease alpha", + "generate-betarelease": "eslint-generate-prerelease beta", + "generate-rcrelease": "eslint-generate-prerelease rc", "publish-release": "eslint-publish-release" }, "main": "index.js",