diff --git a/.github/workflows/circular.dep.check.yml b/.github/workflows/circular.dep.check.yml new file mode 100644 index 00000000..41178400 --- /dev/null +++ b/.github/workflows/circular.dep.check.yml @@ -0,0 +1,37 @@ +name: Circular dependency checks + +on: + push: + branches: + - '**' + +jobs: + lint: + runs-on: ubuntu-latest + env: + NODE_OPTIONS: --max-old-space-size=4096 + steps: + - uses: actions/checkout@v2 + + - name: Set Node Version + uses: actions/setup-node@v2 + with: + node-version: 16 + + - name: Restore lerna cache + uses: actions/cache@v2 + with: + path: | + node_modules + packages/*/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + + - name: Install dependencies + run: npm i + + - name: Bootstrap + run: npm run bootstrap + + - name: List circular dependencies + continue-on-error: true + run: npm run madge diff --git a/package.json b/package.json index 5491d158..4a9b1797 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "lerna": "^3.22.1", + "madge": "^5.0.1", "prettier": "^2.2.1", "rimraf": "^3.0.2", "typedoc": "^0.20.35", @@ -62,6 +63,7 @@ "lint:prettier:fix": "prettier --write \"packages/**/src/**/*.{ts,tsx|!(d.ts)}\" *.js", "build:docs": "rimraf docs && typedoc --name \"Stacks.js $npm_package_version Library Reference\" --readme ./readme.md --tsconfig tsconfig.typedoc.json --out docs --json docs/docs.json packages/**/src/index.ts", "test": "lerna run test", - "typecheck": "lerna run typecheck --parallel --no-bail --stream" + "typecheck": "lerna run typecheck --parallel --no-bail --stream", + "madge": "madge --circular --extensions ts --exclude 'd.ts' packages/" } }