@forge/bundler 4.11.2-next.8 → 4.12.0-next.9
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 +12 -0
- package/out/config/node.d.ts +29 -1
- package/out/config/node.d.ts.map +1 -1
- package/out/config/node.js +70 -4
- package/out/index.d.ts +2 -2
- package/out/index.d.ts.map +1 -1
- package/out/index.js +4 -3
- package/out/webpack.d.ts +3 -2
- package/out/webpack.d.ts.map +1 -1
- package/out/webpack.js +5 -3
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/bundler
|
|
2
2
|
|
|
3
|
+
## 4.12.0-next.9
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 424cf45e: Use CDN packaged wrapper script for the node runtime
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [424cf45e]
|
|
12
|
+
- @forge/cli-shared@3.18.0-next.6
|
|
13
|
+
- @forge/lint@3.6.6-next.6
|
|
14
|
+
|
|
3
15
|
## 4.11.2-next.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/out/config/node.d.ts
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import { CommonWebpackConfig, ConfigBuilder, FunctionsEntryPoint } from './common';
|
|
2
|
+
import { BaseError, FeatureFlagReader, FileSystemReader, UserError } from '@forge/cli-shared';
|
|
2
3
|
export declare const NODE_WEBPACK_CONFIG_NAME = "node-runtime";
|
|
3
4
|
export declare const NODE_WEBPACK_USER_CODE_DIR = "bundled";
|
|
4
|
-
export declare
|
|
5
|
+
export declare class LocalWrapperNotFoundError extends UserError {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class WrapperNetworkError extends BaseError {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
export declare class WrapperNotAvailableError extends BaseError {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
export interface WrapperProvider {
|
|
15
|
+
getNodeRuntimeWrapper(): Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
export declare class LocalWrapperProvider implements WrapperProvider {
|
|
18
|
+
private readonly filesystemReader;
|
|
19
|
+
constructor(filesystemReader: FileSystemReader);
|
|
20
|
+
getNodeRuntimeWrapper(): Promise<string>;
|
|
21
|
+
}
|
|
22
|
+
export declare class NetworkWrapperProvider implements WrapperProvider {
|
|
23
|
+
private readonly wrapperUrl;
|
|
24
|
+
private wrapper;
|
|
25
|
+
constructor(wrapperUrl: string);
|
|
26
|
+
getNodeRuntimeWrapper(): Promise<string>;
|
|
27
|
+
}
|
|
28
|
+
export declare const getWrapperProvider: ({ featureFlags, fileSystemReader }: {
|
|
29
|
+
featureFlags: FeatureFlagReader;
|
|
30
|
+
fileSystemReader: FileSystemReader;
|
|
31
|
+
}) => Promise<LocalWrapperProvider | NetworkWrapperProvider>;
|
|
32
|
+
export declare const getNodeRuntimeBuildConfig: (wrapperProvider: WrapperProvider) => (entrypoints: FunctionsEntryPoint[], config: ConfigBuilder) => CommonWebpackConfig;
|
|
5
33
|
//# sourceMappingURL=node.d.ts.map
|
package/out/config/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/config/node.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EAGpB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/config/node.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9F,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AACvD,eAAO,MAAM,0BAA0B,YAAY,CAAC;AAEpD,qBAAa,yBAA0B,SAAQ,SAAS;;CAIvD;AAED,qBAAa,mBAAoB,SAAQ,SAAS;gBACpC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,wBAAyB,SAAQ,SAAS;;CAItD;AAED,MAAM,WAAW,eAAe;IAC9B,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1C;AAED,qBAAa,oBAAqB,YAAW,eAAe;IAC9C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IACzD,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;CAO/C;AAED,qBAAa,sBAAuB,YAAW,eAAe;IAEhD,OAAO,CAAC,QAAQ,CAAC,UAAU;IADvC,OAAO,CAAC,OAAO,CAAqB;gBACP,UAAU,EAAE,MAAM;IACzC,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;CAiB/C;AAED,eAAO,MAAM,kBAAkB;kBAIf,iBAAiB;sBACb,gBAAgB;4DAYnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oBAClB,eAAe,mBACnB,mBAAmB,EAAE,UAAU,aAAa,KAAG,mBA6C5D,CAAC"}
|
package/out/config/node.js
CHANGED
|
@@ -1,12 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNodeRuntimeBuildConfig = exports.NODE_WEBPACK_USER_CODE_DIR = exports.NODE_WEBPACK_CONFIG_NAME = void 0;
|
|
3
|
+
exports.getNodeRuntimeBuildConfig = exports.getWrapperProvider = exports.NetworkWrapperProvider = exports.LocalWrapperProvider = exports.WrapperNotAvailableError = exports.WrapperNetworkError = exports.LocalWrapperNotFoundError = exports.NODE_WEBPACK_USER_CODE_DIR = exports.NODE_WEBPACK_CONFIG_NAME = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const node_runtime_1 = require("@forge/node-runtime");
|
|
5
6
|
const common_1 = require("./common");
|
|
6
|
-
const
|
|
7
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
8
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
9
|
exports.NODE_WEBPACK_CONFIG_NAME = 'node-runtime';
|
|
8
10
|
exports.NODE_WEBPACK_USER_CODE_DIR = 'bundled';
|
|
9
|
-
|
|
11
|
+
class LocalWrapperNotFoundError extends cli_shared_1.UserError {
|
|
12
|
+
constructor() {
|
|
13
|
+
super('Local node runtime wrapper not found.');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.LocalWrapperNotFoundError = LocalWrapperNotFoundError;
|
|
17
|
+
class WrapperNetworkError extends cli_shared_1.BaseError {
|
|
18
|
+
constructor(message) {
|
|
19
|
+
super(undefined, message);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.WrapperNetworkError = WrapperNetworkError;
|
|
23
|
+
class WrapperNotAvailableError extends cli_shared_1.BaseError {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(undefined, 'Failed to load runtime component, check your network connection and retry.');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.WrapperNotAvailableError = WrapperNotAvailableError;
|
|
29
|
+
class LocalWrapperProvider {
|
|
30
|
+
constructor(filesystemReader) {
|
|
31
|
+
this.filesystemReader = filesystemReader;
|
|
32
|
+
}
|
|
33
|
+
async getNodeRuntimeWrapper() {
|
|
34
|
+
const wrapper = await this.filesystemReader.readFileAsync(node_runtime_1.WRAPPER_PATH);
|
|
35
|
+
if (!wrapper) {
|
|
36
|
+
throw new LocalWrapperNotFoundError();
|
|
37
|
+
}
|
|
38
|
+
return wrapper;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.LocalWrapperProvider = LocalWrapperProvider;
|
|
42
|
+
class NetworkWrapperProvider {
|
|
43
|
+
constructor(wrapperUrl) {
|
|
44
|
+
this.wrapperUrl = wrapperUrl;
|
|
45
|
+
}
|
|
46
|
+
async getNodeRuntimeWrapper() {
|
|
47
|
+
if (this.wrapper) {
|
|
48
|
+
return this.wrapper;
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const response = await (0, node_fetch_1.default)(this.wrapperUrl);
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
throw new WrapperNetworkError(`Failed to fetch runtime component: ${this.wrapperUrl} ${response.status}.`);
|
|
54
|
+
}
|
|
55
|
+
this.wrapper = await response.text();
|
|
56
|
+
return this.wrapper;
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
throw new WrapperNetworkError(e instanceof Error ? e.message : 'Networking error when retrieving runtime component, retry the command.');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.NetworkWrapperProvider = NetworkWrapperProvider;
|
|
64
|
+
const getWrapperProvider = async ({ featureFlags, fileSystemReader }) => {
|
|
65
|
+
if (process.env.FORGE_USE_LOCAL_WRAPPER === 'true') {
|
|
66
|
+
return new LocalWrapperProvider(fileSystemReader);
|
|
67
|
+
}
|
|
68
|
+
const wrapperUrl = await featureFlags.readFlag('forge-cli-node-runtime-wrapper-url');
|
|
69
|
+
if (typeof wrapperUrl === 'string') {
|
|
70
|
+
return new NetworkWrapperProvider(wrapperUrl);
|
|
71
|
+
}
|
|
72
|
+
throw new WrapperNotAvailableError();
|
|
73
|
+
};
|
|
74
|
+
exports.getWrapperProvider = getWrapperProvider;
|
|
75
|
+
const getNodeRuntimeBuildConfig = (wrapperProvider) => (entrypoints, config) => {
|
|
10
76
|
const webpackConfig = (0, common_1.getCommonWebpackConfig)(entrypoints, config);
|
|
11
77
|
const newEntries = {};
|
|
12
78
|
for (const [entryKey, entryPath] of Object.entries(webpackConfig.entry)) {
|
|
@@ -25,7 +91,7 @@ const getNodeRuntimeBuildConfig = (entrypoints, config) => {
|
|
|
25
91
|
apply: (compiler) => {
|
|
26
92
|
compiler.hooks.make.tapPromise('AfterEmitPlugin', async (compilation) => {
|
|
27
93
|
const { RawSource } = compiler.webpack.sources;
|
|
28
|
-
const wrapper = await
|
|
94
|
+
const wrapper = await wrapperProvider.getNodeRuntimeWrapper();
|
|
29
95
|
const source = new RawSource(wrapper);
|
|
30
96
|
for (const entrypoint of entrypoints) {
|
|
31
97
|
compilation.emitAsset(`${entrypoint.name}.js`, source);
|
package/out/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Bundler, InDiskBundler, Watcher, WatcherMonitor, BundlerOutput } from './types';
|
|
2
|
-
export {
|
|
2
|
+
export { getSandboxBundler, getNodeBundler, nativeUiBundle, watch, getCompiler, getInMemoryBundle, handleWebpackCompilationResult, runLinter } from './webpack';
|
|
3
3
|
export { EntryPoint, FunctionsEntryPoint, getEntryPoints } from './config/common';
|
|
4
4
|
export { getNativeUiBuildConfig } from './config/nativeui';
|
|
5
|
-
export { getNodeRuntimeBuildConfig } from './config/node';
|
|
5
|
+
export { getNodeRuntimeBuildConfig, getWrapperProvider } from './config/node';
|
|
6
6
|
export { getSandboxedRuntimeBuildConfig } from './config/sandbox';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,8BAA8B,EAC9B,SAAS,EACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSandboxedRuntimeBuildConfig = exports.getNodeRuntimeBuildConfig = exports.getNativeUiBuildConfig = exports.getEntryPoints = exports.runLinter = exports.handleWebpackCompilationResult = exports.getInMemoryBundle = exports.getCompiler = exports.watch = exports.nativeUiBundle = exports.
|
|
3
|
+
exports.getSandboxedRuntimeBuildConfig = exports.getWrapperProvider = exports.getNodeRuntimeBuildConfig = exports.getNativeUiBuildConfig = exports.getEntryPoints = exports.runLinter = exports.handleWebpackCompilationResult = exports.getInMemoryBundle = exports.getCompiler = exports.watch = exports.nativeUiBundle = exports.getNodeBundler = exports.getSandboxBundler = void 0;
|
|
4
4
|
var webpack_1 = require("./webpack");
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "getSandboxBundler", { enumerable: true, get: function () { return webpack_1.getSandboxBundler; } });
|
|
6
|
+
Object.defineProperty(exports, "getNodeBundler", { enumerable: true, get: function () { return webpack_1.getNodeBundler; } });
|
|
7
7
|
Object.defineProperty(exports, "nativeUiBundle", { enumerable: true, get: function () { return webpack_1.nativeUiBundle; } });
|
|
8
8
|
Object.defineProperty(exports, "watch", { enumerable: true, get: function () { return webpack_1.watch; } });
|
|
9
9
|
Object.defineProperty(exports, "getCompiler", { enumerable: true, get: function () { return webpack_1.getCompiler; } });
|
|
@@ -16,5 +16,6 @@ var nativeui_1 = require("./config/nativeui");
|
|
|
16
16
|
Object.defineProperty(exports, "getNativeUiBuildConfig", { enumerable: true, get: function () { return nativeui_1.getNativeUiBuildConfig; } });
|
|
17
17
|
var node_1 = require("./config/node");
|
|
18
18
|
Object.defineProperty(exports, "getNodeRuntimeBuildConfig", { enumerable: true, get: function () { return node_1.getNodeRuntimeBuildConfig; } });
|
|
19
|
+
Object.defineProperty(exports, "getWrapperProvider", { enumerable: true, get: function () { return node_1.getWrapperProvider; } });
|
|
19
20
|
var sandbox_1 = require("./config/sandbox");
|
|
20
21
|
Object.defineProperty(exports, "getSandboxedRuntimeBuildConfig", { enumerable: true, get: function () { return sandbox_1.getSandboxedRuntimeBuildConfig; } });
|
package/out/webpack.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Bundler, Watcher, InDiskBundler, BundlerOutput, BundleLogger } from './
|
|
|
4
4
|
import { FileSystemReader, FileSystemWriter } from '@forge/cli-shared';
|
|
5
5
|
import { LintLogger } from '@forge/lint';
|
|
6
6
|
import { CommonWebpackConfig, ConfigBuilder, EntryPoint, FunctionsEntryPoint } from './config/common';
|
|
7
|
+
import { WrapperProvider } from './config/node';
|
|
7
8
|
export { EntryPoint };
|
|
8
9
|
export declare function handleWebpackCompilationResult(logger: BundleLogger, err: Error | null | undefined, stats: webpack.Stats | undefined): asserts stats is webpack.Stats;
|
|
9
10
|
export declare function getInMemoryBundle(config: CommonWebpackConfig, fileSystem?: IFs): BundlerOutput;
|
|
@@ -14,7 +15,7 @@ export declare const getCompiler: (webpackConfig: WebpackConfig, options?: Compi
|
|
|
14
15
|
export declare const runLinter: (logger?: LintLogger, fileSystemReader?: FileSystemReader, fileSystemWriter?: FileSystemWriter) => Promise<void>;
|
|
15
16
|
export declare const watch: Watcher;
|
|
16
17
|
export declare function createBundler<EP extends EntryPoint = EntryPoint>(getBuildConfig: (entrypoints: EP[], configBuilder: ConfigBuilder) => CommonWebpackConfig): Bundler<EP>;
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const getSandboxBundler: () => Bundler;
|
|
19
|
+
export declare const getNodeBundler: (wrapperProvider: WrapperProvider) => Bundler<FunctionsEntryPoint>;
|
|
19
20
|
export declare const nativeUiBundle: InDiskBundler;
|
|
20
21
|
//# sourceMappingURL=webpack.d.ts.map
|
package/out/webpack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,GAAG,EAAU,MAAM,OAAO,CAAC;AACxD,OAAO,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAG5E,OAAO,EACL,OAAO,EAGP,OAAO,EAEP,aAAa,EACb,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,gBAAgB,EAGhB,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA2B,UAAU,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,GAAG,EAAU,MAAM,OAAO,CAAC;AACxD,OAAO,OAAO,EAAE,EAAE,QAAQ,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAG5E,OAAO,EACL,OAAO,EAGP,OAAO,EAEP,aAAa,EACb,aAAa,EACb,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAEL,gBAAgB,EAGhB,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA2B,UAAU,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtG,OAAO,EAIL,eAAe,EAChB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,CAAC;AAQtB,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC7B,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,SAAS,GAC/B,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAkChC;AAWD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,GAAG,aAAa,CAmB9F;AAED,UAAU,eAAe;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,kBAAmB,aAAa,YAAY,eAAe,KAAG,QAOrF,CAAC;AA6BF,eAAO,MAAM,SAAS,YAEZ,UAAU,+EAGjB,QAAQ,IAAI,CA+Bd,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,OAwBnB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAE,SAAS,UAAU,GAAG,UAAU,EAC9D,cAAc,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,aAAa,KAAK,mBAAmB,GACvF,OAAO,CAAC,EAAE,CAAC,CA8Bb;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,OAA6D,CAAC;AACpG,eAAO,MAAM,cAAc,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,OAAO,CAAC,mBAAmB,CACnC,CAAC;AAE5D,eAAO,MAAM,cAAc,EAAE,aAkB5B,CAAC"}
|
package/out/webpack.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nativeUiBundle = exports.
|
|
3
|
+
exports.nativeUiBundle = exports.getNodeBundler = exports.getSandboxBundler = exports.createBundler = exports.watch = exports.runLinter = exports.getCompiler = exports.getInMemoryBundle = exports.handleWebpackCompilationResult = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const memfs_1 = require("memfs");
|
|
6
6
|
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
@@ -177,8 +177,10 @@ function createBundler(getBuildConfig) {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
exports.createBundler = createBundler;
|
|
180
|
-
|
|
181
|
-
exports.
|
|
180
|
+
const getSandboxBundler = () => createBundler(sandbox_1.getSandboxedRuntimeBuildConfig);
|
|
181
|
+
exports.getSandboxBundler = getSandboxBundler;
|
|
182
|
+
const getNodeBundler = (wrapperProvider) => createBundler((0, node_1.getNodeRuntimeBuildConfig)(wrapperProvider));
|
|
183
|
+
exports.getNodeBundler = getNodeBundler;
|
|
182
184
|
const nativeUiBundle = (logger, entrypoints) => {
|
|
183
185
|
const config = (0, nativeui_1.getNativeUiBuildConfig)(entrypoints);
|
|
184
186
|
const compiler = (0, exports.getCompiler)(config, { writeToDisk: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bundler",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0-next.9",
|
|
4
4
|
"description": "Default bundler for Forge apps",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Atlassian",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@babel/preset-typescript": "^7.22.11",
|
|
22
22
|
"@forge/api": "2.18.6-next.1",
|
|
23
23
|
"@forge/babel-plugin-transform-ui": "1.1.7-next.0",
|
|
24
|
-
"@forge/cli-shared": "3.18.0-next.
|
|
25
|
-
"@forge/lint": "3.6.6-next.
|
|
24
|
+
"@forge/cli-shared": "3.18.0-next.6",
|
|
25
|
+
"@forge/lint": "3.6.6-next.6",
|
|
26
26
|
"@forge/node-runtime": "0.1.2-next.2",
|
|
27
27
|
"@forge/util": "1.3.1",
|
|
28
28
|
"assert": "^2.0.0",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"inherits": "^2.0.4",
|
|
38
38
|
"memfs": "^3.5.3",
|
|
39
39
|
"nock": "^10.0.6",
|
|
40
|
+
"node-fetch": "2.6.13",
|
|
40
41
|
"os-browserify": "^0.3.0",
|
|
41
42
|
"path-browserify": "^1.0.1",
|
|
42
43
|
"process": "^0.11.10",
|
|
@@ -57,6 +58,7 @@
|
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
60
|
"@atlassian/xen-test-util": "^3.0.4",
|
|
61
|
+
"@forge/runtime": "5.0.1-next.2",
|
|
60
62
|
"@types/jest": "^29.5.4",
|
|
61
63
|
"@types/node": "14.18.56",
|
|
62
64
|
"@types/react": "^17.0.65",
|
|
@@ -67,10 +69,10 @@
|
|
|
67
69
|
"eslint": "^8.47.0",
|
|
68
70
|
"eslint-config-prettier": "^9.0.0",
|
|
69
71
|
"eslint-plugin-prettier": "^5.0.0",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
+
"jest-matcher-specific-error": "^1.0.0",
|
|
73
|
+
"prettier": "3.0.3"
|
|
72
74
|
},
|
|
73
75
|
"engines": {
|
|
74
76
|
"node": ">=12.13.1"
|
|
75
77
|
}
|
|
76
|
-
}
|
|
78
|
+
}
|