@hyperframes/producer 0.9.34 → 0.9.35

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.
@@ -2248,6 +2248,7 @@ import {
2248
2248
  readTextFile,
2249
2249
  resolveCompositionSrc
2250
2250
  } from "@hyperframes/parsers/asset-resolution";
2251
+ import { isPrivateFileUnder, isVcsOrSecretPath } from "@hyperframes/core/safe-path";
2251
2252
 
2252
2253
  // src/services/renderMediaCollector.ts
2253
2254
  import { parseHTML as parseHTML2 } from "linkedom";
@@ -3245,6 +3246,7 @@ function normalizeCompositionSrcs(html, projectDir) {
3245
3246
  return `${name}${quote}${relative2(projectDir, file).split(sep2).join("/")}${quote}`;
3246
3247
  });
3247
3248
  }
3249
+ var isPrivateCompositionFile = (projectDir, filePath) => isPrivateFileUnder(projectDir, filePath, isVcsOrSecretPath);
3248
3250
  function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */ new Set()) {
3249
3251
  const { document: document2 } = parseHTML5(html);
3250
3252
  const hosts = [...document2.querySelectorAll("[data-composition-src]")];
@@ -3258,6 +3260,10 @@ function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */
3258
3260
  problems.push({ srcPath, detail: "it is outside the project folder" });
3259
3261
  continue;
3260
3262
  }
3263
+ if (isPrivateCompositionFile(projectDir, filePath)) {
3264
+ problems.push({ srcPath, detail: "it is git metadata or an env file" });
3265
+ continue;
3266
+ }
3261
3267
  if (visited.has(filePath)) continue;
3262
3268
  const read = readProjectFile(filePath);
3263
3269
  if (read.kind === "missing") {
@@ -3561,7 +3567,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
3561
3567
  const srcPath = el.getAttribute("data-composition-src");
3562
3568
  if (!srcPath) continue;
3563
3569
  const filePath = resolveCompositionSrc(projectDir, srcPath);
3564
- if (filePath === null) continue;
3570
+ if (filePath === null || isPrivateCompositionFile(projectDir, filePath)) continue;
3565
3571
  if (visited.has(filePath)) {
3566
3572
  continue;
3567
3573
  }
@@ -3758,7 +3764,7 @@ function inlineSubCompositions(html, subCompositions, projectDir, variableOverri
3758
3764
  let compHtml = subCompositions.get(srcPath) || null;
3759
3765
  if (!compHtml) {
3760
3766
  const filePath = resolveCompositionSrc(projectDir, srcPath);
3761
- const read = filePath ? readProjectFile(filePath) : null;
3767
+ const read = filePath && !isPrivateCompositionFile(projectDir, filePath) ? readProjectFile(filePath) : null;
3762
3768
  if (read?.kind === "file") {
3763
3769
  compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
3764
3770
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "0026fcce8802ced3aac18b83db5e22594fead81c85f85013a7570461d988021f",
4
+ "sha256": "829e51fed8f17ae34c6be9aead791e6370c28e9c809255971a9b4e8b2332a47e",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"