@hyperframes/lint 0.7.86 → 0.7.87
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.js +7 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4883,8 +4883,8 @@ import { checkSubCompositionUsability } from "@hyperframes/parsers/sub-compositi
|
|
|
4883
4883
|
import { parseHTML } from "linkedom";
|
|
4884
4884
|
import {
|
|
4885
4885
|
cleanAssetUrl as cleanAssetUrl2,
|
|
4886
|
-
hasUnresolvedTemplatingToken as hasUnresolvedTemplatingToken2,
|
|
4887
4886
|
isRemoteOrInlineUrl as isRemoteOrInlineUrl2,
|
|
4887
|
+
isUnresolvedAssetPlaceholder as isUnresolvedAssetPlaceholder2,
|
|
4888
4888
|
isWithinProjectRoot,
|
|
4889
4889
|
maskNonScannableRanges as maskNonScannableRanges2,
|
|
4890
4890
|
resolveExistingLocalAsset as resolveExistingLocalAsset2,
|
|
@@ -4897,8 +4897,8 @@ import { rewriteAssetPath } from "@hyperframes/parsers/asset-paths";
|
|
|
4897
4897
|
import { findFfBinary } from "@hyperframes/parsers/ff-binaries";
|
|
4898
4898
|
import {
|
|
4899
4899
|
cleanAssetUrl,
|
|
4900
|
-
hasUnresolvedTemplatingToken,
|
|
4901
4900
|
isRemoteOrInlineUrl,
|
|
4901
|
+
isUnresolvedAssetPlaceholder,
|
|
4902
4902
|
maskNonScannableRanges,
|
|
4903
4903
|
resolveExistingLocalAsset
|
|
4904
4904
|
} from "@hyperframes/parsers/asset-resolution";
|
|
@@ -4948,11 +4948,10 @@ function collectLocalVideoCandidates(projectDir, htmlSources) {
|
|
|
4948
4948
|
let match;
|
|
4949
4949
|
while ((match = re.exec(scannable)) !== null) {
|
|
4950
4950
|
const rawSrc = match[1] ?? "";
|
|
4951
|
-
if (
|
|
4951
|
+
if (isUnresolvedAssetPlaceholder(rawSrc)) continue;
|
|
4952
4952
|
const src = cleanAssetUrl(rawSrc);
|
|
4953
4953
|
if (!src) continue;
|
|
4954
4954
|
if (isRemoteOrInlineUrl(src)) continue;
|
|
4955
|
-
if (/^__[A-Z_]+__$/.test(src)) continue;
|
|
4956
4955
|
const rootRelative = compSrcPath ? rewriteAssetPath(compSrcPath, src) : src;
|
|
4957
4956
|
const resolvedAsset = resolveExistingLocalAsset(projectDir, rootRelative);
|
|
4958
4957
|
if (!resolvedAsset) continue;
|
|
@@ -5178,8 +5177,7 @@ function lintAudioSrcNotFound(projectDir, htmlSources) {
|
|
|
5178
5177
|
while ((match = audioSrcRe.exec(html)) !== null) {
|
|
5179
5178
|
const src = match[1];
|
|
5180
5179
|
if (/^(https?:|data:|blob:)/i.test(src)) continue;
|
|
5181
|
-
if (
|
|
5182
|
-
if (hasUnresolvedTemplatingToken2(src)) continue;
|
|
5180
|
+
if (isUnresolvedAssetPlaceholder2(src)) continue;
|
|
5183
5181
|
const rootRelative = compSrcPath ? rewriteAssetPath2(compSrcPath, src) : src;
|
|
5184
5182
|
if (!resolveLocalAssetCandidates(projectDir, rootRelative).some(existsSync)) {
|
|
5185
5183
|
missingSrcs.push(src);
|
|
@@ -5208,11 +5206,10 @@ function lintMissingLocalAsset(projectDir, htmlSources) {
|
|
|
5208
5206
|
while ((match = re.exec(scannable)) !== null) {
|
|
5209
5207
|
const tagName = (match[1] ?? "").toLowerCase();
|
|
5210
5208
|
const rawSrc = match[2] ?? "";
|
|
5211
|
-
if (
|
|
5209
|
+
if (isUnresolvedAssetPlaceholder2(rawSrc)) continue;
|
|
5212
5210
|
const src = cleanAssetUrl2(rawSrc);
|
|
5213
5211
|
if (!src) continue;
|
|
5214
5212
|
if (isRemoteOrInlineUrl2(src)) continue;
|
|
5215
|
-
if (/^__[A-Z_]+__$/.test(src)) continue;
|
|
5216
5213
|
const rootRelative = compSrcPath ? rewriteAssetPath2(compSrcPath, src) : src;
|
|
5217
5214
|
const resolvedAsset = resolveExistingLocalAsset2(projectDir, rootRelative);
|
|
5218
5215
|
if (resolvedAsset) continue;
|
|
@@ -5244,10 +5241,9 @@ function lintTextureMaskAssetNotFound(projectDir, htmlSources) {
|
|
|
5244
5241
|
const pattern = new RegExp(MASK_IMAGE_URL_RE.source, MASK_IMAGE_URL_RE.flags);
|
|
5245
5242
|
while ((match = pattern.exec(cssSource.content)) !== null) {
|
|
5246
5243
|
const rawUrl = match[1] ?? match[2] ?? match[3] ?? "";
|
|
5247
|
-
if (
|
|
5244
|
+
if (isUnresolvedAssetPlaceholder2(rawUrl)) continue;
|
|
5248
5245
|
const url = cleanAssetUrl2(rawUrl);
|
|
5249
5246
|
if (!url || isRemoteOrInlineUrl2(url)) continue;
|
|
5250
|
-
if (/^__[A-Z_]+__$/.test(url)) continue;
|
|
5251
5247
|
const candidates = resolveCssAssetCandidates(
|
|
5252
5248
|
projectDir,
|
|
5253
5249
|
url,
|
|
@@ -5351,8 +5347,7 @@ function lintMissingOrEmptySubComposition(projectDir, rootHtml) {
|
|
|
5351
5347
|
while ((match = compositionSrcRe.exec(scannable)) !== null) {
|
|
5352
5348
|
const srcPath = (match[1] ?? "").trim();
|
|
5353
5349
|
if (!srcPath) continue;
|
|
5354
|
-
if (
|
|
5355
|
-
if (hasUnresolvedTemplatingToken2(srcPath)) continue;
|
|
5350
|
+
if (isUnresolvedAssetPlaceholder2(srcPath)) continue;
|
|
5356
5351
|
const filePath = resolve(projectDir, srcPath);
|
|
5357
5352
|
if (visited.has(filePath)) continue;
|
|
5358
5353
|
visited.add(filePath);
|