Skip to content

Commit ee63f74

Browse files
committed
chore: use knip to ensure repository is 💯
1 parent 2c1e14e commit ee63f74

File tree

11 files changed

+37
-53
lines changed

11 files changed

+37
-53
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- run: pnpm lint
3030
- run: pnpm test:types
3131
- run: pnpm build
32+
- run: pnpm knip
3233
- run: pnpm test:dist
3334
- run: pnpm test:unit
3435
- if: matrix.os != 'windows-latest'

‎knip.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"workspaces": {
4+
".": {
5+
"ignoreDependencies": [
6+
"pkg-pr-new"
7+
]
8+
},
9+
"playground": {
10+
"ignoreDependencies": [
11+
"nuxi",
12+
"nuxt"
13+
]
14+
}
15+
}
16+
}

‎package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
"knip": "^5.41.1",
6363
"listhen": "^1.9.0",
6464
"magicast": "^0.3.5",
65-
"mlly": "^1.7.3",
6665
"nitropack": "npm:nitropack-nightly",
6766
"nypm": "^0.4.1",
6867
"ofetch": "^1.4.1",

‎src/commands/module/_utils.ts‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const categories = [
2424
'UI',
2525
]
2626

27-
export interface NuxtApiModulesResponse {
27+
interface NuxtApiModulesResponse {
2828
version: string
2929
generatedAt: string
3030
stats: Stats
@@ -33,43 +33,42 @@ export interface NuxtApiModulesResponse {
3333
modules: NuxtModule[]
3434
}
3535

36-
export interface Contributor {
36+
interface Contributor {
3737
id: number
3838
username: string
3939
contributions: number
4040
modules: string[]
4141
}
4242

43-
export interface Stats {
43+
interface Stats {
4444
downloads: number
4545
stars: number
4646
maintainers: number
4747
contributors: number
4848
modules: number
4949
}
5050

51-
export interface ModuleCompatibility {
51+
interface ModuleCompatibility {
5252
nuxt: string
5353
requires: { bridge?: boolean | 'optional' }
5454
versionMap: {
5555
[nuxtVersion: string]: string
5656
}
5757
}
5858

59-
export interface MaintainerInfo {
59+
interface MaintainerInfo {
6060
name: string
6161
github: string
6262
twitter?: string
6363
}
6464

65-
export interface GithubContributor {
65+
interface GitHubContributor {
6666
username: string
6767
name?: string
6868
avatar_url?: string
6969
}
7070

71-
export type CompatibilityStatus = 'working' | 'wip' | 'unknown' | 'not-working'
72-
export type ModuleType = 'community' | 'official' | '3rd-party'
71+
type ModuleType = 'community' | 'official' | '3rd-party'
7372

7473
export interface NuxtModule {
7574
name: string
@@ -83,7 +82,7 @@ export interface NuxtModule {
8382
category: (typeof categories)[number]
8483
type: ModuleType
8584
maintainers: MaintainerInfo[]
86-
contributors?: GithubContributor[]
85+
contributors?: GitHubContributor[]
8786
compatibility: ModuleCompatibility
8887
aliases?: string[]
8988
stats: Stats

‎src/commands/module/add.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
} from './_utils'
2222
import type { NuxtModule } from './_utils'
2323

24-
export type RegistryMeta = {
24+
type RegistryMeta = {
2525
registry: string
2626
authToken: string | null
2727
}

‎src/main.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { commands } from './commands'
55
import { setupGlobalConsole } from './utils/console'
66
import { checkEngines } from './utils/engines'
77

8-
// import { checkForUpdates } from './utils/update'
9-
108
export const main = defineCommand({
119
meta: {
1210
name: nuxiPkg.name,
@@ -24,7 +22,6 @@ export const main = defineCommand({
2422
if (command !== '_dev' && provider !== 'stackblitz') {
2523
backgroundTasks = Promise.all([
2624
checkEngines(),
27-
// checkForUpdates(),
2825
]).catch(err => console.error(err))
2926
}
3027

‎src/utils/dev.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface NuxtDevContext {
3131
}
3232
}
3333

34-
export interface NuxtDevServerOptions {
34+
interface NuxtDevServerOptions {
3535
cwd: string
3636
logLevel: 'silent' | 'info' | 'verbose'
3737
dotenv: boolean

‎src/utils/fs.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { join } from 'pathe'
33
import { consola } from 'consola'
44

55
// Check if a file exists
6-
export async function exists(path: string) {
6+
async function exists(path: string) {
77
try {
88
await fsp.access(path)
99
return true

‎src/utils/nuxt.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { hash } from 'ohash'
55
import type { Nuxt } from '@nuxt/schema'
66
import { rmRecursive } from './fs'
77

8-
export interface NuxtProjectManifest {
8+
interface NuxtProjectManifest {
99
_hash: string | null
1010
project: {
1111
rootDir: string
@@ -39,7 +39,7 @@ export function nuxtVersionToGitIdentifier(version: string) {
3939
return `v${version}`
4040
}
4141

42-
export function resolveNuxtManifest(nuxt: Nuxt): NuxtProjectManifest {
42+
function resolveNuxtManifest(nuxt: Nuxt): NuxtProjectManifest {
4343
const manifest: NuxtProjectManifest = {
4444
_hash: null,
4545
project: {

‎src/utils/update.ts‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)