@forge/bundler 4.15.11-next.1 → 4.15.11

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