@zappie/check 0.1.3 → 0.2.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/CHANGELOG.md +18 -0
- package/README.md +18 -1
- package/dist/index.d.ts +24 -2
- package/dist/index.js +841 -61
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/schema/check-result.v1.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @zappie/check
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 79deec3: Hold every template to the same accessibility, semantics, performance and CSS bar.
|
|
8
|
+
|
|
9
|
+
- `eslint-plugin-zappie`: `zappie/no-lazy-overlay` reports `React.lazy` and `Suspense` and points at `deferred()` from `@zappie/foundations`. It is an error in `recommended`.
|
|
10
|
+
- `@zappie/check`: `lint` fails when a project turns down a `jsx-a11y` rule from `recommended`. A new `css` step reports `css/important` and `css/class-patch` as errors, and `css/duplicate-keyframes`, `css/duplicate-selector`, `css/arbitrary-token`, `css/literal-token`, `css/unused-custom-property`, `css/reduced-motion` and `css/unreadable` as warnings.
|
|
11
|
+
- `@zappie/verify`: V13 fails on a missing main landmark, a page without exactly one h1, a dialog without a name, a positive tabindex, a phone control under 44×44 px and focus that doesn't return after the item or cart closes. V16 times each marked overlay from tap to first paint on a phone profile. V17 checks each marked overlay's focus, Escape and scroll lock. Both are skipped while a menu has no overlay markers. V14 records `menuCssKbGz`. `findRegressions` compares two reports' metrics.
|
|
12
|
+
- `@zappie/starter`: menu controls are at least 44×44 px on a phone.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [4f3cdc3]
|
|
17
|
+
- Updated dependencies [79deec3]
|
|
18
|
+
- @zappie/sdk@0.1.8
|
|
19
|
+
- eslint-plugin-zappie@0.2.0
|
|
20
|
+
|
|
3
21
|
## 0.1.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -15,13 +15,30 @@ 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
|
-
| `lint` | The `eslint-plugin-zappie` rules
|
|
18
|
+
| `lint` | The `eslint-plugin-zappie` rules and the `jsx-a11y` accessibility baseline |
|
|
19
19
|
| `types` | A TypeScript check of the project |
|
|
20
20
|
| `test` | Your project's tests |
|
|
21
21
|
| `build` | A production build |
|
|
22
22
|
| `secrets` | No secret keys or tokens in your source or build |
|
|
23
23
|
| `readiness` | Initial route discovery is enabled, or the config records why the site opts out |
|
|
24
24
|
| `budgets` | Built JavaScript and CSS sizes, against Zappie's default budgets or the ones in your config |
|
|
25
|
+
| `css` | Your source CSS and class names, and the built client CSS, for the problems below |
|
|
26
|
+
|
|
27
|
+
### CSS problems
|
|
28
|
+
|
|
29
|
+
| Code | Level | What it catches |
|
|
30
|
+
| ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `css/important` | Error | `!important` in source CSS or `@apply`, or an important utility such as `p-4!` or `!p-4` |
|
|
32
|
+
| `css/class-patch` | Error | A selector that matches a class attribute, such as `[class*="bg-white"]`. Dark mode goes through tokens |
|
|
33
|
+
| `css/duplicate-keyframes` | Warning | Two `@keyframes` with the same frames under different names, or one name defined twice |
|
|
34
|
+
| `css/duplicate-selector` | Warning | A selector, or a selector list, styled by more than one source rule in the same context |
|
|
35
|
+
| `css/arbitrary-token` | Warning | An arbitrary utility that restates a token from your `@theme`, such as `text-[hsl(var(--foreground))]` |
|
|
36
|
+
| `css/literal-token` | Warning | A plain CSS colour, radius or shadow that equals a token your CSS defines |
|
|
37
|
+
| `css/unused-custom-property` | Warning | A custom property your CSS defines that no CSS, source or built script reads |
|
|
38
|
+
| `css/reduced-motion` | Warning | An animation or transition with no `prefers-reduced-motion` path |
|
|
39
|
+
| `css/unreadable` | Warning | A CSS file that can't be parsed |
|
|
40
|
+
|
|
41
|
+
Warnings don't fail the step. A reviewed `!important` passes with `/* zappie-allow-important: <reason> */` on the same line. Declarations inside `@media (prefers-reduced-motion: reduce)` may use `!important`.
|
|
25
42
|
|
|
26
43
|
Add `--json` for a machine-readable result. Its shape is the JSON Schema at `@zappie/check/schema/check-result.v1.json`.
|
|
27
44
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type CheckProblem = {
|
|
|
6
6
|
message: string;
|
|
7
7
|
fix: string | null;
|
|
8
8
|
};
|
|
9
|
-
type CheckStepName = "config" | "allowlist" | "lint" | "types" | "test" | "build" | "secrets" | "readiness" | "budgets";
|
|
9
|
+
type CheckStepName = "config" | "allowlist" | "lint" | "types" | "test" | "build" | "secrets" | "readiness" | "budgets" | "css";
|
|
10
10
|
type CheckStep = {
|
|
11
11
|
name: CheckStepName;
|
|
12
12
|
result: CheckResultValue;
|
|
@@ -44,6 +44,28 @@ declare function supportsTypeScriptImport(version?: string): boolean;
|
|
|
44
44
|
declare function loadConfig(cwd: string): Promise<LoadedConfig>;
|
|
45
45
|
declare function checkConfig({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
46
46
|
|
|
47
|
+
declare function checkCss({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
48
|
+
|
|
49
|
+
type TextFile = {
|
|
50
|
+
file: string;
|
|
51
|
+
text: string;
|
|
52
|
+
};
|
|
53
|
+
type CssInputs = {
|
|
54
|
+
/** CSS the project authors. */
|
|
55
|
+
sourceCss: TextFile[];
|
|
56
|
+
/** Script and markup that can hold class strings or read custom properties. */
|
|
57
|
+
sourceCode: TextFile[];
|
|
58
|
+
/** Client CSS the build emitted, Tailwind's generated rules among it. */
|
|
59
|
+
builtCss: TextFile[];
|
|
60
|
+
/** Client JavaScript the build emitted; it can read custom properties too. */
|
|
61
|
+
builtCode: TextFile[];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type CssCode = "css/important" | "css/duplicate-keyframes" | "css/duplicate-selector" | "css/arbitrary-token" | "css/unused-custom-property" | "css/reduced-motion" | "css/class-patch" | "css/literal-token" | "css/unreadable";
|
|
65
|
+
/** These codes fail the step. The other codes warn for one release. */
|
|
66
|
+
declare const CSS_ERRORS: ReadonlySet<CssCode>;
|
|
67
|
+
declare function analyseCss(inputs: CssInputs): CheckProblem[];
|
|
68
|
+
|
|
47
69
|
declare function checkLint({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
48
70
|
|
|
49
71
|
declare function checkReadiness({ cwd, signal, }: StepOptions): Promise<CheckStep>;
|
|
@@ -61,4 +83,4 @@ declare function checkTests({ cwd, packageManager, signal, }: StepOptions): Prom
|
|
|
61
83
|
|
|
62
84
|
declare function checkTypes(options: StepOptions): Promise<CheckStep>;
|
|
63
85
|
|
|
64
|
-
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, checkReadiness, checkSecrets, checkTests, checkTypes, loadConfig, runCheck, scanSecrets, supportsTypeScriptImport };
|
|
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 };
|