@hyperframes/inspector 0.9.107 → 0.10.0
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/service.js
CHANGED
|
@@ -51146,6 +51146,12 @@ function acceleratedCanvasTrackerSource() {
|
|
|
51146
51146
|
return `(${installAcceleratedCanvasTracker.toString()})();`;
|
|
51147
51147
|
}
|
|
51148
51148
|
|
|
51149
|
+
// ../core/src/studioPreviewMark.ts
|
|
51150
|
+
var PREVIEW_FOR_ANOTHER_SITE_META = "hyperframes-preview-for-another-site";
|
|
51151
|
+
function serviceWorkerScriptFetch(headers) {
|
|
51152
|
+
return headers.serviceWorker === "script" || headers.fetchDest === "serviceworker";
|
|
51153
|
+
}
|
|
51154
|
+
|
|
51149
51155
|
// ../parsers/dist/subCompositionValidity.js
|
|
51150
51156
|
function isHtmlTemplate(el) {
|
|
51151
51157
|
return el.localName === "template" && "content" in el;
|
|
@@ -51501,6 +51507,9 @@ function insertRuntimeTag(html, tag, atHeadStart = false) {
|
|
|
51501
51507
|
const tracker = `<script ${ACCEL_TRACKER_ATTR}>${acceleratedCanvasTrackerSource()}</script>`;
|
|
51502
51508
|
return (atHeadStart ? insertWhereScriptsFirstRun : injectTagsAtHeadStart)(withRuntime, tracker);
|
|
51503
51509
|
}
|
|
51510
|
+
function markForAnotherSite(html) {
|
|
51511
|
+
return insertWhereScriptsFirstRun(html, `<meta name="${PREVIEW_FOR_ANOTHER_SITE_META}">`);
|
|
51512
|
+
}
|
|
51504
51513
|
function insertWhereScriptsFirstRun(html, tags) {
|
|
51505
51514
|
const at2 = headContentStart(html);
|
|
51506
51515
|
const opensWithMarkup = html.charAt(at2 - 1) === ">";
|
|
@@ -66338,12 +66347,6 @@ function servableProjectFile(project, urlPath) {
|
|
|
66338
66347
|
}
|
|
66339
66348
|
}
|
|
66340
66349
|
|
|
66341
|
-
// ../core/src/studioPreviewMark.ts
|
|
66342
|
-
var PREVIEW_FOR_ANOTHER_SITE_META = "hyperframes-preview-for-another-site";
|
|
66343
|
-
function serviceWorkerScriptFetch(headers) {
|
|
66344
|
-
return headers.serviceWorker === "script" || headers.fetchDest === "serviceworker";
|
|
66345
|
-
}
|
|
66346
|
-
|
|
66347
66350
|
// ../core/src/cacheDir.ts
|
|
66348
66351
|
import {
|
|
66349
66352
|
chmodSync,
|
|
@@ -67242,12 +67245,11 @@ var Inspector = class {
|
|
|
67242
67245
|
});
|
|
67243
67246
|
if (fingerprint(this.project) !== digest)
|
|
67244
67247
|
throw new Error("source_changed_during_load: retry against a stable project");
|
|
67245
|
-
const servedHtml =
|
|
67248
|
+
const servedHtml = markForAnotherSite(
|
|
67246
67249
|
html.replace(
|
|
67247
67250
|
'data-hyperframes-preview-runtime="1" src=""',
|
|
67248
67251
|
'data-hyperframes-preview-runtime="1" src="/__hf-runtime.js"'
|
|
67249
|
-
)
|
|
67250
|
-
`<meta name="${PREVIEW_FOR_ANOTHER_SITE_META}">`
|
|
67252
|
+
)
|
|
67251
67253
|
);
|
|
67252
67254
|
const serve = (req, res) => {
|
|
67253
67255
|
if (!this.host || !isOwnPageHost(req.headers.host, this.host.port))
|
|
@@ -31,6 +31,7 @@ export declare function hasCompositionOutsideTemplates(html: string): boolean;
|
|
|
31
31
|
/** Insert markup before the document's own `</head>`, `</body>` or `</template>`; null if it has none. */
|
|
32
32
|
export declare function insertBeforeCloseTag(html: string, name: "head" | "body" | "template", markup: string): string | null;
|
|
33
33
|
export declare function insertRuntimeTag(html: string, tag: string, atHeadStart?: boolean): string;
|
|
34
|
+
export declare function markForAnotherSite(html: string): string;
|
|
34
35
|
/**
|
|
35
36
|
* Insert raw tag markup at the very start of `<head>`, ahead of every author
|
|
36
37
|
* script (inline or external). Falls back to just before `<body>`, then to the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/inspector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"htmlparser2": "^10.1.0",
|
|
44
44
|
"postcss": "^8.5.8",
|
|
45
45
|
"puppeteer-core": "^25.8.0",
|
|
46
|
-
"@hyperframes/core": "0.
|
|
47
|
-
"@hyperframes/parsers": "0.
|
|
46
|
+
"@hyperframes/core": "0.10.0",
|
|
47
|
+
"@hyperframes/parsers": "0.10.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^25.0.10",
|