@forge/bundler 4.21.1-next.13 → 4.21.1-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/out/runtime.d.ts +1 -0
- package/out/runtime.d.ts.map +1 -1
- package/out/runtime.js +10 -10
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @forge/bundler
|
|
2
2
|
|
|
3
|
+
## 4.21.1-next.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c57e34a: Fix bundling when handlers are defined in subdirectories
|
|
8
|
+
- Updated dependencies [c57e34a]
|
|
9
|
+
- @forge/cli-shared@6.8.0-next.13
|
|
10
|
+
- @forge/lint@5.7.3-next.14
|
|
11
|
+
|
|
3
12
|
## 4.21.1-next.13
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/out/runtime.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare class SandboxBundler extends WebpackBundler {
|
|
|
6
6
|
constructor(logger: BundleLogger);
|
|
7
7
|
getConfig(args: BundlerArgs): Promise<ConfigWithOutput>;
|
|
8
8
|
}
|
|
9
|
+
export declare function userCodePath(entryKey: string): string;
|
|
9
10
|
declare class NodeBundler extends WebpackBundler {
|
|
10
11
|
private readonly wrapperProvider;
|
|
11
12
|
private readonly statsigReader;
|
package/out/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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"}
|
package/out/runtime.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNodeBundler = exports.SandboxBundler = void 0;
|
|
3
|
+
exports.getNodeBundler = exports.userCodePath = exports.SandboxBundler = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
+
const promises_1 = tslib_1.__importDefault(require("fs/promises"));
|
|
5
7
|
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
6
8
|
var RawSource = webpack_1.default.sources.RawSource;
|
|
7
9
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
8
|
-
const path_1 = require("path");
|
|
9
10
|
const common_1 = require("./config/common");
|
|
10
11
|
const sandbox_1 = require("./config/sandbox");
|
|
11
12
|
const webpack_2 = require("./webpack");
|
|
12
13
|
const i18n_1 = require("@forge/i18n");
|
|
13
|
-
const fs_1 = require("fs");
|
|
14
14
|
class SandboxBundler extends webpack_2.WebpackBundler {
|
|
15
15
|
constructor(logger) {
|
|
16
16
|
super(logger);
|
|
@@ -24,6 +24,10 @@ const NODE_RUNTIME_CODE_FILE = '__forge__.js';
|
|
|
24
24
|
const NODE_RUNTIME_BACKUP_WRAPPER_FILE = '__forge_wrapper__.cjs';
|
|
25
25
|
const NODE_RUNTIME_VERSION_FILE = 'runtime.json';
|
|
26
26
|
const NODE_WEBPACK_USER_CODE_DIR = 'bundled';
|
|
27
|
+
function userCodePath(entryKey) {
|
|
28
|
+
return path_1.default.join(path_1.default.dirname(entryKey), NODE_WEBPACK_USER_CODE_DIR, path_1.default.basename(entryKey));
|
|
29
|
+
}
|
|
30
|
+
exports.userCodePath = userCodePath;
|
|
27
31
|
async function emitWrapperFiles(provider, entrypoints, emit, useSingleWrapper) {
|
|
28
32
|
const wrapper = await provider.getNodeRuntimeWrapper();
|
|
29
33
|
const loader = await provider.getNodeRuntimeLoader();
|
|
@@ -47,8 +51,8 @@ async function emitWrapperFiles(provider, entrypoints, emit, useSingleWrapper) {
|
|
|
47
51
|
}
|
|
48
52
|
async function emitI18nFiles(i18nResourceBundle, emit) {
|
|
49
53
|
await Promise.all((0, cli_shared_1.listFilesInI18nResourceBundle)(i18nResourceBundle).map(async ([fileName, filePath]) => {
|
|
50
|
-
const fileContent = await
|
|
51
|
-
await emit(
|
|
54
|
+
const fileContent = await promises_1.default.readFile(filePath);
|
|
55
|
+
await emit(path_1.default.join(i18n_1.I18N_BUNDLE_FOLDER_NAME, fileName), fileContent.toString());
|
|
52
56
|
}));
|
|
53
57
|
}
|
|
54
58
|
class NodeBundler extends webpack_2.WebpackBundler {
|
|
@@ -62,11 +66,7 @@ class NodeBundler extends webpack_2.WebpackBundler {
|
|
|
62
66
|
async getConfig(args) {
|
|
63
67
|
const webpackConfig = (0, common_1.getCommonWebpackConfig)(args);
|
|
64
68
|
if (!(await this.statsigReader.packageSingleWrapper())) {
|
|
65
|
-
|
|
66
|
-
for (const [entryKey, entryPath] of Object.entries(webpackConfig.entry)) {
|
|
67
|
-
newEntries[`${NODE_WEBPACK_USER_CODE_DIR}/${entryKey}`] = entryPath;
|
|
68
|
-
}
|
|
69
|
-
webpackConfig.entry = newEntries;
|
|
69
|
+
webpackConfig.entry = Object.fromEntries(Object.entries(webpackConfig.entry).map(([entryKey, entryPath]) => [userCodePath(entryKey), entryPath]));
|
|
70
70
|
}
|
|
71
71
|
webpackConfig.target = 'node18';
|
|
72
72
|
webpackConfig.output.filename = '[name].cjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bundler",
|
|
3
|
-
"version": "4.21.1-next.
|
|
3
|
+
"version": "4.21.1-next.14",
|
|
4
4
|
"description": "Default bundler for Forge apps",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Atlassian",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"@babel/preset-typescript": "^7.23.3",
|
|
22
22
|
"@forge/api": "5.2.0-next.0",
|
|
23
23
|
"@forge/babel-plugin-transform-ui": "1.1.21",
|
|
24
|
-
"@forge/cli-shared": "6.8.0-next.
|
|
24
|
+
"@forge/cli-shared": "6.8.0-next.13",
|
|
25
25
|
"@forge/i18n": "0.0.5-next.0",
|
|
26
|
-
"@forge/lint": "5.7.3-next.
|
|
26
|
+
"@forge/lint": "5.7.3-next.14",
|
|
27
27
|
"@forge/manifest": "8.9.0-next.7",
|
|
28
28
|
"@forge/util": "1.4.8",
|
|
29
29
|
"assert": "^2.1.0",
|