@zappie/check 0.0.0-stage → 0.1.1
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 +13 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/index.d.ts +62 -0
- package/dist/index.js +1950 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -3
- package/schema/check-result.v1.json +52 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @zappie/check
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eeccfed: First release on npm. `zappie check` and `zappie verify` now work in any project that installs these as dev dependencies. `@zappie/verify` takes `@playwright/test` as a peer dependency.
|
|
8
|
+
- Updated dependencies [38f23ac]
|
|
9
|
+
- Updated dependencies [1e6f420]
|
|
10
|
+
- Updated dependencies [eeccfed]
|
|
11
|
+
- @zappie/sdk@0.1.1
|
|
12
|
+
- @zappie/tokens@0.1.1
|
|
13
|
+
- eslint-plugin-zappie@0.1.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zappie
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @zappie/check
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The checks behind `zappie check`. They look over a Zappie storefront project before you ship it, and report each problem with how to fix it.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install --save-dev @zappie/check
|
|
7
|
+
npx zappie check
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## What it checks
|
|
11
|
+
|
|
12
|
+
`zappie check` runs these steps in order and stops at the first that fails. Pass `--all` to run every step anyway.
|
|
13
|
+
|
|
14
|
+
| Step | What it looks at |
|
|
15
|
+
| ----------- | ------------------------------------------------------------------------------------------- |
|
|
16
|
+
| `config` | `zappie.config.ts` and `theme.json`, against the SDK and token rules |
|
|
17
|
+
| `allowlist` | Every npm dependency is on Zappie's package allowlist or in `packages.allow` in your config |
|
|
18
|
+
| `lint` | The `eslint-plugin-zappie` rules |
|
|
19
|
+
| `types` | A TypeScript check of the project |
|
|
20
|
+
| `test` | Your project's tests |
|
|
21
|
+
| `build` | A production build |
|
|
22
|
+
| `secrets` | No secret keys or tokens in your source or build |
|
|
23
|
+
| `budgets` | Built JavaScript and CSS sizes, against Zappie's default budgets or the ones in your config |
|
|
24
|
+
|
|
25
|
+
Add `--json` for a machine-readable result. Its shape is the JSON Schema at `@zappie/check/schema/check-result.v1.json`.
|
|
26
|
+
|
|
27
|
+
## From code
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { runCheck } from "@zappie/check";
|
|
31
|
+
|
|
32
|
+
const result = await runCheck({
|
|
33
|
+
cwd: process.cwd(),
|
|
34
|
+
packageManager: "npm",
|
|
35
|
+
all: true,
|
|
36
|
+
});
|
|
37
|
+
console.log(result.result); // "passed" or "failed"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Docs
|
|
41
|
+
|
|
42
|
+
- [CLI: zappie check](https://docs.zappie.ai/cli/check)
|
|
43
|
+
- [Lint rules](https://docs.zappie.ai/lint)
|
|
44
|
+
|
|
45
|
+
## Status
|
|
46
|
+
|
|
47
|
+
`@zappie/check` is at `0.x`. Its steps and result can change in a minor release while it settles. Each change is listed in `CHANGELOG.md`.
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
type CheckResultValue = "passed" | "failed" | "skipped";
|
|
2
|
+
type CheckProblem = {
|
|
3
|
+
rule?: string;
|
|
4
|
+
file?: string;
|
|
5
|
+
line?: number;
|
|
6
|
+
message: string;
|
|
7
|
+
fix: string | null;
|
|
8
|
+
};
|
|
9
|
+
type CheckStepName = "config" | "allowlist" | "lint" | "types" | "test" | "build" | "secrets" | "budgets";
|
|
10
|
+
type CheckStep = {
|
|
11
|
+
name: CheckStepName;
|
|
12
|
+
result: CheckResultValue;
|
|
13
|
+
problems: CheckProblem[];
|
|
14
|
+
};
|
|
15
|
+
type CheckResult = {
|
|
16
|
+
result: Exclude<CheckResultValue, "skipped">;
|
|
17
|
+
steps: CheckStep[];
|
|
18
|
+
};
|
|
19
|
+
type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
|
|
20
|
+
type CheckOptions = {
|
|
21
|
+
cwd: string;
|
|
22
|
+
all?: boolean;
|
|
23
|
+
packageManager: PackageManager;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
};
|
|
26
|
+
type StepOptions = Omit<CheckOptions, "all">;
|
|
27
|
+
|
|
28
|
+
type AllowlistSource = {
|
|
29
|
+
load(signal?: AbortSignal): Promise<readonly string[]>;
|
|
30
|
+
};
|
|
31
|
+
declare const BUILTIN_ALLOWLIST_SOURCE: AllowlistSource;
|
|
32
|
+
declare function checkAllowlist({ cwd, signal }: StepOptions, source?: AllowlistSource): Promise<CheckStep>;
|
|
33
|
+
|
|
34
|
+
declare function checkBudgets({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
35
|
+
|
|
36
|
+
declare function checkBuild({ cwd, packageManager, signal, }: StepOptions): Promise<CheckStep>;
|
|
37
|
+
|
|
38
|
+
type LoadedConfig = {
|
|
39
|
+
value: unknown;
|
|
40
|
+
source: string;
|
|
41
|
+
file: string;
|
|
42
|
+
};
|
|
43
|
+
declare function supportsTypeScriptImport(version?: string): boolean;
|
|
44
|
+
declare function loadConfig(cwd: string): Promise<LoadedConfig>;
|
|
45
|
+
declare function checkConfig({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
46
|
+
|
|
47
|
+
declare function checkLint({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
48
|
+
|
|
49
|
+
declare function runCheck(options: CheckOptions): Promise<CheckResult>;
|
|
50
|
+
|
|
51
|
+
declare const SECRET_FILE_SIZE_CAP: number;
|
|
52
|
+
type SecretFinding = CheckProblem & {
|
|
53
|
+
severity: "error" | "warning";
|
|
54
|
+
};
|
|
55
|
+
declare function scanSecrets(dir: string): Promise<SecretFinding[]>;
|
|
56
|
+
declare function checkSecrets({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
57
|
+
|
|
58
|
+
declare function checkTests({ cwd, packageManager, signal, }: StepOptions): Promise<CheckStep>;
|
|
59
|
+
|
|
60
|
+
declare function checkTypes(options: StepOptions): Promise<CheckStep>;
|
|
61
|
+
|
|
62
|
+
export { type AllowlistSource, BUILTIN_ALLOWLIST_SOURCE, type CheckOptions, type CheckProblem, type CheckResult, type CheckResultValue, type CheckStep, type CheckStepName, type PackageManager, SECRET_FILE_SIZE_CAP, type SecretFinding, type StepOptions, checkAllowlist, checkBudgets, checkBuild, checkConfig, checkLint, checkSecrets, checkTests, checkTypes, loadConfig, runCheck, scanSecrets, supportsTypeScriptImport };
|