Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧑‍💻(chore) migrate hub scope to knip #8220

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-desktop-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
name: lint-desktop
path: ${{ github.workspace }}/apps/ledger-live-desktop/lint-desktop.json
- name: check for dead code
run: pnpm desktop unimported
run: pnpm desktop knip-check
shell: bash

unit-tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-mobile-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Run linter
run: pnpm lint --filter="live-mobile" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo" -- --format="json" -o="lint-mobile.json"
- name: check for dead code
run: pnpm mobile unimported
run: pnpm mobile knip-check
shell: bash
- name: Run code checkers
run: pnpm typecheck --filter="live-mobile" --api="http://127.0.0.1:${{ steps.toolchain.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"
Expand Down
10 changes: 3 additions & 7 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ libs/live-nft-react/ @ledgerhq/live-hub
libs/live-nft/ @ledgerhq/live-hub
libs/promise/ @ledgerhq/live-hub
libs/ui/ @ledgerhq/live-hub
libs/live-hooks/ @ledgerhq/live-hub
LucasWerey marked this conversation as resolved.
Show resolved Hide resolved
libs/live-countervalues/ @ledgerhq/live-hub
libs/live-countervalues-react/ @ledgerhq/live-hub
libs/live-nft/ @ledgerhq/live-hub
libs/live-nft-react/ @ledgerhq/live-hub
libs/live-wallet/ @ledgerhq/live-hub
libs/trustchain/ @ledgerhq/live-hub
libs/hw-trustchain/ @ledgerhq/live-hub
libs/ledger-key-ring-protocol/ @ledgerhq/live-hub
libs/hw-ledger-key-ring-protocol/ @ledgerhq/live-hub

# Blockchain team
.github/**/bot-*.yml @ledgerhq/live-blockchain-support
Expand Down Expand Up @@ -77,6 +72,7 @@ libs/ledger-live-common/src/exchange/ @ledgerhq/p
libs/exchange-module/ @ledgerhq/ptx
libs/wallet-api-acre-module/ @ledgerhq/ptx
libs/ledgerjs/packages/hw-app-exchange/ @ledgerhq/ptx

