@hanzogui/get 7.3.0 → 8.0.0

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/cli.js +49 -31
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
34
+ var __returnValue = (v) => v;
35
+ function __exportSetter(name, newValue) {
36
+ this[name] = __returnValue.bind(null, newValue);
37
+ }
20
38
  var __export = (target, all) => {
21
39
  for (var name in all)
22
40
  __defProp(target, name, {
23
41
  get: all[name],
24
42
  enumerable: true,
25
43
  configurable: true,
26
- set: (newValue) => all[name] = () => newValue
44
+ set: __exportSetter.bind(all, name)
27
45
  });
28
46
  };
29
47
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -46,7 +64,7 @@ var init_ansi = __esm(() => {
46
64
  var require_package = __commonJS((exports, module) => {
47
65
  module.exports = {
48
66
  name: "@hanzogui/get",
49
- version: "7.3.0",
67
+ version: "8.0.0",
50
68
  description: "CLI installer for Hanzo GUI recipes.",
51
69
  license: "BSD-3-Clause",
52
70
  author: "Hanzo AI <dev@hanzo.ai>",
@@ -1402,32 +1420,6 @@ async function readConfig(root) {
1402
1420
  function resolveInstallDir(root, config) {
1403
1421
  return path.join(root, config.installDir ?? DEFAULT_INSTALL_DIR);
1404
1422
  }
1405
- async function getInstallDir(opts) {
1406
- if (opts.installDir)
1407
- return opts.installDir;
1408
- const root = await findProjectRoot(opts.cwd);
1409
- return resolveInstallDir(root, await readConfig(root));
1410
- }
1411
- async function installRecipe(recipe, opts = {}) {
1412
- const installDir = await getInstallDir(opts);
1413
- const written = [];
1414
- for (const file of recipe.files) {
1415
- const dest = path2.join(installDir, file.path);
1416
- const dir = path2.dirname(dest);
1417
- if (!existsSync2(dir))
1418
- await fs2.mkdir(dir, { recursive: true });
1419
- await fs2.writeFile(dest, file.source);
1420
- written.push(dest);
1421
- }
1422
- return written;
1423
- }
1424
- async function installPlan(plan, opts = {}) {
1425
- const written = [];
1426
- for (const r of [plan.recipe, ...plan.transitiveRecipes]) {
1427
- written.push(...await installRecipe(r, opts));
1428
- }
1429
- return written;
1430
- }
1431
1423
  async function getJSON(url) {
1432
1424
  const res = await fetch(url, { headers: { Accept: "application/json" } });
1433
1425
  if (!res.ok) {
@@ -1475,10 +1467,36 @@ async function resolveRecipe(slug, opts = {}) {
1475
1467
  })();
1476
1468
  const recipe = seen.get(slug);
1477
1469
  const transitiveRecipes = Array.from(seen.values()).filter((r) => r.slug !== slug);
1478
- const path3 = await import("node:path");
1479
- const targetPaths = [recipe, ...transitiveRecipes].flatMap((r) => r.files.map((f) => path3.join(installDir, f.path)));
1470
+ const path22 = await import("node:path");
1471
+ const targetPaths = [recipe, ...transitiveRecipes].flatMap((r) => r.files.map((f) => path22.join(installDir, f.path)));
1480
1472
  return { recipe, transitiveRecipes, targetPaths };
1481
1473
  }
1474
+ async function getInstallDir(opts) {
1475
+ if (opts.installDir)
1476
+ return opts.installDir;
1477
+ const root = await findProjectRoot(opts.cwd);
1478
+ return resolveInstallDir(root, await readConfig(root));
1479
+ }
1480
+ async function installRecipe(recipe, opts = {}) {
1481
+ const installDir = await getInstallDir(opts);
1482
+ const written = [];
1483
+ for (const file of recipe.files) {
1484
+ const dest = path2.join(installDir, file.path);
1485
+ const dir = path2.dirname(dest);
1486
+ if (!existsSync2(dir))
1487
+ await fs2.mkdir(dir, { recursive: true });
1488
+ await fs2.writeFile(dest, file.source);
1489
+ written.push(dest);
1490
+ }
1491
+ return written;
1492
+ }
1493
+ async function installPlan(plan, opts = {}) {
1494
+ const written = [];
1495
+ for (const r of [plan.recipe, ...plan.transitiveRecipes]) {
1496
+ written.push(...await installRecipe(r, opts));
1497
+ }
1498
+ return written;
1499
+ }
1482
1500
  var DEFAULT_BASE_URL = "https://base.hanzo.ai", RECIPES_COLLECTION = "gui_recipes", DEFAULT_INSTALL_DIR = "src/gui", DEFAULT_CONFIG_FILENAMES;
1483
1501
  var init_dist = __esm(() => {
1484
1502
  DEFAULT_CONFIG_FILENAMES = ["gui.config.json", ".guirc.json"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/get",
3
- "version": "7.3.0",
3
+ "version": "8.0.0",
4
4
  "description": "CLI installer for Hanzo GUI recipes.",
5
5
  "license": "BSD-3-Clause",
6
6
  "author": "Hanzo AI <dev@hanzo.ai>",
@@ -30,7 +30,7 @@
30
30
  "test": "bun test"
31
31
  },
32
32
  "dependencies": {
33
- "@hanzogui/recipes": "7.3.0",
33
+ "@hanzogui/recipes": "8.0.0",
34
34
  "fuse.js": "7.1.0"
35
35
  },
36
36
  "engines": {