@d-zero/archaeologist 1.0.0-alpha.2 → 1.0.0-alpha.3
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/analize-url.d.ts +7 -0
- package/dist/analize-url.js +18 -0
- package/dist/analyze.js +4 -0
- package/package.json +5 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function analyzeUrlList(list) {
|
|
2
|
+
const result = {
|
|
3
|
+
hasAuth: false,
|
|
4
|
+
hasNoSSL: false,
|
|
5
|
+
};
|
|
6
|
+
for (const urlPair of list) {
|
|
7
|
+
for (const url of urlPair) {
|
|
8
|
+
const urlObj = new URL(url);
|
|
9
|
+
if (urlObj.username || urlObj.password) {
|
|
10
|
+
result.hasAuth = true;
|
|
11
|
+
}
|
|
12
|
+
if (urlObj.protocol === 'http:') {
|
|
13
|
+
result.hasNoSSL = true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return result;
|
|
18
|
+
}
|
package/dist/analyze.js
CHANGED
|
@@ -3,12 +3,16 @@ import path from 'node:path';
|
|
|
3
3
|
import { deal } from '@d-zero/dealer';
|
|
4
4
|
import c from 'ansi-colors';
|
|
5
5
|
import puppeteer from 'puppeteer';
|
|
6
|
+
import { analyzeUrlList } from './analize-url.js';
|
|
6
7
|
import { diffImages } from './diff-images.js';
|
|
7
8
|
import { diffTree } from './diff-tree.js';
|
|
8
9
|
import { getData } from './get-data.js';
|
|
9
10
|
import { label, score } from './output-utils.js';
|
|
10
11
|
export async function analyze(list) {
|
|
12
|
+
const urlInfo = analyzeUrlList(list);
|
|
13
|
+
const useOldMode = urlInfo.hasAuth && urlInfo.hasNoSSL;
|
|
11
14
|
const browser = await puppeteer.launch({
|
|
15
|
+
headless: useOldMode ? 'shell' : true,
|
|
12
16
|
args: [
|
|
13
17
|
//
|
|
14
18
|
'--lang=ja',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-zero/archaeologist",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "Uncover visual and HTML differences in web pages with precision",
|
|
5
5
|
"author": "D-ZERO",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@d-zero/dealer": "^1.0.0-alpha.2",
|
|
30
30
|
"@d-zero/html-distiller": "^1.0.0-alpha.2",
|
|
31
|
-
"@d-zero/puppeteer-screenshot": "^1.0.0-alpha.
|
|
31
|
+
"@d-zero/puppeteer-screenshot": "^1.0.0-alpha.3",
|
|
32
32
|
"@d-zero/readtext": "^1.0.0-alpha.2",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
34
|
"diff": "5.2.0",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"minimist": "1.2.8",
|
|
38
38
|
"pixelmatch": "5.3.0",
|
|
39
39
|
"pngjs": "7.0.0",
|
|
40
|
-
"puppeteer": "22.6.
|
|
40
|
+
"puppeteer": "22.6.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/diff": "5.0.9",
|
|
44
44
|
"@types/pixelmatch": "5.2.6",
|
|
45
45
|
"@types/pngjs": "6.0.4",
|
|
46
|
-
"puppeteer": "22.6.
|
|
46
|
+
"puppeteer": "22.6.5"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "3544423004c3ee923790f78657a78dfc3c88771d"
|
|
49
49
|
}
|