@forge/bundler 4.16.2-next.6 → 4.16.2-next.7

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @forge/bundler
2
2
 
3
+ ## 4.16.2-next.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [670a419]
8
+ - @forge/cli-shared@5.0.0-next.6
9
+ - @forge/lint@5.1.1-next.6
10
+
3
11
  ## 4.16.2-next.6
4
12
 
5
13
  ### Patch Changes
@@ -12,7 +12,9 @@ const getNativeUiBuildConfig = (entrypoints) => {
12
12
  resolvedEntryPoints[entrypoint.name] = (0, path_1.resolve)(entrypoint.path);
13
13
  }
14
14
  return {
15
- entry: Object.assign({}, resolvedEntryPoints),
15
+ entry: {
16
+ ...resolvedEntryPoints
17
+ },
16
18
  name: 'native-ui',
17
19
  mode: 'production',
18
20
  devtool: 'source-map',
@@ -31,6 +31,7 @@ class ParseWrapperCDNIndexError extends cli_shared_1.BaseError {
31
31
  }
32
32
  exports.ParseWrapperCDNIndexError = ParseWrapperCDNIndexError;
33
33
  class LocalWrapperProvider {
34
+ filesystemReader;
34
35
  constructor(filesystemReader) {
35
36
  this.filesystemReader = filesystemReader;
36
37
  }
@@ -47,13 +48,14 @@ class LocalWrapperProvider {
47
48
  }
48
49
  exports.LocalWrapperProvider = LocalWrapperProvider;
49
50
  class NetworkWrapperProvider {
51
+ cdnUrl;
52
+ wrapper;
50
53
  constructor(cdnUrl) {
51
54
  this.cdnUrl = cdnUrl;
52
55
  }
53
56
  async getWrapperPathFromIndex(htmlContent, requestId) {
54
- var _a, _b, _c;
55
57
  const html = cheerio_1.default.load(htmlContent);
56
- const wrapperPath = (_c = (_b = (_a = html('script')) === null || _a === void 0 ? void 0 : _a.get()) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.attribs['src'];
58
+ const wrapperPath = html('script')?.get()?.[0]?.attribs['src'];
57
59
  if (typeof wrapperPath !== 'string') {
58
60
  throw new ParseWrapperCDNIndexError('Unable to parse source of runtime component.', requestId);
59
61
  }
@@ -100,7 +100,12 @@ const getSandboxedRuntimeBuildConfig = (entrypoints, config) => {
100
100
  ];
101
101
  moduleRuls.forEach((rule) => webpackConfig.module.rules.push(rule));
102
102
  webpackConfig.target = 'webworker';
103
- webpackConfig.resolve = Object.assign(Object.assign({}, webpackConfig.resolve), { mainFields: ['main', 'module'], exportsFields: [], alias: getCustomModulesAliases() });
103
+ webpackConfig.resolve = {
104
+ ...webpackConfig.resolve,
105
+ mainFields: ['main', 'module'],
106
+ exportsFields: [],
107
+ alias: getCustomModulesAliases()
108
+ };
104
109
  webpackConfig.name = exports.SANDBOXED_WEBPACK_CONFIG_NAME;
105
110
  return webpackConfig;
106
111
  };
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StubPlugin = void 0;
4
4
  const ConstDependency = require('webpack/lib/dependencies/ConstDependency');
5
5
  class StubPlugin {
6
+ modules;
7
+ placeholder;
8
+ stub;
6
9
  constructor({ modules = [], placeholder, stub = '' }) {
7
10
  this.modules = modules;
8
11
  this.placeholder = placeholder;
@@ -16,7 +19,10 @@ class StubPlugin {
16
19
  return callback();
17
20
  }
18
21
  const stubRequest = `${this.stub}?${requestedModule}`;
19
- resolver.doResolve(resolver.hooks.resolve, Object.assign(Object.assign({}, request), { request: stubRequest }), `Stub for ${requestedModule}`, resolveContext, callback);
22
+ resolver.doResolve(resolver.hooks.resolve, {
23
+ ...request,
24
+ request: stubRequest
25
+ }, `Stub for ${requestedModule}`, resolveContext, callback);
20
26
  });
21
27
  });
22
28
  if (this.placeholder) {
@@ -10,15 +10,16 @@ const isStringOrURL = (options) => isString(options) || isURL(options);
10
10
  const isHttpRequestOptions = (options) => !isStringOrURL(options) && !isCallback(options);
11
11
  exports.isHttpRequestOptions = isHttpRequestOptions;
12
12
  function formatHttpRequestArgsToUrl(options) {
13
- var _a, _b;
14
13
  const protocol = 'https:';
15
14
  const auth = options.auth ? `${options.auth}@` : '';
16
- const host = (_a = options.hostname) !== null && _a !== void 0 ? _a : options.host;
15
+ const host = options.hostname ?? options.host;
17
16
  const port = options.port ? `:${options.port}` : '';
18
- const path = (_b = options.path) !== null && _b !== void 0 ? _b : '/';
17
+ const path = options.path ?? '/';
19
18
  return `${protocol}//${auth}${host}${port}${path}`;
20
19
  }
21
20
  class Request extends readable_stream_1.Writable {
21
+ reqBody;
22
+ chainableOptions;
22
23
  constructor(options, callback) {
23
24
  super();
24
25
  this.reqBody = [];
@@ -114,7 +115,7 @@ class Request extends readable_stream_1.Writable {
114
115
  if (options.timeout)
115
116
  reqOpts.timeout = options.timeout;
116
117
  reqOpts.method = options.method || 'GET';
117
- return { url, init: Object.assign(Object.assign({}, chainableOptions), reqOpts) };
118
+ return { url, init: { ...chainableOptions, ...reqOpts } };
118
119
  }
119
120
  }
120
121
  abort() {
@@ -142,6 +143,10 @@ const HEADERS_DISCARD_DUPLICATES = new Set([
142
143
  'user-agent'
143
144
  ]);
144
145
  class Response extends readable_stream_1.Readable {
146
+ statusCode;
147
+ statusMessage;
148
+ headers;
149
+ headersDistinct;
145
150
  constructor(content, response) {
146
151
  super();
147
152
  this.statusCode = response.status;
@@ -8,7 +8,7 @@ function request(options, callback) {
8
8
  exports.request = request;
9
9
  function get(options, callback) {
10
10
  if ((0, http_sandbox_impl_1.isHttpRequestOptions)(options)) {
11
- options = Object.assign(Object.assign({}, options), { method: 'GET' });
11
+ options = { ...options, method: 'GET' };
12
12
  }
13
13
  const result = new http_sandbox_impl_1.Request(options, callback);
14
14
  result.end();
@@ -5,6 +5,8 @@ const path_1 = require("path");
5
5
  exports.TSCONFIG = 'tsconfig.json';
6
6
  exports.STATIC_TSCONFIG_PATH = (0, path_1.join)(__dirname, `../static/${exports.TSCONFIG}`);
7
7
  class TSConfigInteractor {
8
+ fileSystemReader;
9
+ appDirectory;
8
10
  constructor(fileSystemReader, appDirectory) {
9
11
  this.fileSystemReader = fileSystemReader;
10
12
  this.appDirectory = appDirectory;
package/out/webpack.js CHANGED
@@ -51,10 +51,9 @@ function tryReadSourceMapSync(fileSystem, sourceMap, fileName) {
51
51
  }
52
52
  }
53
53
  function getInMemoryBundle(config, fileSystem) {
54
- var _a, _b;
55
54
  const output = {}, sourceMap = {};
56
55
  const outputFileSystem = fileSystem || compilerOutputFileSystem;
57
- const fileNamePattern = (_b = (_a = config.output) === null || _a === void 0 ? void 0 : _a.filename) !== null && _b !== void 0 ? _b : '[name].js';
56
+ const fileNamePattern = config.output?.filename ?? '[name].js';
58
57
  for (const name in config.entry) {
59
58
  const fileName = fileNamePattern.replace('[name]', name);
60
59
  output[fileName] = readMemoryFileSync(outputFileSystem, fileName);
@@ -75,7 +74,7 @@ function getInMemoryBundle(config, fileSystem) {
75
74
  exports.getInMemoryBundle = getInMemoryBundle;
76
75
  const getCompiler = (webpackConfig, options) => {
77
76
  const compiler = (0, webpack_1.default)(webpackConfig);
78
- if (!(options === null || options === void 0 ? void 0 : options.writeToDisk)) {
77
+ if (!options?.writeToDisk) {
79
78
  compiler.outputFileSystem = compilerOutputFileSystem;
80
79
  }
81
80
  return compiler;
@@ -101,6 +100,7 @@ const getNodeModuleNames = (stats) => {
101
100
  }
102
101
  };
103
102
  class Monitor {
103
+ watcher;
104
104
  constructor(watcher) {
105
105
  this.watcher = watcher;
106
106
  }
@@ -173,7 +173,10 @@ function createBundler(getBuildConfig) {
173
173
  reject(closeError);
174
174
  }
175
175
  });
176
- result.metadata = Object.assign({ modules: getNodeModuleNames(stats) }, result.metadata);
176
+ result.metadata = {
177
+ modules: getNodeModuleNames(stats),
178
+ ...result.metadata
179
+ };
177
180
  resolve(result);
178
181
  }
179
182
  catch (fileReadError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/bundler",
3
- "version": "4.16.2-next.6",
3
+ "version": "4.16.2-next.7",
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.23.3",
22
22
  "@forge/api": "3.7.0-next.0",
23
23
  "@forge/babel-plugin-transform-ui": "1.1.18",
24
- "@forge/cli-shared": "5.0.0-next.5",
25
- "@forge/lint": "5.1.1-next.5",
24
+ "@forge/cli-shared": "5.0.0-next.6",
25
+ "@forge/lint": "5.1.1-next.6",
26
26
  "@forge/util": "1.4.3",
27
27
  "assert": "^2.1.0",
28
28
  "babel-loader": "^8.3.0",