@yawlabs/ctxlint 0.9.4 → 0.9.5
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/context-lint-rules.json +0 -11
- package/dist/index.js +3 -19
- package/package.json +1 -1
package/context-lint-rules.json
CHANGED
|
@@ -148,17 +148,6 @@
|
|
|
148
148
|
"fixable": false,
|
|
149
149
|
"stability": "stable"
|
|
150
150
|
},
|
|
151
|
-
{
|
|
152
|
-
"id": "commands/npm-auth-trap",
|
|
153
|
-
"category": "commands",
|
|
154
|
-
"severity": "info",
|
|
155
|
-
"description": "Context file documents an npm write operation (deprecate, unpublish, dist-tag, access, owner) as a local CLI command. Under WebAuthn-only 2FA (no TOTP authenticator), these commands return 422 because npm treats CLI web-auth tokens as not-2FA-authenticated for writes. The npm website settings UI is the only path that works; CI-driven workflows are the scalable alternative.",
|
|
156
|
-
"trigger": "Context file references `npm deprecate`, `npm unpublish`, `npm dist-tag add/rm/set`, `npm access grant/revoke/2fa`, or `npm owner add/rm` as a command.",
|
|
157
|
-
"message": "\"{cmd}\" — npm {op} requires a 2FA-authenticated session; CLI returns 422 under WebAuthn-only auth",
|
|
158
|
-
"fixable": false,
|
|
159
|
-
"stability": "experimental",
|
|
160
|
-
"source": "https://docs.npmjs.com/requiring-2fa-for-package-publishing-and-settings-modification"
|
|
161
|
-
},
|
|
162
151
|
{
|
|
163
152
|
"id": "staleness/stale",
|
|
164
153
|
"category": "staleness",
|
package/dist/index.js
CHANGED
|
@@ -35175,7 +35175,7 @@ var init_parser = __esm({
|
|
|
35175
35175
|
"use strict";
|
|
35176
35176
|
init_fs();
|
|
35177
35177
|
await init_tokens();
|
|
35178
|
-
PATH_PATTERN = /(?:^|[\s`"'(])((\.{0,2}\/)?(?:[\w@.-]+\/)+[\w.*-]
|
|
35178
|
+
PATH_PATTERN = /(?:^|[\s`"'(])((\.{0,2}\/)?(?:[\w@.-]+\/)+[\w.*-]*(?:\.\w+)?)(?=[\s`"'),;:]|$)/gm;
|
|
35179
35179
|
PATH_EXCLUDE = /^(https?:\/\/|ftp:\/\/|mailto:|n\/a|w\/o|I\/O|i\/o|e\.g\.|N\/A|\.deb\/|\.rpm[.\/]|\.tar[.\/]|\.zip[.\/])/i;
|
|
35180
35180
|
COMMAND_PREFIXES = /^\s*[\$>]\s+(.+)$/;
|
|
35181
35181
|
COMMON_COMMANDS = /^(npm|npx|pnpm|yarn|make|cargo|go\s+(run|build|test)|python|pytest|vitest|jest|bun|deno)\b/;
|
|
@@ -41488,21 +41488,6 @@ async function checkCommands(file2, projectRoot) {
|
|
|
41488
41488
|
const makefile = loadMakefile(projectRoot);
|
|
41489
41489
|
for (const ref of file2.references.commands) {
|
|
41490
41490
|
const cmd = ref.value;
|
|
41491
|
-
const writeMatch = cmd.match(NPM_WRITE_OP_PATTERN);
|
|
41492
|
-
if (writeMatch) {
|
|
41493
|
-
const op = writeMatch[1].split(/\s+/)[0];
|
|
41494
|
-
if (op !== "publish") {
|
|
41495
|
-
issues.push({
|
|
41496
|
-
severity: "info",
|
|
41497
|
-
check: "commands",
|
|
41498
|
-
ruleId: "commands/npm-auth-trap",
|
|
41499
|
-
line: ref.line,
|
|
41500
|
-
message: `"${cmd}" \u2014 npm ${op} requires a 2FA-authenticated session; CLI returns 422 under WebAuthn-only auth`,
|
|
41501
|
-
suggestion: "Under WebAuthn 2FA without a TOTP fallback, the npm website UI (npmjs.com/package/<pkg>/settings) is the only path that works. For recurring writes, prefer a CI-driven workflow using a granular NPM_TOKEN secret.",
|
|
41502
|
-
detail: "npm treats CLI web-auth tokens as not-2FA-authenticated for writes; WebAuthn yields no TOTP code to satisfy the check."
|
|
41503
|
-
});
|
|
41504
|
-
}
|
|
41505
|
-
}
|
|
41506
41491
|
const scriptMatch = cmd.match(NPM_SCRIPT_PATTERN);
|
|
41507
41492
|
if (scriptMatch && pkgJson) {
|
|
41508
41493
|
const scriptName = scriptMatch[1];
|
|
@@ -41622,7 +41607,7 @@ function hasMakeTarget(makefile, target) {
|
|
|
41622
41607
|
const pattern = new RegExp(`^${target.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*:`, "m");
|
|
41623
41608
|
return pattern.test(makefile);
|
|
41624
41609
|
}
|
|
41625
|
-
var NPM_SCRIPT_PATTERN, MAKE_PATTERN, NPX_PATTERN
|
|
41610
|
+
var NPM_SCRIPT_PATTERN, MAKE_PATTERN, NPX_PATTERN;
|
|
41626
41611
|
var init_commands = __esm({
|
|
41627
41612
|
"src/core/checks/commands.ts"() {
|
|
41628
41613
|
"use strict";
|
|
@@ -41630,7 +41615,6 @@ var init_commands = __esm({
|
|
|
41630
41615
|
NPM_SCRIPT_PATTERN = /^(?:npm\s+run|pnpm(?:\s+run)?|yarn(?:\s+run)?|bun(?:\s+run)?)\s+(\S+)/;
|
|
41631
41616
|
MAKE_PATTERN = /^make\s+(\S+)/;
|
|
41632
41617
|
NPX_PATTERN = /^npx\s+(\S+)/;
|
|
41633
|
-
NPM_WRITE_OP_PATTERN = /^npm\s+(publish|deprecate|unpublish|access\s+(grant|revoke|2fa)|dist-tag\s+(add|rm|set)|owner\s+(add|rm))\b/;
|
|
41634
41618
|
}
|
|
41635
41619
|
});
|
|
41636
41620
|
|
|
@@ -44153,7 +44137,7 @@ import { readFileSync as readFileSync4 } from "node:fs";
|
|
|
44153
44137
|
import { resolve as resolve8, dirname as dirname3 } from "node:path";
|
|
44154
44138
|
import { fileURLToPath } from "node:url";
|
|
44155
44139
|
function loadVersion() {
|
|
44156
|
-
if (true) return "0.9.
|
|
44140
|
+
if (true) return "0.9.5";
|
|
44157
44141
|
const __dir = dirname3(fileURLToPath(import.meta.url));
|
|
44158
44142
|
const pkgPath = resolve8(__dir, "../package.json");
|
|
44159
44143
|
const pkg = JSON.parse(readFileSync4(pkgPath, "utf-8"));
|