remove publisher from manifest
This commit is contained in:
parent
7a658f375b
commit
ffb5ef5000
2 changed files with 25 additions and 15 deletions
|
@ -10,9 +10,6 @@ export interface Manifest {
|
||||||
version: string;
|
version: string;
|
||||||
engines: { vscode: string; [name: string]: string; };
|
engines: { vscode: string; [name: string]: string; };
|
||||||
|
|
||||||
// mandatory (vscode)
|
|
||||||
publisher: string; // TODO move out
|
|
||||||
|
|
||||||
// optional (npm)
|
// optional (npm)
|
||||||
author?: string | Person;
|
author?: string | Person;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
|
|
@ -3,8 +3,10 @@ import * as path from 'path';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import * as yazl from 'yazl';
|
import * as yazl from 'yazl';
|
||||||
import { Manifest } from './manifest';
|
import { Manifest } from './manifest';
|
||||||
|
import { getCredentials } from './login';
|
||||||
import { nfcall, Promise, reject, resolve, all } from 'q';
|
import { nfcall, Promise, reject, resolve, all } from 'q';
|
||||||
import * as glob from 'glob';
|
import * as glob from 'glob';
|
||||||
|
import { read } from './util';
|
||||||
|
|
||||||
const resourcesPath = path.join(path.dirname(__dirname), 'resources');
|
const resourcesPath = path.join(path.dirname(__dirname), 'resources');
|
||||||
const vsixManifestTemplatePath = path.join(resourcesPath, 'extension.vsixmanifest');
|
const vsixManifestTemplatePath = path.join(resourcesPath, 'extension.vsixmanifest');
|
||||||
|
@ -32,10 +34,6 @@ function validateManifest(manifest: Manifest): Promise<Manifest> {
|
||||||
return reject<Manifest>('Manifest missing field: version');
|
return reject<Manifest>('Manifest missing field: version');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!manifest.publisher) {
|
|
||||||
return reject<Manifest>('Manifest missing field: publisher');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!manifest.engines) {
|
if (!manifest.engines) {
|
||||||
return reject<Manifest>('Manifest missing field: engines');
|
return reject<Manifest>('Manifest missing field: engines');
|
||||||
}
|
}
|
||||||
|
@ -50,14 +48,29 @@ function validateManifest(manifest: Manifest): Promise<Manifest> {
|
||||||
function toVsixManifest(manifest: Manifest): Promise<string> {
|
function toVsixManifest(manifest: Manifest): Promise<string> {
|
||||||
return nfcall<string>(fs.readFile, vsixManifestTemplatePath, 'utf8')
|
return nfcall<string>(fs.readFile, vsixManifestTemplatePath, 'utf8')
|
||||||
.then(vsixManifestTemplateStr => _.template(vsixManifestTemplateStr))
|
.then(vsixManifestTemplateStr => _.template(vsixManifestTemplateStr))
|
||||||
.then(vsixManifestTemplate => vsixManifestTemplate({
|
.then(vsixManifestTemplate => {
|
||||||
id: manifest.name,
|
return getCredentials().then(credentials => {
|
||||||
displayName: manifest.name,
|
if (credentials) {
|
||||||
version: manifest.version,
|
return resolve(credentials.publisher);
|
||||||
publisher: manifest.publisher,
|
}
|
||||||
description: manifest.description || '',
|
|
||||||
tags: (manifest.keywords || []).concat('vscode').join(';')
|
console.log(`A publisher name is required. Run '${ path.basename(process.argv[1]) } login' to avoid setting it every time.`);
|
||||||
}));
|
return read('Publisher name: ');
|
||||||
|
}).then(publisher => {
|
||||||
|
if (!publisher) {
|
||||||
|
return reject<string>('Packaging requires a publisher name.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return vsixManifestTemplate({
|
||||||
|
id: manifest.name,
|
||||||
|
displayName: manifest.name,
|
||||||
|
version: manifest.version,
|
||||||
|
publisher,
|
||||||
|
description: manifest.description || '',
|
||||||
|
tags: (manifest.keywords || []).concat('vscode').join(';')
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function collectFiles(cwd: string): Promise<string[]> {
|
function collectFiles(cwd: string): Promise<string[]> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue