This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
99 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,61 @@ | ||
import {Package} from 'read-pkg' | ||
|
||
export interface PJSON extends Package { | ||
name: string | ||
version: string | ||
export interface PJSON { | ||
dependencies?: {[name: string]: string} | ||
anycli: { | ||
schema?: number | ||
bin?: string | ||
npmRegistry?: string | ||
pluginScope?: string | ||
dirname?: string | ||
commands?: string | ||
hooks?: { [name: string]: string[] } | ||
plugins?: (string | PJSON.Plugin)[] | ||
devPlugins?: (string | PJSON.Plugin)[] | ||
title?: string | ||
description?: string | ||
topics?: { | ||
[k: string]: { | ||
description?: string | ||
subtopics?: PJSON['anycli']['topics'] | ||
hidden?: boolean | ||
} | ||
} | ||
} | ||
} | ||
|
||
export namespace PJSON { | ||
export type Plugin = User | Link | ||
export interface User { | ||
type: 'user', | ||
name: string, | ||
tag?: string, | ||
} | ||
export interface Link { | ||
type: 'link' | ||
export interface Plugin extends PJSON, Package { | ||
name: string | ||
root: string | ||
version: string | ||
anycli: PJSON['anycli'] & { | ||
schema?: number | ||
title?: string | ||
description?: string | ||
hooks?: { [name: string]: (string | string[]) } | ||
commands?: string | ||
plugins?: string[] | ||
devPlugins?: string[] | ||
topics?: { | ||
[k: string]: { | ||
description?: string | ||
subtopics?: Plugin['anycli']['topics'] | ||
hidden?: boolean | ||
} | ||
} | ||
} | ||
} | ||
|
||
export interface CLI extends Plugin { | ||
anycli: Plugin['anycli'] & { | ||
schema?: number | ||
bin?: string | ||
npmRegistry?: string | ||
pluginScope?: string | ||
dirname?: string | ||
} | ||
} | ||
|
||
export interface User extends PJSON { | ||
private?: boolean | ||
anycli: PJSON['anycli'] & { | ||
plugins?: (string | PluginTypes.User | PluginTypes.Link)[] } | ||
} | ||
|
||
export type PluginTypes = PluginTypes.User | PluginTypes.Link | ||
export namespace PluginTypes { | ||
export interface User { | ||
type: 'user', | ||
name: string, | ||
tag?: string, | ||
} | ||
export interface Link { | ||
type: 'link' | ||
name: string | ||
root: string | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters