@hyperframes/studio-server 0.8.6 → 0.8.7

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 { P as PreviewApiAdapter, i as injectMediaCodecMap, e as injectMediaCodecMapIntoHtml, f as isAutoProxyEnabled, p as proxyEtagSalt, r as resolvePreviewMediaCodecProbeCache } from '../mediaProxyPreview-DVTxBkRO.js';
1
+ export { P as PreviewApiAdapter, i as injectMediaCodecMap, e as injectMediaCodecMapIntoHtml, f as isAutoProxyEnabled, p as proxyEtagSalt, r as resolvePreviewMediaCodecProbeCache } from '../mediaProxyPreview-CGJ7f9JA.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, M as MediaProcessingJobState } from './mediaProxyPreview-DVTxBkRO.js';
3
- export { L as LintResult, P as PreviewApiAdapter, R as RenderJobState, a as ResolvedProject, b as StudioSelectionResponse, c as StudioSelectionSnapshot, d as StudioSelectionTextField } from './mediaProxyPreview-DVTxBkRO.js';
2
+ import { S as StudioApiAdapter, M as MediaProcessingJobState } from './mediaProxyPreview-CGJ7f9JA.js';
3
+ export { L as LintResult, P as PreviewApiAdapter, R as RenderJobState, a as ResolvedProject, b as StudioSelectionResponse, c as StudioSelectionSnapshot, d as StudioSelectionTextField } from './mediaProxyPreview-CGJ7f9JA.js';
4
4
  export { ScreenshotClip, getElementScreenshotClip } from './helpers/screenshotClip.js';
5
5
  export { STUDIO_MANUAL_EDITS_PATH, StudioManualEditsRenderScriptOptions, createStudioManualEditsRenderBodyScript, createStudioPositionSeekReapplyScript } from './helpers/manualEditsRenderScript.js';
6
6
  export { STUDIO_MOTION_PATH, StudioMotionRenderScriptOptions, createStudioMotionRenderBodyScript } from './helpers/studioMotionRenderScript.js';
package/dist/index.js CHANGED
@@ -3718,6 +3718,31 @@ ${runtimeTag}`;
3718
3718
  // src/routes/lint.ts
3719
3719
  import { readFileSync as readFileSync9 } from "fs";
3720
3720
  import { join as join9 } from "path";
3721
+ async function collectProjectFindings(adapter, projectDir) {
3722
+ const findings = [];
3723
+ const coveredFiles = /* @__PURE__ */ new Set();
3724
+ if (!adapter.lintProject) return { findings, coveredFiles };
3725
+ const result = await adapter.lintProject(projectDir);
3726
+ for (const entry of result.results) {
3727
+ coveredFiles.add(entry.file);
3728
+ for (const finding of entry.result.findings) {
3729
+ findings.push({ ...finding, file: entry.file });
3730
+ }
3731
+ }
3732
+ return { findings, coveredFiles };
3733
+ }
3734
+ async function lintUncoveredHtml(adapter, projectDir, htmlFiles, coveredFiles) {
3735
+ const findings = [];
3736
+ for (const file of htmlFiles) {
3737
+ if (coveredFiles.has(file)) continue;
3738
+ const content = readFileSync9(join9(projectDir, file), "utf-8");
3739
+ const result = await adapter.lint(content, { filePath: file });
3740
+ for (const finding of result?.findings ?? []) {
3741
+ findings.push({ ...finding, file });
3742
+ }
3743
+ }
3744
+ return findings;
3745
+ }
3721
3746
  function registerLintRoutes(api, adapter) {
3722
3747
  api.get("/projects/:id/lint", async (c) => {
3723
3748
  const project = await adapter.resolveProject(c.req.param("id"));
@@ -3726,17 +3751,14 @@ function registerLintRoutes(api, adapter) {
3726
3751
  const htmlFiles = walkDir(project.dir).filter(
3727
3752
  (f) => f.endsWith(".html") && !isInHiddenOrVendorDir(f)
3728
3753
  );
3729
- const allFindings = [];
3730
- for (const file of htmlFiles) {
3731
- const content = readFileSync9(join9(project.dir, file), "utf-8");
3732
- const result = await adapter.lint(content, { filePath: file });
3733
- if (result?.findings) {
3734
- for (const f of result.findings) {
3735
- allFindings.push({ ...f, file });
3736
- }
3737
- }
3738
- }
3739
- return c.json({ findings: allFindings });
3754
+ const projectLint = await collectProjectFindings(adapter, project.dir);
3755
+ const extraFindings = await lintUncoveredHtml(
3756
+ adapter,
3757
+ project.dir,
3758
+ htmlFiles,
3759
+ projectLint.coveredFiles
3760
+ );
3761
+ return c.json({ findings: [...projectLint.findings, ...extraFindings] });
3740
3762
  } catch (err) {
3741
3763
  const msg = err instanceof Error ? err.message : String(err);
3742
3764
  return c.json({ error: `Lint failed: ${msg}` }, 500);