-
Notifications
You must be signed in to change notification settings - Fork 3
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
2 changed files
with
118 additions
and
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,127 @@ | ||
export interface Person { | ||
name: string; | ||
url?: string; | ||
email?: string; | ||
name: string | ||
url?: string | ||
email?: string | ||
} | ||
|
||
export interface Translation { | ||
id: string; | ||
path: string; | ||
id: string | ||
path: string | ||
} | ||
|
||
export interface Localization { | ||
languageId: string; | ||
languageName?: string; | ||
localizedLanguageName?: string; | ||
translations: Translation[]; | ||
languageId: string | ||
languageName?: string | ||
localizedLanguageName?: string | ||
translations: Translation[] | ||
} | ||
|
||
export interface Language { | ||
readonly id: string; | ||
readonly aliases?: string[]; | ||
readonly extensions?: string[]; | ||
readonly id: string | ||
readonly aliases?: string[] | ||
readonly extensions?: string[] | ||
} | ||
|
||
export interface Grammar { | ||
readonly language: string; | ||
readonly scopeName: string; | ||
readonly path: string; | ||
readonly language: string | ||
readonly scopeName: string | ||
readonly path: string | ||
} | ||
|
||
export interface Command { | ||
readonly command: string; | ||
readonly title: string; | ||
readonly command: string | ||
readonly title: string | ||
} | ||
|
||
export interface Authentication { | ||
readonly id: string; | ||
readonly label: string; | ||
readonly id: string | ||
readonly label: string | ||
} | ||
|
||
export interface CustomEditor { | ||
readonly viewType: string; | ||
readonly priority: string; | ||
readonly selector: readonly { | ||
readonly filenamePattern?: string; | ||
}[]; | ||
readonly viewType: string | ||
readonly priority: string | ||
readonly selector: readonly { | ||
readonly filenamePattern?: string | ||
}[] | ||
} | ||
|
||
export interface View { | ||
readonly id: string; | ||
readonly name: string; | ||
readonly id: string | ||
readonly name: string | ||
} | ||
|
||
export interface Contributions { | ||
readonly localizations?: Localization[]; | ||
readonly languages?: Language[]; | ||
readonly grammars?: Grammar[]; | ||
readonly commands?: Command[]; | ||
readonly authentication?: Authentication[]; | ||
readonly customEditors?: CustomEditor[]; | ||
readonly views?: { [location: string]: View[] }; | ||
readonly [contributionType: string]: any; | ||
readonly localizations?: Localization[] | ||
readonly languages?: Language[] | ||
readonly grammars?: Grammar[] | ||
readonly commands?: Command[] | ||
readonly authentication?: Authentication[] | ||
readonly customEditors?: CustomEditor[] | ||
readonly views?: { [location: string]: View[] } | ||
readonly [contributionType: string]: any | ||
} | ||
|
||
export type ExtensionKind = 'ui' | 'workspace' | 'web'; | ||
export type ExtensionKind = 'ui' | 'workspace' | 'web' | ||
|
||
export interface Manifest { | ||
// mandatory (npm) | ||
name: string; | ||
version: string; | ||
engines: { [name: string]: string }; | ||
// mandatory (npm) | ||
name: string | ||
version: string | ||
engines: { [name: string]: string } | ||
|
||
// vscode | ||
publisher: string; | ||
icon?: string; | ||
contributes?: Contributions; | ||
activationEvents?: string[]; | ||
extensionDependencies?: string[]; | ||
extensionPack?: string[]; | ||
galleryBanner?: { color?: string; theme?: string }; | ||
preview?: boolean; | ||
badges?: { url: string; href: string; description: string }[]; | ||
markdown?: 'github' | 'standard'; | ||
_bundling?: { [name: string]: string }[]; | ||
_testing?: string; | ||
enableProposedApi?: boolean; | ||
enabledApiProposals?: readonly string[]; | ||
qna?: 'marketplace' | string | false; | ||
extensionKind?: ExtensionKind | ExtensionKind[]; | ||
sponsor?: { url: string }; | ||
// vscode | ||
publisher: string | ||
icon?: string | ||
contributes?: Contributions | ||
activationEvents?: string[] | ||
extensionDependencies?: string[] | ||
extensionPack?: string[] | ||
galleryBanner?: { color?: string; theme?: string } | ||
preview?: boolean | ||
badges?: { url: string; href: string; description: string }[] | ||
markdown?: 'github' | 'standard' | ||
_bundling?: { [name: string]: string }[] | ||
_testing?: string | ||
enableProposedApi?: boolean | ||
enabledApiProposals?: readonly string[] | ||
qna?: 'marketplace' | string | false | ||
extensionKind?: ExtensionKind | ExtensionKind[] | ||
sponsor?: { url: string } | ||
|
||
// optional (npm) | ||
author?: string | Person; | ||
displayName?: string; | ||
description?: string; | ||
keywords?: string[]; | ||
categories?: string[]; | ||
homepage?: string; | ||
bugs?: string | { url?: string; email?: string }; | ||
license?: string; | ||
contributors?: string | Person[]; | ||
main?: string; | ||
browser?: string; | ||
repository?: string | { type?: string; url?: string }; | ||
scripts?: { [name: string]: string }; | ||
dependencies?: { [name: string]: string }; | ||
devDependencies?: { [name: string]: string }; | ||
private?: boolean; | ||
pricing?: string; | ||
// optional (npm) | ||
author?: string | Person | ||
displayName?: string | ||
description?: string | ||
keywords?: string[] | ||
categories?: string[] | ||
homepage?: string | ||
bugs?: string | { url?: string; email?: string } | ||
license?: string | ||
contributors?: string | Person[] | ||
main?: string | ||
browser?: string | ||
repository?: string | { type?: string; url?: string } | ||
scripts?: { [name: string]: string } | ||
dependencies?: { [name: string]: string } | ||
devDependencies?: { [name: string]: string } | ||
private?: boolean | ||
pricing?: string | ||
|
||
// vsce | ||
vsce?: any; | ||
// vsce | ||
vsce?: any | ||
|
||
// not supported (npm) | ||
// files?: string[]; | ||
// bin | ||
// man | ||
// directories | ||
// config | ||
// peerDependencies | ||
// bundledDependencies | ||
// optionalDependencies | ||
// os?: string[]; | ||
// cpu?: string[]; | ||
// preferGlobal | ||
// publishConfig | ||
// not supported (npm) | ||
// files?: string[]; | ||
// bin | ||
// man | ||
// directories | ||
// config | ||
// peerDependencies | ||
// bundledDependencies | ||
// optionalDependencies | ||
// os?: string[]; | ||
// cpu?: string[]; | ||
// preferGlobal | ||
// publishConfig | ||
} |
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,36 +1,36 @@ | ||
import { promisify } from 'util'; | ||
import { parseString } from 'xml2js'; | ||
import { promisify } from 'util' | ||
import { parseString } from 'xml2js' | ||
|
||
function createXMLParser<T>(): (raw: string) => Promise<T> { | ||
return promisify<string, T>(parseString); | ||
return promisify<string, T>(parseString) | ||
} | ||
|
||
export type XMLManifest = { | ||
PackageManifest: { | ||
$: { Version: string; xmlns: string; 'xmlns:d': string }; | ||
Metadata: { | ||
Description: { _: string }[]; | ||
DisplayName: string[]; | ||
Identity: { $: { Id: string; Version: string; Publisher: string; TargetPlatform?: string } }[]; | ||
Tags: string[]; | ||
GalleryFlags: string[]; | ||
License: string[]; | ||
Icon: string[]; | ||
Properties: { Property: { $: { Id: string; Value: string } }[] }[]; | ||
Categories: string[]; | ||
Badges: { Badge: { $: { Link: string; ImgUri: string; Description: string } }[] }[]; | ||
}[]; | ||
Installation: { InstallationTarget: { $: { Id: string } }[] }[]; | ||
Dependencies: string[]; | ||
Assets: { Asset: { $: { Type: string; Path: string } }[] }[]; | ||
}; | ||
}; | ||
PackageManifest: { | ||
$: { Version: string; xmlns: string; 'xmlns:d': string } | ||
Metadata: { | ||
Description: { _: string }[] | ||
DisplayName: string[] | ||
Identity: { $: { Id: string; Version: string; Publisher: string; TargetPlatform?: string } }[] | ||
Tags: string[] | ||
GalleryFlags: string[] | ||
License: string[] | ||
Icon: string[] | ||
Properties: { Property: { $: { Id: string; Value: string } }[] }[] | ||
Categories: string[] | ||
Badges: { Badge: { $: { Link: string; ImgUri: string; Description: string } }[] }[] | ||
}[] | ||
Installation: { InstallationTarget: { $: { Id: string } }[] }[] | ||
Dependencies: string[] | ||
Assets: { Asset: { $: { Type: string; Path: string } }[] }[] | ||
} | ||
} | ||
|
||
export type ContentTypes = { | ||
Types: { | ||
Default: { $: { Extension: string; ContentType: string } }[]; | ||
}; | ||
}; | ||
Types: { | ||
Default: { $: { Extension: string; ContentType: string } }[] | ||
} | ||
} | ||
|
||
export const parseXmlManifest = createXMLParser<XMLManifest>(); | ||
export const parseContentTypes = createXMLParser<ContentTypes>(); | ||
export const parseXmlManifest = createXMLParser<XMLManifest>() | ||
export const parseContentTypes = createXMLParser<ContentTypes>() |