# Wallet API team
**/PlatformAppProviderWrapper.tsx @ledgerhq/wallet-api
**/Web3AppWebview/ @ledgerhq/wallet-api
Expand Down
39 changes: 0 additions & 39 deletions apps/ledger-live-desktop/.unimportedrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"test:playwright:clean": "git clean -fdX tests/artifacts",
"typecheck": "node scripts/typecheck.js",
"check": "pnpm lint; pnpm typecheck",
"unimported": "unimported",
"assets:replace": "zx ./scripts/replace-assets.mjs"
"assets:replace": "zx ./scripts/replace-assets.mjs",
"knip-check": "pnpm knip --directory ../.. -W apps/ledger-live-desktop"
},
"dependencies": {
"@braze/web-sdk": "4.10.2",
Expand Down
45 changes: 0 additions & 45 deletions apps/ledger-live-mobile/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"download-hermes-profile": "zx ./scripts/download-hermes-profile.mjs",
"e2e:loadConfig": "ts-node ./e2e/bridge/start-server.ts",
"check": "pnpm lint; pnpm typecheck",
"unimported": "unimported",
"knip-check": "pnpm knip --directory ../.. -W apps/ledger-live-mobile",
"assets:replace": "zx ./scripts/replace-assets.mjs"
},
"dependencies": {
Expand Down
112 changes: 112 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"rules": {
"binaries": "off",
"classMembers": "off",
"dependencies": "error",
"devDependencies": "off",
"optionalPeerDependencies": "off",
"duplicates": "warn",
"enumMembers": "warn",
"exports": "warn",
"files": "error",
"nsExports": "off",
"nsTypes": "off",
"types": "warn",
"unlisted": "off",
"unresolved": "off"
},
"ignoreExportsUsedInFile": true,
"project": ["src/**"],

"ignore": [
"**/__integrations__/*",
"**/*.test.*",
"**/*.spec.*",
"**/tests/**",
"**/__test__/**",
"**/__tests__/**",
"**/__mocks__/**",
"**/e2e/**",
"**/*.config.*",
"**/scripts/**",
"**/tools/**"
],

"workspaces": {
"./apps/ledger-live-desktop": {
"entry": [
"src/index.ts",
"src/renderer/index.ts",
"src/preloader/index.ts",
"src/renderer/webworkers/workers/*.ts",
"src/webviewPreloader/dappPreloader.ts",
"src/webviewPreloader/index.ts"
],
"ignore": ["src/newArch/features/Collectibles/**", "**/types.*"],
"ignoreBinaries": ["eslint", "knip", "prettier", "zx", "lint"],
"ignoreDependencies": ["prop-types", "allure-commandline", "msw"]
},
"./apps/ledger-live-mobile": {
"entry": ["index.js", "src/families/**"],
"ignore": ["src/**/*.android.*", "src/**/*.ios.*", "src/logic/keyboardVisible.ts"],
"ignoreDependencies": [
"@react-native-masked-view/masked-view",
"@react-native/gradle-plugin",
"@react-native/metro-config",
"asyncstorage-down",
"buffer",
"expo-crypto",
"expo-file-system",
"expo-image-loader",
"expo-modules-autolinking",
"expo-modules-core",
"prop-types",
"react-native-fast-pbkdf2",
"react-native-level-fs",
"react-native-navigation-bar-color",
"react-native-randombytes",
"react-native-tcp-socket",
"react-native-udp"
]
},
"./libs/live-nft-react": {
"entry": ["src/index.ts", "src/tools/*", "src/hooks/*"]
},
"./libs/live-nft": {
"entry": ["src/api/index.ts", "src/index.ts", "src/index.test.ts", "src/types.ts"]
},
"./libs/env": {
"entry": ["src/index.ts"]
},
"./libs/live-hooks": {
"entry": ["src/useDebounce.ts", "src/useThrottledFunction.ts"]
},
"./libs/live-countervalues": {
"entry": ["src/logic.ts", "src/api/index.ts", "src/types.ts", "src/portfolio.ts"]
},
"./libs/live-countervalues-react": {
"entry": ["src/index.tsx", "src/portfolio.tsx"]
},
"./libs/live-wallet": {
"entry": [
"src/walletsync/index.ts",
"src/cloudsync/index.ts",
"src/liveqr/cross.ts",
"src/liveqr/importAccounts.ts",
"src/ordering.ts",
"src/addAccounts.ts",
"src/store.ts",
"src/accountName.ts"
]
},
"./libs/ledger-key-ring-protocol": {
"entry": ["src/index.ts", "src/store.ts", "src/qrcode/index.ts"]
},
"./libs/hw-ledger-key-ring-protocol": {
"entry": ["src/index.ts"],
"ignoreDependencies": ["@ledgerhq/logs", "@ledgerhq/live-env"]
},
"./libs/promise": { "entry": ["src/index.ts"] }
}
}
5 changes: 0 additions & 5 deletions libs/env/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported"
"unimported": "pnpm knip --directory ../.. -W libs/env"
}
}
4 changes: 0 additions & 4 deletions libs/hw-ledger-key-ring-protocol/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/hw-ledger-key-ring-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported",
"unimported": "pnpm knip --directory ../.. -W libs/hw-ledger-key-ring-protocol",
"test": "jest"
},
"typesVersions": {
Expand Down
16 changes: 0 additions & 16 deletions libs/ledger-key-ring-protocol/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/ledger-key-ring-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported",
"unimported": "pnpm knip --directory ../.. -W libs/ledger-key-ring-protocol",
"test": "jest",
"e2e": "ts-node scripts/e2e.ts"
}
Expand Down
4 changes: 0 additions & 4 deletions libs/live-countervalues-react/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/live-countervalues-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported",
"unimported": "pnpm knip --directory ../.. -W libs/live-countervalues-react",
"test": "jest"
},
"typesVersions": {
Expand Down
4 changes: 0 additions & 4 deletions libs/live-countervalues/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/live-countervalues/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported",
"unimported": "pnpm knip --directory ../.. -W libs/live-countervalues",
"test": "jest"
},
"typesVersions": {
Expand Down
5 changes: 0 additions & 5 deletions libs/live-hooks/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/live-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported",
"unimported": "pnpm knip --directory ../.. -W libs/live-hooks",
"test": "jest"
},
"typesVersions": {
Expand Down
4 changes: 0 additions & 4 deletions libs/live-nft-react/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/live-nft-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported",
"unimported": "pnpm knip --directory ../.. -W libs/live-nft-react",
"test": "jest"
},
"typesVersions": {
Expand Down
4 changes: 0 additions & 4 deletions libs/live-nft/.unimportedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion libs/live-nft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
"lint:fix": "pnpm lint --fix",
"typecheck": "tsc --noEmit",
"unimported": "unimported",
"unimported": "pnpm knip --directory ../.. -W libs/live-nft",
"test": "jest"
},
"typesVersions": {
Expand Down
Loading
Loading