@zappie/check 0.2.6 → 0.4.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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @zappie/check
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 628ac42: The `build` step fails when `build/client` or `build/server` has Studio's dev-only `data-zappie-source` or `data-zappie-component` attributes (`build/no-dev-source-attributes`). `magic-string` joins `GLOBAL_DEV_PACKAGE_ALLOWLIST` for the starter's `zappieSource()` plugin.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [628ac42]
12
+ - @zappie/sdk@0.1.19
13
+
14
+ ## 0.3.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 5c0569f: The `allowlist` step checks devDependencies against `packages.allow` and the allowlists, including the new `GLOBAL_DEV_PACKAGE_ALLOWLIST`. It fails any installed or locked package with an install script, except those in `INSTALL_SCRIPT_ALLOWLIST`: esbuild, workerd and fsevents. Packages are named by their folder, and one whose manifest claims another name fails. Alias, git, file, link and tarball sources in package.json fail. Linked packages are checked once, and the walk stops at a link out of the project. When nothing is installed, the step says install scripts weren't checked.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [88f52b6]
23
+ - Updated dependencies [a151b0b]
24
+ - Updated dependencies [a151b0b]
25
+ - Updated dependencies [195a5b8]
26
+ - eslint-plugin-zappie@0.3.2
27
+ - @zappie/sdk@0.1.17
28
+
3
29
  ## 0.2.6
4
30
 
5
31
  ### Patch Changes
package/README.md CHANGED
@@ -14,7 +14,7 @@ npx zappie check
14
14
  | Step | What it looks at |
15
15
  | ----------- | ------------------------------------------------------------------------------------------- |
16
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 |
17
+ | `allowlist` | Dependencies, devDependencies and lockfile install scripts, against Zappie's allowlists |
18
18
  | `audit` | High and critical dependency advisories, with critical findings enforced on request |
19
19
  | `lint` | The `eslint-plugin-zappie` rules and the `jsx-a11y` accessibility baseline |
20
20
  | `types` | A TypeScript check of the project |
package/dist/index.d.ts CHANGED
@@ -43,7 +43,12 @@ type StepOptions = Omit<CheckOptions, "all">;
43
43
 
44
44
  type AllowlistSource = {
45
45
  load(signal?: AbortSignal): Promise<readonly string[]>;
46
+ loadDev?(signal?: AbortSignal): Promise<readonly string[]>;
46
47
  };
48
+ /** Build and test tools allowed in devDependencies without a packages.allow entry. */
49
+ declare const GLOBAL_DEV_PACKAGE_ALLOWLIST: readonly ["typescript", "vite", "@react-router/dev", "magic-string", "@cloudflare/*", "wrangler", "eslint", "eslint-plugin-zappie", "vitest", "@playwright/test", "@types/*", "@zappie/*", "zappie", "postcss", "jsdom", "@testing-library/*"];
50
+ /** The only packages allowed to run install scripts. npm flags fsevents on every platform. */
51
+ declare const INSTALL_SCRIPT_ALLOWLIST: readonly ["esbuild", "workerd", "fsevents"];
47
52
  declare const BUILTIN_ALLOWLIST_SOURCE: AllowlistSource;
48
53
  declare function checkAllowlist({ cwd, signal }: StepOptions, source?: AllowlistSource): Promise<CheckStep>;
49
54
 
@@ -102,6 +107,12 @@ type CssCode = "css/important" | "css/duplicate-keyframes" | "css/duplicate-sele
102
107
  declare const CSS_ERRORS: ReadonlySet<CssCode>;
103
108
  declare function analyseCss(inputs: CssInputs): CheckProblem[];
104
109
 
110
+ /**
111
+ * Find Studio's dev-only source attributes in the build output. They name the files and lines of the site's code, so
112
+ * a published page must never carry them. Source maps are skipped: they quote library source, not rendered markup.
113
+ */
114
+ declare function devSourceProblems(cwd: string): Promise<CheckProblem[]>;
115
+
105
116
  declare function checkLint({ cwd, signal, }: StepOptions): Promise<CheckStep>;
106
117
 
107
118
  declare function checkReadiness({ cwd, signal, }: StepOptions): Promise<CheckStep>;
@@ -121,4 +132,4 @@ declare function checkTests({ cwd, packageManager, signal, }: StepOptions): Prom
121
132
 
122
133
  declare function checkTypes(options: StepOptions): Promise<CheckStep>;
123
134
 
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 };
135
+ 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, GLOBAL_DEV_PACKAGE_ALLOWLIST, INSTALL_SCRIPT_ALLOWLIST, type PackageManager, SECRET_FILE_SIZE_CAP, type SecretFinding, type StepOptions, type TextFile, analyseCss, checkAllowlist, checkAudit, checkBudgets, checkBuild, checkConfig, checkCss, checkLint, checkReadiness, checkSecrets, checkTests, checkTypes, devSourceProblems, evaluateAudit, loadConfig, parseAuditOutput, runCheck, scanSecrets, supportsTypeScriptImport };