Skip to content

Commit 91b7641

Browse files
committed
fix: add module analysis tool link, remove legacy template entry code
1 parent c52f366 commit 91b7641

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export enum ENTRY_OPTION {
99
VISIT_REPO = 'Visit GitHub repository',
1010
VISIT_DIRECTORY = 'Visit React Native Directory page',
1111
VISIT_NPM = 'Visit npm registry entry',
12+
VIEW_MODULES_INSPECTOR = 'View Node Modules Inspector analysis',
1213
VIEW_BUNDLEPHOBIA = 'View BundlePhobia analysis',
1314
VIEW_LICENSE = 'View license details',
1415
VIEW_DEPENDENCIES = 'View dependencies',

src/createSearchQuickPickHandler.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,9 @@ export function createSearchQuickPickHandler(preferredManager: string, workspace
103103
`$(eye) ${numberFormatter.format(selectedEntry.github.stats.subscribers)}`,
104104
].join(' '),
105105
},
106-
!selectedEntry.template && {
106+
selectedEntry.npm?.downloads && {
107107
label: ENTRY_OPTION.VISIT_NPM,
108-
description: selectedEntry.npm?.downloads
109-
? `$(arrow-circle-down) ${numberFormatter.format(selectedEntry.npm.downloads)}`
110-
: '',
108+
description: `$(arrow-circle-down) ${numberFormatter.format(selectedEntry.npm.downloads)}`,
111109
},
112110
{ label: ENTRY_OPTION.VISIT_DIRECTORY },
113111
selectedEntry.github.urls.homepage && {
@@ -122,7 +120,8 @@ export function createSearchQuickPickHandler(preferredManager: string, workspace
122120
label: ENTRY_OPTION.VIEW_DEPENDENCIES,
123121
description: `$(package) ${numberFormatter.format(selectedEntry.github.stats.dependencies)} ${pluralize('dependency', selectedEntry.github.stats.dependencies)}`,
124122
},
125-
!selectedEntry.template && { label: ENTRY_OPTION.VIEW_BUNDLEPHOBIA },
123+
{ label: ENTRY_OPTION.VIEW_MODULES_INSPECTOR },
124+
{ label: ENTRY_OPTION.VIEW_BUNDLEPHOBIA },
126125
selectedEntry.nightlyProgram && { label: ENTRY_OPTION.VIEW_NIGHTLY_RESULTS },
127126
{ label: 'details', kind: QuickPickItemKind.Separator },
128127
{
@@ -143,10 +142,10 @@ export function createSearchQuickPickHandler(preferredManager: string, workspace
143142
},
144143
...examplesActions,
145144
{ label: 'copy data', kind: QuickPickItemKind.Separator },
146-
!selectedEntry.template && { label: ENTRY_OPTION.COPY_NAME },
145+
{ label: ENTRY_OPTION.COPY_NAME },
147146
{ label: ENTRY_OPTION.COPY_REPO_URL },
148-
!selectedEntry.template && { label: ENTRY_OPTION.COPY_NPM_URL },
149-
!selectedEntry.template && { label: ENTRY_OPTION.COPY_DIRECTORY_URL },
147+
{ label: ENTRY_OPTION.COPY_NPM_URL },
148+
{ label: ENTRY_OPTION.COPY_DIRECTORY_URL },
150149
{ label: '', kind: QuickPickItemKind.Separator },
151150
{ label: ENTRY_OPTION.GO_BACK },
152151
].filter(option => !!option && typeof option === 'object');
@@ -279,6 +278,10 @@ export function createSearchQuickPickHandler(preferredManager: string, workspace
279278
env.openExternal(Uri.parse(selectedEntry.github.license.url));
280279
break;
281280
}
281+
case ENTRY_OPTION.VIEW_MODULES_INSPECTOR: {
282+
env.openExternal(Uri.parse(`https://node-modules.dev/grid/depth#install=${selectedEntry.npmPkg}`));
283+
break;
284+
}
282285
case ENTRY_OPTION.VIEW_BUNDLEPHOBIA: {
283286
env.openExternal(Uri.parse(`https://bundlephobia.com/package/${selectedEntry.npmPkg}`));
284287
break;

src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export type PackageData = {
2525
vegaos?: boolean | string;
2626
unmaintained?: boolean;
2727
dev?: boolean;
28-
template?: boolean;
2928
newArchitecture?: boolean | 'new-arch-only';
3029
newArchitectureNote?: string;
3130
configPlugin?: boolean | string;

src/utils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ export function getDetailLabel(item: PackageData, skipPlatforms = false): string
1111
`$(star) ${numberFormatter.format(item.github.stats.stars)}`,
1212
`$(gist-fork) ${numberFormatter.format(item.github.stats.forks)}`,
1313
item.npm?.downloads && `$(arrow-circle-down) ${numberFormatter.format(item.npm.downloads)}`,
14-
(item.dev ?? item.template) && '•',
14+
item.dev && '•',
1515
item.dev && '$(tools) Dev Tool',
16-
item.template && '$(folder-library) Template',
1716
!skipPlatforms && platforms.length && '•',
1817
!skipPlatforms && platforms.join(', '),
1918
(item.newArchitecture ?? item.expoGo) && '•',
@@ -138,9 +137,7 @@ export async function openListWithSearch(
138137
}
139138

140139
export function getEntryTypeLabel(entry: DirectoryEntry): string {
141-
if (entry.template) {
142-
return ' template';
143-
} else if (entry.dev) {
140+
if (entry.dev) {
144141
return ' development tool';
145142
}
146143
return 'library';

0 commit comments

Comments
 (0)