webstore-lint 1.0.29 → 1.0.31

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/README.md CHANGED
@@ -64,6 +64,10 @@ git clone https://github.com/Circadian-agent/chrome-extension-rejection-lint
64
64
  node chrome-extension-rejection-lint/bin/webstore-lint.mjs ./my-extension
65
65
  ```
66
66
 
67
+ Pass one extension directory per command. If you maintain several extensions,
68
+ run the command separately for each one. Multiple directories, including those
69
+ expanded from a shell wildcard, are rejected before any checks run.
70
+
67
71
  ## In GitHub Actions
68
72
 
69
73
  ```yaml
@@ -311,6 +315,17 @@ npx webstore-lint ./my-extension \
311
315
  This is the only flag that touches the network, and only when you pass a URL.
312
316
  Without it the tool opens no sockets at all.
313
317
 
318
+ Run the privacy URL check and the permission ledger as separate commands:
319
+
320
+ ```bash
321
+ npx webstore-lint ./my-extension --privacy-policy https://example.com/privacy
322
+ npx webstore-lint ./my-extension --permissions
323
+ ```
324
+
325
+ Combining `--privacy-policy`, `--permissions` or `--policy` is a usage error
326
+ (exit 2). No checks run for that combination. `--json` works with either the
327
+ privacy check or the permission ledger.
328
+
314
329
  It exists because of a real rejection. A developer was rejected under **Purple
315
330
  Lithium** and the cause was mundane: the privacy policy URL in their listing
316
331
  404'd, because the GitHub repository serving it was private. It looks perfectly
@@ -70,7 +70,8 @@ for (const f of VALUED) {
70
70
  const i = args.indexOf(f);
71
71
  if (i >= 0 && args[i + 1] && !args[i + 1].startsWith("--")) consumed.add(i + 1);
72
72
  }
73
- const target = args.find((a, i) => !a.startsWith("--") && !consumed.has(i));
73
+ const targets = args.filter((a, i) => !a.startsWith("--") && !consumed.has(i));
74
+ const target = targets[0];
74
75
  const policyUrl = valueOf("--privacy-policy");
75
76
 
76
77
  if (flags.has("--help") || (!target && !flags.has("--policy"))) {
@@ -88,6 +89,9 @@ if (flags.has("--help") || (!target && !flags.has("--policy"))) {
88
89
  and only when you pass a url
89
90
  webstore-lint --policy list the policy data this build carries
90
91
 
92
+ Use --permissions, --privacy-policy and --policy in separate commands.
93
+ Check one extension directory per command.
94
+
91
95
  The one-liner, no install needed:
92
96
  npx webstore-lint <extension-directory>
93
97
 
@@ -100,6 +104,27 @@ not affiliated with Google. A clean run is not a promise of approval.`);
100
104
  process.exit(flags.has("--help") ? 0 : 2);
101
105
  }
102
106
 
107
+ // A second directory (including a shell-expanded glob) must not be silently
108
+ // ignored: the first extension can pass while the unexamined one would fail.
109
+ if (targets.length > 1) {
110
+ console.error("Pass only one extension directory per command. No checks were run.");
111
+ console.error("Run webstore-lint separately for each extension directory.");
112
+ process.exit(2);
113
+ }
114
+
115
+ // These branches produce different reports and return early. Combining them
116
+ // used to exit successfully after silently skipping an explicitly requested
117
+ // check, including a broken privacy URL. Reject before producing any report.
118
+ const modes = ["--permissions", "--privacy-policy", "--policy"].filter(f => flags.has(f));
119
+ if (modes.length > 1) {
120
+ console.error(`${modes.join(", ")} cannot be combined. No checks were run.`);
121
+ console.error("Run each mode separately:");
122
+ console.error(" webstore-lint <extension-directory> --permissions");
123
+ console.error(" webstore-lint <extension-directory> --privacy-policy <url>");
124
+ console.error(" webstore-lint --policy");
125
+ process.exit(2);
126
+ }
127
+
103
128
  if (flags.has("--policy")) {
104
129
  console.log(`${Object.keys(POLICY.categories).length} verified rejection categories, from ${POLICY.generatedFrom}\n`);
105
130
  for (const [id, c] of Object.entries(POLICY.categories)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstore-lint",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Check an unpacked Chrome extension against the Chrome Web Store program policies before you submit it. Every finding cites Google's own notification ID and verbatim policy text. Covers the 1 August 2026 policy updates.",
5
5
  "keywords": [
6
6
  "chrome-extension",
@@ -38,7 +38,7 @@
38
38
  "node": ">=18"
39
39
  },
40
40
  "scripts": {
41
- "test": "node test/lint.test.mjs && node test/action.test.mjs && node --test test/permissions-output.test.mjs"
41
+ "test": "node test/lint.test.mjs && node test/action.test.mjs && node --test test/permissions-output.test.mjs test/cli-modes.test.mjs"
42
42
  },
43
43
  "repository": {
44
44
  "type": "git",