Skip to content

Commit 820a46b

Browse files
committed
feat: remove taze usage command, use node-modules-inspector instead
1 parent d8fa57f commit 820a46b

File tree

6 files changed

+4
-163
lines changed

6 files changed

+4
-163
lines changed

src/api/usage.ts

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

src/cli.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { hideBin } from 'yargs/helpers'
88
import pkgJson from '../package.json'
99
import { check } from './commands/check'
1010
import { checkGlobal } from './commands/check/checkGlobal'
11-
import { usage } from './commands/usage'
1211
import { resolveConfig } from './config'
1312
import { LOG_LEVELS, MODE_CHOICES } from './constants'
1413
import { SORT_CHOICES } from './utils/sort'
@@ -69,21 +68,6 @@ function commonOptions(args: Argv<object>): Argv<CommonOptions> {
6968
yargs(hideBin(process.argv))
7069
.scriptName('taze')
7170
.usage('$0 [args]')
72-
.command(
73-
'usage',
74-
'List dependencies versions usage across packages',
75-
(args) => {
76-
return commonOptions(args)
77-
.option('detail', {
78-
alias: 'a',
79-
type: 'boolean',
80-
describe: 'show more info',
81-
})
82-
.help()
83-
.demandOption('recursive', c.yellow('Please add -r to analysis usages'))
84-
},
85-
async args => usage(await resolveConfig({ ...args, recursive: true })),
86-
)
8771
.command(
8872
'* [mode]',
8973
'Keeps your deps fresh',

src/commands/usage.ts

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

src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import process from 'node:process'
33
import _debug from 'debug'
44
import deepmerge from 'deepmerge'
55
import { createConfigLoader } from 'unconfig'
6-
import { DEFAULT_CHECK_OPTIONS, DEFAULT_USAGE_OPTIONS } from './constants'
6+
import { DEFAULT_CHECK_OPTIONS } from './constants'
77
import { toArray } from './utils/toArray'
88

99
const debug = _debug('taze:config')
@@ -24,9 +24,9 @@ function normalizeConfig<T extends CommonOptions>(options: T) {
2424
}
2525

2626
export async function resolveConfig<T extends CommonOptions>(
27-
options: T & { _?: (string | number)[] },
27+
options: T,
2828
): Promise<T> {
29-
const defaults = options?._?.[0] === 'usage' ? DEFAULT_USAGE_OPTIONS : DEFAULT_CHECK_OPTIONS
29+
const defaults = DEFAULT_CHECK_OPTIONS
3030
options = normalizeConfig(options)
3131

3232
const loader = createConfigLoader<CommonOptions>({

src/constants.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CheckOptions, CommonOptions, UsageOptions } from './types'
1+
import type { CheckOptions, CommonOptions } from './types'
22

33
export const LOG_LEVELS = ['debug', 'info', 'warn', 'error', 'silent'] as const
44

@@ -26,12 +26,6 @@ export const DEFAULT_COMMON_OPTIONS: CommonOptions = {
2626
depFields: {},
2727
}
2828

29-
export const DEFAULT_USAGE_OPTIONS: UsageOptions = {
30-
...DEFAULT_COMMON_OPTIONS,
31-
detail: false,
32-
recursive: true,
33-
}
34-
3529
export const DEFAULT_CHECK_OPTIONS: CheckOptions = {
3630
...DEFAULT_COMMON_OPTIONS,
3731
mode: 'default',

src/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ export interface CommonOptions {
9090
addons?: Addon[]
9191
}
9292

93-
export interface UsageOptions extends CommonOptions {
94-
detail?: boolean
95-
recursive?: true
96-
}
97-
9893
export type DepFieldOptions = Partial<Record<DepType, boolean>>
9994

10095
export interface CheckOptions extends CommonOptions {

0 commit comments

Comments
 (0)