Merge pull request #2586 from heygen-com/carve/s1-asset-resolution

refactor(parsers): share local-asset resolution across lint and studio-server
This commit is contained in:
Miguel Ángel
2026-07-16 20:07:47 -04:00
committed by GitHub
5 changed files with 18 additions and 8 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import {
isRemoteOrInlineUrl,
maskNonScannableRanges,
resolveExistingLocalAsset,
} from "./assetResolution.js";
} from "@hyperframes/parsers/asset-resolution";
import type { HyperframeLintFinding } from "./types.js";
/** Structurally compatible with `project.ts`'s (unexported) `HtmlSource` —
+1 -1
View File
@@ -11,7 +11,7 @@ import {
maskNonScannableRanges,
resolveExistingLocalAsset,
resolveLocalAssetCandidates,
} from "./assetResolution.js";
} from "@hyperframes/parsers/asset-resolution";
import { collectLocalVideoCandidates, lintHevcPreviewCodec } from "./hevcPreviewLint.js";
import { lintHyperframeHtml } from "./hyperframeLinter.js";
import type { HyperframeLintFinding, HyperframeLintResult } from "./types.js";
+10
View File
@@ -99,6 +99,12 @@
"node": "./dist/ffBinaries.js",
"import": "./src/ffBinaries.ts",
"types": "./src/ffBinaries.ts"
},
"./asset-resolution": {
"bun": "./src/assetResolution.ts",
"node": "./dist/assetResolution.js",
"import": "./src/assetResolution.ts",
"types": "./src/assetResolution.ts"
}
},
"publishConfig": {
@@ -160,6 +166,10 @@
"./ff-binaries": {
"import": "./dist/ffBinaries.js",
"types": "./dist/ffBinaries.d.ts"
},
"./asset-resolution": {
"import": "./dist/assetResolution.js",
"types": "./dist/assetResolution.d.ts"
}
},
"main": "./dist/index.js",
@@ -1,13 +1,12 @@
import { existsSync } from "node:fs";
import { isAbsolute, posix, relative, resolve } from "node:path";
import { decodeUrlPathVariants } from "@hyperframes/parsers/composition";
import { decodeUrlPathVariants } from "./composition.js";
/**
* Shared local-asset resolution helpers used by both the project-level lint
* rules (`project.ts`) and the HEVC preview-codec check
* (`hevcPreviewLint.ts`). Split out so the latter doesn't need to import from
* `project.ts` (which imports it back to run the rule) that would be a
* circular import within the package.
* Shared local-asset resolution helpers for every package that maps
* composition asset URLs to files on disk (lint project rules, the HEVC
* preview check, studio-server's media codec scan). Import via the
* `@hyperframes/parsers/asset-resolution` subpath.
*/
export function isRemoteOrInlineUrl(url: string): boolean {
+1
View File
@@ -16,6 +16,7 @@ export default defineConfig({
compositionContract: "src/compositionContract.ts",
subCompositionValidity: "src/subCompositionValidity.ts",
ffBinaries: "src/ffBinaries.ts",
assetResolution: "src/assetResolution.ts",
},
format: ["esm"],
outDir: "dist",