@hyperframes/lint 0.7.15 → 0.7.17

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
@@ -46,6 +46,12 @@ declare function lintMediaUrls(html: string, options?: {
46
46
  timeoutMs?: number;
47
47
  }): Promise<HyperframeLintFinding[]>;
48
48
 
49
+ /**
50
+ * Pure render-gate decision — no Node.js dependencies, so it is safe to import
51
+ * from the browser entry alongside the rule engine.
52
+ */
53
+ declare function shouldBlockRender(strictErrors: boolean, strictAll: boolean, totalErrors: number, totalWarnings: number): boolean;
54
+
49
55
  interface ProjectLintResult {
50
56
  results: Array<{
51
57
  file: string;
@@ -56,6 +62,5 @@ interface ProjectLintResult {
56
62
  totalInfos: number;
57
63
  }
58
64
  declare function lintProject(projectDir: string): Promise<ProjectLintResult>;
59
- declare function shouldBlockRender(strictErrors: boolean, strictAll: boolean, totalErrors: number, totalWarnings: number): boolean;
60
65
 
61
66
  export { type HyperframeLintFinding, type HyperframeLintResult, type HyperframeLintSeverity, type HyperframeLinterOptions, type ProjectLintResult, lintHyperframeHtml, lintMediaUrls, lintProject, shouldBlockRender };
package/dist/index.js CHANGED
@@ -2114,7 +2114,7 @@ var captionRules = [
2114
2114
  ];
2115
2115
 
2116
2116
  // src/rules/composition.ts
2117
- import { COMPOSITION_VARIABLE_TYPES } from "@hyperframes/parsers";
2117
+ import { COMPOSITION_VARIABLE_TYPES } from "@hyperframes/parsers/composition";
2118
2118
  var MAX_COMPOSITION_LINES = 300;
2119
2119
  var MAX_TIMED_ELEMENTS_PER_TRACK = 3;
2120
2120
  var TRACK_DENSITY_EXEMPT_TAGS = /* @__PURE__ */ new Set(["audio", "script", "style", "video"]);
@@ -2916,7 +2916,7 @@ var textureRules = [
2916
2916
  ];
2917
2917
 
2918
2918
  // src/rules/fonts.ts
2919
- import { FONT_ALIAS_KEYS, resolveAliasDisplayName } from "@hyperframes/core/fonts/aliases";
2919
+ import { FONT_ALIAS_KEYS, resolveAliasDisplayName } from "@hyperframes/parsers/composition";
2920
2920
  var GENERIC_FAMILIES = /* @__PURE__ */ new Set([
2921
2921
  "serif",
2922
2922
  "sans-serif",
@@ -3091,7 +3091,7 @@ import {
3091
3091
  parseSlideshowManifest,
3092
3092
  resolveSlideshow,
3093
3093
  isSceneLikeCompositionId
3094
- } from "@hyperframes/core/slideshow";
3094
+ } from "@hyperframes/parsers/slideshow";
3095
3095
  function parseTiming(raw) {
3096
3096
  const startStr = readAttr(raw, "data-start");
3097
3097
  if (startStr === null) return null;
@@ -3264,10 +3264,16 @@ async function lintMediaUrls(html, options = {}) {
3264
3264
  return findings;
3265
3265
  }
3266
3266
 
3267
+ // src/shouldBlockRender.ts
3268
+ function shouldBlockRender(strictErrors, strictAll, totalErrors, totalWarnings) {
3269
+ return strictErrors && totalErrors > 0 || strictAll && (totalErrors > 0 || totalWarnings > 0);
3270
+ }
3271
+
3267
3272
  // src/project.ts
3268
3273
  import { existsSync, readFileSync, readdirSync } from "fs";
3269
3274
  import { dirname, extname, isAbsolute, join, posix, relative, resolve } from "path";
3270
- import { decodeUrlPathVariants, rewriteAssetPath } from "@hyperframes/core";
3275
+ import { decodeUrlPathVariants } from "@hyperframes/parsers/composition";
3276
+ import { rewriteAssetPath } from "@hyperframes/parsers/asset-paths";
3271
3277
  var AUDIO_EXTENSIONS = /* @__PURE__ */ new Set([".mp3", ".wav", ".aac", ".ogg", ".m4a", ".flac", ".opus"]);
3272
3278
  var STYLE_BLOCK_RE = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
3273
3279
  var OPEN_TAG_RE = /<([a-z][\w:-]*)(\s[^<>]*?)?>/gi;
@@ -3449,9 +3455,6 @@ async function lintProject(projectDir) {
3449
3455
  }
3450
3456
  return { results, totalErrors, totalWarnings, totalInfos };
3451
3457
  }
3452
- function shouldBlockRender(strictErrors, strictAll, totalErrors, totalWarnings) {
3453
- return strictErrors && totalErrors > 0 || strictAll && (totalErrors > 0 || totalWarnings > 0);
3454
- }
3455
3458
  function lintProjectAudioFiles(projectDir, htmlSources) {
3456
3459
  const findings = [];
3457
3460
  let audioFiles;