@forge/bundler 4.11.1-next.16 → 4.11.1-next.18
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,25 @@
|
|
|
1
1
|
# @forge/bundler
|
|
2
2
|
|
|
3
|
+
## 4.11.1-next.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8c4ec99f: Bumping dependencies via Renovate:
|
|
8
|
+
|
|
9
|
+
- @atlassian/xen-test-util
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [8c4ec99f]
|
|
12
|
+
- @forge/cli-shared@3.17.2-next.8
|
|
13
|
+
- @forge/lint@3.6.5-next.9
|
|
14
|
+
|
|
15
|
+
## 4.11.1-next.17
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- a9e43a70: Don't include runtime in sandbox wrapper
|
|
20
|
+
- Updated dependencies [a9e43a70]
|
|
21
|
+
- @forge/node-runtime@0.1.1-next.4
|
|
22
|
+
|
|
3
23
|
## 4.11.1-next.16
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
import { IncomingMessage } from 'http';
|
|
3
5
|
import { RequestOptions } from 'https';
|
|
4
6
|
import { Writable } from 'readable-stream';
|
|
5
7
|
import { URL } from 'url';
|
|
6
8
|
import { FetchOptions } from '@forge/api';
|
|
7
|
-
|
|
9
|
+
type HttpCallback = (res: IncomingMessage) => void;
|
|
10
|
+
type HttpArg = RequestOptions | string | URL | HttpCallback;
|
|
11
|
+
export declare const isHttpRequestOptions: (options: HttpArg) => options is RequestOptions;
|
|
8
12
|
interface ChainableOptions {
|
|
9
13
|
timeout?: number;
|
|
10
14
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-sandbox-impl.d.ts","sourceRoot":"","sources":["../../src/stubs/http-sandbox-impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-sandbox-impl.d.ts","sourceRoot":"","sources":["../../src/stubs/http-sandbox-impl.ts"],"names":[],"mappings":";;;AAGA,OAAO,EAAuB,eAAe,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAY,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAe,YAAY,EAAS,MAAM,YAAY,CAAC;AAE9D,KAAK,YAAY,GAAG,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;AAEnD,KAAK,OAAO,GAAG,cAAc,GAAG,MAAM,GAAG,GAAG,GAAG,YAAY,CAAC;AAQ5D,eAAO,MAAM,oBAAoB,YAAa,OAAO,8BACJ,CAAC;AAYlD,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH;AAED,qBAAa,OAAQ,SAAQ,QAAQ;IACnC,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,gBAAgB,CAAmB;gBAE/B,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,EAAE,QAAQ,CAAC,EAAE,YAAY;IAapE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAM/C,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO;IAQhE,OAAO,CAAC,KAAK;IAsBN,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI;IAe3F,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM;IAiBvE,MAAM,CAAC,uBAAuB,CAC5B,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,EACtC,gBAAgB,EAAE,gBAAgB,GACjC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE;IAuBtC,KAAK;CAGN"}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Request = void 0;
|
|
3
|
+
exports.Request = exports.isHttpRequestOptions = void 0;
|
|
4
4
|
const readable_stream_1 = require("readable-stream");
|
|
5
5
|
const api_1 = require("@forge/api");
|
|
6
|
-
const
|
|
6
|
+
const isCallback = (options) => typeof options === 'function';
|
|
7
|
+
const isString = (options) => typeof options === 'string';
|
|
8
|
+
const isURL = (options) => typeof options === 'object' && options.constructor.name === 'URL';
|
|
9
|
+
const isStringOrURL = (options) => isString(options) || isURL(options);
|
|
10
|
+
const isHttpRequestOptions = (options) => !isStringOrURL(options) && !isCallback(options);
|
|
11
|
+
exports.isHttpRequestOptions = isHttpRequestOptions;
|
|
12
|
+
function formatHttpRequestArgsToUrl(options) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const protocol = 'https:';
|
|
15
|
+
const auth = options.auth ? `${options.auth}@` : '';
|
|
16
|
+
const host = (_a = options.hostname) !== null && _a !== void 0 ? _a : options.host;
|
|
17
|
+
const port = options.port ? `:${options.port}` : '';
|
|
18
|
+
const path = (_b = options.path) !== null && _b !== void 0 ? _b : '/';
|
|
19
|
+
return `${protocol}//${auth}${host}${port}${path}`;
|
|
20
|
+
}
|
|
7
21
|
class Request extends readable_stream_1.Writable {
|
|
8
22
|
constructor(options, callback) {
|
|
9
23
|
super();
|
|
@@ -65,15 +79,15 @@ class Request extends readable_stream_1.Writable {
|
|
|
65
79
|
}
|
|
66
80
|
}
|
|
67
81
|
static urlFromFetchArgs(options) {
|
|
68
|
-
if (
|
|
82
|
+
if (isString(options)) {
|
|
69
83
|
return options;
|
|
70
84
|
}
|
|
71
|
-
else if (
|
|
85
|
+
else if (isURL(options)) {
|
|
72
86
|
return options.toString();
|
|
73
87
|
}
|
|
74
88
|
else {
|
|
75
89
|
try {
|
|
76
|
-
return
|
|
90
|
+
return formatHttpRequestArgsToUrl(options);
|
|
77
91
|
}
|
|
78
92
|
catch (err) {
|
|
79
93
|
console.error('Unable to make request with unrecognised URL options:', options);
|
|
@@ -83,7 +97,7 @@ class Request extends readable_stream_1.Writable {
|
|
|
83
97
|
}
|
|
84
98
|
static convertToForgeFetchArgs(options, chainableOptions) {
|
|
85
99
|
const url = Request.urlFromFetchArgs(options);
|
|
86
|
-
if (
|
|
100
|
+
if (isStringOrURL(options)) {
|
|
87
101
|
return { url, init: chainableOptions };
|
|
88
102
|
}
|
|
89
103
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-sandbox.d.ts","sourceRoot":"","sources":["../../src/stubs/http-sandbox.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"http-sandbox.d.ts","sourceRoot":"","sources":["../../src/stubs/http-sandbox.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAwB,MAAM,qBAAqB,CAAC;AAEpE,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAElH;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAO9G;AAID,qBAAa,KAAK;gBACJ,OAAO,EAAE,YAAY;CAOlC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Agent = exports.get = exports.request = void 0;
|
|
4
|
-
const runtime_1 = require("@forge/runtime");
|
|
5
4
|
const http_sandbox_impl_1 = require("./http-sandbox-impl");
|
|
6
5
|
function request(options, callback) {
|
|
7
6
|
return new http_sandbox_impl_1.Request(options, callback);
|
|
8
7
|
}
|
|
9
8
|
exports.request = request;
|
|
10
9
|
function get(options, callback) {
|
|
11
|
-
if ((0,
|
|
10
|
+
if ((0, http_sandbox_impl_1.isHttpRequestOptions)(options)) {
|
|
12
11
|
options = Object.assign(Object.assign({}, options), { method: 'GET' });
|
|
13
12
|
}
|
|
14
13
|
const result = new http_sandbox_impl_1.Request(options, callback);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bundler",
|
|
3
|
-
"version": "4.11.1-next.
|
|
3
|
+
"version": "4.11.1-next.18",
|
|
4
4
|
"description": "Default bundler for Forge apps",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Atlassian",
|
|
@@ -21,10 +21,9 @@
|
|
|
21
21
|
"@babel/preset-typescript": "^7.22.5",
|
|
22
22
|
"@forge/api": "2.18.5-next.2",
|
|
23
23
|
"@forge/babel-plugin-transform-ui": "1.1.6",
|
|
24
|
-
"@forge/cli-shared": "3.17.2-next.
|
|
25
|
-
"@forge/lint": "3.6.5-next.
|
|
26
|
-
"@forge/node-runtime": "0.1.1-next.
|
|
27
|
-
"@forge/runtime": "5.0.0-next.5",
|
|
24
|
+
"@forge/cli-shared": "3.17.2-next.8",
|
|
25
|
+
"@forge/lint": "3.6.5-next.9",
|
|
26
|
+
"@forge/node-runtime": "0.1.1-next.4",
|
|
28
27
|
"@forge/util": "1.3.1",
|
|
29
28
|
"assert": "^2.0.0",
|
|
30
29
|
"babel-loader": "^8.3.0",
|
|
@@ -57,7 +56,7 @@
|
|
|
57
56
|
"whatwg-url": "^7.1.0"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
|
-
"@atlassian/xen-test-util": "^
|
|
59
|
+
"@atlassian/xen-test-util": "^3.0.3",
|
|
61
60
|
"@types/jest": "^29.5.3",
|
|
62
61
|
"@types/node": "14.18.54",
|
|
63
62
|
"@types/react": "^17.0.64",
|
|
@@ -68,9 +67,10 @@
|
|
|
68
67
|
"eslint": "^8.47.0",
|
|
69
68
|
"eslint-config-prettier": "^9.0.0",
|
|
70
69
|
"eslint-plugin-prettier": "^5.0.0",
|
|
71
|
-
"prettier": "3.0.2"
|
|
70
|
+
"prettier": "3.0.2",
|
|
71
|
+
"@forge/runtime": "5.0.0-next.6"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=12.13.1"
|
|
75
75
|
}
|
|
76
|
-
}
|
|
76
|
+
}
|