npm package diff
Package: @forge/bundler
Versions: 4.21.1-next.13 - 4.21.1-next.14
Modified: package/out/runtime.js
Index: package/out/runtime.js
===================================================================
--- package/out/runtime.js
+++ package/out/runtime.js
@@ -1,17 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.getNodeBundler = exports.SandboxBundler = void 0;
+exports.getNodeBundler = exports.userCodePath = exports.SandboxBundler = void 0;
const tslib_1 = require("tslib");
+const path_1 = tslib_1.__importDefault(require("path"));
+const promises_1 = tslib_1.__importDefault(require("fs/promises"));
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);
}
@@ -23,8 +23,12 @@
const NODE_RUNTIME_CODE_FILE = '__forge__.js';
const NODE_RUNTIME_BACKUP_WRAPPER_FILE = '__forge_wrapper__.cjs';
const NODE_RUNTIME_VERSION_FILE = 'runtime.json';
const NODE_WEBPACK_USER_CODE_DIR = 'bundled';
+function userCodePath(entryKey) {
+ return path_1.default.join(path_1.default.dirname(entryKey), NODE_WEBPACK_USER_CODE_DIR, path_1.default.basename(entryKey));
+}
+exports.userCodePath = userCodePath;
async function emitWrapperFiles(provider, entrypoints, emit, useSingleWrapper) {
const wrapper = await provider.getNodeRuntimeWrapper();
const loader = await provider.getNodeRuntimeLoader();
let entrypointScript;
@@ -46,10 +50,10 @@
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());
+ const fileContent = await promises_1.default.readFile(filePath);
+ await emit(path_1.default.join(i18n_1.I18N_BUNDLE_FOLDER_NAME, fileName), fileContent.toString());
}));
}
class NodeBundler extends webpack_2.WebpackBundler {
wrapperProvider;
@@ -61,13 +65,9 @@
}
async getConfig(args) {
const webpackConfig = (0, common_1.getCommonWebpackConfig)(args);
if (!(await this.statsigReader.packageSingleWrapper())) {
- const newEntries = {};
- for (const [entryKey, entryPath] of Object.entries(webpackConfig.entry)) {
- newEntries[`${NODE_WEBPACK_USER_CODE_DIR}/${entryKey}`] = entryPath;
- }
- webpackConfig.entry = newEntries;
+ webpackConfig.entry = Object.fromEntries(Object.entries(webpackConfig.entry).map(([entryKey, entryPath]) => [userCodePath(entryKey), entryPath]));
}
webpackConfig.target = 'node18';
webpackConfig.output.filename = '[name].cjs';
webpackConfig.name = 'node-runtime';
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.13",
+ "version": "4.21.1-next.14",
"description": "Default bundler for Forge apps",
"license": "SEE LICENSE IN LICENSE.txt",
"author": "Atlassian",
"main": "out/index.js",
@@ -20,11 +20,11 @@
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@babel/preset-typescript": "^7.23.3",
"@forge/api": "5.2.0-next.0",
"@forge/babel-plugin-transform-ui": "1.1.21",
- "@forge/cli-shared": "6.8.0-next.12",
+ "@forge/cli-shared": "6.8.0-next.13",
"@forge/i18n": "0.0.5-next.0",
- "@forge/lint": "5.7.3-next.13",
+ "@forge/lint": "5.7.3-next.14",
"@forge/manifest": "8.9.0-next.7",
"@forge/util": "1.4.8",
"assert": "^2.1.0",
"babel-loader": "^8.3.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,EAAqD,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAInH,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;AAIpE,qBAAa,cAAe,SAAQ,cAAc;gBACpC,MAAM,EAAE,YAAY;IAI1B,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG9D;AA8DD,cAAM,WAAY,SAAQ,cAAc;IAGpC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAF9B,MAAM,EAAE,YAAY,EACH,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa;IAKzC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAsD9D;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
+{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAqD,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnH,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;AAGpE,qBAAa,cAAe,SAAQ,cAAc;gBACpC,MAAM,EAAE,YAAY;IAI1B,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG9D;AAoBD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AA4CD,cAAM,WAAY,SAAQ,cAAc;IAGpC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAF9B,MAAM,EAAE,YAAY,EACH,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa;IAKzC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAoD9D;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/CHANGELOG.md
Large diffs are not rendered by default.
Modified: package/out/runtime.d.ts
Index: package/out/runtime.d.ts
===================================================================
--- package/out/runtime.d.ts
+++ package/out/runtime.d.ts
@@ -5,8 +5,9 @@
export declare class SandboxBundler extends WebpackBundler {
constructor(logger: BundleLogger);
getConfig(args: BundlerArgs): Promise<ConfigWithOutput>;
}
+export declare function userCodePath(entryKey: string): string;
declare class NodeBundler extends WebpackBundler {
private readonly wrapperProvider;
private readonly statsigReader;
constructor(logger: BundleLogger, wrapperProvider: WrapperProvider, statsigReader: StatsigReader);