hyperframes 0.4.24 → 0.4.25
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/cli.js +9 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -54,7 +54,7 @@ var VERSION;
|
|
|
54
54
|
var init_version = __esm({
|
|
55
55
|
"src/version.ts"() {
|
|
56
56
|
"use strict";
|
|
57
|
-
VERSION = true ? "0.4.
|
|
57
|
+
VERSION = true ? "0.4.25" : "0.0.0-dev";
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -10790,14 +10790,14 @@ function lintProject(project) {
|
|
|
10790
10790
|
totalErrors += rootResult.errorCount;
|
|
10791
10791
|
totalWarnings += rootResult.warningCount;
|
|
10792
10792
|
totalInfos += rootResult.infoCount;
|
|
10793
|
-
const allHtmlSources = [rootHtml];
|
|
10793
|
+
const allHtmlSources = [{ html: rootHtml }];
|
|
10794
10794
|
const compositionsDir = resolve5(project.dir, "compositions");
|
|
10795
10795
|
if (existsSync7(compositionsDir)) {
|
|
10796
10796
|
const files = readdirSync2(compositionsDir).filter((f3) => f3.endsWith(".html"));
|
|
10797
10797
|
for (const file of files) {
|
|
10798
10798
|
const filePath = join9(compositionsDir, file);
|
|
10799
10799
|
const html = readFileSync7(filePath, "utf-8");
|
|
10800
|
-
allHtmlSources.push(html);
|
|
10800
|
+
allHtmlSources.push({ html, compSrcPath: `compositions/${file}` });
|
|
10801
10801
|
const result = lintHyperframeHtml(html, { filePath, isSubComposition: true });
|
|
10802
10802
|
results.push({ file: `compositions/${file}`, result });
|
|
10803
10803
|
totalErrors += result.errorCount;
|
|
@@ -10840,7 +10840,7 @@ function lintProjectAudioFiles(projectDir, htmlSources) {
|
|
|
10840
10840
|
return findings;
|
|
10841
10841
|
}
|
|
10842
10842
|
if (audioFiles.length === 0) return findings;
|
|
10843
|
-
const hasAudioElement = htmlSources.some((html) => /<audio\b/i.test(html));
|
|
10843
|
+
const hasAudioElement = htmlSources.some(({ html }) => /<audio\b/i.test(html));
|
|
10844
10844
|
if (!hasAudioElement) {
|
|
10845
10845
|
findings.push({
|
|
10846
10846
|
code: "audio_file_without_element",
|
|
@@ -10855,13 +10855,14 @@ function lintAudioSrcNotFound(projectDir, htmlSources) {
|
|
|
10855
10855
|
const findings = [];
|
|
10856
10856
|
const audioSrcRe = /<audio\b[^>]*\bsrc\s*=\s*["']([^"']+)["'][^>]*>/gi;
|
|
10857
10857
|
const missingSrcs = [];
|
|
10858
|
-
for (const html of htmlSources) {
|
|
10858
|
+
for (const { html, compSrcPath } of htmlSources) {
|
|
10859
10859
|
let match;
|
|
10860
10860
|
while ((match = audioSrcRe.exec(html)) !== null) {
|
|
10861
10861
|
const src = match[1];
|
|
10862
10862
|
if (/^(https?:|data:|blob:)/i.test(src)) continue;
|
|
10863
10863
|
if (/^__[A-Z_]+__$/.test(src)) continue;
|
|
10864
|
-
const
|
|
10864
|
+
const rootRelative = compSrcPath ? rewriteAssetPath(compSrcPath, src) : src;
|
|
10865
|
+
const resolved = resolve5(projectDir, rootRelative);
|
|
10865
10866
|
if (!existsSync7(resolved)) {
|
|
10866
10867
|
missingSrcs.push(src);
|
|
10867
10868
|
}
|
|
@@ -10910,7 +10911,7 @@ function lintDuplicateAudioTracks(htmlSources) {
|
|
|
10910
10911
|
}
|
|
10911
10912
|
const tracks = [];
|
|
10912
10913
|
const seen = /* @__PURE__ */ new Set();
|
|
10913
|
-
for (const html of htmlSources) {
|
|
10914
|
+
for (const { html } of htmlSources) {
|
|
10914
10915
|
const audioTagRe = /<audio\b[^>]*>/gi;
|
|
10915
10916
|
let match;
|
|
10916
10917
|
while ((match = audioTagRe.exec(html)) !== null) {
|
|
@@ -10954,6 +10955,7 @@ var init_lintProject = __esm({
|
|
|
10954
10955
|
"src/utils/lintProject.ts"() {
|
|
10955
10956
|
"use strict";
|
|
10956
10957
|
init_lint();
|
|
10958
|
+
init_src();
|
|
10957
10959
|
AUDIO_EXTENSIONS2 = /* @__PURE__ */ new Set([".mp3", ".wav", ".aac", ".ogg", ".m4a", ".flac", ".opus"]);
|
|
10958
10960
|
}
|
|
10959
10961
|
});
|