npm package diff
Package: @forge/cli
Versions: 12.3.0-next.0-experimental-47556b0 - 12.3.0-next.0-experimental-8a53773
File: package/out/deploy/packager/runtime-bundler.js
Index: package/out/deploy/packager/runtime-bundler.js
===================================================================
--- package/out/deploy/packager/runtime-bundler.js
+++ package/out/deploy/packager/runtime-bundler.js
@@ -19,9 +19,9 @@
this.fileSystemReader = fileSystemReader;
this.configReader = configReader;
}
async packageCode(archiver, entryPoints, i18nResourceBundle) {
- const moduleList = [];
+ let combinedMetadata = (0, bundler_1.emptyMetadata)();
if (entryPoints.length > 0) {
let bundlerResponse;
try {
bundlerResponse = await this.bundler.bundle({ appDirectory: process.cwd(), entryPoints, i18nResourceBundle });
@@ -30,18 +30,16 @@
throw new bundler_1.BundlerError(e.message);
}
const { outputDir, metadata } = bundlerResponse;
if (metadata) {
- if (metadata.modules) {
- moduleList.push(...metadata.modules);
- }
+ combinedMetadata = (0, bundler_1.mergeMetadata)(combinedMetadata, metadata);
}
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.packageBundledFiles);
for (const name of await this.fileSystemReader.getFileGlobList([`${outputDir}/**`])) {
archiver.addFileFrom(path_1.default.relative(outputDir, name), name);
}
}
- return moduleList;
+ return combinedMetadata;
}
async packageDependencies(archiver) {
const manifest = JSON.stringify(await this.configReader.readConfig());
archiver.addFile(cli_shared_1.manifestFileName, Buffer.from(manifest));
@@ -53,30 +51,30 @@
}
}
async packageAll(archiver, handlers, packageConfig, i18nResourceBundle) {
const entryPoints = (0, bundler_1.getEntryPoints)(handlers);
- const moduleList = await this.packageCode(archiver, entryPoints, i18nResourceBundle);
+ const metadata = await this.packageCode(archiver, entryPoints, i18nResourceBundle);
await this.packageDependencies(archiver);
const files = await this.fileSystemReader.getFileGlobList(packageConfig?.extraFiles ?? []);
for (const fileName of files) {
archiver.addFileFrom(fileName, fileName);
}
- return moduleList;
+ return metadata;
}
packageI18nResources(archiver, i18nResourceBundle) {
(0, cli_shared_1.listFilesInI18nResourceBundle)(i18nResourceBundle).forEach(([fileName, filePath]) => {
archiver.addFileFrom(path_1.default.join(i18n_1.I18N_BUNDLE_FOLDER_NAME, fileName), filePath);
});
}
async bundle(handlers, i18nResourceBundle, packageConfig) {
const archiver = this.archiverFactory();
- const moduleList = await this.packageAll(archiver, handlers, packageConfig, i18nResourceBundle);
+ const metadata = await this.packageAll(archiver, handlers, packageConfig, i18nResourceBundle);
if (handlers.length === 0) {
this.packageI18nResources(archiver, i18nResourceBundle);
}
const archivePath = await archiver.finalise();
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.archiveCreated(archivePath));
- return { runtimeArchivePath: archivePath, moduleList };
+ return { runtimeArchivePath: archivePath, metadata };
}
}
exports.RuntimeBundler = RuntimeBundler;
//# sourceMappingURL=runtime-bundler.js.map
\ No newline at end of file