@xbrowser/cli 1.0.9 → 1.1.0
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.
|
@@ -38,9 +38,23 @@ function filterRecording(inputPath, outputPath, excludeTypes) {
|
|
|
38
38
|
return { originalCount, filteredCount, removed, percentage };
|
|
39
39
|
}
|
|
40
40
|
function parseExcludeTypes(args) {
|
|
41
|
-
for (
|
|
41
|
+
for (let i = 0; i < args.length; i++) {
|
|
42
|
+
const arg = args[i];
|
|
42
43
|
if (arg.startsWith("--exclude-types=")) {
|
|
43
|
-
return arg.replace("--exclude-types=", "").split(",");
|
|
44
|
+
return arg.replace("--exclude-types=", "").split(",").map((s) => s.trim());
|
|
45
|
+
}
|
|
46
|
+
if (arg === "--exclude-types" && args[i + 1]) {
|
|
47
|
+
return args[i + 1].split(",").map((s) => s.trim());
|
|
48
|
+
}
|
|
49
|
+
if (arg.startsWith("--exclude=")) {
|
|
50
|
+
return arg.replace("--exclude=", "").split(",").map((s) => s.trim());
|
|
51
|
+
}
|
|
52
|
+
if (arg === "--exclude" && args[i + 1]) {
|
|
53
|
+
const types = [];
|
|
54
|
+
for (let j = i + 1; j < args.length && !args[j].startsWith("-"); j++) {
|
|
55
|
+
types.push(...args[j].split(",").map((s) => s.trim()));
|
|
56
|
+
}
|
|
57
|
+
if (types.length > 0) return types;
|
|
44
58
|
}
|
|
45
59
|
}
|
|
46
60
|
return void 0;
|
package/dist/cli.js
CHANGED
|
@@ -10646,7 +10646,7 @@ async function handleFilter(args, _mode) {
|
|
|
10646
10646
|
console.error("Usage: xbrowser filter <input.yaml> <output.yaml> [--exclude-types=type1,type2]");
|
|
10647
10647
|
process.exit(1);
|
|
10648
10648
|
}
|
|
10649
|
-
const { filterRecording, parseExcludeTypes } = await import("./filter-
|
|
10649
|
+
const { filterRecording, parseExcludeTypes } = await import("./filter-EDTFGLS5.js");
|
|
10650
10650
|
const excludeTypes = parseExcludeTypes(args.slice(2));
|
|
10651
10651
|
const result = filterRecording(filePath, outputPath, excludeTypes);
|
|
10652
10652
|
console.log(`Filtered ${filePath} -> ${outputPath}`);
|
|
@@ -12272,13 +12272,13 @@ async function routeCommand(argvIn, stdinCommands) {
|
|
|
12272
12272
|
handleConfig(cmdArgs, options);
|
|
12273
12273
|
break;
|
|
12274
12274
|
case "convert":
|
|
12275
|
-
handleConvert(cmdArgs, mode);
|
|
12275
|
+
await handleConvert(cmdArgs, mode);
|
|
12276
12276
|
break;
|
|
12277
12277
|
case "extract":
|
|
12278
|
-
handleExtract(cmdArgs, mode);
|
|
12278
|
+
await handleExtract(cmdArgs, mode);
|
|
12279
12279
|
break;
|
|
12280
12280
|
case "filter":
|
|
12281
|
-
handleFilter(cmdArgs, mode);
|
|
12281
|
+
await handleFilter(cmdArgs, mode);
|
|
12282
12282
|
break;
|
|
12283
12283
|
case "run":
|
|
12284
12284
|
if (!cmdArgs[0]) {
|
|
@@ -40,9 +40,23 @@ function filterRecording(inputPath, outputPath, excludeTypes) {
|
|
|
40
40
|
return { originalCount, filteredCount, removed, percentage };
|
|
41
41
|
}
|
|
42
42
|
function parseExcludeTypes(args) {
|
|
43
|
-
for (
|
|
43
|
+
for (let i = 0; i < args.length; i++) {
|
|
44
|
+
const arg = args[i];
|
|
44
45
|
if (arg.startsWith("--exclude-types=")) {
|
|
45
|
-
return arg.replace("--exclude-types=", "").split(",");
|
|
46
|
+
return arg.replace("--exclude-types=", "").split(",").map((s) => s.trim());
|
|
47
|
+
}
|
|
48
|
+
if (arg === "--exclude-types" && args[i + 1]) {
|
|
49
|
+
return args[i + 1].split(",").map((s) => s.trim());
|
|
50
|
+
}
|
|
51
|
+
if (arg.startsWith("--exclude=")) {
|
|
52
|
+
return arg.replace("--exclude=", "").split(",").map((s) => s.trim());
|
|
53
|
+
}
|
|
54
|
+
if (arg === "--exclude" && args[i + 1]) {
|
|
55
|
+
const types = [];
|
|
56
|
+
for (let j = i + 1; j < args.length && !args[j].startsWith("-"); j++) {
|
|
57
|
+
types.push(...args[j].split(",").map((s) => s.trim()));
|
|
58
|
+
}
|
|
59
|
+
if (types.length > 0) return types;
|
|
46
60
|
}
|
|
47
61
|
}
|
|
48
62
|
return void 0;
|
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
import {
|
|
54
54
|
filterRecording,
|
|
55
55
|
parseExcludeTypes
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-AT4PHAJY.js";
|
|
57
57
|
import {
|
|
58
58
|
SessionRecorder
|
|
59
59
|
} from "./chunk-ACFE6PKF.js";
|
|
@@ -10986,7 +10986,7 @@ async function handleFilter(args, _mode) {
|
|
|
10986
10986
|
console.error("Usage: xbrowser filter <input.yaml> <output.yaml> [--exclude-types=type1,type2]");
|
|
10987
10987
|
process.exit(1);
|
|
10988
10988
|
}
|
|
10989
|
-
const { filterRecording: filterRecording2, parseExcludeTypes: parseExcludeTypes2 } = await import("./filter-
|
|
10989
|
+
const { filterRecording: filterRecording2, parseExcludeTypes: parseExcludeTypes2 } = await import("./filter-3JQWBM5F.js");
|
|
10990
10990
|
const excludeTypes = parseExcludeTypes2(args.slice(2));
|
|
10991
10991
|
const result = filterRecording2(filePath, outputPath, excludeTypes);
|
|
10992
10992
|
console.log(`Filtered ${filePath} -> ${outputPath}`);
|
|
@@ -12612,13 +12612,13 @@ async function routeCommand(argvIn, stdinCommands) {
|
|
|
12612
12612
|
handleConfig(cmdArgs, options);
|
|
12613
12613
|
break;
|
|
12614
12614
|
case "convert":
|
|
12615
|
-
handleConvert(cmdArgs, mode);
|
|
12615
|
+
await handleConvert(cmdArgs, mode);
|
|
12616
12616
|
break;
|
|
12617
12617
|
case "extract":
|
|
12618
|
-
handleExtract(cmdArgs, mode);
|
|
12618
|
+
await handleExtract(cmdArgs, mode);
|
|
12619
12619
|
break;
|
|
12620
12620
|
case "filter":
|
|
12621
|
-
handleFilter(cmdArgs, mode);
|
|
12621
|
+
await handleFilter(cmdArgs, mode);
|
|
12622
12622
|
break;
|
|
12623
12623
|
case "run":
|
|
12624
12624
|
if (!cmdArgs[0]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbrowser/cli",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Browser automation CLI for web scraping, headless browsing, SEO analysis, and AI agent workflows. A command-line alternative to Playwright, Puppeteer, and Selenium.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|