npm package diff
Package: @forge/bundler
Versions: 4.21.0-next.2 - 4.21.0-next.3
Added: package/out/common.js
Added: package/out/lint.js
Added: package/out/common.d.ts.map
Added: package/out/lint.d.ts.map
Added: package/out/common.d.ts
Added: package/out/lint.d.ts
Modified: package/out/config/common.js
Index: package/out/config/common.js
===================================================================
--- package/out/config/common.js
+++ package/out/config/common.js
@@ -1,22 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.getCommonWebpackConfig = exports.geti18nRule = exports.getDevToolConfig = exports.resolveStubPath = exports.resolveModulePath = exports.getEntryPoints = void 0;
+exports.getCommonWebpackConfig = exports.geti18nRule = exports.getDevToolConfig = exports.resolveStubPath = exports.resolveModulePath = void 0;
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const webpack_1 = tslib_1.__importDefault(require("webpack"));
const cli_shared_1 = require("@forge/cli-shared");
const i18n_1 = require("@forge/i18n");
+const common_1 = require("../common");
const text_1 = require("../text");
const tsconfig_interactor_1 = require("../tsconfig-interactor");
-function getEntryPoints(handlers) {
- const modules = new Set(handlers.map(({ module }) => module));
- return Array.from(modules).map((module) => ({
- name: module,
- path: path_1.default.resolve('src', module)
- }));
-}
-exports.getEntryPoints = getEntryPoints;
const resolveModulePath = (moduleName) => {
return require.resolve(moduleName);
};
exports.resolveModulePath = resolveModulePath;
@@ -56,9 +49,9 @@
const resolvedEntryPoints = {};
for (const entrypoint of entryPoints) {
resolvedEntryPoints[entrypoint.name] = path_1.default.resolve(entrypoint.path);
}
- const outputDir = args.watchMode === 'debug' ? path_1.default.resolve(cli_shared_1.TUNNEL_BUNDLE_DIRECTORY) : (0, cli_shared_1.tmpDir)('dist');
+ const outputDir = (0, common_1.getOutputDir)(args);
return {
entry: resolvedEntryPoints,
mode: 'production',
optimization: {
Modified: package/out/index.js
Index: package/out/index.js
===================================================================
--- package/out/index.js
+++ package/out/index.js
@@ -1,20 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.LocalWrapperProvider = exports.getWrapperProvider = exports.getNativeUiBuildConfig = exports.getEntryPoints = exports.runLinter = exports.handleWebpackCompilationResult = exports.getCompiler = exports.BundlerError = exports.NodeBundler = exports.SandboxBundler = exports.NativeUIBundler = void 0;
+exports.LocalWrapperProvider = exports.getWrapperProvider = exports.getNativeUiBuildConfig = exports.handleWebpackCompilationResult = exports.getCompiler = exports.BundlerError = exports.getNodeBundler = exports.SandboxBundler = 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");
+Object.defineProperty(exports, "runLinter", { enumerable: true, get: function () { return lint_1.runLinter; } });
var nativeui_1 = require("./nativeui");
Object.defineProperty(exports, "NativeUIBundler", { enumerable: true, get: function () { return nativeui_1.NativeUIBundler; } });
var runtime_1 = require("./runtime");
Object.defineProperty(exports, "SandboxBundler", { enumerable: true, get: function () { return runtime_1.SandboxBundler; } });
-Object.defineProperty(exports, "NodeBundler", { enumerable: true, get: function () { return runtime_1.NodeBundler; } });
+Object.defineProperty(exports, "getNodeBundler", { enumerable: true, get: function () { return runtime_1.getNodeBundler; } });
var types_1 = require("./types");
Object.defineProperty(exports, "BundlerError", { enumerable: true, get: function () { return types_1.BundlerError; } });
var webpack_1 = require("./webpack");
Object.defineProperty(exports, "getCompiler", { enumerable: true, get: function () { return webpack_1.getCompiler; } });
Object.defineProperty(exports, "handleWebpackCompilationResult", { enumerable: true, get: function () { return webpack_1.handleWebpackCompilationResult; } });
-Object.defineProperty(exports, "runLinter", { enumerable: true, get: function () { return webpack_1.runLinter; } });
-var common_1 = require("./config/common");
-Object.defineProperty(exports, "getEntryPoints", { enumerable: true, get: function () { return common_1.getEntryPoints; } });
var nativeui_2 = require("./config/nativeui");
Object.defineProperty(exports, "getNativeUiBuildConfig", { enumerable: true, get: function () { return nativeui_2.getNativeUiBuildConfig; } });
var wrapper_provider_1 = require("./wrapper-provider");
Object.defineProperty(exports, "getWrapperProvider", { enumerable: true, get: function () { return wrapper_provider_1.getWrapperProvider; } });
Modified: package/out/runtime.js
Index: package/out/runtime.js
===================================================================
--- package/out/runtime.js
+++ package/out/runtime.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.NodeBundler = exports.SandboxBundler = void 0;
+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 common_1 = require("./config/common");
@@ -17,8 +17,24 @@
}
exports.SandboxBundler = SandboxBundler;
const NODE_RUNTIME_VERSION_FILE = 'runtime.json';
const NODE_WEBPACK_USER_CODE_DIR = 'bundled';
+async function emitWrapperFiles(provider, entrypoints, emit) {
+ const wrapper = await provider.getNodeRuntimeWrapper();
+ const loader = await provider.getNodeRuntimeLoader();
+ if (loader) {
+ for (const entrypoint of entrypoints) {
+ await emit(`${entrypoint.name}.cjs`, loader.script);
+ }
+ await emit('__forge_wrapper__.cjs', wrapper.script);
+ }
+ else {
+ for (const entrypoint of entrypoints) {
+ await emit(`${entrypoint.name}.cjs`, wrapper.script);
+ }
+ }
+ await emit(NODE_RUNTIME_VERSION_FILE, JSON.stringify({ version: loader ? loader.version : wrapper.version }, null, 2));
+}
class NodeBundler extends webpack_2.WebpackBundler {
wrapperProvider;
constructor(logger, wrapperProvider) {
super(logger);
@@ -41,34 +57,14 @@
}
});
webpackConfig.plugins.push({
apply: (compiler) => {
- compiler.hooks.make.tapPromise('AfterEmitPlugin', this.insertWrapperBundle(args.entryPoints));
+ compiler.hooks.make.tapPromise('AfterEmitPlugin', async (compilation) => await emitWrapperFiles(this.wrapperProvider, args.entryPoints, async (name, contents) => compilation.emitAsset(name, new RawSource(contents))));
}
});
return webpackConfig;
}
- insertWrapperBundle(entrypoints) {
- return async (compilation) => {
- const wrapper = await this.wrapperProvider.getNodeRuntimeWrapper();
- const loader = await this.wrapperProvider.getNodeRuntimeLoader();
- if (loader) {
- const loaderSource = new RawSource(loader.script);
- for (const entrypoint of entrypoints) {
- compilation.emitAsset(`${entrypoint.name}.cjs`, loaderSource);
- }
- const wrapperSource = new RawSource(wrapper.script);
- compilation.emitAsset('__forge_wrapper__.cjs', wrapperSource);
- }
- else {
- const source = new RawSource(wrapper.script);
- for (const entrypoint of entrypoints) {
- compilation.emitAsset(`${entrypoint.name}.cjs`, source);
- }
- }
- compilation.emitAsset(NODE_RUNTIME_VERSION_FILE, new RawSource(JSON.stringify({
- version: loader ? loader.version : wrapper.version
- }, null, 2)));
- };
- }
}
-exports.NodeBundler = NodeBundler;
+function getNodeBundler(logger, wrapperProvider, configReader) {
+ return new NodeBundler(logger, wrapperProvider);
+}
+exports.getNodeBundler = getNodeBundler;
Modified: package/out/webpack.js
Index: package/out/webpack.js
===================================================================
--- package/out/webpack.js
+++ package/out/webpack.js
@@ -1,12 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.WebpackBundler = exports.runLinter = exports.getCompiler = exports.handleWebpackCompilationResult = void 0;
+exports.WebpackBundler = exports.getCompiler = exports.handleWebpackCompilationResult = void 0;
const tslib_1 = require("tslib");
-const path_1 = tslib_1.__importDefault(require("path"));
const webpack_1 = tslib_1.__importDefault(require("webpack"));
const cli_shared_1 = require("@forge/cli-shared");
-const lint_1 = require("@forge/lint");
const text_1 = require("./text");
function handleWebpackCompilationResult(logger, err, stats) {
if (err) {
throw err;
@@ -56,41 +54,14 @@
});
return Array.from(filteredModuleNames);
}
}
-const runLinter = async (logger = { info: console.log }, fileSystemReader = new cli_shared_1.FileSystemReader(), fileSystemWriter = new cli_shared_1.FileSystemWriter()) => {
- logger.info(`\n${cli_shared_1.Text.tunnel.preBundleTask(cli_shared_1.Text.lint.running)}`);
- const exclude = [...(await (0, cli_shared_1.listGitIgnoreFiles)(fileSystemReader)), '.git', 'node_modules'];
- const configFile = new cli_shared_1.ConfigFile(fileSystemReader, fileSystemWriter);
- const manifest = await configFile.readConfig();
- const csuikResources = await configFile.getResources(['nativeUI']);
- const csuikDirectories = csuikResources.map((resource) => path_1.default.dirname(resource.path));
- const [filesToLint, ...csuikFilesByDirectory] = await Promise.all([
- fileSystemReader.recursiveReadDir('./src', exclude),
- ...csuikDirectories.map((directory) => fileSystemReader.recursiveReadDir(directory, exclude))
- ]);
- const csuikFilesToLint = csuikFilesByDirectory.reduce((allFiles, directoryFiles) => allFiles.concat(directoryFiles), []);
- try {
- const lintResults = await (0, lint_1.lint)([...filesToLint, ...csuikFilesToLint], manifest, 'development', logger);
- if (lintResults.some((result) => result.size())) {
- logger.info('');
- (0, lint_1.reportLintResults)(logger, lintResults);
- }
- else {
- logger.info(cli_shared_1.LogColor.trace(cli_shared_1.Text.lint.noProblems) + '\n');
- }
- }
- catch (error) {
- logger.info(cli_shared_1.Text.tunnel.lintFailed + '\n');
- }
-};
-exports.runLinter = runLinter;
class WebpackBundler {
logger;
constructor(logger) {
this.logger = logger;
}
- getOutput(config, stats) {
+ async getOutput(config, stats) {
const outputDir = config.output.path;
const metadata = {};
if (stats) {
metadata.modules = getNodeModuleNames(stats);
@@ -99,17 +70,17 @@
}
async runCompiler(config) {
const compiler = getCompiler(config);
return new Promise((resolve, reject) => {
- compiler.run((compilerError, stats) => {
+ compiler.run(async (compilerError, stats) => {
try {
handleWebpackCompilationResult(this.logger, compilerError, stats);
compiler.close((closeError) => {
if (closeError) {
reject(closeError);
}
});
- resolve(this.getOutput(config, stats));
+ resolve(await this.getOutput(config, stats));
}
catch (err) {
reject(err);
}
@@ -134,9 +105,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 = this.getOutput(config, stats);
+ const result = await this.getOutput(config, stats);
if (isFirstRun) {
isFirstRun = false;
resolve({ result, stop: () => watching.close(() => void 0) });
}
Modified: package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/bundler",
- "version": "4.21.0-next.2",
+ "version": "4.21.0-next.3",
"description": "Default bundler for Forge apps",
"license": "SEE LICENSE IN LICENSE.txt",
"author": "Atlassian",
"main": "out/index.js",
@@ -18,9 +18,9 @@
"@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-next.0",
+ "@forge/api": "5.1.1-next.1",
"@forge/babel-plugin-transform-ui": "1.1.21",
"@forge/cli-shared": "6.6.2-next.1",
"@forge/i18n": "0.0.4",
"@forge/lint": "5.7.2-next.1",
Modified: package/out/config/common.d.ts.map
Index: package/out/config/common.d.ts.map
===================================================================
--- package/out/config/common.d.ts.map
+++ package/out/config/common.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/config/common.ts"],"names":[],"mappings":";AAEA,OAAgB,EAAE,aAAa,IAAI,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,EAAE,OAAO,EAAqD,MAAM,mBAAmB,CAAC;AAE/F,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEnD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAOhE;AAED,eAAO,MAAM,iBAAiB,eAAgB,MAAM,KAAG,MAEtD,CAAC;AAEF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,eAAO,MAAM,gBAAgB,kBAAmB,KAAK,WA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,kBAAmB,KAAK,WAAW,EAAE,WAAW,CAAC,KAAG,MAShF,CAAC;AAEF,oBAAY,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5E,oBAAY,mBAAmB,GAAG,cAAc,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAC5F,aAAK,mBAAmB,GAAG,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAClE,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,oBAAY,mBAAmB,GAAG,cAAc,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,GACnF,MAAM,CAAC,QAAQ,EAAE,mBAAmB,CAAC,GACrC,MAAM,CAAC,QAAQ,EAAE,mBAAmB,CAAC,GACrC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAElC,eAAO,MAAM,WAAW,eAAgB,YAAY;;;;;+DAIe;YAAE,QAAQ;gBAAE,QAAQ,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE;;CAalG,CAAC;AAEF,eAAO,MAAM,sBAAsB,SAAU,WAAW,KAAG,mBA4G1D,CAAC"}
\ No newline at end of file
Modified: package/out/index.d.ts.map
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,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzG,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,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,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzG,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
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":"AAKA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAc,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,cAAe,SAAQ,cAAc;gBACpC,MAAM,EAAE,YAAY;IAIhC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB;CAG/C;AAUD,qBAAa,WAAY,SAAQ,cAAc;IAG3C,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADhC,MAAM,EAAE,YAAY,EACH,eAAe,EAAE,eAAe;IAKnD,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB;IAyC9C,OAAO,CAAC,mBAAmB;CAkC5B"}
\ No newline at end of file
+{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAc,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,cAAe,SAAQ,cAAc;gBACpC,MAAM,EAAE,YAAY;IAIhC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB;CAG/C;AAoCD,cAAM,WAAY,SAAQ,cAAc;IAGpC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADhC,MAAM,EAAE,YAAY,EACH,eAAe,EAAE,eAAe;IAKnD,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB;CA8C/C;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,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":"AAA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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/out/webpack.d.ts.map
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,EAEL,gBAAgB,EAGhB,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA2B,UAAU,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EACL,OAAO,EACP,YAAY,EAEZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,YAAY,EACpB,GAA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ChB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,YAAY,EACpB,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,YAAY;gBAApB,MAAM,EAAE,YAAY;cAEnC,SAAS,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC;cAWjF,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAsB7E,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,gBAAgB;IAEjD,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
Modified: package/CHANGELOG.md
Large diffs are not rendered by default.
Modified: package/out/config/common.d.ts
Index: package/out/config/common.d.ts
===================================================================
--- package/out/config/common.d.ts
+++ package/out/config/common.d.ts
@@ -1,10 +1,8 @@
/// <reference types="node" />
import { Configuration as WebpackConfig, ModuleOptions } from 'webpack';
-import { Handler } from '@forge/cli-shared';
import { Translations } from '@forge/manifest';
-import { BundlerArgs, EntryPoint } from '../types';
-export declare function getEntryPoints(handlers: Handler[]): EntryPoint[];
+import { BundlerArgs } from '../types';
export declare const resolveModulePath: (moduleName: string) => string;
export declare function resolveStubPath(stubName: string): string;
export declare const getDevToolConfig: ({ watchMode }: Pick<BundlerArgs, 'watchMode'>) => string;
export declare type RequiredFields<T, F extends keyof T> = T & Required<Pick<T, F>>;
Modified: package/out/index.d.ts
Index: package/out/index.d.ts
===================================================================
--- package/out/index.d.ts
+++ package/out/index.d.ts
@@ -1,8 +1,9 @@
+export { getOutputDir, getEntryPoints } from './common';
+export { runLinter } from './lint';
export { NativeUIBundler, NativeUIBundleResult } from './nativeui';
-export { SandboxBundler, NodeBundler } from './runtime';
+export { SandboxBundler, getNodeBundler } from './runtime';
export { Bundler, BundlerError, BundlerOutput, BundlerWatch, EntryPoint, WatcherMonitor } from './types';
-export { getCompiler, handleWebpackCompilationResult, runLinter } from './webpack';
-export { getEntryPoints } from './config/common';
+export { getCompiler, handleWebpackCompilationResult } from './webpack';
export { getNativeUiBuildConfig } from './config/nativeui';
export { getWrapperProvider, LocalWrapperProvider } from './wrapper-provider';
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
Modified: package/out/runtime.d.ts
Index: package/out/runtime.d.ts
===================================================================
--- package/out/runtime.d.ts
+++ package/out/runtime.d.ts
@@ -1,14 +1,16 @@
+import { ConfigReader } from '@forge/cli-shared';
import { BundleLogger, BundlerArgs } from './types';
import { ConfigWithOutput, WebpackBundler } from './webpack';
import { WrapperProvider } from './wrapper-provider';
export declare class SandboxBundler extends WebpackBundler {
constructor(logger: BundleLogger);
getConfig(args: BundlerArgs): ConfigWithOutput;
}
-export declare class NodeBundler extends WebpackBundler {
+declare class NodeBundler extends WebpackBundler {
private readonly wrapperProvider;
constructor(logger: BundleLogger, wrapperProvider: WrapperProvider);
getConfig(args: BundlerArgs): ConfigWithOutput;
- private insertWrapperBundle;
}
+export declare function getNodeBundler(logger: BundleLogger, wrapperProvider: WrapperProvider, configReader: ConfigReader): NodeBundler;
+export {};
//# sourceMappingURL=runtime.d.ts.map
\ No newline at end of file
Modified: package/out/types.d.ts
Index: package/out/types.d.ts
===================================================================
--- package/out/types.d.ts
+++ package/out/types.d.ts
@@ -6,9 +6,9 @@
export interface BundlerOutput {
outputDir: string;
metadata?: BundlerMetadata;
}
-export declare type BundleLogger = Pick<Logger, 'trace' | 'debug' | 'info' | 'warn'>;
+export declare type BundleLogger = Pick<Logger, 'trace' | 'debug' | 'info' | 'warn' | 'error'>;
export declare type BundlerWatchMode = 'watch' | 'debug';
export declare type EntryPoint = {
name: string;
path: string;
@@ -18,9 +18,9 @@
entryPoints: EntryPoint[];
i18nConfig?: Translations;
watchMode?: BundlerWatchMode;
};
-export declare type BundlerWatchArgs = BundlerArgs & {
+export declare type BundlerWatchArgs = BundlerArgs & Required<Pick<BundlerArgs, 'watchMode'>> & {
successMessage: string;
};
export declare type BundlerWatch = {
onBuildWillStart: () => Promise<void>;
Modified: package/out/webpack.d.ts
Index: package/out/webpack.d.ts
===================================================================
--- package/out/webpack.d.ts
+++ package/out/webpack.d.ts
@@ -1,19 +1,16 @@
import webpack from 'webpack';
-import { FileSystemReader, FileSystemWriter } from '@forge/cli-shared';
-import { LintLogger } from '@forge/lint';
import { CommonOutputOptions } from './config/common';
import { Bundler, BundleLogger, BundlerOutput, BundlerArgs, BundlerWatch, BundlerWatchArgs, BundlerWatchOutput } from './types';
export declare function handleWebpackCompilationResult(logger: BundleLogger, err: Error | null | undefined, stats: Pick<webpack.Stats, 'hasErrors' | 'hasWarnings' | 'toJson'> | undefined): asserts stats is webpack.Stats;
export declare function getCompiler(config: webpack.Configuration): webpack.Compiler;
-export declare const runLinter: (logger?: LintLogger, fileSystemReader?: FileSystemReader, fileSystemWriter?: FileSystemWriter) => Promise<void>;
export declare type ConfigWithOutput = webpack.Configuration & {
output: CommonOutputOptions;
};
export declare abstract class WebpackBundler implements Bundler {
protected readonly logger: BundleLogger;
constructor(logger: BundleLogger);
- protected getOutput(config: ConfigWithOutput, stats: webpack.Stats): BundlerOutput;
+ protected getOutput(config: ConfigWithOutput, stats: webpack.Stats): Promise<BundlerOutput>;
protected runCompiler(config: ConfigWithOutput): Promise<BundlerOutput>;
abstract getConfig(args: BundlerArgs): ConfigWithOutput;
bundle(args: BundlerArgs): Promise<BundlerOutput>;
watch(args: BundlerWatchArgs, watch: BundlerWatch): Promise<BundlerWatchOutput>;