in src/package.ts [436:496]
bugs: getBugsUrl(manifest, gitHost),
homepage: getHomepageUrl(manifest, gitHost),
},
galleryBanner: manifest.galleryBanner ?? {},
badges: manifest.badges,
githubMarkdown: manifest.markdown !== 'standard',
enableMarketplaceQnA,
customerQnALink,
extensionDependencies: [...new Set(manifest.extensionDependencies ?? [])].join(','),
extensionPack: [...new Set(manifest.extensionPack ?? [])].join(','),
extensionKind: extensionKind.join(','),
localizedLanguages:
manifest.contributes && manifest.contributes.localizations
? manifest.contributes.localizations
.map(loc => loc.localizedLanguageName ?? loc.languageName ?? loc.languageId)
.join(',')
: '',
preRelease: !!this.options.preRelease,
};
if (isGitHub) {
this.vsix.links.github = repository;
}
}
async onFile(file: IFile): Promise<IFile> {
const path = util.normalize(file.path);
if (!/^extension\/package.json$/i.test(path)) {
return Promise.resolve(file);
}
if (this.options.version && !(this.options.updatePackageJson ?? true)) {
const contents = await read(file);
const packageJson = JSON.parse(contents);
packageJson.version = this.options.version;
file = { ...file, contents: JSON.stringify(packageJson, undefined, 2) };
}
// Ensure that package.json is writable as VS Code needs to
// store metadata in the extracted file.
return { ...file, mode: 0o100644 };
}
async onEnd(): Promise<void> {
if (typeof this.manifest.extensionKind === 'string') {
util.log.warn(
`The 'extensionKind' property should be of type 'string[]'. Learn more at: https://aka.ms/vscode/api/incorrect-execution-location`
);
}
if (this.manifest.publisher === 'vscode-samples') {
throw new Error(
"It's not allowed to use the 'vscode-samples' publisher. Learn more at: https://code.visualstudio.com/api/working-with-extensions/publishing-extension."
);
}
if (!this.manifest.repository) {
util.log.warn(`A 'repository' field is missing from the 'package.json' manifest file.`);
if (!/^y$/i.test(await util.read('Do you want to continue? [y/N] '))) {