@@ -229,6 +229,7 @@ const createZipArchive = async function ({
229
229
const userNamespace = hasEntryFileConflict ? DEFAULT_USER_SUBDIRECTORY : ''
230
230
231
231
let entryFilename = `${ basename ( filename , extname ( filename ) ) } .js`
232
+ let bootstrapVersion : string | undefined
232
233
233
234
if ( needsEntryFile ) {
234
235
const entryFile = getEntryFile ( {
@@ -255,8 +256,10 @@ const createZipArchive = async function ({
255
256
const bootstrapPath = addBootstrapFile ( srcFiles , aliases )
256
257
257
258
if ( featureFlags . zisi_add_metadata_file === true ) {
258
- const { version : bootstrapVersion } = await getPackageJsonIfAvailable ( bootstrapPath )
259
- const payload = JSON . stringify ( getMetadataFile ( bootstrapVersion , branch ) )
259
+ const { version } = await getPackageJsonIfAvailable ( bootstrapPath )
260
+ const payload = JSON . stringify ( getMetadataFile ( version , branch ) )
261
+
262
+ bootstrapVersion = version
260
263
261
264
addZipContent ( archive , payload , METADATA_FILE_NAME )
262
265
}
@@ -281,16 +284,19 @@ const createZipArchive = async function ({
281
284
282
285
await endZip ( archive , output )
283
286
284
- return { path : destPath , entryFilename }
287
+ return { path : destPath , entryFilename, bootstrapVersion }
288
+ }
289
+
290
+ interface ZipNodeJsResult {
291
+ bootstrapVersion ?: string
292
+ entryFilename : string
293
+ path : string
285
294
}
286
295
287
296
export const zipNodeJs = function ( {
288
297
archiveFormat,
289
298
...options
290
- } : ZipNodeParameters & { archiveFormat : ArchiveFormat } ) : Promise < {
291
- path : string
292
- entryFilename : string
293
- } > {
299
+ } : ZipNodeParameters & { archiveFormat : ArchiveFormat } ) : Promise < ZipNodeJsResult > {
294
300
if ( archiveFormat === ARCHIVE_FORMAT . ZIP ) {
295
301
return createZipArchive ( options )
296
302
}
0 commit comments