Skip to content

Commit

Permalink
chore: configured knip
Browse files Browse the repository at this point in the history
  • Loading branch information
ascariandrea committed Dec 1, 2024
1 parent 0a2585a commit 9eb033e
Show file tree
Hide file tree
Showing 26 changed files with 7,328 additions and 11,603 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/root-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Root - Pull Request

on:
pull_request:
branches:
- daily

jobs:
knip-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: ./.github/actions/install-deps
with:
hash: ${{ hashFiles('**/pnpm-lock.yaml') }}

- uses: ./.github/actions/build-packages
with:
hash: ${{ github.sha }}

- name: Post the knip results
# uses: codex-/knip-reporter@v2
run: pnpm knip
69 changes: 69 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"includeEntryExports": true,
"ignoreWorkspaces": [
"services/data"
],
"workspaces": {
".": {
"ignore": ["ecosystem.dev.config.js", "ecosystem.config.js"],
"ignoreBinaries": ["corepack up"],
"ignoreDependencies": ["husky", "is-ci", "pm2", "lint-staged"]
},
"packages/@liexp/*": {
"includeEntryExports": false,
"entry": ["src/**/*.{ts,tsx}"],
"project": ["src/**/*.{ts,tsx}", "lib/**/*.js"]
},
"services/web": {
"entry": ["src/client/index.tsx", "src/server/server.tsx", "src/server/entry.tsx"],
"includeEntryExports": false,
"project": ["src/**/*.{ts,tsx}", "build/**/*.js"],
"ignore": [
"src/client/components/events/AddEventModal.tsx",
"src/client/pages/dashboards/VaccineDashboard.tsx",
"src/client/pages/DocsPage.tsx",
"src/client/templates/PageTemplate.tsx",
"src/client/state/commands.ts"
]
},
"services/admin-web": {
"entry": ["src/index.tsx"],
"includeEntryExports": false,
"project": ["src/**/*.{ts,tsx}", "build/**/*.js"]
},
"services/ai-bot": {
"entry": ["src/run.ts"],
"project": ["src/**/*.{ts,tsx}", "build/**/*.js"],
"ignoreDependencies": [
"@aws-sdk/client-sso-oidc",
"@aws-sdk/client-sts"
]
},
"services/api": {
"entry": [
"src/run.ts",
"src/bin/**/*.ts",
"src/**/*.{spec,e2e}.ts",
"src/worker/index.ts",
"test/AppTest.ts"
],
"project": [
"{src,test}/**/*.ts",
"!src/migrations/*.ts",
"!src/**/*.{spec,e2e}.ts",
"build/**/*.js"
],
"ignore": [
"ormconfig.js",
"test/__mocks__/**/*",
"test/globalSetup.ts"
]
},
"services/storybook": {
"entry": [".storybook/*.{ts,tsx}", "src/stories/**/*.tsx"],
"includeEntryExports": false,
"project": ["src/**/*.{ts,tsx}", "build/**/*.js"]
}
}
}
17 changes: 5 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"web": "pnpm --filter 'web'",
"vitest": "vitest",
"vitest:expected-cov": "vitest run --coverage.enabled --coverage.thresholds.lines=90 --coverage.thresholds.functions=90 --coverage.thresholds.statements=90",
"vitest:cov": "vitest run --coverage.enabled"
"vitest:cov": "vitest run --coverage.enabled",
"knip": "knip"
},
"resolutions": {
"dotenv": "^16.4.5",
Expand All @@ -41,23 +42,15 @@
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"@types/node": "^20.16.11",
"@vitest/coverage-v8": "^2.1.5",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-fp-ts": "^0.3.2",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-n": "^17.14.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.2.1",
"husky": "^9.1.6",
"is-ci": "^3.0.1",
"knip": "^5.37.2",
"lint-staged": "^15.2.10",
"pm2": "^5.4.3",
"prettier": "^3.3.3",
"typescript": "^5.6.2",
"typescript": "^5.6.3",
"typescript-eslint": "^8.16.0",
"vitest": "^2.1.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@liexp/core/src/frontend/vite/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const defineViteConfig = <A extends Record<string, any>>(
[key]: v,
};
}),
config.env.decode,
(env) => fp.E.right(env as A),
(env) => {
if (env._tag === "Left") {
// eslint-disable-next-line
Expand Down
4 changes: 0 additions & 4 deletions packages/@liexp/core/typings/eslint-plugin-react.d.ts

This file was deleted.

13 changes: 4 additions & 9 deletions packages/@liexp/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,26 @@
"@blocknote/server-util": "^0.19.2",
"@liexp/core": "workspace:*",
"axios": "^1.7.8",
"bs58": "^5.0.0",
"date-fns": "^4.1.0",
"domino": "^2.1.6",
"fp-ts": "^2.16.9",
"io-ts": "^2.2.21",
"io-ts-types": "^0.5.19",
"jsonwebtoken": "^9.0.2",
"lodash": "^4.17.21",
"page-metadata-parser": "^1.1.4",
"query-string": "^7.1.3",
"throttle-debounce": "^5.0.0",
"ts-endpoint": "^2.0.0",
"ts-io-error": "^2.0.0",
"typelevel-ts": "^0.4.0",
"uuid": "^11.0.3"
},
"devDependencies": {
"@liexp/test": "workspace:*",
"@types/bs58": "^4.0.4",
"@types/jsonwebtoken": "^9.0.6",
"@types/lodash": "^4.17.13",
"@types/react": "^18.3.8",
"@types/react-dom": "^18.3.1",
"@types/throttle-debounce": "^5.0.2",
"@types/uuid": "^10.0.0",
"@visx/network": "^3.12.0",
"cheerio": "^1.0.0",
"eslint": "^9.16.0",
"pdfjs-dist": "^4.8.69",
"react-admin": "^5.4.0",
"typescript": "^5.6.2",
Expand All @@ -67,7 +62,7 @@
"@visx/network": "^3.12.0",
"debug": "*",
"openai": "^4",
"pdfjs-dist": "^4.2.67",
"pdfjs-dist": "^4",
"react": "^18",
"react-admin": "^5",
"react-dom": "^18",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { fc } from "@liexp/test";
import { type Tag } from "../../io/http/Common/Tag.js";
import { DateArb } from "./Date.arbitrary.js";
import { getRandomInt, name1 } from "./HumanReadableString.arbitrary.js";
import { ColorArb } from "./common/Color.arbitrary.js";
import { UUIDArb } from "./common/UUID.arbitrary.js";

export const TagArb = (): fc.Arbitrary<string> => {
export const TagArb = (): fc.Arbitrary<Tag> => {
const stringArb = fc.convertToNext(fc.string());
return fc.convertFromNext({
...stringArb,
Expand All @@ -29,7 +30,7 @@ export const TagArb = (): fc.Arbitrary<string> => {
);
return v;
},
});
}) as fc.Arbitrary<Tag>;
};

export const CreateKeywordArb = fc.record({
Expand All @@ -38,7 +39,7 @@ export const CreateKeywordArb = fc.record({

export const KeywordArb = fc.record({
id: UUIDArb,
tag: TagArb() as fc.Arbitrary<any>,
tag: TagArb(),
color: ColorArb,
socialPosts: fc.constant([]),
createdAt: DateArb,
Expand Down
5 changes: 2 additions & 3 deletions packages/@liexp/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
"fast-check": "^2.25.0",
"fast-check-io-ts": "^0.5.0",
"fp-ts": "^2.16.9",
"io-ts": "^2.2.21",
"io-ts-types": "^0.5.19"
"io-ts": "^2.2.21"
},
"devDependencies": {
"prettier": "^3.3.3",
"eslint": "^9.16.0",
"typescript": "^5.6.2"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 9eb033e

Please sign in to comment.