@hyperframes/studio-server 0.8.169 → 0.8.170

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -16
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -5857,7 +5857,6 @@ import { closeSync as closeSync3, constants, fstatSync as fstatSync3, openSync a
5857
5857
  import {
5858
5858
  collectFontFileEntries,
5859
5859
  fontDirectories,
5860
- getSystemProfilerFamilies,
5861
5860
  locateSystemFont,
5862
5861
  SYSTEM_FONT_SIZE_LIMIT
5863
5862
  } from "@hyperframes/core/fonts/system-locator";
@@ -5897,10 +5896,6 @@ function collectFontsFromDir(dir) {
5897
5896
  function listInstalledFontFamilies() {
5898
5897
  if (cachedFonts) return cachedFonts;
5899
5898
  const families = /* @__PURE__ */ new Set();
5900
- for (const family of getSystemProfilerFamilies()) {
5901
- families.add(family);
5902
- if (families.size >= MAX_FONT_RESULTS) break;
5903
- }
5904
5899
  for (const dir of fontDirectories()) {
5905
5900
  for (const family of collectFontsFromDir(dir)) {
5906
5901
  families.add(family);
@@ -6415,10 +6410,11 @@ function nextStep(history, direction) {
6415
6410
  return { id: target.id, label: target.label, endedAt: target.endedAt, paths };
6416
6411
  }
6417
6412
  async function withHistory(adapter, c, task) {
6418
- const history = await historyOf(adapter, c);
6419
- if (!history) return c.json({ error: "This project has no history here." }, 404);
6420
6413
  try {
6421
- return c.json(await task(history, await bodyOf(c)) ?? null);
6414
+ const history = await historyOf(adapter, c);
6415
+ if (!history) return c.json({ error: "This project has no history here." }, 404);
6416
+ const result = await task(history, await bodyOf(c));
6417
+ return result instanceof Response ? result : c.json(result ?? null);
6422
6418
  } catch (error) {
6423
6419
  return c.json({ error: error instanceof Error ? error.message : String(error) }, 409);
6424
6420
  }
@@ -6474,14 +6470,14 @@ function registerHistoryRoutes(api, adapter) {
6474
6470
  return { ok: true };
6475
6471
  })
6476
6472
  );
6477
- api.get(`${base}/blob/:hash`, async (c) => {
6478
- const history = await historyOf(adapter, c);
6479
- const hash = c.req.param("hash") ?? "";
6480
- const missing = () => c.json({ error: "That file is not kept in this project's history." }, 404);
6481
- if (!history || !/^[0-9a-f]{64}$/.test(hash)) return missing();
6482
- const bytes = await history.readBlob(hash).catch(() => null);
6483
- return bytes ? c.body(new Uint8Array(bytes)) : missing();
6484
- });
6473
+ api.get(
6474
+ `${base}/blob/:hash`,
6475
+ (c) => withHistory(adapter, c, async (history) => {
6476
+ const hash = c.req.param("hash") ?? "";
6477
+ const bytes = /^[0-9a-f]{64}$/.test(hash) ? await history.readBlob(hash).catch(() => null) : null;
6478
+ return bytes ? c.body(new Uint8Array(bytes)) : c.json({ error: "That file is not kept in this project's history." }, 404);
6479
+ })
6480
+ );
6485
6481
  api.post(
6486
6482
  `${base}/claim`,
6487
6483
  (c) => withHistory(adapter, c, async (history, body) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/studio-server",
3
- "version": "0.8.169",
3
+ "version": "0.8.170",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/heygen-com/hyperframes",
@@ -85,8 +85,8 @@
85
85
  "postcss": "^8.5.8",
86
86
  "postcss-selector-parser": "^7.1.2",
87
87
  "sharp": "^0.35.0",
88
- "@hyperframes/core": "0.8.169",
89
- "@hyperframes/parsers": "0.8.169"
88
+ "@hyperframes/core": "0.8.170",
89
+ "@hyperframes/parsers": "0.8.170"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@types/node": "^25.0.10",