@@ -151,13 +151,30 @@ function _validateGitHubReleaseAssets(githubReleaseDetails, issueMessages) {
151151async function _downloadAndValidateExtensionZip ( githubReleaseTag , extensionZipAsset , issueMessages ) {
152152 const targetPath = `${ EXTENSION_DOWNLOAD_DIR } /${ githubReleaseTag . owner } _${ githubReleaseTag . repo } _${ githubReleaseTag . tag } _${ extensionZipAsset . name } ` ;
153153 await downloader . downloadFile ( extensionZipAsset . browser_download_url , targetPath ) ;
154- const { packageJSON, error} = await ZipUtils . getExtensionPackageJSON ( targetPath ) ;
154+ let { packageJSON, error} = await ZipUtils . getExtensionPackageJSON ( targetPath ) ;
155155 if ( error ) {
156156 issueMessages . push ( error ) ;
157157 throw { status : HTTP_STATUS_CODES . BAD_REQUEST ,
158158 updatePublishErrors : true ,
159159 error} ;
160160 }
161+ let requiredParams = [ "name" , "title" , "description" , "homepage" , "version" , "author" , "license" ] ;
162+ let missingParams = [ ] ;
163+ for ( let param of requiredParams ) {
164+ if ( ! packageJSON [ param ] ) {
165+ missingParams . push ( param ) ;
166+ }
167+ }
168+ if ( ! packageJSON ?. engines ?. brackets ) {
169+ missingParams . push ( `"engines":{"brackets":<version Eg. ">=0.34.0"}>` ) ;
170+ }
171+ if ( missingParams . length ) {
172+ error = "Required parameters missing in package.json: " + missingParams ;
173+ issueMessages . push ( error ) ;
174+ throw { status : HTTP_STATUS_CODES . BAD_REQUEST ,
175+ updatePublishErrors : true ,
176+ error} ;
177+ }
161178 return targetPath ;
162179}
163180
0 commit comments