@hyperframes/producer 0.9.55 → 0.9.56
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/README.md +1 -1
- package/dist/distributed.d.ts +1 -1
- package/dist/distributed.js +240 -86
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +76 -76
- package/dist/index.js +382 -96
- package/dist/public-server.js +381 -96
- package/dist/services/distributed/projectHash.d.ts +8 -2
- package/dist/services/htmlTagScans.d.ts +57 -0
- package/dist/services/render/stages/captureHdrResources.d.ts +19 -4
- package/package.json +7 -7
|
@@ -8,12 +8,18 @@
|
|
|
8
8
|
* same key — that contract has to be byte-identical across adapters, which is
|
|
9
9
|
* exactly why it lives here rather than being copy-pasted per adapter.
|
|
10
10
|
*/
|
|
11
|
+
/** Whether a site's `/`-separated project path is one no upload ships: env, Git, credentials, tool state, app records. */
|
|
12
|
+
export declare const isPrivateSitePath: (relPath: string) => boolean;
|
|
11
13
|
/**
|
|
12
14
|
* The files a site upload ships, as `/`-separated paths under `projectDir`. Symlinks are followed
|
|
13
15
|
* (root included), top-level {@link PLAN_PROJECT_DIR_SKIP_SEGMENTS} are left out as the plan stage
|
|
14
|
-
* does,
|
|
16
|
+
* does, and a dangling symlink throws. Private files (env, Git, credentials, tool and agent state,
|
|
17
|
+
* app records) are left out at every depth, by name or by where a link points; `onPrivate` hears
|
|
18
|
+
* each one left out, a folder once.
|
|
15
19
|
*/
|
|
16
|
-
export declare function listSiteFiles(projectDir: string): string[];
|
|
20
|
+
export declare function listSiteFiles(projectDir: string, onPrivate?: (relPath: string) => void): string[];
|
|
21
|
+
/** {@link listSiteFiles} for an upload: one line to `onNotice` names the private files left out. */
|
|
22
|
+
export declare function listSiteFilesForUpload(projectDir: string, onNotice?: (message: string) => void): string[];
|
|
17
23
|
/**
|
|
18
24
|
* SHA-256 over a scheme tag plus each of {@link listSiteFiles}'s paths and
|
|
19
25
|
* bytes → 16-character hex prefix. The prefix is the `siteId`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forward scans that return exactly what the compiler's and the render telemetry's tag regexes
|
|
3
|
+
* return, in time linear in the HTML. Each of those regexes rescans to the end of the page from
|
|
4
|
+
* every tag opener that never closes, or from every character of a long whitespace run in one tag.
|
|
5
|
+
*
|
|
6
|
+
* Two facts make the scans below exact. A `[^>]*` after an opener can only reach the first `>`
|
|
7
|
+
* after it, so every opener inside that span sees the same span, minus a prefix. And the parts
|
|
8
|
+
* matched after an attribute (a quoted value, the closing `>`) do not depend on where the tag began.
|
|
9
|
+
*/
|
|
10
|
+
/** The `attrs` and `body` groups of `/<script\b([^>]*)>([\s\S]*?)<\/script>/gi`, match by match. */
|
|
11
|
+
export declare function inlineScriptBlocks(html: string): Generator<{
|
|
12
|
+
attrs: string;
|
|
13
|
+
body: string;
|
|
14
|
+
}>;
|
|
15
|
+
/** `source.replace(/<start>[\s\S]*?<end>/g, "")` for the literal strings `start` and `end`. */
|
|
16
|
+
export declare function removeDelimitedRuns(source: string, start: string, end: string): string;
|
|
17
|
+
type GsapScriptReplacer = (full: string, prefix: string, src: string, file: string, suffix: string) => string;
|
|
18
|
+
/** `html.replace(/(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi, replace)`. */
|
|
19
|
+
export declare function replaceGsapDistScripts(html: string, replace: GsapScriptReplacer): string;
|
|
20
|
+
/** `html.replace(/(<tagName\b[^>]*)\s+crossorigin(?:=["'][^"']*["'])?/gi, "$1")`. */
|
|
21
|
+
export declare function stripCrossoriginAttr(html: string, tagName: "video" | "img" | "audio"): string;
|
|
22
|
+
/** `html.replace(/(<(?:video|audio)\b[^>]*?)\s+preload\s*=\s*["']none["']/gi, "$1")`. */
|
|
23
|
+
export declare function stripPreloadNone(html: string): string;
|
|
24
|
+
declare const REMOTE_SRC_TAGS: {
|
|
25
|
+
readonly media: {
|
|
26
|
+
readonly opener: "<(?:video|audio)\\b";
|
|
27
|
+
readonly attr: RegExp;
|
|
28
|
+
};
|
|
29
|
+
readonly source: {
|
|
30
|
+
readonly opener: "<source\\b";
|
|
31
|
+
readonly attr: RegExp;
|
|
32
|
+
};
|
|
33
|
+
readonly img: {
|
|
34
|
+
readonly opener: "<img\\b";
|
|
35
|
+
readonly attr: RegExp;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Group 1 of every match of `/<tag\b[^>]*?src\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi`, in
|
|
40
|
+
* order: `<video>`/`<audio>` and `<source>` use `\bsrc`, `<img>` uses `(?<![\w-])src`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function remoteSrcUrls(html: string, tag: keyof typeof REMOTE_SRC_TAGS): string[];
|
|
43
|
+
/** One pass of `markup.replace(/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi, "")`. */
|
|
44
|
+
export declare function removeScriptAndStyleBlocks(markup: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* The tag name each match of
|
|
47
|
+
* `/<\/([a-zA-Z][-a-zA-Z0-9]*)|<(img|br|hr|input|source|track|area|base|col|embed|link|meta|param|wbr)\b|<([a-zA-Z][-a-zA-Z0-9]*)\b[^>]*\/>/gi`
|
|
48
|
+
* captures, in order and with its original case.
|
|
49
|
+
*/
|
|
50
|
+
export declare function countedTagNames(markup: string): Generator<string>;
|
|
51
|
+
/** How many matches `/<tagName\b[^>]*ATTR[^>]*>/gi` has, for an `attr` source that matches no `>`. */
|
|
52
|
+
export declare function countTagsWithAttr(markup: string, tagName: string, attr: string): number;
|
|
53
|
+
/** How many matches `/<[a-zA-Z][-a-zA-Z0-9]*\b[^>]*\bdata-composition-src=["'][^"']*["']/gi` has. */
|
|
54
|
+
export declare function countCompositionSrcMounts(markup: string): number;
|
|
55
|
+
/** What `html.match(/<[a-zA-Z][-a-zA-Z0-9]*\b[^>]*\bdata-composition-id=["'][^"']*["'][^>]*>/i)?.[0]` returns. */
|
|
56
|
+
export declare function firstCompositionIdTag(html: string): string | undefined;
|
|
57
|
+
export {};
|
|
@@ -98,15 +98,30 @@ export declare function extractHdrVideoFrames(args: {
|
|
|
98
98
|
extractMediaMetadataImpl?: typeof extractMediaMetadata;
|
|
99
99
|
resolveFinalFrameExtractionWindowImpl?: typeof resolveFinalFrameExtractionWindow;
|
|
100
100
|
}): Promise<HdrVideoExtractionResult>;
|
|
101
|
+
/** Shrinks the box uniformly so page CSS alone cannot size a buffer larger than the frame. */
|
|
102
|
+
export declare function fitHdrImageLayoutToFrame(layout: {
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
}, frameWidth: number, frameHeight: number): {
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
};
|
|
109
|
+
export interface HdrImageDecodeResult {
|
|
110
|
+
buffers: Map<string, HdrImageBuffer>;
|
|
111
|
+
releaseReservation: () => void;
|
|
112
|
+
}
|
|
101
113
|
/**
|
|
102
114
|
* Decode each HDR image into an rgb48le buffer, resampling to the element's
|
|
103
|
-
* layout box
|
|
104
|
-
*
|
|
105
|
-
*
|
|
115
|
+
* layout box (fitted inside the output frame) if known. Every buffer is counted
|
|
116
|
+
* against the HDR extraction budget until the caller releases the reservation.
|
|
117
|
+
* Failures abort the render to avoid shipping missing layers (the hot loop has
|
|
118
|
+
* no fallback for a missing HDR layer that the composition expects to see).
|
|
106
119
|
*/
|
|
107
120
|
export declare function decodeHdrImageBuffers(args: {
|
|
108
121
|
log: ProducerLogger;
|
|
109
122
|
hdrImageSrcPaths: Map<string, string>;
|
|
110
123
|
prep: HdrResourcePrep;
|
|
111
124
|
hdrDiagnostics: HdrDiagnostics;
|
|
112
|
-
|
|
125
|
+
width: number;
|
|
126
|
+
height: number;
|
|
127
|
+
}): HdrImageDecodeResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/producer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.56",
|
|
4
4
|
"description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"postcss": "^8.4.0",
|
|
36
36
|
"puppeteer": "~25.13.0",
|
|
37
37
|
"puppeteer-core": "^25.13.0",
|
|
38
|
-
"@hyperframes/
|
|
39
|
-
"@hyperframes/
|
|
40
|
-
"@hyperframes/parsers": "0.9.
|
|
41
|
-
"@hyperframes/
|
|
42
|
-
"@hyperframes/
|
|
38
|
+
"@hyperframes/lint": "0.9.56",
|
|
39
|
+
"@hyperframes/core": "0.9.56",
|
|
40
|
+
"@hyperframes/parsers": "0.9.56",
|
|
41
|
+
"@hyperframes/studio-server": "0.9.56",
|
|
42
|
+
"@hyperframes/engine": "0.9.56"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^25.0.10",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tsx": "^4.21.0",
|
|
49
49
|
"typescript": "^5.7.2",
|
|
50
50
|
"vitest": "^4.1.12",
|
|
51
|
-
"@hyperframes/aws-lambda": "0.9.
|
|
51
|
+
"@hyperframes/aws-lambda": "0.9.56"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22"
|