@keithadler/frostjs 0.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.
- package/LICENSE +21 -0
- package/README.md +568 -0
- package/dist/baseline.d.ts +18 -0
- package/dist/baseline.d.ts.map +1 -0
- package/dist/baseline.js +56 -0
- package/dist/baseline.js.map +1 -0
- package/dist/changed.d.ts +15 -0
- package/dist/changed.d.ts.map +1 -0
- package/dist/changed.js +93 -0
- package/dist/changed.js.map +1 -0
- package/dist/cli/args.d.ts +37 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +200 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +8 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/run.d.ts +9 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +404 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/discover/index.d.ts +15 -0
- package/dist/discover/index.d.ts.map +1 -0
- package/dist/discover/index.js +70 -0
- package/dist/discover/index.js.map +1 -0
- package/dist/eslint.d.ts +103 -0
- package/dist/eslint.d.ts.map +1 -0
- package/dist/eslint.js +111 -0
- package/dist/eslint.js.map +1 -0
- package/dist/extract/annotations.d.ts +5 -0
- package/dist/extract/annotations.d.ts.map +1 -0
- package/dist/extract/annotations.js +5 -0
- package/dist/extract/annotations.js.map +1 -0
- package/dist/extract/ast.d.ts +45 -0
- package/dist/extract/ast.d.ts.map +1 -0
- package/dist/extract/ast.js +60 -0
- package/dist/extract/ast.js.map +1 -0
- package/dist/extract/capability.d.ts +22 -0
- package/dist/extract/capability.d.ts.map +1 -0
- package/dist/extract/capability.js +2 -0
- package/dist/extract/capability.js.map +1 -0
- package/dist/extract/html.d.ts +15 -0
- package/dist/extract/html.d.ts.map +1 -0
- package/dist/extract/html.js +69 -0
- package/dist/extract/html.js.map +1 -0
- package/dist/extract/index.d.ts +9 -0
- package/dist/extract/index.d.ts.map +1 -0
- package/dist/extract/index.js +95 -0
- package/dist/extract/index.js.map +1 -0
- package/dist/extract/recognizers/codegen.d.ts +10 -0
- package/dist/extract/recognizers/codegen.d.ts.map +1 -0
- package/dist/extract/recognizers/codegen.js +39 -0
- package/dist/extract/recognizers/codegen.js.map +1 -0
- package/dist/extract/recognizers/dom-escape.d.ts +11 -0
- package/dist/extract/recognizers/dom-escape.d.ts.map +1 -0
- package/dist/extract/recognizers/dom-escape.js +58 -0
- package/dist/extract/recognizers/dom-escape.js.map +1 -0
- package/dist/extract/recognizers/globals.d.ts +9 -0
- package/dist/extract/recognizers/globals.d.ts.map +1 -0
- package/dist/extract/recognizers/globals.js +121 -0
- package/dist/extract/recognizers/globals.js.map +1 -0
- package/dist/extract/recognizers/identity.d.ts +10 -0
- package/dist/extract/recognizers/identity.d.ts.map +1 -0
- package/dist/extract/recognizers/identity.js +79 -0
- package/dist/extract/recognizers/identity.js.map +1 -0
- package/dist/extract/recognizers/navigation.d.ts +12 -0
- package/dist/extract/recognizers/navigation.d.ts.map +1 -0
- package/dist/extract/recognizers/navigation.js +110 -0
- package/dist/extract/recognizers/navigation.js.map +1 -0
- package/dist/extract/recognizers/network.d.ts +11 -0
- package/dist/extract/recognizers/network.d.ts.map +1 -0
- package/dist/extract/recognizers/network.js +41 -0
- package/dist/extract/recognizers/network.js.map +1 -0
- package/dist/extract/recognizers/resolve.d.ts +37 -0
- package/dist/extract/recognizers/resolve.d.ts.map +1 -0
- package/dist/extract/recognizers/resolve.js +72 -0
- package/dist/extract/recognizers/resolve.js.map +1 -0
- package/dist/extract/recognizers/storage.d.ts +9 -0
- package/dist/extract/recognizers/storage.d.ts.map +1 -0
- package/dist/extract/recognizers/storage.js +37 -0
- package/dist/extract/recognizers/storage.js.map +1 -0
- package/dist/extract/recognizers/types.d.ts +38 -0
- package/dist/extract/recognizers/types.d.ts.map +1 -0
- package/dist/extract/recognizers/types.js +25 -0
- package/dist/extract/recognizers/types.js.map +1 -0
- package/dist/extract/recognizers/worker.d.ts +11 -0
- package/dist/extract/recognizers/worker.d.ts.map +1 -0
- package/dist/extract/recognizers/worker.js +41 -0
- package/dist/extract/recognizers/worker.js.map +1 -0
- package/dist/extract/scope.d.ts +23 -0
- package/dist/extract/scope.d.ts.map +1 -0
- package/dist/extract/scope.js +299 -0
- package/dist/extract/scope.js.map +1 -0
- package/dist/extract/suppress.d.ts +21 -0
- package/dist/extract/suppress.d.ts.map +1 -0
- package/dist/extract/suppress.js +42 -0
- package/dist/extract/suppress.js.map +1 -0
- package/dist/extract/target.d.ts +34 -0
- package/dist/extract/target.d.ts.map +1 -0
- package/dist/extract/target.js +81 -0
- package/dist/extract/target.js.map +1 -0
- package/dist/extract/typescript.d.ts +12 -0
- package/dist/extract/typescript.d.ts.map +1 -0
- package/dist/extract/typescript.js +56 -0
- package/dist/extract/typescript.js.map +1 -0
- package/dist/extract/walk.d.ts +14 -0
- package/dist/extract/walk.d.ts.map +1 -0
- package/dist/extract/walk.js +70 -0
- package/dist/extract/walk.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +10 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +79 -0
- package/dist/init.js.map +1 -0
- package/dist/policy/compile.d.ts +56 -0
- package/dist/policy/compile.d.ts.map +1 -0
- package/dist/policy/compile.js +78 -0
- package/dist/policy/compile.js.map +1 -0
- package/dist/policy/config.d.ts +18 -0
- package/dist/policy/config.d.ts.map +1 -0
- package/dist/policy/config.js +70 -0
- package/dist/policy/config.js.map +1 -0
- package/dist/policy/csp.d.ts +19 -0
- package/dist/policy/csp.d.ts.map +1 -0
- package/dist/policy/csp.js +47 -0
- package/dist/policy/csp.js.map +1 -0
- package/dist/policy/glob.d.ts +12 -0
- package/dist/policy/glob.d.ts.map +1 -0
- package/dist/policy/glob.js +63 -0
- package/dist/policy/glob.js.map +1 -0
- package/dist/policy/index.d.ts +47 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +34 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/parse.d.ts +51 -0
- package/dist/policy/parse.d.ts.map +1 -0
- package/dist/policy/parse.js +352 -0
- package/dist/policy/parse.js.map +1 -0
- package/dist/policy/vocabulary.d.ts +15 -0
- package/dist/policy/vocabulary.d.ts.map +1 -0
- package/dist/policy/vocabulary.js +99 -0
- package/dist/policy/vocabulary.js.map +1 -0
- package/dist/registry.d.ts +45 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +85 -0
- package/dist/registry.js.map +1 -0
- package/dist/report/github.d.ts +10 -0
- package/dist/report/github.d.ts.map +1 -0
- package/dist/report/github.js +31 -0
- package/dist/report/github.js.map +1 -0
- package/dist/report/json.d.ts +44 -0
- package/dist/report/json.d.ts.map +1 -0
- package/dist/report/json.js +40 -0
- package/dist/report/json.js.map +1 -0
- package/dist/report/sarif.d.ts +10 -0
- package/dist/report/sarif.d.ts.map +1 -0
- package/dist/report/sarif.js +64 -0
- package/dist/report/sarif.js.map +1 -0
- package/dist/report/summary.d.ts +9 -0
- package/dist/report/summary.d.ts.map +1 -0
- package/dist/report/summary.js +67 -0
- package/dist/report/summary.js.map +1 -0
- package/dist/report/text.d.ts +37 -0
- package/dist/report/text.d.ts.map +1 -0
- package/dist/report/text.js +81 -0
- package/dist/report/text.js.map +1 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +131 -0
- package/dist/sync.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface LineRange {
|
|
2
|
+
start: number;
|
|
3
|
+
/** Inclusive. */
|
|
4
|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
/** Canonical absolute file path (see canonical) -> changed line ranges on the new side, or "all" for an untracked file. */
|
|
7
|
+
export type ChangedLines = Map<string, LineRange[] | "all">;
|
|
8
|
+
/**
|
|
9
|
+
* Lines changed since `ref` in the repository containing `cwd`. Throws
|
|
10
|
+
* outside a repository or when git cannot diff against the ref.
|
|
11
|
+
*/
|
|
12
|
+
export declare function changedLines(ref: string, cwd: string): ChangedLines;
|
|
13
|
+
/** True when the line of `file` (any spelling of its absolute path) was added or modified. */
|
|
14
|
+
export declare function isChanged(changed: ChangedLines, file: string, line: number): boolean;
|
|
15
|
+
//# sourceMappingURL=changed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changed.d.ts","sourceRoot":"","sources":["../src/changed.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,2HAA2H;AAC3H,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,CAAC;AA6B5D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAoCnE;AAED,8FAA8F;AAC9F,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKpF"}
|
package/dist/changed.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Changed-lines-only mode. Asks git which lines of which files differ from
|
|
3
|
+
* a ref, so a PR check can fail only on uses the PR introduced or touched.
|
|
4
|
+
* Untracked files count as entirely changed. Parsing the unified diff with
|
|
5
|
+
* zero context keeps it to the hunk headers.
|
|
6
|
+
*/
|
|
7
|
+
import { execFileSync } from "node:child_process";
|
|
8
|
+
import fs from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
/**
|
|
11
|
+
* One spelling for a path, so git's output and the caller's paths agree:
|
|
12
|
+
* symlinks resolved (macOS temp dirs), Windows short names expanded
|
|
13
|
+
* (RUNNER~1), drive letter case settled. Falls back to path.resolve when
|
|
14
|
+
* the path does not exist.
|
|
15
|
+
*/
|
|
16
|
+
function canonical(p) {
|
|
17
|
+
try {
|
|
18
|
+
return fs.realpathSync.native(p);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return path.resolve(p);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function git(args, cwd) {
|
|
25
|
+
return execFileSync("git", args, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
|
|
26
|
+
}
|
|
27
|
+
/** The git repository containing `cwd`, or null outside one. */
|
|
28
|
+
function repoRoot(cwd) {
|
|
29
|
+
try {
|
|
30
|
+
return git(["rev-parse", "--show-toplevel"], cwd).trim();
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Lines changed since `ref` in the repository containing `cwd`. Throws
|
|
38
|
+
* outside a repository or when git cannot diff against the ref.
|
|
39
|
+
*/
|
|
40
|
+
export function changedLines(ref, cwd) {
|
|
41
|
+
// The ref comes from the command line, often from a CI variable. It must
|
|
42
|
+
// never be read as a git option: `--output=<file>` would write a file.
|
|
43
|
+
if (ref === "" || ref.startsWith("-"))
|
|
44
|
+
throw new Error(`--changed-since needs a git ref, not '${ref}'`);
|
|
45
|
+
const top = repoRoot(cwd);
|
|
46
|
+
if (top === null)
|
|
47
|
+
throw new Error("--changed-since needs a git repository");
|
|
48
|
+
const root = canonical(top);
|
|
49
|
+
const out = new Map();
|
|
50
|
+
let diff;
|
|
51
|
+
try {
|
|
52
|
+
diff = git(["diff", "-U0", "--no-color", "--no-ext-diff", "--end-of-options", ref, "--"], root);
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
const msg = e.stderr?.trim() || e.message;
|
|
56
|
+
throw new Error(`git diff against ${ref} failed: ${msg.split("\n")[0]}`);
|
|
57
|
+
}
|
|
58
|
+
let current = null;
|
|
59
|
+
for (const line of diff.split("\n")) {
|
|
60
|
+
if (line.startsWith("+++ ")) {
|
|
61
|
+
const name = line.slice(4).trim();
|
|
62
|
+
current = name === "/dev/null" ? null : canonical(path.resolve(root, name.replace(/^b\//, "")));
|
|
63
|
+
if (current !== null && !out.has(current))
|
|
64
|
+
out.set(current, []);
|
|
65
|
+
}
|
|
66
|
+
else if (line.startsWith("@@") && current !== null) {
|
|
67
|
+
const m = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(line);
|
|
68
|
+
if (!m)
|
|
69
|
+
continue;
|
|
70
|
+
const start = Number(m[1]);
|
|
71
|
+
const count = m[2] === undefined ? 1 : Number(m[2]);
|
|
72
|
+
if (count === 0)
|
|
73
|
+
continue; // pure deletion
|
|
74
|
+
const ranges = out.get(current);
|
|
75
|
+
if (Array.isArray(ranges))
|
|
76
|
+
ranges.push({ start, end: start + count - 1 });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const untracked = git(["ls-files", "--others", "--exclude-standard", "-z"], root).split("\0").filter(Boolean);
|
|
80
|
+
for (const f of untracked)
|
|
81
|
+
out.set(canonical(path.resolve(root, f)), "all");
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
/** True when the line of `file` (any spelling of its absolute path) was added or modified. */
|
|
85
|
+
export function isChanged(changed, file, line) {
|
|
86
|
+
const ranges = changed.get(canonical(file));
|
|
87
|
+
if (ranges === undefined)
|
|
88
|
+
return false;
|
|
89
|
+
if (ranges === "all")
|
|
90
|
+
return true;
|
|
91
|
+
return ranges.some((r) => line >= r.start && line <= r.end);
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=changed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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OAAO,KAAK,CAAC;IACvC,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command-line parsing and the help text. Every flag here has a usage line
|
|
3
|
+
* in the README and a test; keep the three in step.
|
|
4
|
+
*/
|
|
5
|
+
import { type Confidence } from "../policy/index.js";
|
|
6
|
+
/** The subcommand, `check` being the bare `frostjs <paths>` form. */
|
|
7
|
+
type Command = "check" | "init" | "csp" | "summary" | "vendor-add" | "registry-sync" | "sri";
|
|
8
|
+
export interface ParsedArgs {
|
|
9
|
+
command: Command;
|
|
10
|
+
version: boolean;
|
|
11
|
+
help: boolean;
|
|
12
|
+
exclude: string[];
|
|
13
|
+
exitZero: boolean;
|
|
14
|
+
policy: string | null;
|
|
15
|
+
today: string | null;
|
|
16
|
+
minConfidence: Confidence | null;
|
|
17
|
+
baseline: string | null;
|
|
18
|
+
updateBaseline: boolean;
|
|
19
|
+
changedSince: string | null;
|
|
20
|
+
format: Format;
|
|
21
|
+
paths: string[];
|
|
22
|
+
}
|
|
23
|
+
declare const FORMATS: readonly ["text", "json", "sarif", "github", "html"];
|
|
24
|
+
type Format = (typeof FORMATS)[number];
|
|
25
|
+
/** A flag or argument the CLI cannot accept; the message is printed with the help text. */
|
|
26
|
+
export declare class UsageError extends Error {
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parse argv (without node and script name). The first token may be a
|
|
30
|
+
* subcommand; `--` ends option parsing; `--name=value` and `--name value`
|
|
31
|
+
* are both accepted. Throws UsageError.
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseArgs(argv: readonly string[]): ParsedArgs;
|
|
34
|
+
/** The `--help` text, also printed after a usage error. */
|
|
35
|
+
export declare const HELP = "usage: frostjs [options] <paths...>\n frostjs init [paths...]\n frostjs csp [--policy <file>]\n frostjs summary [--policy <file>]\n frostjs vendor add <files...>\n frostjs registry sync\n frostjs sri [--format text|json|html] [paths...]\n\nDeny-by-default capability linter for JavaScript.\n\ncommands:\n (default) analyze the given paths against the policy\n frostjs init write a starter frostjs.policy in the current\n directory granting exactly what the code under the\n paths (default .) does today, with a note on each\n grant saying where; read it and delete what should\n not be allowed\n frostjs csp print the Content-Security-Policy header the policy\n implies, and nothing else, for the deploy step\n frostjs summary print a plain-English reading of the policy for a\n reviewer who does not write JavaScript\n frostjs vendor add analyze third-party files once, print the capability\n set found, and record it with the file's SHA-384 in\n .frostjs/registry.json beside the policy\n frostjs registry sync after a dependency bump: re-admit vendored files\n whose capability set did not change, refuse and show\n the difference for those that gained one, prune\n entries whose file is gone, record the lockfile hash\n frostjs sri print Subresource Integrity values for registered\n vendored files (text: path and hash; json: a map;\n html: script tags), so the browser enforces the same\n hashes the registry reviewed\n\noptions:\n -h, --help show this help and exit\n -V, --version print the version and exit\n --exclude <name> skip directories with this name (repeatable);\n node_modules, dist, build, coverage and .git are\n always skipped\n --exit-zero report findings but always exit 0\n --policy <file> use this policy instead of searching for frostjs.policy\n --today <date> treat this YYYY-MM-DD as today when checking expiry\n --min-confidence <c> lowest confidence that can fail the build:\n certain, probable (default) or possible; uses below\n it are listed as unknown\n --baseline <file> denials recorded in this file do not fail the build\n --update-baseline write every current denial into the baseline file\n and exit 0; use once to adopt frostjs on a codebase\n --changed-since <ref> fail only on uses in lines changed since the git\n ref (e.g. origin/main); untracked files count whole\n --format <f> text (default), json (versioned schema), sarif\n (2.1.0, one rule per capability), or github\n (inline PR annotations followed by the text report);\n html only with frostjs sri\n\npolicy:\n frostjs.policy is searched for in the directory shared by all the given\n paths, then in each parent directory. The nearest one wins. Path globs in\n a policy are relative to the policy file's directory. With no policy, every\n capability is denied.\n\nexit codes:\n 0 no denied capability uses\n 1 at least one denied capability use\n 2 usage or input error (bad flag, missing path, syntax error)\n";
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEvE,qEAAqE;AACrE,KAAK,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,KAAK,CAAC;AAE7F,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,aAAa,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,QAAA,MAAM,OAAO,sDAAuD,CAAC;AACrE,KAAK,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvC,2FAA2F;AAC3F,qBAAa,UAAW,SAAQ,KAAK;CAAG;AAExC;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAkH7D;AAED,2DAA2D;AAC3D,eAAO,MAAM,IAAI,ygHAiEhB,CAAC"}
|
package/dist/cli/args.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command-line parsing and the help text. Every flag here has a usage line
|
|
3
|
+
* in the README and a test; keep the three in step.
|
|
4
|
+
*/
|
|
5
|
+
import { CONFIDENCE_ORDER } from "../policy/index.js";
|
|
6
|
+
const FORMATS = ["text", "json", "sarif", "github", "html"];
|
|
7
|
+
/** A flag or argument the CLI cannot accept; the message is printed with the help text. */
|
|
8
|
+
export class UsageError extends Error {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse argv (without node and script name). The first token may be a
|
|
12
|
+
* subcommand; `--` ends option parsing; `--name=value` and `--name value`
|
|
13
|
+
* are both accepted. Throws UsageError.
|
|
14
|
+
*/
|
|
15
|
+
export function parseArgs(argv) {
|
|
16
|
+
const out = {
|
|
17
|
+
command: "check",
|
|
18
|
+
version: false,
|
|
19
|
+
help: false,
|
|
20
|
+
exclude: [],
|
|
21
|
+
exitZero: false,
|
|
22
|
+
policy: null,
|
|
23
|
+
today: null,
|
|
24
|
+
minConfidence: null,
|
|
25
|
+
baseline: null,
|
|
26
|
+
updateBaseline: false,
|
|
27
|
+
changedSince: null,
|
|
28
|
+
format: "text",
|
|
29
|
+
paths: [],
|
|
30
|
+
};
|
|
31
|
+
let positionalOnly = false;
|
|
32
|
+
let first = true;
|
|
33
|
+
for (let i = 0; i < argv.length; i++) {
|
|
34
|
+
const arg = argv[i];
|
|
35
|
+
if (first) {
|
|
36
|
+
first = false;
|
|
37
|
+
if (arg === "csp" || arg === "summary" || arg === "sri" || arg === "init") {
|
|
38
|
+
out.command = arg;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (arg === "registry") {
|
|
42
|
+
const sub = argv[i + 1];
|
|
43
|
+
if (sub !== "sync")
|
|
44
|
+
throw new UsageError(`frostjs registry needs a subcommand: sync${sub ? ` (got '${sub}')` : ""}`);
|
|
45
|
+
out.command = "registry-sync";
|
|
46
|
+
i++;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (arg === "vendor") {
|
|
50
|
+
const sub = argv[i + 1];
|
|
51
|
+
if (sub !== "add")
|
|
52
|
+
throw new UsageError(`frostjs vendor needs a subcommand: add${sub ? ` (got '${sub}')` : ""}`);
|
|
53
|
+
out.command = "vendor-add";
|
|
54
|
+
i++;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (positionalOnly) {
|
|
59
|
+
out.paths.push(arg);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const eq = arg.indexOf("=");
|
|
63
|
+
const name = arg.startsWith("--") && eq > 0 ? arg.slice(0, eq) : arg;
|
|
64
|
+
const takeValue = () => {
|
|
65
|
+
if (eq > 0 && arg.startsWith("--"))
|
|
66
|
+
return arg.slice(eq + 1);
|
|
67
|
+
const next = argv[++i];
|
|
68
|
+
if (next === undefined)
|
|
69
|
+
throw new UsageError(`${name} needs a value`);
|
|
70
|
+
return next;
|
|
71
|
+
};
|
|
72
|
+
switch (name) {
|
|
73
|
+
case "--":
|
|
74
|
+
positionalOnly = true;
|
|
75
|
+
break;
|
|
76
|
+
case "--version":
|
|
77
|
+
case "-V":
|
|
78
|
+
out.version = true;
|
|
79
|
+
break;
|
|
80
|
+
case "--help":
|
|
81
|
+
case "-h":
|
|
82
|
+
out.help = true;
|
|
83
|
+
break;
|
|
84
|
+
case "--exclude":
|
|
85
|
+
out.exclude.push(takeValue());
|
|
86
|
+
break;
|
|
87
|
+
case "--exit-zero":
|
|
88
|
+
out.exitZero = true;
|
|
89
|
+
break;
|
|
90
|
+
case "--policy":
|
|
91
|
+
out.policy = takeValue();
|
|
92
|
+
break;
|
|
93
|
+
case "--min-confidence": {
|
|
94
|
+
const v = takeValue();
|
|
95
|
+
if (!CONFIDENCE_ORDER.includes(v)) {
|
|
96
|
+
throw new UsageError("--min-confidence must be certain, probable or possible");
|
|
97
|
+
}
|
|
98
|
+
out.minConfidence = v;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case "--baseline":
|
|
102
|
+
out.baseline = takeValue();
|
|
103
|
+
break;
|
|
104
|
+
case "--update-baseline":
|
|
105
|
+
out.updateBaseline = true;
|
|
106
|
+
break;
|
|
107
|
+
case "--changed-since":
|
|
108
|
+
out.changedSince = takeValue();
|
|
109
|
+
break;
|
|
110
|
+
case "--format": {
|
|
111
|
+
const v = takeValue();
|
|
112
|
+
if (!FORMATS.includes(v))
|
|
113
|
+
throw new UsageError(`--format must be one of ${FORMATS.join(", ")}`);
|
|
114
|
+
out.format = v;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case "--today": {
|
|
118
|
+
const v = takeValue();
|
|
119
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(v))
|
|
120
|
+
throw new UsageError("--today must be a date like 2026-12-01");
|
|
121
|
+
out.today = v;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
default:
|
|
125
|
+
if (arg.startsWith("-")) {
|
|
126
|
+
throw new UsageError(`unknown option: ${arg}`);
|
|
127
|
+
}
|
|
128
|
+
out.paths.push(arg);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return out;
|
|
132
|
+
}
|
|
133
|
+
/** The `--help` text, also printed after a usage error. */
|
|
134
|
+
export const HELP = `usage: frostjs [options] <paths...>
|
|
135
|
+
frostjs init [paths...]
|
|
136
|
+
frostjs csp [--policy <file>]
|
|
137
|
+
frostjs summary [--policy <file>]
|
|
138
|
+
frostjs vendor add <files...>
|
|
139
|
+
frostjs registry sync
|
|
140
|
+
frostjs sri [--format text|json|html] [paths...]
|
|
141
|
+
|
|
142
|
+
Deny-by-default capability linter for JavaScript.
|
|
143
|
+
|
|
144
|
+
commands:
|
|
145
|
+
(default) analyze the given paths against the policy
|
|
146
|
+
frostjs init write a starter frostjs.policy in the current
|
|
147
|
+
directory granting exactly what the code under the
|
|
148
|
+
paths (default .) does today, with a note on each
|
|
149
|
+
grant saying where; read it and delete what should
|
|
150
|
+
not be allowed
|
|
151
|
+
frostjs csp print the Content-Security-Policy header the policy
|
|
152
|
+
implies, and nothing else, for the deploy step
|
|
153
|
+
frostjs summary print a plain-English reading of the policy for a
|
|
154
|
+
reviewer who does not write JavaScript
|
|
155
|
+
frostjs vendor add analyze third-party files once, print the capability
|
|
156
|
+
set found, and record it with the file's SHA-384 in
|
|
157
|
+
.frostjs/registry.json beside the policy
|
|
158
|
+
frostjs registry sync after a dependency bump: re-admit vendored files
|
|
159
|
+
whose capability set did not change, refuse and show
|
|
160
|
+
the difference for those that gained one, prune
|
|
161
|
+
entries whose file is gone, record the lockfile hash
|
|
162
|
+
frostjs sri print Subresource Integrity values for registered
|
|
163
|
+
vendored files (text: path and hash; json: a map;
|
|
164
|
+
html: script tags), so the browser enforces the same
|
|
165
|
+
hashes the registry reviewed
|
|
166
|
+
|
|
167
|
+
options:
|
|
168
|
+
-h, --help show this help and exit
|
|
169
|
+
-V, --version print the version and exit
|
|
170
|
+
--exclude <name> skip directories with this name (repeatable);
|
|
171
|
+
node_modules, dist, build, coverage and .git are
|
|
172
|
+
always skipped
|
|
173
|
+
--exit-zero report findings but always exit 0
|
|
174
|
+
--policy <file> use this policy instead of searching for frostjs.policy
|
|
175
|
+
--today <date> treat this YYYY-MM-DD as today when checking expiry
|
|
176
|
+
--min-confidence <c> lowest confidence that can fail the build:
|
|
177
|
+
certain, probable (default) or possible; uses below
|
|
178
|
+
it are listed as unknown
|
|
179
|
+
--baseline <file> denials recorded in this file do not fail the build
|
|
180
|
+
--update-baseline write every current denial into the baseline file
|
|
181
|
+
and exit 0; use once to adopt frostjs on a codebase
|
|
182
|
+
--changed-since <ref> fail only on uses in lines changed since the git
|
|
183
|
+
ref (e.g. origin/main); untracked files count whole
|
|
184
|
+
--format <f> text (default), json (versioned schema), sarif
|
|
185
|
+
(2.1.0, one rule per capability), or github
|
|
186
|
+
(inline PR annotations followed by the text report);
|
|
187
|
+
html only with frostjs sri
|
|
188
|
+
|
|
189
|
+
policy:
|
|
190
|
+
frostjs.policy is searched for in the directory shared by all the given
|
|
191
|
+
paths, then in each parent directory. The nearest one wins. Path globs in
|
|
192
|
+
a policy are relative to the policy file's directory. With no policy, every
|
|
193
|
+
capability is denied.
|
|
194
|
+
|
|
195
|
+
exit codes:
|
|
196
|
+
0 no denied capability uses
|
|
197
|
+
1 at least one denied capability use
|
|
198
|
+
2 usage or input error (bad flag, missing path, syntax error)
|
|
199
|
+
`;
|
|
200
|
+
//# sourceMappingURL=args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AAqBvE,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAGrE,2FAA2F;AAC3F,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG;AAExC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC/C,MAAM,GAAG,GAAe;QACtB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,KAAK;QACrB,YAAY,EAAE,IAAI;QAClB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,EAAE;KACV,CAAC;IACF,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,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;;;;;;;;;;;;;;;;CAiEnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":""}
|
package/dist/cli/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACtC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CACvC,CAAC,CAAC;AACH,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface Io {
|
|
2
|
+
stdout: (s: string) => void;
|
|
3
|
+
stderr: (s: string) => void;
|
|
4
|
+
/** Directory inputs are resolved against and reported paths are made relative to. Defaults to process.cwd(). */
|
|
5
|
+
cwd?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Run the CLI against argv (without node and script name) and return the exit code. */
|
|
8
|
+
export declare function run(argv: readonly string[], io: Io): number;
|
|
9
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/cli/run.ts"],"names":[],"mappings":"AAkDA,MAAM,WAAW,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,gHAAgH;IAChH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wFAAwF;AACxF,wBAAgB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,MAAM,CAiC3D"}
|