bdy 1.8.15-dev → 1.8.17-dev
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/distTs/package.json
CHANGED
package/distTs/src/output.js
CHANGED
|
@@ -38,7 +38,12 @@ class Output {
|
|
|
38
38
|
static error(txt) {
|
|
39
39
|
terminal.red(`${txt}\n`);
|
|
40
40
|
}
|
|
41
|
-
static
|
|
41
|
+
static debug(txt) {
|
|
42
|
+
if (context_1.debug) {
|
|
43
|
+
this.normal(txt);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
static async debugAction(text, action) {
|
|
42
47
|
if (context_1.debug) {
|
|
43
48
|
const t1 = performance.now();
|
|
44
49
|
const result = await action;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.debug = exports.browserPath = exports.commitDetails = exports.invokerId = exports.executionId = exports.actionId = exports.pipelineId = exports.baseCommit = exports.commit = exports.branch = exports.ci = exports.cliId = exports.buildId = exports.token = exports.parallel = exports.skipDiscovery = exports.oneByOne = exports.cliVersion = void 0;
|
|
3
|
+
exports.debug = exports.browserPath = exports.commitDetails = exports.invokerId = exports.executionId = exports.actionId = exports.pipelineName = exports.pipelineId = exports.baseCommit = exports.commit = exports.branch = exports.ci = exports.cliId = exports.buildId = exports.token = exports.parallel = exports.skipDiscovery = exports.oneByOne = exports.cliVersion = void 0;
|
|
4
4
|
exports.setOptions = setOptions;
|
|
5
5
|
exports.setBrowserPath = setBrowserPath;
|
|
6
6
|
exports.setCiAndCommitInfo = setCiAndCommitInfo;
|
|
@@ -41,5 +41,6 @@ function setCiAndCommitInfo(ciInfo) {
|
|
|
41
41
|
exports.actionId = ciInfo.actionId;
|
|
42
42
|
exports.executionId = ciInfo.executionId;
|
|
43
43
|
exports.invokerId = ciInfo.invokerId;
|
|
44
|
+
exports.pipelineName = ciInfo.pipelineName;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -66,6 +66,7 @@ async function sendSnapshot(snapshot) {
|
|
|
66
66
|
commit: context_js_1.commit,
|
|
67
67
|
baseCommit: context_js_1.baseCommit,
|
|
68
68
|
pipelineId: context_js_1.pipelineId,
|
|
69
|
+
pipelineName: context_js_1.pipelineName,
|
|
69
70
|
actionId: context_js_1.actionId,
|
|
70
71
|
executionId: context_js_1.executionId,
|
|
71
72
|
invokerId: context_js_1.invokerId,
|
|
@@ -97,6 +98,7 @@ async function sendSnapshots(snapshots) {
|
|
|
97
98
|
commit: context_js_1.commit,
|
|
98
99
|
baseCommit: context_js_1.baseCommit,
|
|
99
100
|
pipelineId: context_js_1.pipelineId,
|
|
101
|
+
pipelineName: context_js_1.pipelineName,
|
|
100
102
|
actionId: context_js_1.actionId,
|
|
101
103
|
executionId: context_js_1.executionId,
|
|
102
104
|
invokerId: context_js_1.invokerId,
|
|
@@ -148,6 +150,7 @@ async function sendStorybook(snapshots, filePaths) {
|
|
|
148
150
|
commit: context_js_1.commit,
|
|
149
151
|
baseCommit: context_js_1.baseCommit,
|
|
150
152
|
pipelineId: context_js_1.pipelineId,
|
|
153
|
+
pipelineName: context_js_1.pipelineName,
|
|
151
154
|
actionId: context_js_1.actionId,
|
|
152
155
|
executionId: context_js_1.executionId,
|
|
153
156
|
invokerId: context_js_1.invokerId,
|
|
@@ -170,7 +173,7 @@ async function sendStorybook(snapshots, filePaths) {
|
|
|
170
173
|
return message;
|
|
171
174
|
}
|
|
172
175
|
async function sendRequest({ url, payload, multipart, }) {
|
|
173
|
-
output_1.default.
|
|
176
|
+
output_1.default.debug((0, texts_1.LOG_SENDING_REQUEST)(`${serviceUrl}${url}`));
|
|
174
177
|
const init = {
|
|
175
178
|
method: 'GET',
|
|
176
179
|
redirect: 'follow',
|
|
@@ -21,7 +21,7 @@ async function collectResources({ url, widths = [1280], resourceDiscoveryTimeout
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
else if (scrapedUrl && missingWidths.length > 0) {
|
|
24
|
-
const { scrapedResourcesUrls, duplicatedResourcesUrls } = await output_1.default.
|
|
24
|
+
const { scrapedResourcesUrls, duplicatedResourcesUrls } = await output_1.default.debugAction((0, texts_1.DEBUG_RESOURCE_SCRAPPING_URL)(url), scrapeResources({
|
|
25
25
|
url,
|
|
26
26
|
widths: missingWidths,
|
|
27
27
|
height,
|
|
@@ -51,7 +51,7 @@ async function collectResources({ url, widths = [1280], resourceDiscoveryTimeout
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
|
-
const { scrapedResourcesUrls, duplicatedResourcesUrls } = await output_1.default.
|
|
54
|
+
const { scrapedResourcesUrls, duplicatedResourcesUrls } = await output_1.default.debugAction((0, texts_1.DEBUG_RESOURCE_SCRAPPING_URL)(url), scrapeResources({
|
|
55
55
|
url,
|
|
56
56
|
widths,
|
|
57
57
|
height,
|
|
@@ -154,15 +154,15 @@ async function scrapeResources({ url, widths, height, resourceDiscoveryTimeout,
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
await page.goto(url);
|
|
157
|
-
await output_1.default.
|
|
158
|
-
await output_1.default.
|
|
157
|
+
await output_1.default.debugAction(texts_1.DEBUG_AUTO_SCROLL, autoScroll(page));
|
|
158
|
+
await output_1.default.debugAction(texts_1.DEBUG_AUTO_WIDTH, autoWidths(page, widths, height));
|
|
159
159
|
if (resourceDiscoveryTimeout > 0) {
|
|
160
160
|
await new Promise((resolve) => setTimeout(resolve, resourceDiscoveryTimeout));
|
|
161
161
|
if (context_js_1.debug) {
|
|
162
162
|
output_1.default.warning((0, texts_1.DEBUG_RESOURCE_DISCOVERY_TIMEOUT)(resourceDiscoveryTimeout));
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
await output_1.default.
|
|
165
|
+
await output_1.default.debugAction(texts_1.DEBUG_WAIT_FOR_IDLE, page.waitForNetworkIdle());
|
|
166
166
|
await browser.close();
|
|
167
167
|
return { scrapedResourcesUrls, duplicatedResourcesUrls };
|
|
168
168
|
}
|