diff --git a/src/manifest.ts b/src/manifest.ts index d7608915..35827065 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -79,6 +79,7 @@ export interface Manifest { dependencies?: { [name: string]: string }; devDependencies?: { [name: string]: string }; private?: boolean; + pricing?: string; // vsce vsce?: any; diff --git a/src/package.ts b/src/package.ts index 9faf7a10..d8a1f3b9 100644 --- a/src/package.ts +++ b/src/package.ts @@ -172,6 +172,7 @@ export interface VSIX { localizedLanguages: string; preRelease: boolean; sponsorLink: string; + pricing: string; } export class BaseProcessor implements IProcessor { @@ -475,6 +476,7 @@ export class ManifestProcessor extends BaseProcessor { target, engine: manifest.engines['vscode'], description: manifest.description ?? '', + pricing: manifest.pricing ?? 'Free', categories: (manifest.categories ?? []).join(','), flags: flags.join(' '), links: { @@ -1191,6 +1193,10 @@ export function validateManifest(manifest: Manifest): Manifest { throw new Error('Manifest missing field: version'); } + if (manifest.pricing && !['Free', 'Trial'].includes(manifest.pricing)) { + throw new Error('Pricing should be Free or Trial'); + } + validateVersion(manifest.version); if (!manifest.engines) { @@ -1404,6 +1410,8 @@ export async function toVsixManifest(vsix: VSIX): Promise { : '' } + + ${ vsix.enableMarketplaceQnA !== undefined ? `