Skip to content

Commit

Permalink
chore: fix knip issues
Browse files Browse the repository at this point in the history
Remove unused dependencies, set public tag for public exports and add
unused files to ignore list.
  • Loading branch information
gitcoindev committed Apr 8, 2024
1 parent 1d891bc commit c276046
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 823 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
node-version: "20.10.0"

- name: Install dependencies
run: yarn i --immutable --immutable-cache --check-cache
run: yarn install --immutable --immutable-cache --check-cache

- name: Generate Permit
run: npx tsx ./src/index.ts
Expand Down
2 changes: 1 addition & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: ["build/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts"],
ignore: ["src/utils/config.ts", "src/utils/helpers.ts", "src/types/github.ts", "src/types/webhook-events.ts"],
ignoreExportsUsedInFile: true,
ignoreDependencies: [],
};
Expand Down
21 changes: 4 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@ubiquibot/permit-generation",
"version": "1.0.0",
"description": "Template repository with TypeScript support.",
"main": "src/worker.ts",
"main": "src/index.ts",
"author": "Ubiquity DAO",
"license": "MIT",
"engines": {
Expand All @@ -26,40 +26,29 @@
"open-source"
],
"dependencies": {
"@octokit/webhooks-types": "^7.3.1",
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@octokit/rest": "^20.0.2",
"@octokit/webhooks": "^13.1.0",
"@supabase/supabase-js": "^2.39.7",
"@sinclair/typebox": "^0.32.5",
"@supabase/supabase-js": "^2.39.7",
"@uniswap/permit2-sdk": "^1.2.0",
"blake2b": "^2.1.4",
"decimal.js": "^10.4.3",
"dotenv": "^16.4.4",
"ethers": "6.11.1",
"libsodium-wrappers": "^0.7.13",
"tweetnacl": "^1.0.3",
"tweetnacl-util": "^0.15.1"
"libsodium-wrappers": "^0.7.13"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240117.0",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@cspell/dict-node": "^4.0.3",
"@cspell/dict-software-terms": "^3.3.18",
"@cspell/dict-typescript": "^3.1.2",
"@octokit/types": "^12.6.0",
"@types/libsodium-wrappers": "^0.7.8",
"@types/jest": "29.5.12",
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"cspell": "^8.4.0",
"esbuild": "^0.20.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-sonarjs": "^0.24.0",
"husky": "^9.0.11",
"jest": "29.7.0",
Expand All @@ -69,10 +58,8 @@
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"ts-jest": "29.1.2",
"ts-node": "10.9.2",
"tsx": "^4.7.1",
"typescript": "^5.3.3",
"wrangler": "^3.23.0"
"typescript": "^5.3.3"
},
"lint-staged": {
"*.ts": [
Expand Down
4 changes: 4 additions & 0 deletions src/adapters/supabase/types/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export type Database = {

type PublicSchema = Database[Extract<keyof Database, "public">];

/** @public */
export type Tables<
PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & PublicSchema["Views"]) | { schema: keyof Database },
TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
Expand All @@ -98,6 +99,7 @@ export type Tables<
: never
: never;

/** @public */
export type TablesInsert<
PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database },
TableName extends PublicTableNameOrOptions extends { schema: keyof Database } ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] : never = never,
Expand All @@ -115,6 +117,7 @@ export type TablesInsert<
: never
: never;

/** @public */
export type TablesUpdate<
PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database },
TableName extends PublicTableNameOrOptions extends { schema: keyof Database } ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] : never = never,
Expand All @@ -132,6 +135,7 @@ export type TablesUpdate<
: never
: never;

/** @public */
export type Enums<
PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] | { schema: keyof Database },
EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] : never = never,
Expand Down
Loading

0 comments on commit c276046

Please sign in to comment.