hyperframes 0.6.32 → 0.6.34

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/cli.js CHANGED
@@ -54,7 +54,7 @@ var VERSION;
54
54
  var init_version = __esm({
55
55
  "src/version.ts"() {
56
56
  "use strict";
57
- VERSION = true ? "0.6.32" : "0.0.0-dev";
57
+ VERSION = true ? "0.6.34" : "0.0.0-dev";
58
58
  }
59
59
  });
60
60
 
@@ -32572,7 +32572,7 @@ function injectInterceptor(html, runtimeMode = "inline") {
32572
32572
  tag = `<script ${RUNTIME_BOOTSTRAP_ATTR}="1">${inlinedRuntime}</script>`;
32573
32573
  }
32574
32574
  if (sanitized.includes("</head>")) {
32575
- return sanitized.replace("</head>", `${tag}
32575
+ return sanitized.replace("</head>", () => `${tag}
32576
32576
  </head>`);
32577
32577
  }
32578
32578
  const htmlOpenMatch = sanitized.match(/<html\b[^>]*>/i);
@@ -45511,8 +45511,36 @@ function createStudioServer(options) {
45511
45511
  async installRegistryBlock(opts) {
45512
45512
  const { resolveItem: resolveItem2 } = await Promise.resolve().then(() => (init_resolver(), resolver_exports));
45513
45513
  const { installItem: installItem2 } = await Promise.resolve().then(() => (init_installer(), installer_exports));
45514
+ const { readFileSync: readFileSync54, writeFileSync: writeFileSync39, existsSync: existsSync80 } = await import("fs");
45515
+ const { join: join89 } = await import("path");
45514
45516
  const item = await resolveItem2(opts.blockName);
45515
45517
  const { written } = await installItem2(item, { destDir: opts.project.dir });
45518
+ const indexPath = join89(opts.project.dir, "index.html");
45519
+ if (existsSync80(indexPath)) {
45520
+ const indexHtml = readFileSync54(indexPath, "utf-8");
45521
+ const hostW = indexHtml.match(/data-width="(\d+)"/)?.[1];
45522
+ const hostH = indexHtml.match(/data-height="(\d+)"/)?.[1];
45523
+ if (hostW && hostH) {
45524
+ for (const absPath of written) {
45525
+ if (!absPath.endsWith(".html")) continue;
45526
+ let content = readFileSync54(absPath, "utf-8");
45527
+ content = content.replace(
45528
+ /(<meta\s+name="viewport"\s+content="width=)\d+(,\s*height=)\d+/i,
45529
+ `$1${hostW}$2${hostH}`
45530
+ );
45531
+ content = content.replace(
45532
+ /(\bwidth:\s*)\d+(px;\s*\n?\s*height:\s*)\d+(px;)/g,
45533
+ (match, pre, mid, post) => {
45534
+ if (match.includes("1920") || match.includes("1080")) {
45535
+ return `${pre}${hostW}${mid}${hostH}${post}`;
45536
+ }
45537
+ return match;
45538
+ }
45539
+ );
45540
+ writeFileSync39(absPath, content, "utf-8");
45541
+ }
45542
+ }
45543
+ }
45516
45544
  const relativePaths = written.map((abs) => {
45517
45545
  const rel = abs.startsWith(opts.project.dir) ? abs.slice(opts.project.dir.length + 1) : abs;
45518
45546
  return rel;