npm package diff
Package: @forge/cli
Versions: 11.3.0-next.8-experimental-900adc2 - 11.3.0-next.12
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
@@ -4,10 +4,8 @@
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const bundler_1 = require("@forge/bundler");
const cli_shared_1 = require("@forge/cli-shared");
-const i18n_1 = require("@forge/i18n");
-const path_2 = require("path");
class RuntimeBundler {
archiverFactory;
logger;
bundler;
@@ -19,14 +17,14 @@
this.bundler = bundler;
this.fileSystemReader = fileSystemReader;
this.configReader = configReader;
}
- async packageCode(archiver, entryPoints) {
+ async packageCode(archiver, entryPoints, i18nResourceBundle) {
const moduleList = [];
if (entryPoints.length > 0) {
let bundlerResponse;
try {
- bundlerResponse = await this.bundler.bundle({ appDirectory: process.cwd(), entryPoints });
+ bundlerResponse = await this.bundler.bundle({ appDirectory: process.cwd(), entryPoints, i18nResourceBundle });
}
catch (e) {
throw new bundler_1.BundlerError(e.message);
}
@@ -52,23 +50,17 @@
}
archiver.addFileFrom(fileName, fileName);
}
}
- async packageAll(archiver, handlers, packageConfig) {
+ async packageAll(archiver, handlers, packageConfig, i18nResourceBundle) {
const entryPoints = (0, bundler_1.getEntryPoints)(handlers);
- const moduleList = await this.packageCode(archiver, entryPoints);
+ const moduleList = await this.packageCode(archiver, entryPoints, i18nResourceBundle);
await this.packageDependencies(archiver);
return moduleList;
}
- packageI18nResources(archiver, i18nResourceBundle) {
- (0, cli_shared_1.listFilesInI18nResourceBundle)(i18nResourceBundle).forEach(([fileName, filePath]) => {
- archiver.addFileFrom((0, path_2.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);
- this.packageI18nResources(archiver, i18nResourceBundle);
+ const moduleList = await this.packageAll(archiver, handlers, packageConfig, i18nResourceBundle);
const archivePath = await archiver.finalise();
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.archiveCreated(archivePath));
return { runtimeArchivePath: archivePath, moduleList };
}
@@ -83,10 +75,10 @@
}
}
exports.SandboxRuntimeBundler = SandboxRuntimeBundler;
class NodeRuntimeBundler extends RuntimeBundler {
- async packageAll(archiver, handlers, packageConfig) {
- const moduleList = await super.packageAll(archiver, handlers, packageConfig);
+ async packageAll(archiver, handlers, packageConfig, i18nResourceBundle) {
+ const moduleList = await super.packageAll(archiver, handlers, packageConfig, i18nResourceBundle);
const files = await this.fileSystemReader.getFileGlobList(packageConfig?.extraFiles ?? []);
for (const fileName of files) {
archiver.addFileFrom(fileName, fileName);
}