hyperdx/package.json
Brandon Pereira b642ce43d3
feat: Add Knip for unused code analysis with CI reporting (#1954)
## Summary

Adds [Knip](https://knip.dev) to the monorepo to detect unused files, dependencies, and exports. The goal is to reduce dead code over time and prevent new unused code from accumulating.

**What's included:**
- Root-level `knip.json` configured for all three workspaces (`packages/app`, `packages/api`, `packages/common-utils`)
- `yarn knip` and `yarn knip:ci` scripts for local and CI usage
- GitHub Action (`.github/workflows/knip.yml`) that runs on every PR to `main`, compares results against the base branch, and posts a summary comment showing any increase or decrease in unused code
- Removed the previous app-only `packages/app/knip.json` in favor of the monorepo-wide config

**How the CI workflow works:**
1. Runs Knip on the PR branch
2. Checks out `main` and runs Knip there
3. Compares issue counts per category and posts/updates a PR comment with a diff table

This is additive — Knip runs as an informational check and does not block PRs.
2026-03-23 14:41:44 +00:00

85 lines
3.3 KiB
JSON

{
"name": "hyperdx",
"private": true,
"version": "2.0.0",
"license": "MIT",
"workspaces": [
"packages/*"
],
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@dotenvx/dotenvx": "^1.51.1",
"@nx/workspace": "21.3.11",
"@types/ungap__structured-clone": "^1.2.0",
"@typescript-eslint/eslint-plugin": "^8.48.1",
"@typescript-eslint/parser": "^8.48.1",
"@ungap/structured-clone": "^1.3.0",
"babel-plugin-react-compiler": "^1.0.0",
"concurrently": "^9.1.2",
"dotenv": "^16.4.7",
"dotenv-cli": "^8.0.0",
"dotenv-expand": "^12.0.1",
"eslint": "^9.39.1",
"eslint-config-next": "16.0.7",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-n": "^16.4.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"husky": "^8.0.3",
"knip": "^6.0.1",
"lint-staged": "^13.1.2",
"nx": "21.3.11",
"prettier": "3.3.3"
},
"scripts": {
"setup": "yarn install && husky install",
"build:common-utils": "nx run @hyperdx/common-utils:dev:build",
"app:dev": "concurrently -k -n 'API,APP,ALERTS-TASK,COMMON-UTILS' -c 'green.bold,blue.bold,yellow.bold,magenta' 'nx run @hyperdx/api:dev' 'nx run @hyperdx/app:dev' 'nx run @hyperdx/api:dev-task check-alerts' 'nx run @hyperdx/common-utils:dev'",
"app:dev:local": "concurrently -k -n 'APP,COMMON-UTILS' -c 'blue.bold,magenta' 'nx run @hyperdx/app:dev:local' 'nx run @hyperdx/common-utils:dev'",
"app:lint": "nx run @hyperdx/app:ci:lint",
"app:storybook": "nx run @hyperdx/app:storybook",
"build:clickhouse": "nx run @hyperdx/common-utils:build && nx run @hyperdx/app:build:clickhouse",
"run:clickhouse": "nx run @hyperdx/app:run:clickhouse",
"dev": "yarn build:common-utils && dotenvx run --convention=nextjs -- docker compose -f docker-compose.dev.yml up -d && yarn app:dev && docker compose -f docker-compose.dev.yml down",
"dev:local": "IS_LOCAL_APP_MODE='DANGEROUSLY_is_local_app_mode💀' yarn dev",
"dev:down": "docker compose -f docker-compose.dev.yml down",
"dev:compose": "docker compose -f docker-compose.dev.yml",
"knip": "knip",
"knip:ci": "knip --reporter json",
"lint": "npx nx run-many -t ci:lint",
"version": "make version",
"release": "npx changeset tag && npx changeset publish"
},
"lint-staged": {
"packages/api/src/routers/external-api/**/*.ts": [
"prettier --write --ignore-unknown",
"eslint --flag v10_config_lookup_from_file --fix --quiet",
"sh -c 'cd packages/api && yarn run lint:openapi && git add openapi.json'"
],
"**/*.{ts,tsx}": [
"prettier --write --ignore-unknown",
"eslint --flag v10_config_lookup_from_file --fix --quiet"
],
"**/*.{mdx,json,yml}": [
"prettier --write --ignore-unknown"
]
},
"packageManager": "yarn@4.5.1",
"resolutions": {
"@types/react": "19.0.7",
"@types/react-dom": "19.0.3",
"@types/express": "4.17.21",
"@types/express-serve-static-core": "4.17.43",
"express": "^4.20.0",
"send": "^0.19.0",
"serve-static": "^1.16.0",
"cookie": "^0.7.0",
"brace-expansion": "^2.0.2",
"diff": "^5.2.2",
"on-headers": "^1.1.0",
"fast-xml-parser": "^4.5.4",
"systeminformation": "^5.24.0"
}
}