@usequeek/theme-check 0.3.0 → 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 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';
@@ -57,7 +57,7 @@ export declare function vendorFactFallbacks(source: string): Array<{
57
57
  }>;
58
58
  export declare const vendorFactsRule: Rule;
59
59
  export declare const fontsSelfHostedRule: Rule;
60
- /** The starter's own demo photos, rehosted under themes/_bare — never a real theme's. */
60
+ /** The starter's labelled placeholder images ("Your banner photo", "Category photo", "Product photo") under theme-assets/_bare. */
61
61
  export declare const STARTER_PLACEHOLDER_IMAGES: readonly string[];
62
62
  export declare const placeholderContentRule: Rule;
63
63
  export declare const STATIC_RULES: Rule[];
@@ -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 is rejected (it fails builds), a Google Fonts @import is flagged',
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', 'warn', {
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
  }
@@ -1189,14 +1189,18 @@ export const fontsSelfHostedRule = {
1189
1189
  return findings;
1190
1190
  },
1191
1191
  };
1192
- /** The starter's own demo photos, rehosted under themes/_bare — never a real theme's. */
1192
+ /** The starter's labelled placeholder images ("Your banner photo", "Category photo", "Product photo") under theme-assets/_bare. */
1193
1193
  export const STARTER_PLACEHOLDER_IMAGES = [
1194
- 'https://media.usequeek.com/theme-assets/_bare/0e21e31030533d79.jpg',
1195
- 'https://media.usequeek.com/theme-assets/_bare/201b6247be904af4.jpg',
1196
- 'https://media.usequeek.com/theme-assets/_bare/377756cea202d263.jpg',
1197
- 'https://media.usequeek.com/theme-assets/_bare/57e4183c303aab31.jpg',
1198
- 'https://media.usequeek.com/theme-assets/_bare/67913acc7ef19523.jpg',
1199
- 'https://media.usequeek.com/theme-assets/_bare/cd48af92c911f8b6.jpg',
1194
+ 'https://media.usequeek.com/theme-assets/_bare/0c8749c67b449815.jpg',
1195
+ 'https://media.usequeek.com/theme-assets/_bare/23d5f6928502dcca.jpg',
1196
+ 'https://media.usequeek.com/theme-assets/_bare/430bb331b314f613.jpg',
1197
+ 'https://media.usequeek.com/theme-assets/_bare/43b1e392b8039306.jpg',
1198
+ 'https://media.usequeek.com/theme-assets/_bare/5a75479e668914bb.jpg',
1199
+ 'https://media.usequeek.com/theme-assets/_bare/8847c6c8472cc629.jpg',
1200
+ 'https://media.usequeek.com/theme-assets/_bare/ce7b1219776e7a98.jpg',
1201
+ 'https://media.usequeek.com/theme-assets/_bare/dcdae58f874939a9.jpg',
1202
+ 'https://media.usequeek.com/theme-assets/_bare/e37b930c35976c89.jpg',
1203
+ 'https://media.usequeek.com/theme-assets/_bare/e8543451de24e310.jpg',
1200
1204
  ];
1201
1205
  export const placeholderContentRule = {
1202
1206
  id: 'theme/placeholder-content',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usequeek/theme-check",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "The rules a Queek storefront theme is checked against, as a library.",
5
5
  "license": "MIT",
6
6
  "type": "module",