@forge/bundler
6.1.23-next.56.1.23-next.6
~
Modified (15 files)
Index: package/out/index.js
===================================================================
--- package/out/index.js
+++ package/out/index.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.LocalWrapperProvider = exports.getWrapperProvider = exports.getNativeUiBuildConfig = exports.handleWebpackCompilationResult = exports.getCompiler = exports.mergeMetadata = exports.emptyMetadata = exports.BundlerError = exports.NODE_RUNTIME_CODE_FILE = exports.getNodeBundler = exports.NativeUIBundler = exports.runLinter = exports.getEntryPoints = exports.getOutputDir = void 0;
+exports.LocalWrapperProvider = exports.getWrapperProvider = exports.getNativeUiWorkerBuildConfig = exports.getNativeUiBuildConfig = exports.handleWebpackCompilationResult = exports.getCompiler = exports.mergeMetadata = exports.emptyMetadata = exports.BundlerError = exports.NODE_RUNTIME_CODE_FILE = exports.getNodeBundler = exports.NativeUIBundler = exports.runLinter = exports.getEntryPoints = exports.getOutputDir = void 0;
var common_1 = require("./common");
Object.defineProperty(exports, "getOutputDir", { enumerable: true, get: function () { return common_1.getOutputDir; } });
Object.defineProperty(exports, "getEntryPoints", { enumerable: true, get: function () { return common_1.getEntryPoints; } });
var lint_1 = require("./lint");
@@ -19,7 +19,8 @@
Object.defineProperty(exports, "getCompiler", { enumerable: true, get: function () { return webpack_1.getCompiler; } });
Object.defineProperty(exports, "handleWebpackCompilationResult", { enumerable: true, get: function () { return webpack_1.handleWebpackCompilationResult; } });
var nativeui_2 = require("./config/nativeui");
Object.defineProperty(exports, "getNativeUiBuildConfig", { enumerable: true, get: function () { return nativeui_2.getNativeUiBuildConfig; } });
+Object.defineProperty(exports, "getNativeUiWorkerBuildConfig", { enumerable: true, get: function () { return nativeui_2.getNativeUiWorkerBuildConfig; } });
var wrapper_provider_1 = require("./wrapper-provider");
Object.defineProperty(exports, "getWrapperProvider", { enumerable: true, get: function () { return wrapper_provider_1.getWrapperProvider; } });
Object.defineProperty(exports, "LocalWrapperProvider", { enumerable: true, get: function () { return wrapper_provider_1.LocalWrapperProvider; } }); Index: package/out/config/nativeui.js
===================================================================
--- package/out/config/nativeui.js
+++ package/out/config/nativeui.js
@@ -1,89 +1,129 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.getNativeUiBuildConfig = void 0;
+exports.getNativeUiWorkerBuildConfig = exports.getNativeUiBuildConfig = void 0;
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const html_webpack_plugin_1 = tslib_1.__importDefault(require("html-webpack-plugin"));
const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
const cli_shared_1 = require("@forge/cli-shared");
const common_1 = require("./common");
+const WORKER_OUTPUT_SUBDIR = '__worker__';
+const getBundleAnalyzerPlugin = (statsFilename) => process.env.FORGE_INSPECT_ARCHIVE
+ ? new webpack_bundle_analyzer_1.BundleAnalyzerPlugin({
+ analyzerMode: 'disabled',
+ generateStatsFile: true,
+ statsFilename: path_1.default.join(process.cwd(), statsFilename),
+ logLevel: 'silent'
+ })
+ : null;
+const baseNativeUiConfig = {
+ mode: 'production',
+ devtool: 'source-map',
+ node: { __dirname: true },
+ performance: { hints: false },
+ resolve: {
+ extensions: ['.ts', '.tsx', '.js', '.jsx', '.jpg', '.jpeg', '.png', '.gif', '.svg']
+ },
+ resolveLoader: {
+ modules: require.resolve.paths('babel-loader') || undefined
+ },
+ module: {
+ rules: [
+ {
+ test: /\.(jpe?g|png|gif|svg)$/i,
+ type: 'asset/resource'
+ },
+ { test: /\.tsx?$/, loader: 'ts-loader' },
+ {
+ test: /\.jsx?$/,
+ exclude: /node_modules/,
+ use: [
+ {
+ loader: 'babel-loader',
+ options: {
+ plugins: [
+ [
+ require.resolve('@babel/plugin-transform-react-jsx'),
+ {
+ pragma: 'React.createElement'
+ }
+ ],
+ require.resolve('@babel/plugin-transform-numeric-separator'),
+ require.resolve('@babel/plugin-transform-class-static-block'),
+ require.resolve('@babel/plugin-transform-class-properties'),
+ require.resolve('@babel/plugin-transform-optional-chaining')
+ ],
+ cacheDirectory: true
+ }
+ }
+ ]
+ }
+ ]
+ }
+};
const getNativeUiBuildConfig = (entrypoints, i18nConfig) => {
const resolvedEntryPoints = {};
for (const entrypoint of entrypoints) {
+ if (entrypoint.name === WORKER_OUTPUT_SUBDIR) {
+ throw new Error(`Entry point name "${WORKER_OUTPUT_SUBDIR}" is reserved for the web worker bundle output directory and cannot be used as a resource key.`);
+ }
resolvedEntryPoints[entrypoint.name] = path_1.default.resolve(entrypoint.path);
}
return {
- entry: {
- ...resolvedEntryPoints
- },
+ ...baseNativeUiConfig,
+ entry: { ...resolvedEntryPoints },
name: 'native-ui',
- mode: 'production',
- devtool: 'source-map',
+ target: 'web',
output: {
filename: '[name].js',
path: (0, cli_shared_1.tmpDir)('native-ui'),
publicPath: 'auto'
},
- node: {
- __dirname: true
- },
- performance: {
- hints: false
- },
plugins: [
- new html_webpack_plugin_1.default({
- filename: 'index.html'
- }),
- process.env.FORGE_INSPECT_ARCHIVE
- ? new webpack_bundle_analyzer_1.BundleAnalyzerPlugin({
- analyzerMode: 'disabled',
- generateStatsFile: true,
- statsFilename: path_1.default.join(process.cwd(), '.forge_app_inspect_stats.json'),
- logLevel: 'silent'
- })
- : null
+ new html_webpack_plugin_1.default({ filename: 'index.html' }),
+ getBundleAnalyzerPlugin('.forge_app_inspect_stats.json')
].filter(Boolean),
+ module: {
+ rules: [...(i18nConfig ? [(0, common_1.geti18nRule)(i18nConfig)] : []), ...baseNativeUiConfig.module.rules]
+ }
+ };
+};
+exports.getNativeUiBuildConfig = getNativeUiBuildConfig;
+const getNativeUiWorkerBuildConfig = (entrypoints, i18nConfig, baseOutputDir) => {
+ const resolvedEntryPoints = {};
+ for (const entrypoint of entrypoints) {
+ resolvedEntryPoints[entrypoint.name] = path_1.default.resolve(entrypoint.path);
+ }
+ return {
+ ...baseNativeUiConfig,
+ entry: { ...resolvedEntryPoints },
+ name: 'native-ui-worker',
+ target: 'webworker',
+ experiments: { outputModule: true },
resolve: {
- extensions: ['.ts', '.tsx', '.js', '.jsx', '.jpg', '.jpeg', '.png', '.gif', '.svg']
+ ...baseNativeUiConfig.resolve,
+ alias: {
+ 'iframe-resizer': false
+ }
},
- resolveLoader: {
- modules: require.resolve.paths('babel-loader') || undefined
+ output: {
+ filename: '[name].js',
+ path: path_1.default.join(baseOutputDir ?? (0, cli_shared_1.tmpDir)('native-ui'), WORKER_OUTPUT_SUBDIR),
+ module: true
},
- target: 'web',
+ optimization: {
+ splitChunks: false,
+ runtimeChunk: false
+ },
+ plugins: [getBundleAnalyzerPlugin('.forge_app_worker_inspect_stats.json')].filter(Boolean),
module: {
- rules: [
- ...(i18nConfig ? [(0, common_1.geti18nRule)(i18nConfig)] : []),
- {
- test: /\.(jpe?g|png|gif|svg)$/i,
- type: 'asset/resource'
- },
- { test: /\.tsx?$/, loader: 'ts-loader' },
- {
- test: /\.jsx?$/,
- exclude: /node_modules/,
- use: [
- {
- loader: 'babel-loader',
- options: {
- plugins: [
- [
- require.resolve('@babel/plugin-transform-react-jsx'),
- {
- pragma: 'React.createElement'
- }
- ],
- require.resolve('@babel/plugin-transform-numeric-separator'),
- require.resolve('@babel/plugin-transform-class-static-block'),
- require.resolve('@babel/plugin-transform-class-properties'),
- require.resolve('@babel/plugin-transform-optional-chaining')
- ],
- cacheDirectory: true
- }
- }
- ]
+ rules: [...(i18nConfig ? [(0, common_1.geti18nRule)(i18nConfig)] : []), ...baseNativeUiConfig.module.rules],
+ parser: {
+ javascript: {
+ dynamicImportMode: 'eager'
}
- ]
+ }
}
};
};
-exports.getNativeUiBuildConfig = getNativeUiBuildConfig;
+exports.getNativeUiWorkerBuildConfig = getNativeUiWorkerBuildConfig; Index: package/out/nativeui.js
===================================================================
--- package/out/nativeui.js
+++ package/out/nativeui.js
@@ -4,10 +4,14 @@
const nativeui_1 = require("./config/nativeui");
const types_1 = require("./types");
const webpack_1 = require("./webpack");
class NativeUIBundler extends webpack_1.WebpackBundler {
- async getConfig({ entryPoints, i18nConfig }) {
- return (0, nativeui_1.getNativeUiBuildConfig)(entryPoints, i18nConfig);
+ async getConfigs({ entryPoints, i18nConfig }) {
+ const iframeConfig = (0, nativeui_1.getNativeUiBuildConfig)(entryPoints, i18nConfig);
+ if (process.env.EXP_FORGE_UI_WORKER_RUNTIME === 'true') {
+ return [iframeConfig, (0, nativeui_1.getNativeUiWorkerBuildConfig)(entryPoints, i18nConfig, iframeConfig.output.path)];
+ }
+ return [iframeConfig];
}
async bundleResources(resources, i18nConfig) {
const nativeUiBundlesDetails = [];
let combinedMetadata = (0, types_1.emptyMetadata)(); Index: package/out/runtime.js
===================================================================
--- package/out/runtime.js
+++ package/out/runtime.js
@@ -49,9 +49,9 @@
constructor(logger, wrapperProvider) {
super(logger);
this.wrapperProvider = wrapperProvider;
}
- async getConfig(args) {
+ async getConfigs(args) {
const webpackConfig = (0, common_1.getCommonWebpackConfig)(args);
webpackConfig.target = 'node18';
webpackConfig.output.filename = '[name].cjs';
webpackConfig.name = 'node-runtime';
@@ -71,9 +71,9 @@
}
});
}
});
- return webpackConfig;
+ return [webpackConfig];
}
}
class TypeScriptNodeBundler extends typescript_1.TypeScriptBundler {
wrapperProvider; Index: package/out/webpack.js
===================================================================
--- package/out/webpack.js
+++ package/out/webpack.js
@@ -6,8 +6,9 @@
const webpack_1 = tslib_1.__importDefault(require("webpack"));
const cli_shared_1 = require("@forge/cli-shared");
const metadata_1 = require("./metadata");
const text_1 = require("./text");
+const types_1 = require("./types");
function handleWebpackCompilationResult(logger, err, stats) {
if (err) {
throw err;
}
@@ -119,14 +120,18 @@
});
});
}
async bundle(args) {
- const config = await this.getConfig(args);
- return await this.runCompiler(args, config);
+ const configs = await this.getConfigs(args);
+ const outputs = await Promise.all(configs.map((cfg) => this.runCompiler(args, cfg)));
+ const [primary, ...rest] = outputs;
+ const metadata = rest.reduce((acc, output) => (output.metadata ? (0, types_1.mergeMetadata)(acc, output.metadata) : acc), primary.metadata ?? (0, types_1.emptyMetadata)());
+ return { outputDir: primary.outputDir, metadata };
}
async watch(args, watch) {
- const config = await this.getConfig(args);
- const compiler = getCompiler(config);
+ const configs = await this.getConfigs(args);
+ const targetConfig = configs[configs.length - 1];
+ const compiler = getCompiler(targetConfig);
let isFirstRun = true;
compiler.hooks.watchRun.tapAsync('watchRun', async (_, watchRunCallback) => {
if (!isFirstRun) {
await watch.onBuildWillStart();
@@ -137,9 +142,9 @@
const watching = compiler.watch({ poll: 1000 }, async (compilerError, stats) => {
try {
handleWebpackCompilationResult(this.logger, compilerError, stats);
this.logger.info(cli_shared_1.LogColor.trace(args.successMessage));
- const result = await this.getOutput(args, config, stats);
+ const result = await this.getOutput(args, targetConfig, stats);
if (isFirstRun) {
isFirstRun = false;
resolve({ result, stop: () => watching.close(() => void 0) });
} Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/bundler",
- "version": "6.1.23-next.5",
+ "version": "6.1.23-next.6",
"description": "Default bundler for Forge apps",
"license": "SEE LICENSE IN LICENSE.txt",
"author": "Atlassian",
"main": "out/index.js",
@@ -20,12 +20,12 @@
"@babel/plugin-transform-optional-chaining": "^7.23.4",
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@babel/traverse": "^7.24.0",
"@babel/types": "^7.24.0",
- "@forge/cli-shared": "8.19.0-next.5",
+ "@forge/cli-shared": "8.19.0-next.6",
"@forge/i18n": "0.0.7",
- "@forge/lint": "5.16.3-next.5",
- "@forge/manifest": "12.5.0-next.3",
+ "@forge/lint": "5.16.3-next.6",
+ "@forge/manifest": "12.5.0-next.4",
"babel-loader": "^8.3.0",
"cheerio": "^1.1.0",
"cross-spawn": "^7.0.6",
"fs-extra": "^11.2.0", Index: package/out/index.d.ts.map
===================================================================
--- package/out/index.d.ts.map
+++ package/out/index.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,eAAe,EACf,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,eAAe,EACf,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC"}
\ No newline at end of file Index: package/out/config/nativeui.d.ts.map
===================================================================
--- package/out/config/nativeui.d.ts.map
+++ package/out/config/nativeui.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"nativeui.d.ts","sourceRoot":"","sources":["../../src/config/nativeui.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAIzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AAE5D,aAAK,cAAc,GAAG,aAAa,GAAG,MAAM,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAE5E,eAAO,MAAM,sBAAsB,gBAAiB,UAAU,EAAE,eAAe,YAAY,KAAG,cAgF7F,CAAC"}
\ No newline at end of file
+{"version":3,"file":"nativeui.d.ts","sourceRoot":"","sources":["../../src/config/nativeui.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAIzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AAE5D,aAAK,cAAc,GAAG,aAAa,GAAG,MAAM,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AAgE5E,eAAO,MAAM,sBAAsB,gBAAiB,UAAU,EAAE,eAAe,YAAY,KAAG,cA8B7F,CAAC;AAEF,eAAO,MAAM,4BAA4B,gBAC1B,UAAU,EAAE,eACZ,YAAY,kBACT,MAAM,KACrB,cAwCF,CAAC"}
\ No newline at end of file Index: package/out/nativeui.d.ts.map
===================================================================
--- package/out/nativeui.d.ts.map
+++ package/out/nativeui.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"nativeui.d.ts","sourceRoot":"","sources":["../src/nativeui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAgB,eAAe,EAA+C,MAAM,SAAS,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,EAAE,eAAe,EAAE,CAAC;IAC1C,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,qBAAa,eAAgB,SAAQ,cAAc;IAC3C,SAAS,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIvE,eAAe,CAAC,SAAS,EAAE,eAAe,EAAE,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAyCrH"}
\ No newline at end of file
+{"version":3,"file":"nativeui.d.ts","sourceRoot":"","sources":["../src/nativeui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAgB,eAAe,EAA+C,MAAM,SAAS,CAAC;AAClH,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,EAAE,eAAe,EAAE,CAAC;IAC1C,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,qBAAa,eAAgB,SAAQ,cAAc;IAC3C,UAAU,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ/D,eAAe,CAAC,SAAS,EAAE,eAAe,EAAE,EAAE,UAAU,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAyCrH"}
\ No newline at end of file Index: package/out/webpack.d.ts.map
===================================================================
--- package/out/webpack.d.ts.map
+++ package/out/webpack.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAA4B,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EACL,OAAO,EAEP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC7B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC,GAAG,SAAS,GAC7E,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAkChC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,QAAQ,CAE3E;AAqBD,oBAAY,gBAAgB,GAAG,OAAO,CAAC,aAAa,GAAG;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAEvF,8BAAsB,cAAe,YAAW,OAAO;IACzC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;cAE7B,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC;IAkBpH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAmBhD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;cAwBzC,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAsBhG,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAE1D,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAKjD,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAsCtF"}
\ No newline at end of file
+{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAA4B,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EACL,OAAO,EAEP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAGnB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC7B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC,GAAG,SAAS,GAC7E,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAkChC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,QAAQ,CAE3E;AAqBD,oBAAY,gBAAgB,GAAG,OAAO,CAAC,aAAa,GAAG;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAEvF,oBAAY,OAAO,GAAG,CAAC,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAAC,CAAC;AAEhE,8BAAsB,cAAe,YAAW,OAAO;IACzC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;cAE7B,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC;IAkBpH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAmBhD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;cAwBzC,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAsBhG,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAElD,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;IAWjD,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2CtF"}
\ No newline at end of file File too large for inline diff
Index: package/out/index.d.ts
===================================================================
--- package/out/index.d.ts
+++ package/out/index.d.ts
@@ -3,7 +3,7 @@
export { NativeUIBundler, NativeUIBundleResult } from './nativeui';
export { getNodeBundler, NODE_RUNTIME_CODE_FILE } from './runtime';
export { Bundler, BundlerError, BundlerMetadata, emptyMetadata, mergeMetadata, BundlerOutput, BundlerWatch, EntryPoint, WatcherMonitor } from './types';
export { getCompiler, handleWebpackCompilationResult } from './webpack';
-export { getNativeUiBuildConfig } from './config/nativeui';
+export { getNativeUiBuildConfig, getNativeUiWorkerBuildConfig } from './config/nativeui';
export { getWrapperProvider, LocalWrapperProvider } from './wrapper-provider';
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file Index: package/out/config/nativeui.d.ts
===================================================================
--- package/out/config/nativeui.d.ts
+++ package/out/config/nativeui.d.ts
@@ -3,6 +3,7 @@
import { EntryPoint } from '../types';
import { CommonOutputOptions } from './common';
declare type NativeUIConfig = WebpackConfig & Record<'output', CommonOutputOptions>;
export declare const getNativeUiBuildConfig: (entrypoints: EntryPoint[], i18nConfig?: Translations) => NativeUIConfig;
+export declare const getNativeUiWorkerBuildConfig: (entrypoints: EntryPoint[], i18nConfig?: Translations, baseOutputDir?: string) => NativeUIConfig;
export {};
//# sourceMappingURL=nativeui.d.ts.map
\ No newline at end of file Index: package/out/nativeui.d.ts
===================================================================
--- package/out/nativeui.d.ts
+++ package/out/nativeui.d.ts
@@ -1,13 +1,13 @@
import { ResourceDetails } from '@forge/cli-shared';
import { Translations } from '@forge/manifest';
import { BundlerArgs, BundlerMetadata } from './types';
-import { ConfigWithOutput, WebpackBundler } from './webpack';
+import { WebpackBundler, Configs } from './webpack';
export interface NativeUIBundleResult {
nativeUiBundlesDetails: ResourceDetails[];
metadata: BundlerMetadata;
}
export declare class NativeUIBundler extends WebpackBundler {
- getConfig({ entryPoints, i18nConfig }: BundlerArgs): Promise<ConfigWithOutput>;
+ getConfigs({ entryPoints, i18nConfig }: BundlerArgs): Promise<Configs>;
bundleResources(resources: ResourceDetails[], i18nConfig?: Translations): Promise<NativeUIBundleResult>;
}
//# sourceMappingURL=nativeui.d.ts.map
\ No newline at end of file Index: package/out/webpack.d.ts
===================================================================
--- package/out/webpack.d.ts
+++ package/out/webpack.d.ts
@@ -6,16 +6,17 @@
export declare function getCompiler(config: webpack.Configuration): webpack.Compiler;
export declare type ConfigWithOutput = webpack.Configuration & {
output: CommonOutputOptions;
};
+export declare type Configs = [ConfigWithOutput, ...ConfigWithOutput[]];
export declare abstract class WebpackBundler implements Bundler {
protected readonly logger: Logger;
constructor(logger: Logger);
protected getOutput(args: BundlerArgs, config: ConfigWithOutput, stats: webpack.Stats): Promise<BundlerOutput>;
protected isRegularModule(name: string): boolean;
protected localModules(stats: webpack.Stats): Set<string>;
protected runCompiler(args: BundlerArgs, config: ConfigWithOutput): Promise<BundlerOutput>;
- abstract getConfig(args: BundlerArgs): Promise<ConfigWithOutput>;
+ abstract getConfigs(args: BundlerArgs): Promise<Configs>;
bundle(args: BundlerArgs): Promise<BundlerOutput>;
watch(args: BundlerWatchArgs, watch: BundlerWatch): Promise<BundlerWatchOutput>;
}
//# sourceMappingURL=webpack.d.ts.map
\ No newline at end of file