@front10/danger-plugins 2.0.0-alpha.1 → 2.0.0-alpha.4
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/dist/danger-plugins.cjs.development.js +73 -219
- package/dist/danger-plugins.cjs.development.js.map +1 -1
- package/dist/danger-plugins.cjs.production.min.js +1 -1
- package/dist/danger-plugins.cjs.production.min.js.map +1 -1
- package/dist/danger-plugins.esm.js +72 -218
- package/dist/danger-plugins.esm.js.map +1 -1
- package/dist/plugin-bundle-size.d.ts +3 -1
- package/dist/plugin-netlify.d.ts +7 -10
- package/package.json +4 -4
- package/src/plugin-bundle-size.ts +27 -14
- package/src/plugin-netlify.ts +9 -47
- package/src/types.d.ts +0 -223
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
6
|
|
|
7
|
-
var NetlifyAPI = _interopDefault(require('netlify'));
|
|
8
7
|
var fs = require('fs');
|
|
9
8
|
var fs__default = _interopDefault(fs);
|
|
10
|
-
var
|
|
9
|
+
var fetch = _interopDefault(require('node-fetch'));
|
|
11
10
|
var path = _interopDefault(require('path'));
|
|
12
11
|
var zlib = _interopDefault(require('zlib'));
|
|
13
12
|
var util = require('util');
|
|
@@ -48,81 +47,6 @@ function _asyncToGenerator(fn) {
|
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
function _extends() {
|
|
52
|
-
_extends = Object.assign || function (target) {
|
|
53
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
54
|
-
var source = arguments[i];
|
|
55
|
-
|
|
56
|
-
for (var key in source) {
|
|
57
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
58
|
-
target[key] = source[key];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return target;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return _extends.apply(this, arguments);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
70
|
-
if (source == null) return {};
|
|
71
|
-
var target = {};
|
|
72
|
-
var sourceKeys = Object.keys(source);
|
|
73
|
-
var key, i;
|
|
74
|
-
|
|
75
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
76
|
-
key = sourceKeys[i];
|
|
77
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
78
|
-
target[key] = source[key];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return target;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
85
|
-
if (!o) return;
|
|
86
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
87
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
88
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
89
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
90
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function _arrayLikeToArray(arr, len) {
|
|
94
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
95
|
-
|
|
96
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
97
|
-
|
|
98
|
-
return arr2;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
102
|
-
var it;
|
|
103
|
-
|
|
104
|
-
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
|
105
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
106
|
-
if (it) o = it;
|
|
107
|
-
var i = 0;
|
|
108
|
-
return function () {
|
|
109
|
-
if (i >= o.length) return {
|
|
110
|
-
done: true
|
|
111
|
-
};
|
|
112
|
-
return {
|
|
113
|
-
done: false,
|
|
114
|
-
value: o[i++]
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
it = o[Symbol.iterator]();
|
|
123
|
-
return it.next.bind(it);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
50
|
function createCommonjsModule(fn, module) {
|
|
127
51
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
128
52
|
}
|
|
@@ -145,24 +69,6 @@ var runtime = (function (exports) {
|
|
|
145
69
|
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
146
70
|
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
147
71
|
|
|
148
|
-
function define(obj, key, value) {
|
|
149
|
-
Object.defineProperty(obj, key, {
|
|
150
|
-
value: value,
|
|
151
|
-
enumerable: true,
|
|
152
|
-
configurable: true,
|
|
153
|
-
writable: true
|
|
154
|
-
});
|
|
155
|
-
return obj[key];
|
|
156
|
-
}
|
|
157
|
-
try {
|
|
158
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
159
|
-
define({}, "");
|
|
160
|
-
} catch (err) {
|
|
161
|
-
define = function(obj, key, value) {
|
|
162
|
-
return obj[key] = value;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
72
|
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
167
73
|
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
168
74
|
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
@@ -215,9 +121,9 @@ var runtime = (function (exports) {
|
|
|
215
121
|
// This is a polyfill for %IteratorPrototype% for environments that
|
|
216
122
|
// don't natively support it.
|
|
217
123
|
var IteratorPrototype = {};
|
|
218
|
-
|
|
124
|
+
IteratorPrototype[iteratorSymbol] = function () {
|
|
219
125
|
return this;
|
|
220
|
-
}
|
|
126
|
+
};
|
|
221
127
|
|
|
222
128
|
var getProto = Object.getPrototypeOf;
|
|
223
129
|
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
@@ -231,22 +137,18 @@ var runtime = (function (exports) {
|
|
|
231
137
|
|
|
232
138
|
var Gp = GeneratorFunctionPrototype.prototype =
|
|
233
139
|
Generator.prototype = Object.create(IteratorPrototype);
|
|
234
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
GeneratorFunctionPrototype,
|
|
239
|
-
toStringTagSymbol,
|
|
240
|
-
"GeneratorFunction"
|
|
241
|
-
);
|
|
140
|
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
141
|
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
142
|
+
GeneratorFunctionPrototype[toStringTagSymbol] =
|
|
143
|
+
GeneratorFunction.displayName = "GeneratorFunction";
|
|
242
144
|
|
|
243
145
|
// Helper for defining the .next, .throw, and .return methods of the
|
|
244
146
|
// Iterator interface in terms of a single ._invoke method.
|
|
245
147
|
function defineIteratorMethods(prototype) {
|
|
246
148
|
["next", "throw", "return"].forEach(function(method) {
|
|
247
|
-
|
|
149
|
+
prototype[method] = function(arg) {
|
|
248
150
|
return this._invoke(method, arg);
|
|
249
|
-
}
|
|
151
|
+
};
|
|
250
152
|
});
|
|
251
153
|
}
|
|
252
154
|
|
|
@@ -265,7 +167,9 @@ var runtime = (function (exports) {
|
|
|
265
167
|
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
266
168
|
} else {
|
|
267
169
|
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
268
|
-
|
|
170
|
+
if (!(toStringTagSymbol in genFun)) {
|
|
171
|
+
genFun[toStringTagSymbol] = "GeneratorFunction";
|
|
172
|
+
}
|
|
269
173
|
}
|
|
270
174
|
genFun.prototype = Object.create(Gp);
|
|
271
175
|
return genFun;
|
|
@@ -347,9 +251,9 @@ var runtime = (function (exports) {
|
|
|
347
251
|
}
|
|
348
252
|
|
|
349
253
|
defineIteratorMethods(AsyncIterator.prototype);
|
|
350
|
-
|
|
254
|
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
351
255
|
return this;
|
|
352
|
-
}
|
|
256
|
+
};
|
|
353
257
|
exports.AsyncIterator = AsyncIterator;
|
|
354
258
|
|
|
355
259
|
// Note that simple async functions are implemented on top of
|
|
@@ -535,20 +439,20 @@ var runtime = (function (exports) {
|
|
|
535
439
|
// unified ._invoke helper method.
|
|
536
440
|
defineIteratorMethods(Gp);
|
|
537
441
|
|
|
538
|
-
|
|
442
|
+
Gp[toStringTagSymbol] = "Generator";
|
|
539
443
|
|
|
540
444
|
// A Generator should always return itself as the iterator object when the
|
|
541
445
|
// @@iterator function is called on it. Some browsers' implementations of the
|
|
542
446
|
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
543
447
|
// object to not be returned from this call. This ensures that doesn't happen.
|
|
544
448
|
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
545
|
-
|
|
449
|
+
Gp[iteratorSymbol] = function() {
|
|
546
450
|
return this;
|
|
547
|
-
}
|
|
451
|
+
};
|
|
548
452
|
|
|
549
|
-
|
|
453
|
+
Gp.toString = function() {
|
|
550
454
|
return "[object Generator]";
|
|
551
|
-
}
|
|
455
|
+
};
|
|
552
456
|
|
|
553
457
|
function pushTryEntry(locs) {
|
|
554
458
|
var entry = { tryLoc: locs[0] };
|
|
@@ -867,49 +771,24 @@ try {
|
|
|
867
771
|
} catch (accidentalStrictMode) {
|
|
868
772
|
// This module should not be running in strict mode, so the above
|
|
869
773
|
// assignment should always work unless something is misconfigured. Just
|
|
870
|
-
// in case runtime.js accidentally runs in strict mode,
|
|
871
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
774
|
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
|
872
775
|
// strict mode using a global Function call. This could conceivably fail
|
|
873
776
|
// if a Content Security Policy forbids using Function, but in that case
|
|
874
777
|
// the proper solution is to fix the accidental strict mode problem. If
|
|
875
778
|
// you've misconfigured your bundler to force strict mode and applied a
|
|
876
779
|
// CSP to forbid Function, and you're not willing to fix either of those
|
|
877
780
|
// problems, please detail your unique predicament in a GitHub issue.
|
|
878
|
-
|
|
879
|
-
globalThis.regeneratorRuntime = runtime;
|
|
880
|
-
} else {
|
|
881
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
882
|
-
}
|
|
781
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
883
782
|
}
|
|
884
783
|
});
|
|
885
784
|
|
|
886
|
-
function
|
|
887
|
-
|
|
888
|
-
buildDir = _ref.buildDir,
|
|
889
|
-
customClient = _ref.client,
|
|
890
|
-
configRest = _objectWithoutPropertiesLoose(_ref, ["siteId", "buildDir", "client"]);
|
|
891
|
-
|
|
892
|
-
var client = customClient;
|
|
893
|
-
|
|
894
|
-
if (!client) {
|
|
895
|
-
var authToken = process.env.NETLIFY_AUTH_TOKEN;
|
|
896
|
-
client = new NetlifyAPI(authToken);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
return client.deploy(siteId, buildDir, _extends({
|
|
900
|
-
statusCb: function statusCb(statusObj) {
|
|
901
|
-
console.log(statusObj.msg);
|
|
902
|
-
}
|
|
903
|
-
}, configRest));
|
|
785
|
+
function deployment(_x) {
|
|
786
|
+
return _deployment.apply(this, arguments);
|
|
904
787
|
}
|
|
905
|
-
function deploy(_x) {
|
|
906
|
-
return _deploy.apply(this, arguments);
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
function _deploy() {
|
|
910
|
-
_deploy = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(configs) {
|
|
911
|
-
var authToken, client, message, deployResults, _iterator, _step, config, result, lastCommit;
|
|
912
788
|
|
|
789
|
+
function _deployment() {
|
|
790
|
+
_deployment = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(configs) {
|
|
791
|
+
var authToken, lastCommit;
|
|
913
792
|
return runtime_1.wrap(function _callee$(_context) {
|
|
914
793
|
while (1) {
|
|
915
794
|
switch (_context.prev = _context.next) {
|
|
@@ -920,66 +799,29 @@ function _deploy() {
|
|
|
920
799
|
fail("Couldn't get deploy information. You need to set up an authentication \n token in your environment variables. \n See: https://gitlab.com/help/ci/variables/README#variables");
|
|
921
800
|
}
|
|
922
801
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
_iterator = _createForOfIteratorHelperLoose(configs);
|
|
932
|
-
|
|
933
|
-
case 7:
|
|
934
|
-
if ((_step = _iterator()).done) {
|
|
935
|
-
_context.next = 15;
|
|
936
|
-
break;
|
|
802
|
+
try {
|
|
803
|
+
lastCommit = danger.git.commits[0];
|
|
804
|
+
markdown(["## Deploy preview", "The deploy preview is ready!", "Built with commit " + lastCommit.sha].concat(configs.map(function (result) {
|
|
805
|
+
return result.label + ": " + result.deploy_url;
|
|
806
|
+
})).join("\n\n"));
|
|
807
|
+
} catch (e) {
|
|
808
|
+
console.error(e);
|
|
809
|
+
fail("Couldn't get deploy information.");
|
|
937
810
|
}
|
|
938
811
|
|
|
939
|
-
|
|
940
|
-
_context.next = 11;
|
|
941
|
-
return deploySite(_extends({
|
|
942
|
-
client: client,
|
|
943
|
-
message: message,
|
|
944
|
-
draft: true
|
|
945
|
-
}, config));
|
|
946
|
-
|
|
947
|
-
case 11:
|
|
948
|
-
result = _context.sent;
|
|
949
|
-
deployResults.push(result);
|
|
950
|
-
|
|
951
|
-
case 13:
|
|
952
|
-
_context.next = 7;
|
|
953
|
-
break;
|
|
954
|
-
|
|
955
|
-
case 15:
|
|
956
|
-
lastCommit = danger.git.commits[0];
|
|
957
|
-
markdown(["## Deploy preview", "Deploy preview for *front10-ui* ready!", "Built with commit " + lastCommit.sha].concat(deployResults.map(function (result, index) {
|
|
958
|
-
return configs[index].label + ": " + result.deploy.deploy_ssl_url;
|
|
959
|
-
})).join("\n\n"));
|
|
960
|
-
_context.next = 23;
|
|
961
|
-
break;
|
|
962
|
-
|
|
963
|
-
case 19:
|
|
964
|
-
_context.prev = 19;
|
|
965
|
-
_context.t0 = _context["catch"](2);
|
|
966
|
-
console.error(_context.t0);
|
|
967
|
-
fail("Couldn't get deploy information.");
|
|
968
|
-
|
|
969
|
-
case 23:
|
|
812
|
+
case 3:
|
|
970
813
|
case "end":
|
|
971
814
|
return _context.stop();
|
|
972
815
|
}
|
|
973
816
|
}
|
|
974
|
-
}, _callee
|
|
817
|
+
}, _callee);
|
|
975
818
|
}));
|
|
976
|
-
return
|
|
819
|
+
return _deployment.apply(this, arguments);
|
|
977
820
|
}
|
|
978
821
|
|
|
979
822
|
var pluginNetlify = {
|
|
980
823
|
__proto__: null,
|
|
981
|
-
|
|
982
|
-
deploy: deploy
|
|
824
|
+
deployment: deployment
|
|
983
825
|
};
|
|
984
826
|
|
|
985
827
|
/**
|
|
@@ -998,7 +840,7 @@ function generateMDTable(headers, body) {
|
|
|
998
840
|
return tableHeaders.join("\n") + "\n" + tableBody.join("\n");
|
|
999
841
|
}
|
|
1000
842
|
|
|
1001
|
-
function
|
|
843
|
+
function getWidgetsGetBundlesFn(bundlePrefix) {
|
|
1002
844
|
return function defaultGetBundlesFn(bundlesDir) {
|
|
1003
845
|
return fs.readdirSync(bundlesDir).map(function (name) {
|
|
1004
846
|
return path.join(bundlesDir, name);
|
|
@@ -1010,23 +852,44 @@ function getDefaultGetBundlesFn(bundlePrefix) {
|
|
|
1010
852
|
};
|
|
1011
853
|
}
|
|
1012
854
|
|
|
1013
|
-
function
|
|
855
|
+
function defaultGetBundlesFn(bundlesDir) {
|
|
856
|
+
return fs.readdirSync(bundlesDir).filter(function (file) {
|
|
857
|
+
return file.endsWith(".js");
|
|
858
|
+
}).map(function (file) {
|
|
859
|
+
return path.join(bundlesDir, file);
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
function widgetsRenameFn(filename) {
|
|
1014
864
|
return filename.split(".bundle.js")[0].replace(/--/g, "-").split("-").map(function (e) {
|
|
1015
865
|
return e[0].toUpperCase() + e.slice(1);
|
|
1016
866
|
}).join(" ").replace("Mobile", "(mobile)");
|
|
1017
867
|
}
|
|
1018
868
|
|
|
869
|
+
function defaultRenameFn(filename) {
|
|
870
|
+
return filename.replace(".min.js", "").replace(".js", "");
|
|
871
|
+
}
|
|
872
|
+
|
|
1019
873
|
function bundleSizeResults(_ref) {
|
|
1020
874
|
var _ref$formats = _ref.formats,
|
|
1021
875
|
formats = _ref$formats === void 0 ? ["gzip"] : _ref$formats,
|
|
1022
876
|
bundlesDir = _ref.bundlesDir,
|
|
1023
877
|
_ref$renameFn = _ref.renameFn,
|
|
1024
878
|
renameFn = _ref$renameFn === void 0 ? defaultRenameFn : _ref$renameFn,
|
|
1025
|
-
getBundlesFn = _ref.getBundlesFn,
|
|
879
|
+
_ref$getBundlesFn = _ref.getBundlesFn,
|
|
880
|
+
getBundlesFn = _ref$getBundlesFn === void 0 ? defaultGetBundlesFn : _ref$getBundlesFn,
|
|
1026
881
|
_ref$bundlePrefix = _ref.bundlePrefix,
|
|
1027
882
|
bundlePrefix = _ref$bundlePrefix === void 0 ? "cmp-mc-" : _ref$bundlePrefix,
|
|
1028
|
-
reportPath = _ref.reportPath
|
|
1029
|
-
|
|
883
|
+
reportPath = _ref.reportPath,
|
|
884
|
+
preset = _ref.preset;
|
|
885
|
+
var getBundles = getBundlesFn;
|
|
886
|
+
var rename = renameFn;
|
|
887
|
+
|
|
888
|
+
if (preset === "widgets") {
|
|
889
|
+
getBundles = getWidgetsGetBundlesFn(bundlePrefix);
|
|
890
|
+
rename = widgetsRenameFn;
|
|
891
|
+
}
|
|
892
|
+
|
|
1030
893
|
var files = getBundles(bundlesDir).filter(fs.existsSync);
|
|
1031
894
|
var formatFilter = new Set(formats);
|
|
1032
895
|
var gzip = formatFilter.has("gzip");
|
|
@@ -1038,7 +901,7 @@ function bundleSizeResults(_ref) {
|
|
|
1038
901
|
var jsFile = fs.readFileSync(filePath);
|
|
1039
902
|
var fileSizes = [jsFile].concat(gzip ? [zlib.gzipSync(jsFile)] : [], brotli ? [zlib.brotliCompressSync(jsFile)] : []);
|
|
1040
903
|
return {
|
|
1041
|
-
filename:
|
|
904
|
+
filename: rename(path.basename(filePath)),
|
|
1042
905
|
sizes: fileSizes.map(function (file) {
|
|
1043
906
|
return file.length;
|
|
1044
907
|
})
|
|
@@ -1078,7 +941,7 @@ function bundleSize(_x) {
|
|
|
1078
941
|
|
|
1079
942
|
function _bundleSize() {
|
|
1080
943
|
_bundleSize = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(options) {
|
|
1081
|
-
var results, reportPath, _options$baseBundleJo, baseBundleJob, baseResults, projectId, authToken, targetBranch, baseBundlesUrl,
|
|
944
|
+
var results, reportPath, _options$baseBundleJo, baseBundleJob, baseResults, projectId, authToken, targetBranch, baseBundlesUrl, baseBundles, diffHeaders, _baseResults, bundles, brotli, gzip, headers, body;
|
|
1082
945
|
|
|
1083
946
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1084
947
|
while (1) {
|
|
@@ -1088,36 +951,27 @@ function _bundleSize() {
|
|
|
1088
951
|
reportPath = options.reportPath, _options$baseBundleJo = options.baseBundleJob, baseBundleJob = _options$baseBundleJo === void 0 ? "publish" : _options$baseBundleJo;
|
|
1089
952
|
|
|
1090
953
|
if (!reportPath) {
|
|
1091
|
-
_context.next =
|
|
954
|
+
_context.next = 10;
|
|
1092
955
|
break;
|
|
1093
956
|
}
|
|
1094
957
|
|
|
1095
958
|
projectId = process.env.CI_MERGE_REQUEST_PROJECT_ID;
|
|
1096
959
|
authToken = process.env.DANGER_GITLAB_API_TOKEN;
|
|
1097
|
-
targetBranch = process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME || "
|
|
960
|
+
targetBranch = process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME || "main";
|
|
1098
961
|
baseBundlesUrl = "https://gitlab.com/api/v4/projects/" + projectId + "/jobs/artifacts/" + targetBranch + "/raw/" + reportPath + "?job=" + baseBundleJob;
|
|
1099
962
|
_context.next = 9;
|
|
1100
|
-
return
|
|
963
|
+
return fetch(baseBundlesUrl, {
|
|
1101
964
|
headers: {
|
|
1102
965
|
"PRIVATE-TOKEN": authToken
|
|
1103
966
|
}
|
|
967
|
+
}).then(function (response) {
|
|
968
|
+
return response.json();
|
|
1104
969
|
});
|
|
1105
970
|
|
|
1106
971
|
case 9:
|
|
1107
|
-
baseResultsResponse = _context.sent;
|
|
1108
|
-
|
|
1109
|
-
if (!baseResultsResponse.ok) {
|
|
1110
|
-
_context.next = 14;
|
|
1111
|
-
break;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
_context.next = 13;
|
|
1115
|
-
return baseResultsResponse.json();
|
|
1116
|
-
|
|
1117
|
-
case 13:
|
|
1118
972
|
baseResults = _context.sent;
|
|
1119
973
|
|
|
1120
|
-
case
|
|
974
|
+
case 10:
|
|
1121
975
|
baseBundles = new Map();
|
|
1122
976
|
diffHeaders = [];
|
|
1123
977
|
|
|
@@ -1158,7 +1012,7 @@ function _bundleSize() {
|
|
|
1158
1012
|
});
|
|
1159
1013
|
markdown(["## Bundle size", generateMDTable(headers, body)].join("\n\n"));
|
|
1160
1014
|
|
|
1161
|
-
case
|
|
1015
|
+
case 16:
|
|
1162
1016
|
case "end":
|
|
1163
1017
|
return _context.stop();
|
|
1164
1018
|
}
|