Skip to content

Commit

Permalink
Merge pull request #3109 from opencollective/depcheck
Browse files Browse the repository at this point in the history
Check dependencies using depcheck
  • Loading branch information
znarf committed Jan 8, 2020
2 parents 5ce1709 + eb1af86 commit 64f7d62
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 29 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- run: npm run lint:check
- run: npm run prettier:check
- run: npm run type:check
- run: npm run depcheck

test:
docker:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,41 @@ jobs:

- run: npm run type:check

depcheck:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2-beta

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: Restore node_modules
uses: actions/cache@v1
id: api-node-modules
with:
path: node_modules
key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}

- name: Restore .npm cache
if: steps.api-node-modules.outputs.cache-hit != 'true'
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
restore-keys: |
- ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
- ${{ runner.os }}-api-npm-cache-
- name: Install dependencies
if: steps.api-node-modules.outputs.cache-hit != 'true'
run: npm ci --prefer-offline --no-audit

- run: npm run depcheck

build:
runs-on: ubuntu-latest

Expand Down
32 changes: 4 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
},
"devDependencies": {
"@babel/cli": "7.7.7",
"@babel/polyfill": "7.7.0",
"@babel/register": "7.7.7",
"@typescript-eslint/eslint-plugin": "^2.15.0",
"@typescript-eslint/parser": "^2.15.0",
Expand Down Expand Up @@ -166,6 +165,7 @@
"db:sanitize": "babel-node --extensions .js,.ts scripts/sanitize-db",
"db:seed": "./scripts/sequelize.sh db:seed",
"db:setup": "babel-node --extensions .js,.ts ./scripts/db_setup.js",
"depcheck": "npx depcheck --specials babel,bin,commitizen,eslint,husky,lint-staged,mocha --ignore-dirs dist,dbdumps .",
"deploy:production": "./scripts/pre-deploy.sh production && bash -x scripts/deploy.sh production",
"deploy:staging": "./scripts/pre-deploy.sh staging && bash -x scripts/deploy.sh staging",
"dev": "nodemon server/index.js -x \"babel-node --extensions .js,.ts\" . -e js,hbs,ts",
Expand All @@ -185,6 +185,7 @@
"refund-transactions": "babel-node --extensions .js,.ts ./scripts/add_refund_transactions_from_collective.js",
"report": "node scripts/send_email_report_cli.js",
"script": "babel-node --extensions .js,.ts $1",
"sequelize": "babel-node --extensions .js,.ts -- ./node_modules/.bin/sequelize --config config/sequelize-cli.js",
"start": "node ./dist/index.js",
"test": "TZ=UTC nyc mocha --reporter-options mochaFile=$(bash scripts/test_output_dir.sh junit)/junit.xml",
"test:graphql": "TZ=UTC nyc mocha test/server/graphql --reporter-options mochaFile=$(bash scripts/test_output_dir.sh junit)/junit.xml",
Expand Down

0 comments on commit 64f7d62

Please sign in to comment.