@usequeek/theme-check 0.3.2 → 0.3.3
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/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/rules/static.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,3 +11,5 @@ export { BUSINESS_KEYS, SERVICE_SLUGS, CATALOGUE, SUBCATEGORIES, isBusinessKey,
|
|
|
11
11
|
export { TEMPLATE_COPY_PLACES, copyViolations, isTestimonialSection, storeNameForms } from './utils/template-copy.js';
|
|
12
12
|
export { PRIMARY_DEMO_ID, DEMO_ID_FORMAT, demoFilesOf } from './utils/theme-demos.js';
|
|
13
13
|
export { TEMPLATE_DESCRIPTION_MAX, screenshotFile, sectionStyle, sectionCopy, declaredFieldsByVariant } from './utils/theme-templates.js';
|
|
14
|
+
export { STATIC_RULES, moduleContractRule, structureRule, demoStoreRule, demoStoresRule, demoArtRule, codeQualityRule, sdkBoundaryRule, selectionMetadataRule, demoCompletenessRule, subscribeScopeRule, demoBlockTypesRule, identityRule, productMetafieldsRule, poweredByRule, fontsSelfHostedRule, templateDescriptionRule, templateScreenshotRule, templateChromeRule, templateStyleRule, templateBusinessRule, templateVersionsRule, templatePagesRule, templateCopyRule, vendorFactsRule, placeholderContentRule, frameworkImport, STARTER_PLACEHOLDER_IMAGES, } from './rules/static.js';
|
|
15
|
+
export { ANALYSIS_RULES, variantParityRule, fieldParityRule, designTokensRule } from './rules/analysis.js';
|
package/dist/index.js
CHANGED
|
@@ -10,3 +10,8 @@ export { BUSINESS_KEYS, SERVICE_SLUGS, CATALOGUE, SUBCATEGORIES, isBusinessKey,
|
|
|
10
10
|
export { TEMPLATE_COPY_PLACES, copyViolations, isTestimonialSection, storeNameForms } from './utils/template-copy.js';
|
|
11
11
|
export { PRIMARY_DEMO_ID, DEMO_ID_FORMAT, demoFilesOf } from './utils/theme-demos.js';
|
|
12
12
|
export { TEMPLATE_DESCRIPTION_MAX, screenshotFile, sectionStyle, sectionCopy, declaredFieldsByVariant } from './utils/theme-templates.js';
|
|
13
|
+
// Per-kind rule arrays and the individual rule constants, for rule-level unit
|
|
14
|
+
// tests that want to run one rule against a hand-built ThemeContext instead
|
|
15
|
+
// of a whole theme directory through checkTheme().
|
|
16
|
+
export { STATIC_RULES, moduleContractRule, structureRule, demoStoreRule, demoStoresRule, demoArtRule, codeQualityRule, sdkBoundaryRule, selectionMetadataRule, demoCompletenessRule, subscribeScopeRule, demoBlockTypesRule, identityRule, productMetafieldsRule, poweredByRule, fontsSelfHostedRule, templateDescriptionRule, templateScreenshotRule, templateChromeRule, templateStyleRule, templateBusinessRule, templateVersionsRule, templatePagesRule, templateCopyRule, vendorFactsRule, placeholderContentRule, frameworkImport, STARTER_PLACEHOLDER_IMAGES, } from './rules/static.js';
|
|
17
|
+
export { ANALYSIS_RULES, variantParityRule, fieldParityRule, designTokensRule } from './rules/analysis.js';
|
package/dist/rules/static.js
CHANGED
|
@@ -1159,7 +1159,7 @@ function themeCssFiles(dir) {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
export const fontsSelfHostedRule = {
|
|
1161
1161
|
id: 'theme/fonts-self-hosted',
|
|
1162
|
-
summary: 'Theme fonts ship as files in the theme: next/font/google
|
|
1162
|
+
summary: 'Theme fonts ship as files in the theme: next/font/google (fails builds) and a Google Fonts @import (dropped or render-blocking) are rejected',
|
|
1163
1163
|
kind: 'static',
|
|
1164
1164
|
run(context) {
|
|
1165
1165
|
const findings = [];
|
|
@@ -1178,10 +1178,10 @@ export const fontsSelfHostedRule = {
|
|
|
1178
1178
|
for (const path of themeCssFiles(context.dir)) {
|
|
1179
1179
|
const css = readFileSync(path, 'utf8').replace(/\/\*[\s\S]*?\*\//g, '');
|
|
1180
1180
|
if (/@import\s+(?:url\()?['"]?https?:\/\/fonts\.googleapis\.com/.test(css)) {
|
|
1181
|
-
findings.push(finding(context, 'theme/fonts-self-hosted', '
|
|
1181
|
+
findings.push(finding(context, 'theme/fonts-self-hosted', 'reject', {
|
|
1182
1182
|
where: relative(context.dir, path),
|
|
1183
1183
|
found: 'loads a font with @import from fonts.googleapis.com',
|
|
1184
|
-
fix: `Either the bundler drops it (it only survives as the very first rule of the compiled stylesheet), so the font never loads, or it survives and every page load waits on an extra render-blocking request to Google before the text can paint. ${fix}`,
|
|
1184
|
+
fix: `Either the bundler drops it (it only survives as the very first rule of the compiled stylesheet), so the font never loads — atelier, deluxr and lumiere shipped that way until 24/9/26 — or it survives and every page load waits on an extra render-blocking request to Google before the text can paint. ${fix}`,
|
|
1185
1185
|
docs: `${context.env.docs}#fonts`,
|
|
1186
1186
|
}));
|
|
1187
1187
|
}
|