@hyperframes/studio-server 0.8.88 → 0.8.90
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as PreviewApiAdapter, P as PreviewDocumentStore, i as injectMediaCodecMap, f as injectMediaCodecMapIntoHtml, g as isAutoProxyEnabled, p as proxyEtagSalt, r as resolvePreviewMediaCodecProbeCache } from '../mediaProxyPreview-
|
|
1
|
+
export { a as PreviewApiAdapter, P as PreviewDocumentStore, i as injectMediaCodecMap, f as injectMediaCodecMapIntoHtml, g as isAutoProxyEnabled, p as proxyEtagSalt, r as resolvePreviewMediaCodecProbeCache } from '../mediaProxyPreview-rleU3r_Q.js';
|
|
2
2
|
import './mediaCodecMap.js';
|
|
3
3
|
import '@hyperframes/core';
|
|
4
4
|
import '@hyperframes/parsers';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Hono } from 'hono';
|
|
2
|
-
import { S as StudioApiAdapter, P as PreviewDocumentStore, M as MediaProcessingJobState } from './mediaProxyPreview-
|
|
3
|
-
export { L as LintResult, a as PreviewApiAdapter, R as RenderJobState, b as ResolvedProject, c as StudioSelectionResponse, d as StudioSelectionSnapshot, e as StudioSelectionTextField } from './mediaProxyPreview-
|
|
2
|
+
import { S as StudioApiAdapter, P as PreviewDocumentStore, M as MediaProcessingJobState } from './mediaProxyPreview-rleU3r_Q.js';
|
|
3
|
+
export { L as LintResult, a as PreviewApiAdapter, R as RenderJobState, b as ResolvedProject, c as StudioSelectionResponse, d as StudioSelectionSnapshot, e as StudioSelectionTextField } from './mediaProxyPreview-rleU3r_Q.js';
|
|
4
4
|
export { C as ClosedWindow, D as DEFAULT_HISTORY_ROOT, S as HISTORY_START, H as HistoryClosedError, a as HistoryEntry, b as HistoryEntrySide, c as HistoryFileChange, d as HistoryListItem, e as HistoryResult, f as HistoryWho, g as HistoryWindow, M as MAX_WINDOW_IDLE_MS, P as ProjectHistory, h as ProjectHistoryOptions, U as UNDO_MODES, i as UndoMode, o as openProjectHistory } from './projectHistory-Cm8Mdmmv.js';
|
|
5
5
|
export { HistoryBusyError, HistoryIdError, ProjectHistoryRecord, PrunedHistory, historyCache, listProjectHistories, pruneGoneProjectHistories } from './history/index.js';
|
|
6
6
|
export { CACHE_DIR_NAME as PROXY_CACHE_DIR_NAME } from './helpers/proxyTranscoder.js';
|
package/dist/index.js
CHANGED
|
@@ -3627,7 +3627,7 @@ function registerPreviewRoutes(api, adapter) {
|
|
|
3627
3627
|
if (builtPreviews.size > 4) builtPreviews.delete(builtPreviews.keys().next().value);
|
|
3628
3628
|
};
|
|
3629
3629
|
const previewBuilds = /* @__PURE__ */ new Map();
|
|
3630
|
-
async function buildPreview(project, previewVariables, builtKey, capture) {
|
|
3630
|
+
async function buildPreview(project, previewVariables, builtKey, capture, signature) {
|
|
3631
3631
|
const diskMain = resolveProjectMainHtml(project.dir, project.id);
|
|
3632
3632
|
const normalizedDisk = diskMain ? ensureHfIds2(diskMain.html) : null;
|
|
3633
3633
|
try {
|
|
@@ -3669,8 +3669,10 @@ ${runtimeTag}`;
|
|
|
3669
3669
|
mediaCodecProbeCache
|
|
3670
3670
|
);
|
|
3671
3671
|
bundled = addScenePartsManifest(bundled, [`meta[name="${PROJECT_SIGNATURE_META}"]`]);
|
|
3672
|
-
|
|
3673
|
-
|
|
3672
|
+
if (createProjectSignature(project.dir) === signature) {
|
|
3673
|
+
rememberPreview(builtKey, bundled);
|
|
3674
|
+
if (!capture) adapter.previewDocuments?.write(builtKey, bundled);
|
|
3675
|
+
}
|
|
3674
3676
|
return bundled;
|
|
3675
3677
|
} catch {
|
|
3676
3678
|
const fallback = resolveProjectMainHtml(project.dir, project.id);
|
|
@@ -3723,7 +3725,7 @@ ${etag}`;
|
|
|
3723
3725
|
}
|
|
3724
3726
|
let pending = previewBuilds.get(builtKey);
|
|
3725
3727
|
if (!pending) {
|
|
3726
|
-
pending = buildPreview(project, previewVariables, builtKey, capture).finally(
|
|
3728
|
+
pending = buildPreview(project, previewVariables, builtKey, capture, signature).finally(
|
|
3727
3729
|
() => previewBuilds.delete(builtKey)
|
|
3728
3730
|
);
|
|
3729
3731
|
previewBuilds.set(builtKey, pending);
|
|
@@ -5370,6 +5372,12 @@ function createStudioApi(adapter) {
|
|
|
5370
5372
|
if (c.res.status >= 403 && dirBeforeRoute && folderGone(dirBeforeRoute))
|
|
5371
5373
|
replaceWithProjectDirMissing(c, hostHeaders);
|
|
5372
5374
|
});
|
|
5375
|
+
api.use("/projects/:id/*", async function forgetSignatureAfterWrite(c, next) {
|
|
5376
|
+
await next();
|
|
5377
|
+
if (c.req.method === "GET" || c.req.method === "HEAD") return;
|
|
5378
|
+
const project = await Promise.resolve().then(() => adapter.resolveProject(c.req.param("id"))).catch(() => null);
|
|
5379
|
+
if (project) adapter.invalidateProjectSignature?.(project.dir);
|
|
5380
|
+
});
|
|
5373
5381
|
registerProjectRoutes(api, adapter);
|
|
5374
5382
|
registerFileRoutes(api, adapter);
|
|
5375
5383
|
registerPreviewRoutes(api, adapter);
|