@zappie/check 0.2.0 → 0.2.2
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/CHANGELOG.md +23 -0
- package/README.md +22 -0
- package/dist/index.d.ts +42 -4
- package/dist/index.js +752 -160
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/schema/check-result.v1.json +30 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @zappie/check
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- afb46d4: Add storefront security lint rules, pass outbound hosts from `zappie.config.ts` to ESLint, and provide `safeRedirect` from `@zappie/sdk/redirect` for untrusted navigation targets.
|
|
8
|
+
- Updated dependencies [2b672c9]
|
|
9
|
+
- Updated dependencies [9b5b412]
|
|
10
|
+
- Updated dependencies [32ecccf]
|
|
11
|
+
- Updated dependencies [afb46d4]
|
|
12
|
+
- Updated dependencies [6a8e227]
|
|
13
|
+
- Updated dependencies [c0171ae]
|
|
14
|
+
- Updated dependencies [0cbc4da]
|
|
15
|
+
- @zappie/sdk@0.1.12
|
|
16
|
+
- eslint-plugin-zappie@0.3.0
|
|
17
|
+
|
|
18
|
+
## 0.2.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- edfc401: Audit storefront dependencies and widen secret scanning to tracked files, Worker output, server bundles and optional Git history.
|
|
23
|
+
- Updated dependencies [edfc401]
|
|
24
|
+
- @zappie/sdk@0.1.11
|
|
25
|
+
|
|
3
26
|
## 0.2.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ npx zappie check
|
|
|
15
15
|
| ----------- | ------------------------------------------------------------------------------------------- |
|
|
16
16
|
| `config` | `zappie.config.ts` and `theme.json`, against the SDK and token rules |
|
|
17
17
|
| `allowlist` | Every npm dependency is on Zappie's package allowlist or in `packages.allow` in your config |
|
|
18
|
+
| `audit` | High and critical dependency advisories, with critical findings enforced on request |
|
|
18
19
|
| `lint` | The `eslint-plugin-zappie` rules and the `jsx-a11y` accessibility baseline |
|
|
19
20
|
| `types` | A TypeScript check of the project |
|
|
20
21
|
| `test` | Your project's tests |
|
|
@@ -42,6 +43,27 @@ Warnings don't fail the step. A reviewed `!important` passes with `/* zappie-all
|
|
|
42
43
|
|
|
43
44
|
Add `--json` for a machine-readable result. Its shape is the JSON Schema at `@zappie/check/schema/check-result.v1.json`.
|
|
44
45
|
|
|
46
|
+
Dependency auditing defaults to `--audit=report`. Use `--audit=off` when the registry is unavailable or `--audit=enforce` to fail on an unacknowledged critical advisory. A high or critical advisory with no fixed version can be acknowledged for at most 90 days:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
// ...
|
|
51
|
+
audit: {
|
|
52
|
+
ignore: [
|
|
53
|
+
{
|
|
54
|
+
id: "GHSA-abcd-1234-5678",
|
|
55
|
+
reason: "The maintainer has not published a fixed release",
|
|
56
|
+
until: "2026-11-30",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
An unreadable or missing lockfile, registry failure, timeout, or unsupported Yarn or Bun project is reported as `audit/unavailable`. Report mode keeps checking and enforce mode fails. Invalid or expired acknowledgements are reported without hiding the advisory or stopping later checks.
|
|
64
|
+
|
|
65
|
+
Pass `--history` to include committed Git history in the secret scan. The normal scan covers every tracked file plus generated files under `workers/**`, `build/client/**` and `build/server/**`.
|
|
66
|
+
|
|
45
67
|
## From code
|
|
46
68
|
|
|
47
69
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,22 @@ type CheckProblem = {
|
|
|
5
5
|
line?: number;
|
|
6
6
|
message: string;
|
|
7
7
|
fix: string | null;
|
|
8
|
+
advisory?: AuditAdvisory;
|
|
8
9
|
};
|
|
9
|
-
type
|
|
10
|
+
type AuditMode = "off" | "report" | "enforce";
|
|
11
|
+
type AuditAdvisory = {
|
|
12
|
+
id: string;
|
|
13
|
+
package: string;
|
|
14
|
+
severity: "high" | "critical";
|
|
15
|
+
vulnerableVersion: string;
|
|
16
|
+
fixedVersion: string | null;
|
|
17
|
+
fixCommand?: string;
|
|
18
|
+
upgradePackage?: string;
|
|
19
|
+
upgradeVersion?: string;
|
|
20
|
+
ignored: boolean;
|
|
21
|
+
ignoredUntil?: string;
|
|
22
|
+
};
|
|
23
|
+
type CheckStepName = "config" | "allowlist" | "audit" | "lint" | "types" | "test" | "build" | "secrets" | "readiness" | "budgets" | "css";
|
|
10
24
|
type CheckStep = {
|
|
11
25
|
name: CheckStepName;
|
|
12
26
|
result: CheckResultValue;
|
|
@@ -21,6 +35,8 @@ type CheckOptions = {
|
|
|
21
35
|
cwd: string;
|
|
22
36
|
all?: boolean;
|
|
23
37
|
packageManager: PackageManager;
|
|
38
|
+
audit?: AuditMode;
|
|
39
|
+
history?: boolean;
|
|
24
40
|
signal?: AbortSignal;
|
|
25
41
|
};
|
|
26
42
|
type StepOptions = Omit<CheckOptions, "all">;
|
|
@@ -31,6 +47,26 @@ type AllowlistSource = {
|
|
|
31
47
|
declare const BUILTIN_ALLOWLIST_SOURCE: AllowlistSource;
|
|
32
48
|
declare function checkAllowlist({ cwd, signal }: StepOptions, source?: AllowlistSource): Promise<CheckStep>;
|
|
33
49
|
|
|
50
|
+
type CommandResult = {
|
|
51
|
+
code: number;
|
|
52
|
+
stdout: string;
|
|
53
|
+
stderr: string;
|
|
54
|
+
};
|
|
55
|
+
declare function command(executable: string, args: string[], cwd: string, signal?: AbortSignal): Promise<CommandResult>;
|
|
56
|
+
|
|
57
|
+
type AuditIgnore = {
|
|
58
|
+
id: string;
|
|
59
|
+
reason: string;
|
|
60
|
+
until: string;
|
|
61
|
+
};
|
|
62
|
+
type AuditDependencies = {
|
|
63
|
+
run?: typeof command;
|
|
64
|
+
timeoutMs?: number;
|
|
65
|
+
};
|
|
66
|
+
declare function checkAudit(options: StepOptions, dependencies?: AuditDependencies): Promise<CheckStep>;
|
|
67
|
+
declare function evaluateAudit(advisories: AuditAdvisory[], mode: "report" | "enforce", ignores?: AuditIgnore[], file?: string): CheckStep;
|
|
68
|
+
declare function parseAuditOutput(manager: PackageManager, source: string): AuditAdvisory[];
|
|
69
|
+
|
|
34
70
|
declare function checkBudgets({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
35
71
|
|
|
36
72
|
declare function checkBuild({ cwd, packageManager, signal, }: StepOptions): Promise<CheckStep>;
|
|
@@ -76,11 +112,13 @@ declare const SECRET_FILE_SIZE_CAP: number;
|
|
|
76
112
|
type SecretFinding = CheckProblem & {
|
|
77
113
|
severity: "error" | "warning";
|
|
78
114
|
};
|
|
79
|
-
declare function scanSecrets(dir: string
|
|
80
|
-
|
|
115
|
+
declare function scanSecrets(dir: string, options?: {
|
|
116
|
+
history?: boolean;
|
|
117
|
+
}): Promise<SecretFinding[]>;
|
|
118
|
+
declare function checkSecrets({ cwd, history, signal, }: StepOptions): Promise<CheckStep>;
|
|
81
119
|
|
|
82
120
|
declare function checkTests({ cwd, packageManager, signal, }: StepOptions): Promise<CheckStep>;
|
|
83
121
|
|
|
84
122
|
declare function checkTypes(options: StepOptions): Promise<CheckStep>;
|
|
85
123
|
|
|
86
|
-
export { type AllowlistSource, BUILTIN_ALLOWLIST_SOURCE, CSS_ERRORS, type CheckOptions, type CheckProblem, type CheckResult, type CheckResultValue, type CheckStep, type CheckStepName, type CssCode, type CssInputs, type PackageManager, SECRET_FILE_SIZE_CAP, type SecretFinding, type StepOptions, type TextFile, analyseCss, checkAllowlist, checkBudgets, checkBuild, checkConfig, checkCss, checkLint, checkReadiness, checkSecrets, checkTests, checkTypes, loadConfig, runCheck, scanSecrets, supportsTypeScriptImport };
|
|
124
|
+
export { type AllowlistSource, type AuditAdvisory, type AuditIgnore, type AuditMode, BUILTIN_ALLOWLIST_SOURCE, CSS_ERRORS, type CheckOptions, type CheckProblem, type CheckResult, type CheckResultValue, type CheckStep, type CheckStepName, type CssCode, type CssInputs, type PackageManager, SECRET_FILE_SIZE_CAP, type SecretFinding, type StepOptions, type TextFile, analyseCss, checkAllowlist, checkAudit, checkBudgets, checkBuild, checkConfig, checkCss, checkLint, checkReadiness, checkSecrets, checkTests, checkTypes, evaluateAudit, loadConfig, parseAuditOutput, runCheck, scanSecrets, supportsTypeScriptImport };
|