Merge pull request #139 from Microsoft/blockProposedApi
check for enableProposedApi and don't allow to publish
This commit is contained in:
commit
79978813cb
3 changed files with 19 additions and 3 deletions
|
@ -22,6 +22,7 @@ export interface Manifest {
|
|||
markdown?: 'github' | 'standard';
|
||||
_bundling?: { [name: string]: string; }[];
|
||||
_testing?: string;
|
||||
enableProposedApi?: boolean;
|
||||
|
||||
// optional (npm)
|
||||
author?: string | Person;
|
||||
|
|
|
@ -432,6 +432,10 @@ export function validateManifest(manifest: Manifest): Manifest {
|
|||
throw new Error('Manifest missing field: engines.vscode');
|
||||
}
|
||||
|
||||
if (manifest.enableProposedApi) {
|
||||
throw new Error('Extensions using proposed API (enableProposedApi: true) cannot be published');
|
||||
}
|
||||
|
||||
return manifest;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,6 +147,17 @@ describe('validateManifest', () => {
|
|||
assert.throws(() => { validateManifest({ publisher: 'demo', name: 'demo', version: '1.0.0', engines: null }); });
|
||||
assert.throws(() => { validateManifest({ publisher: 'demo', name: 'demo', version: '1.0.0', engines: { vscode: null } }); });
|
||||
});
|
||||
|
||||
it('should not allow proposed API', () => {
|
||||
assert.throws(() => { validateManifest({ enableProposedApi: true, publisher: 'demo', name: 'demo', version: '1.0.0', engines: { vscode: '0.10.1' } }); });
|
||||
assert.throws(() => { validateManifest({ enableProposedApi: <any>1, publisher: 'demo', name: 'demo', version: '1.0.0', engines: { vscode: '0.10.1' } }); });
|
||||
|
||||
let mani1: Manifest = { enableProposedApi: false, publisher: 'demo', name: 'demo', version: '1.0.0', engines: { vscode: '0.10.1' } };
|
||||
assert.ok(validateManifest(mani1) === mani1);
|
||||
|
||||
let mani2: Manifest = { publisher: 'demo', name: 'demo', version: '1.0.0', engines: { vscode: '0.10.1' } };
|
||||
assert.ok(validateManifest(mani2) === mani2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('toVsixManifest', () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue