npm package diff

Package: @forge/bundler

Versions: 4.21.1-next.11 - 4.21.1-next.12

Modified: package/out/runtime.js

Index: package/out/runtime.js
===================================================================
--- package/out/runtime.js
+++ package/out/runtime.js
@@ -3,11 +3,15 @@
 exports.getNodeBundler = exports.SandboxBundler = void 0;
 const tslib_1 = require("tslib");
 const webpack_1 = tslib_1.__importDefault(require("webpack"));
 var RawSource = webpack_1.default.sources.RawSource;
+const cli_shared_1 = require("@forge/cli-shared");
+const path_1 = require("path");
 const common_1 = require("./config/common");
 const sandbox_1 = require("./config/sandbox");
 const webpack_2 = require("./webpack");
+const i18n_1 = require("@forge/i18n");
+const fs_1 = require("fs");
 class SandboxBundler extends webpack_2.WebpackBundler {
     constructor(logger) {
         super(logger);
     }
@@ -40,8 +44,14 @@
         }
     }
     await emit(NODE_RUNTIME_VERSION_FILE, JSON.stringify({ version: entrypointScript.version }, null, 2));
 }
+async function emitI18nFiles(i18nResourceBundle, emit) {
+    await Promise.all((0, cli_shared_1.listFilesInI18nResourceBundle)(i18nResourceBundle).map(async ([fileName, filePath]) => {
+        const fileContent = await fs_1.promises.readFile(filePath);
+        await emit((0, path_1.join)(i18n_1.I18N_BUNDLE_FOLDER_NAME, fileName), fileContent.toString());
+    }));
+}
 class NodeBundler extends webpack_2.WebpackBundler {
     wrapperProvider;
     statsigReader;
     constructor(logger, wrapperProvider, statsigReader) {
@@ -68,9 +78,15 @@
             }
         });
         webpackConfig.plugins.push({
             apply: (compiler) => {
-                compiler.hooks.make.tapPromise('AfterEmitPlugin', async (compilation) => await emitWrapperFiles(this.wrapperProvider, args.entryPoints, async (name, contents) => compilation.emitAsset(name, new RawSource(contents)), await this.statsigReader.packageSingleWrapper()));
+                compiler.hooks.make.tapPromise('AfterEmitPlugin', async (compilation) => {
+                    const emit = async (name, contents) => compilation.emitAsset(name, new RawSource(contents));
+                    await emitWrapperFiles(this.wrapperProvider, args.entryPoints, emit, await this.statsigReader.packageSingleWrapper());
+                    if (args.i18nResourceBundle) {
+                        await emitI18nFiles(args.i18nResourceBundle, emit);
+                    }
+                });
             }
         });
         return webpackConfig;
     }

Modified: package/package.json

Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@forge/bundler",
-  "version": "4.21.1-next.11",
+  "version": "4.21.1-next.12",
   "description": "Default bundler for Forge apps",
   "license": "SEE LICENSE IN LICENSE.txt",
   "author": "Atlassian",
   "main": "out/index.js",
@@ -18,14 +18,14 @@
     "@babel/plugin-transform-numeric-separator": "^7.23.4",
     "@babel/plugin-transform-optional-chaining": "^7.23.4",
     "@babel/plugin-transform-react-jsx": "^7.23.4",
     "@babel/preset-typescript": "^7.23.3",
-    "@forge/api": "5.1.1",
+    "@forge/api": "5.2.0-next.0",
     "@forge/babel-plugin-transform-ui": "1.1.21",
-    "@forge/cli-shared": "6.8.0-next.10",
-    "@forge/i18n": "0.0.4",
-    "@forge/lint": "5.7.3-next.11",
-    "@forge/manifest": "8.9.0-next.5",
+    "@forge/cli-shared": "6.8.0-next.11",
+    "@forge/i18n": "0.0.5-next.0",
+    "@forge/lint": "5.7.3-next.12",
+    "@forge/manifest": "8.9.0-next.6",
     "@forge/util": "1.4.8",
     "assert": "^2.1.0",
     "babel-loader": "^8.3.0",
     "browserify-zlib": "^0.2.0",

Modified: package/out/runtime.d.ts.map

Index: package/out/runtime.d.ts.map
===================================================================
--- package/out/runtime.d.ts.map
+++ package/out/runtime.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIhE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAc,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAiB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEpE,qBAA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D9D;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,GAC3B,WAAW,CAKb"}
\ No newline at end of file

Modified: package/out/types.d.ts.map

Index: package/out/types.d.ts.map
===================================================================
--- package/out/types.d.ts.map
+++ package/out/types.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,oBAAY,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,oBAAY,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAEvF,oBAAY,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjD,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAEF,oBAAY,gBAAgB,GAAG,WAAW,GACxC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,GAAG;IACzC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,oBAAY,YAAY,GAAG;I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AAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF,oBAAY,gBAAgB,GAAG,WAAW,GACxC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,GAAG;IACzC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,oBAAY,YAAY,GAAG;IACzB,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,eAAe,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CAC1G,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,IAAI,IAAI,IAAI,CAAC;CACd;AAED,oBAAY,kBAAkB,GAAG,cAAc,GAAG;IAChD,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,oBAAY,OAAO,GAAG;IACpB,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAClD,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjF,CAAC;AAEF,qBAAa,YAAa,SAAQ,SAAS;CAAG"}
\ No newline at end of file

Modified: package/CHANGELOG.md

Large diffs are not rendered by default.

Modified: package/out/types.d.ts

Index: package/out/types.d.ts
===================================================================
--- package/out/types.d.ts
+++ package/out/types.d.ts
@@ -1,5 +1,5 @@
-import { Logger, UserError } from '@forge/cli-shared';
+import { I18nResourceBundle, Logger, UserError } from '@forge/cli-shared';
 import { Translations } from '@forge/manifest';
 export declare type BundlerMetadata = {
     modules?: string[];
 };
@@ -15,10 +15,11 @@
 };
 export declare type BundlerArgs = {
     appDirectory: string;
     entryPoints: EntryPoint[];
-    i18nConfig?: Translations;
     watchMode?: BundlerWatchMode;
+    i18nConfig?: Translations;
+    i18nResourceBundle?: I18nResourceBundle;
 };
 export declare type BundlerWatchArgs = BundlerArgs & Required<Pick<BundlerArgs, 'watchMode'>> & {
     successMessage: string;
 };