mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Show more plugins when use command list-remote
This commit is contained in:
parent
438c7e6a99
commit
529c17da56
1 changed files with 3 additions and 4 deletions
|
|
@ -13,8 +13,6 @@ import got from 'got';
|
||||||
import ora from 'ora';
|
import ora from 'ora';
|
||||||
import * as api from './api';
|
import * as api from './api';
|
||||||
|
|
||||||
const PLUGIN_PREFIX = 'hyper-';
|
|
||||||
|
|
||||||
let commandPromise: Promise<void>;
|
let commandPromise: Promise<void>;
|
||||||
|
|
||||||
const assertPluginName = (pluginName: string) => {
|
const assertPluginName = (pluginName: string) => {
|
||||||
|
|
@ -83,11 +81,12 @@ args.command(
|
||||||
|
|
||||||
const lsRemote = (pattern?: string) => {
|
const lsRemote = (pattern?: string) => {
|
||||||
// note that no errors are catched by this function
|
// note that no errors are catched by this function
|
||||||
const URL = `https://api.npms.io/v2/search?q=${(pattern && `${pattern}+`) || ''}keywords:hyper-plugin,hyper-theme`;
|
const URL = `https://api.npms.io/v2/search?q=${
|
||||||
|
(pattern && `${pattern}+`) || ''
|
||||||
|
}keywords:hyper-plugin,hyper-theme&size=250`;
|
||||||
return got(URL)
|
return got(URL)
|
||||||
.then((response) => JSON.parse(response.body).results as any[])
|
.then((response) => JSON.parse(response.body).results as any[])
|
||||||
.then((entries) => entries.map((entry) => entry.package))
|
.then((entries) => entries.map((entry) => entry.package))
|
||||||
.then((entries) => entries.filter((entry) => entry.name.indexOf(PLUGIN_PREFIX) === 0))
|
|
||||||
.then((entries) =>
|
.then((entries) =>
|
||||||
entries.map(({name, description}) => {
|
entries.map(({name, description}) => {
|
||||||
return {name, description};
|
return {name, description};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue