Skip to content

Build json schema #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 74 additions & 8 deletions app/exec/extension/_lib/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@ export interface AssetDeclaration {
/**
* Describes a screenshot in the manifest
*/
export interface ScreenshotDeclaration extends AssetDeclaration {

}
export interface ScreenshotDeclaration extends AssetDeclaration { }

/**
* Describes a details file in the manifest
*/
export interface DetailsDeclaration extends AssetDeclaration {

export interface DetailsDeclaration extends AssetDeclaration { }
export interface ContentDeclaration extends AssetDeclaration { }
export interface ContentsDeclaration {
[key: string]: ContentDeclaration;
}

/**
* Describes a link in the manifest
*/
export interface LinkDeclaration {
url: string;
url?: string;
uri?: string;
}

/**
Expand All @@ -112,6 +112,30 @@ export interface TargetDeclaration {
version?: string;
}

export interface ContributionDeclaration {
id: string;
}

export interface ContributionTypeDeclaration {
id: string;
}

export interface BadgeDeclaration {
link?: string;
imgUri?: string;
description?: string;
href?: string;
uri?: string
}

export interface RepositoryDeclaration {
type: RepositoryType;
url?: string;
uri?: string;
}

export type RepositoryType = 'git';

/**
* Describes the extension's branding in the manifest.
*/
Expand All @@ -120,6 +144,48 @@ export interface BrandingDeclaration {
theme: string;
}

export interface VssManifest {
manifestVersion: string | number;
manifestversion: VssManifest['manifestVersion'];
targets: TargetDeclaration[];
version: string;
files: FileDeclaration[];
icons: { [key: string]: string };
eventcallbacks: {};
scopes: string[];
baseuri: string;
contributions: ContributionDeclaration[];
contributionTypes: ContributionTypeDeclaration[];
contributiontypes: VssManifest['contributionTypes'];
namespace: string;
extensionid: string;
id: string;
name: string;
description: string;
screenshots: ScreenshotDeclaration[];
details: DetailsDeclaration;
links: Links;
branding: BrandingDeclaration;
public: boolean;
publisher: string;
releasenotes: string;
tags: string|string[];
flags: {};
vsoflags: {};
galleryflags: string|string[];
categories: string|string[];
githubflavoredmarkdown: boolean;
showpricingcalculator: boolean;
content: ContentsDeclaration;
repository: RepositoryDeclaration;
badges: BadgeDeclaration[];
}


export interface VssManifestData extends VssManifest {
__origin: string;
}

/**
* Settings for doing the merging
*/
Expand All @@ -142,7 +208,7 @@ export interface MergeSettings {
/**
* Highest priority partial manifest
*/
overrides: any;
overrides: VssManifestData;

/**
* True to bypass validation during packaging.
Expand Down
1 change: 1 addition & 0 deletions app/exec/extension/_lib/vsix-manifest-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ export class VsixManifestBuilder extends ManifestBuilder {
throw "Value for gitHubFlavoredMarkdown is invalid. Only boolean values are allowed.";
}
this.addProperty("Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown", value.toString());
break;
case "public":
if (typeof value === "boolean") {
let flags = _.get(this.data, "PackageManifest.Metadata[0].GalleryFlags[0]", "").split(" ");
Expand Down
Loading