@hanzogui/static 7.0.0 → 7.3.1

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 (99) hide show
  1. package/LICENSE +40 -19
  2. package/dist/check-dep-versions.cjs +1 -1
  3. package/dist/checkDeps.cjs +11 -11
  4. package/dist/constants.cjs +2 -2
  5. package/dist/exports.cjs +2 -2
  6. package/dist/extractor/bundle.cjs +6 -6
  7. package/dist/extractor/bundleConfig.cjs +45 -45
  8. package/dist/extractor/createExtractor.cjs +39 -39
  9. package/dist/extractor/createLogger.cjs +1 -1
  10. package/dist/extractor/extractHelpers.cjs +1 -1
  11. package/dist/extractor/extractMediaStyle.cjs +7 -7
  12. package/dist/extractor/extractToClassNames.cjs +9 -9
  13. package/dist/extractor/extractToNative.cjs +7 -7
  14. package/dist/extractor/{getHanzoguiConfigPathFromOptionsConfig.cjs → getGuiConfigPathFromOptionsConfig.cjs} +5 -5
  15. package/dist/extractor/getPrefixLogs.cjs +1 -1
  16. package/dist/extractor/getStaticBindingsForScope.cjs +2 -2
  17. package/dist/extractor/{loadHanzogui.cjs → loadGui.cjs} +65 -65
  18. package/dist/extractor/regenerateConfig.cjs +20 -20
  19. package/dist/extractor/{watchHanzoguiConfig.cjs → watchGuiConfig.cjs} +15 -15
  20. package/dist/getPragmaOptions.cjs +6 -6
  21. package/dist/helpers/{requireHanzoguiCore.cjs → requireGuiCore.cjs} +12 -12
  22. package/dist/registerRequire.cjs +20 -20
  23. package/dist/worker.cjs +3 -3
  24. package/package.json +29 -23
  25. package/src/check-dep-versions.ts +1 -1
  26. package/src/checkDeps.ts +27 -27
  27. package/src/constants.ts +2 -2
  28. package/src/exports.ts +2 -2
  29. package/src/extractor/bundle.ts +9 -9
  30. package/src/extractor/bundleConfig.ts +56 -56
  31. package/src/extractor/createEvaluator.ts +2 -2
  32. package/src/extractor/createExtractor.ts +55 -55
  33. package/src/extractor/createLogger.ts +3 -3
  34. package/src/extractor/extractHelpers.ts +12 -12
  35. package/src/extractor/extractMediaStyle.ts +13 -13
  36. package/src/extractor/extractToClassNames.ts +11 -11
  37. package/src/extractor/extractToNative.ts +13 -13
  38. package/src/extractor/{getHanzoguiConfigPathFromOptionsConfig.ts → getGuiConfigPathFromOptionsConfig.ts} +3 -3
  39. package/src/extractor/getPrefixLogs.ts +3 -3
  40. package/src/extractor/getStaticBindingsForScope.ts +2 -2
  41. package/src/extractor/{loadHanzogui.ts → loadGui.ts} +85 -85
  42. package/src/extractor/regenerateConfig.ts +23 -23
  43. package/src/extractor/{watchHanzoguiConfig.ts → watchGuiConfig.ts} +10 -10
  44. package/src/getPragmaOptions.ts +6 -6
  45. package/src/helpers/requireGuiCore.ts +28 -0
  46. package/src/registerRequire.ts +27 -27
  47. package/src/server.ts +2 -2
  48. package/src/types.ts +10 -10
  49. package/src/worker.ts +7 -7
  50. package/types/constants.d.ts.map +1 -1
  51. package/types/exports.d.ts +2 -2
  52. package/types/exports.d.ts.map +1 -1
  53. package/types/extractor/bundle.d.ts +2 -2
  54. package/types/extractor/bundle.d.ts.map +1 -1
  55. package/types/extractor/bundleConfig.d.ts +12 -12
  56. package/types/extractor/bundleConfig.d.ts.map +1 -1
  57. package/types/extractor/createEvaluator.d.ts +2 -2
  58. package/types/extractor/createEvaluator.d.ts.map +1 -1
  59. package/types/extractor/createExtractor.d.ts +5 -5
  60. package/types/extractor/createExtractor.d.ts.map +1 -1
  61. package/types/extractor/createLogger.d.ts +2 -2
  62. package/types/extractor/createLogger.d.ts.map +1 -1
  63. package/types/extractor/extractHelpers.d.ts +8 -8
  64. package/types/extractor/extractHelpers.d.ts.map +1 -1
  65. package/types/extractor/extractMediaStyle.d.ts +4 -4
  66. package/types/extractor/extractMediaStyle.d.ts.map +1 -1
  67. package/types/extractor/extractToClassNames.d.ts +2 -2
  68. package/types/extractor/extractToClassNames.d.ts.map +1 -1
  69. package/types/extractor/extractToNative.d.ts +3 -3
  70. package/types/extractor/extractToNative.d.ts.map +1 -1
  71. package/types/extractor/getGuiConfigPathFromOptionsConfig.d.ts +3 -0
  72. package/types/extractor/getGuiConfigPathFromOptionsConfig.d.ts.map +1 -0
  73. package/types/extractor/getPrefixLogs.d.ts +2 -2
  74. package/types/extractor/getPrefixLogs.d.ts.map +1 -1
  75. package/types/extractor/loadGui.d.ts +22 -0
  76. package/types/extractor/loadGui.d.ts.map +1 -0
  77. package/types/extractor/regenerateConfig.d.ts +4 -4
  78. package/types/extractor/regenerateConfig.d.ts.map +1 -1
  79. package/types/extractor/watchGuiConfig.d.ts +5 -0
  80. package/types/extractor/watchGuiConfig.d.ts.map +1 -0
  81. package/types/helpers/requireGuiCore.d.ts +3 -0
  82. package/types/helpers/requireGuiCore.d.ts.map +1 -0
  83. package/types/registerRequire.d.ts +3 -3
  84. package/types/registerRequire.d.ts.map +1 -1
  85. package/types/server.d.ts +2 -2
  86. package/types/server.d.ts.map +1 -1
  87. package/types/types.d.ts +10 -10
  88. package/types/types.d.ts.map +1 -1
  89. package/types/worker.d.ts +4 -4
  90. package/types/worker.d.ts.map +1 -1
  91. package/src/helpers/requireHanzoguiCore.ts +0 -28
  92. package/types/extractor/getHanzoguiConfigPathFromOptionsConfig.d.ts +0 -3
  93. package/types/extractor/getHanzoguiConfigPathFromOptionsConfig.d.ts.map +0 -1
  94. package/types/extractor/loadHanzogui.d.ts +0 -22
  95. package/types/extractor/loadHanzogui.d.ts.map +0 -1
  96. package/types/extractor/watchHanzoguiConfig.d.ts +0 -5
  97. package/types/extractor/watchHanzoguiConfig.d.ts.map +0 -1
  98. package/types/helpers/requireHanzoguiCore.d.ts +0 -3
  99. package/types/helpers/requireHanzoguiCore.d.ts.map +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,42 @@
1
- MIT License
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026-present, Hanzo AI, Inc.
4
+
5
+ Portions of this software are derived from upstream code originally licensed under
6
+ the MIT License, with the following copyright notices retained per its terms:
2
7
 
3
8
  Copyright (c) 2020 Nate Wienert
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
9
+ Copyright (c) 2015-present, Nicolas Gallagher.
10
+ Copyright (c) 2015-present, Facebook, Inc.
11
+ Copyright (c) 2021 Radix
12
+ Copyright (c) 2017 Carmelo Pullara
13
+ Copyright (c) 2018 Framer B.V.
14
+ Copyright (c) 2022 WorkOS
15
+
16
+ All rights reserved.
17
+
18
+ Redistribution and use in source and binary forms, with or without
19
+ modification, are permitted provided that the following conditions are met:
20
+
21
+ 1. Redistributions of source code must retain the above copyright notice, this
22
+ list of conditions and the following disclaimer.
23
+
24
+ 2. Redistributions in binary form must reproduce the above copyright notice,
25
+ this list of conditions and the following disclaimer in the documentation
26
+ and/or other materials provided with the distribution.
27
+
28
+ 3. Neither the name of the copyright holder nor the names of its contributors
29
+ may be used to endorse or promote products derived from this software
30
+ without specific prior written permission.
31
+
32
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
36
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
37
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
38
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
39
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
40
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
41
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42
+ POSSIBILITY OF SUCH DAMAGE.
@@ -275,7 +275,7 @@ const DEFAULT_DEP_TYPES = ["dependencies" /* dependencies */, "devDependencies"
275
275
  ];
276
276
  function check(path) {
277
277
  const options = {
278
- includeDepPattern: ["hanzogui", "react-native-web-lite", "react-native-web-internals"]
278
+ includeDepPattern: ["gui", "react-native-web-lite", "react-native-web-internals"]
279
279
  };
280
280
  if (options && options.depType && options.depType.some(dt => !Object.keys(DEPENDENCY_TYPE).includes(dt))) {
281
281
  throw new Error(`Invalid depType provided. Choices are: ${Object.keys(DEPENDENCY_TYPE).join(", ")}.`);
@@ -37,7 +37,7 @@ var DEPENDENCY_TYPE = /* @__PURE__ */(DEPENDENCY_TYPE2 => {
37
37
  DEPENDENCY_TYPE2["resolutions"] = "resolutions";
38
38
  return DEPENDENCY_TYPE2;
39
39
  })(DEPENDENCY_TYPE || {});
40
- const CRITICAL_PACKAGES = ["@hanzogui/web", "@hanzogui/core", "hanzogui"];
40
+ const CRITICAL_PACKAGES = ["@hanzogui/web", "@hanzogui/core", "gui"];
41
41
  function checkDuplicateInstalls(root) {
42
42
  const nodeModules = (0, import_node_path.join)(root, "node_modules");
43
43
  if (!(0, import_node_fs.existsSync)(nodeModules)) return "";
@@ -64,7 +64,7 @@ function checkDuplicateInstalls(root) {
64
64
  }
65
65
  }
66
66
  if (duplicates.size === 0) return "";
67
- const lines = ["Found duplicate hanzogui installations in node_modules:", "", "This causes multiple runtime instances, which breaks theme/config detection.", ""];
67
+ const lines = ["Found duplicate gui installations in node_modules:", "", "This causes multiple runtime instances, which breaks theme/config detection.", ""];
68
68
  for (const [pkg, locations] of duplicates) {
69
69
  lines.push(` ${pkg}:`);
70
70
  for (const loc of locations) {
@@ -130,7 +130,7 @@ function checkBunLockDuplicates(lockPath) {
130
130
  const content = (0, import_node_fs.readFileSync)(lockPath, "utf8");
131
131
  const duplicates = /* @__PURE__ */new Map();
132
132
  const criticalSet = new Set(CRITICAL_PACKAGES);
133
- const packagePattern = /["'](@hanzogui\/[\w-]+|hanzogui)@([^"'\s,]+)["']/g;
133
+ const packagePattern = /["'](@hanzogui\/[\w-]+|gui)@([^"'\s,]+)["']/g;
134
134
  let match;
135
135
  while ((match = packagePattern.exec(content)) !== null) {
136
136
  const name = match[1];
@@ -150,7 +150,7 @@ function checkYarnLockDuplicates(lockPath) {
150
150
  const content = (0, import_node_fs.readFileSync)(lockPath, "utf8");
151
151
  const duplicates = /* @__PURE__ */new Map();
152
152
  const criticalSet = new Set(CRITICAL_PACKAGES);
153
- const entryPattern = /^"?(@hanzogui\/[\w-]+|hanzogui)@[^":\n]+[":]?\s*$/gm;
153
+ const entryPattern = /^"?(@hanzogui\/[\w-]+|gui)@[^":\n]+[":]?\s*$/gm;
154
154
  const versionPattern = /^\s+version\s+"([^"]+)"/gm;
155
155
  let entryMatch;
156
156
  while ((entryMatch = entryPattern.exec(content)) !== null) {
@@ -204,11 +204,11 @@ function formatLockfileDuplicates(duplicates, lockfileName) {
204
204
  }
205
205
  lines.push("");
206
206
  lines.push("Multiple versions cause duplicate runtime instances, breaking config/theme detection.");
207
- lines.push("Fix: ensure all hanzogui packages use the same version range, then dedupe.");
207
+ lines.push("Fix: ensure all gui packages use the same version range, then dedupe.");
208
208
  return lines.join("\n");
209
209
  }
210
210
  function checkConfigExists(root) {
211
- const configNames = ["hanzogui.config.ts", "hanzogui.config.tsx", "hanzogui.config.js", "hanzogui.config.mjs", "hanzogui.config.cjs"];
211
+ const configNames = ["gui.config.ts", "gui.config.tsx", "gui.config.js", "gui.config.mjs", "gui.config.cjs"];
212
212
  const searchDirs = [root, (0, import_node_path.join)(root, "src"), (0, import_node_path.join)(root, "app"), (0, import_node_path.join)(root, "config")];
213
213
  for (const dir of searchDirs) {
214
214
  for (const name of configNames) {
@@ -217,7 +217,7 @@ function checkConfigExists(root) {
217
217
  }
218
218
  }
219
219
  }
220
- const buildConfigNames = ["hanzogui.build.ts", "hanzogui.build.js", "hanzogui.build.mjs", "hanzogui.build.cjs"];
220
+ const buildConfigNames = ["gui.build.ts", "gui.build.js", "gui.build.mjs", "gui.build.cjs"];
221
221
  for (const name of buildConfigNames) {
222
222
  const buildPath = (0, import_node_path.join)(root, name);
223
223
  if ((0, import_node_fs.existsSync)(buildPath)) {
@@ -235,8 +235,8 @@ function checkConfigExists(root) {
235
235
  if ((0, import_node_fs.existsSync)(pkgJsonPath)) {
236
236
  try {
237
237
  const pkg = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf8"));
238
- if (pkg.hanzogui?.config) {
239
- const configPath = (0, import_node_path.join)(root, pkg.hanzogui.config);
238
+ if (pkg.gui?.config) {
239
+ const configPath = (0, import_node_path.join)(root, pkg.gui.config);
240
240
  if ((0, import_node_fs.existsSync)(configPath)) return "";
241
241
  }
242
242
  } catch {}
@@ -247,7 +247,7 @@ function checkConfigExists(root) {
247
247
  if (pkg.workspaces) return "";
248
248
  } catch {}
249
249
  }
250
- return ["No hanzogui.config file found.", "", "Hanzogui requires a config file (e.g. hanzogui.config.ts) that calls createHanzogui().", `Without it, components will throw "Can't find Hanzogui configuration" at runtime.`, "", "See: https://hanzogui.dev/docs/core/configuration"].join("\n");
250
+ return ["No gui.config file found.", "", "Gui requires a config file (e.g. gui.config.ts) that calls createGui().", `Without it, components will throw "Can't find Gui configuration" at runtime.`, "", "See: https://gui.dev/docs/core/configuration"].join("\n");
251
251
  }
252
252
  async function checkDeps(root) {
253
253
  const issues = [];
@@ -260,7 +260,7 @@ async function checkDeps(root) {
260
260
  const configSummary = checkConfigExists(root);
261
261
  if (configSummary) issues.push(configSummary);
262
262
  if (issues.length === 0) {
263
- console.info(`Hanzogui dependencies look good \u2705`);
263
+ console.info(`Gui dependencies look good \u2705`);
264
264
  process.exit(0);
265
265
  }
266
266
  for (let i = 0; i < issues.length; i++) {
@@ -44,8 +44,8 @@ var import_find_cache_dir = __toESM(require("find-cache-dir"));
44
44
  const CSS_FILE_NAME = "__snack.css";
45
45
  const MEDIA_SEP = "_";
46
46
  const cacheDir = (0, import_find_cache_dir.default)({
47
- name: "hanzogui",
47
+ name: "gui",
48
48
  create: true
49
49
  });
50
50
  const FAILED_EVAL = /* @__PURE__ */Symbol("failed_style_eval");
51
- const SHOULD_DEBUG = process.env.DEBUG === "*" || process.env.DEBUG?.startsWith("hanzogui");
51
+ const SHOULD_DEBUG = process.env.DEBUG === "*" || process.env.DEBUG?.startsWith("gui");
package/dist/exports.cjs CHANGED
@@ -38,8 +38,8 @@ __reExport(exports_exports, require("./extractor/extractToClassNames.cjs"), modu
38
38
  __reExport(exports_exports, require("./extractor/concatClassName.cjs"), module.exports);
39
39
  __reExport(exports_exports, require("./extractor/extractToNative.cjs"), module.exports);
40
40
  __reExport(exports_exports, require("./extractor/extractHelpers.cjs"), module.exports);
41
- __reExport(exports_exports, require("./extractor/loadHanzogui.cjs"), module.exports);
42
- __reExport(exports_exports, require("./extractor/watchHanzoguiConfig.cjs"), module.exports);
41
+ __reExport(exports_exports, require("./extractor/loadGui.cjs"), module.exports);
42
+ __reExport(exports_exports, require("./extractor/watchGuiConfig.cjs"), module.exports);
43
43
  __reExport(exports_exports, require("./extractor/createLogger.cjs"), module.exports);
44
44
  __reExport(exports_exports, require("./registerRequire.cjs"), module.exports);
45
45
  var import_detectModuleFormat = require("./extractor/detectModuleFormat.cjs");
@@ -35,7 +35,7 @@ var bundle_exports = {};
35
35
  __export(bundle_exports, {
36
36
  esbuildIgnoreFilesRegex: () => esbuildIgnoreFilesRegex,
37
37
  esbuildLoaderConfig: () => esbuildLoaderConfig,
38
- esbundleHanzoguiConfig: () => esbundleHanzoguiConfig
38
+ esbundleGuiConfig: () => esbundleGuiConfig
39
39
  });
40
40
  module.exports = __toCommonJS(bundle_exports);
41
41
  var import_node_fs = require("node:fs");
@@ -44,7 +44,7 @@ var FS = __toESM(require("fs-extra"));
44
44
  var import_detectModuleFormat = require("./detectModuleFormat.cjs");
45
45
  var import_esbuildAliasPlugin = require("./esbuildAliasPlugin.cjs");
46
46
  var import_hasTopLevelAwait = require("./hasTopLevelAwait.cjs");
47
- var import_loadHanzogui = require("./loadHanzogui.cjs");
47
+ var import_loadGui = require("./loadGui.cjs");
48
48
  var import_esbuildTsconfigPaths = require("./esbuildTsconfigPaths.cjs");
49
49
  const esbuildLoaderConfig = {
50
50
  ".js": "jsx",
@@ -78,8 +78,8 @@ function getESBuildConfig({
78
78
  resolvePlatformSpecificEntries,
79
79
  ...options
80
80
  }, platform, aliases) {
81
- if (process.env.DEBUG?.startsWith("hanzogui")) console.info(`Building`, entryPoints);
82
- const resolvedEntryPoints = !resolvePlatformSpecificEntries ? entryPoints : entryPoints.map(import_loadHanzogui.resolveWebOrNativeSpecificEntry);
81
+ if (process.env.DEBUG?.startsWith("gui")) console.info(`Building`, entryPoints);
82
+ const resolvedEntryPoints = !resolvePlatformSpecificEntries ? entryPoints : entryPoints.map(import_loadGui.resolveWebOrNativeSpecificEntry);
83
83
  const detectedFormat = options.format || detectEntryFormat(resolvedEntryPoints[0]);
84
84
  return {
85
85
  bundle: true,
@@ -131,7 +131,7 @@ function getESBuildConfig({
131
131
  modified = true;
132
132
  }
133
133
  if ((0, import_hasTopLevelAwait.hasTopLevelAwait)(contents, args.path)) {
134
- if (process.env.DEBUG?.startsWith("hanzogui")) console.info(`[hanzogui] stubbing file with top-level await: ${args.path}`);
134
+ if (process.env.DEBUG?.startsWith("gui")) console.info(`[gui] stubbing file with top-level await: ${args.path}`);
135
135
  return {
136
136
  contents: `// stubbed - contains top-level await
137
137
  export default {}`,
@@ -212,7 +212,7 @@ function detectEntryFormat(entryPoint) {
212
212
  return "cjs";
213
213
  }
214
214
  }
215
- async function esbundleHanzoguiConfig(props, platform, aliases) {
215
+ async function esbundleGuiConfig(props, platform, aliases) {
216
216
  const config = getESBuildConfig(props, platform, aliases);
217
217
  const tmpFile = props.outfile + ".tmp." + process.pid;
218
218
  const result = await import_esbuild.default.build({
@@ -43,7 +43,7 @@ __export(bundleConfig_exports, {
43
43
  loadComponentsInner: () => loadComponentsInner,
44
44
  loadComponentsInnerSync: () => loadComponentsInnerSync,
45
45
  loadComponentsSync: () => loadComponentsSync,
46
- writeHanzoguiCSS: () => writeHanzoguiCSS
46
+ writeGuiCSS: () => writeGuiCSS
47
47
  });
48
48
  module.exports = __toCommonJS(bundleConfig_exports);
49
49
  var import_generator = __toESM(require("@babel/generator"));
@@ -60,15 +60,15 @@ var import_promises = require("node:fs/promises");
60
60
  var import_registerRequire = require("../registerRequire.cjs");
61
61
  var import_babelParse = require("./babelParse.cjs");
62
62
  var import_bundle = require("./bundle.cjs");
63
- var import_getHanzoguiConfigPathFromOptionsConfig = require("./getHanzoguiConfigPathFromOptionsConfig.cjs");
63
+ var import_getGuiConfigPathFromOptionsConfig = require("./getGuiConfigPathFromOptionsConfig.cjs");
64
64
  var import_hasTopLevelAwait = require("./hasTopLevelAwait.cjs");
65
- var import_requireHanzoguiCore = require("../helpers/requireHanzoguiCore.cjs");
65
+ var import_requireGuiCore = require("../helpers/requireGuiCore.cjs");
66
66
  var import_detectModuleFormat = require("./detectModuleFormat.cjs");
67
67
  const activeTempFiles = /* @__PURE__ */new Set();
68
68
  function getDynamicEvalOutfile(name, format, contents) {
69
69
  const ext = format === "esm" ? "mjs" : "cjs";
70
70
  const hash = (0, import_node_crypto.createHash)("sha1").update(name).update("\0").update(format).update("\0").update(contents).digest("hex").slice(0, 10);
71
- return (0, import_node_path.join)(process.cwd(), ".hanzogui", `dynamic-eval-${hash}-${(0, import_node_path.basename)(name)}.${ext}`);
71
+ return (0, import_node_path.join)(process.cwd(), ".gui", `dynamic-eval-${hash}-${(0, import_node_path.basename)(name)}.${ext}`);
72
72
  }
73
73
  function getEsbuildStdinLoader(filePath) {
74
74
  if (filePath.endsWith(".tsx")) return "tsx";
@@ -141,8 +141,8 @@ const handleEsmFeaturesPlugin = {
141
141
  modified = true;
142
142
  }
143
143
  if ((0, import_hasTopLevelAwait.hasTopLevelAwait)(contents, args.path)) {
144
- if (process.env.DEBUG?.startsWith("hanzogui")) {
145
- console.info(`[hanzogui] stubbing file with top-level await: ${args.path}`);
144
+ if (process.env.DEBUG?.startsWith("gui")) {
145
+ console.info(`[gui] stubbing file with top-level await: ${args.path}`);
146
146
  }
147
147
  return {
148
148
  // Keep this as an ESM-shaped stub so esbuild doesn't inline a top-level
@@ -199,24 +199,24 @@ async function getBundledConfig(props, rebuild = false) {
199
199
  }
200
200
  return currentBundle;
201
201
  }
202
- global.hanzoguiLastLoaded ||= 0;
202
+ global.guiLastLoaded ||= 0;
203
203
  function updateLastLoaded(config) {
204
- global.hanzoguiLastLoaded = Date.now();
205
- global.hanzoguiLastBundledConfig = config;
204
+ global.guiLastLoaded = Date.now();
205
+ global.guiLastBundledConfig = config;
206
206
  }
207
207
  let hasBundledOnce = false;
208
208
  let hasLoggedBuild = false;
209
209
  async function bundleConfig(props) {
210
- if (global.hanzoguiLastBundledConfig && Date.now() - global.hanzoguiLastLoaded < 3e3) {
211
- return global.hanzoguiLastBundledConfig;
210
+ if (global.guiLastBundledConfig && Date.now() - global.guiLastLoaded < 3e3) {
211
+ return global.guiLastBundledConfig;
212
212
  }
213
213
  try {
214
214
  isBundling = true;
215
- const configEntry = props.config ? (0, import_getHanzoguiConfigPathFromOptionsConfig.getHanzoguiConfigPathFromOptionsConfig)(props.config) : "";
216
- const tmpDir = (0, import_node_path.join)(process.cwd(), ".hanzogui");
215
+ const configEntry = props.config ? (0, import_getGuiConfigPathFromOptionsConfig.getGuiConfigPathFromOptionsConfig)(props.config) : "";
216
+ const tmpDir = (0, import_node_path.join)(process.cwd(), ".gui");
217
217
  const configFormat = configEntry ? (0, import_detectModuleFormat.detectModuleFormat)(configEntry) : "cjs";
218
218
  const configExt = configFormat === "esm" ? ".mjs" : ".cjs";
219
- const configOutPath = (0, import_node_path.join)(tmpDir, `hanzogui.config${configExt}`);
219
+ const configOutPath = (0, import_node_path.join)(tmpDir, `gui.config${configExt}`);
220
220
  const baseComponents = (props.components || []).filter(x => x !== "@hanzogui/core");
221
221
  const componentFormats = baseComponents.map(mod => {
222
222
  try {
@@ -231,7 +231,7 @@ async function bundleConfig(props) {
231
231
  const ext = componentFormats[i] === "esm" ? ".mjs" : ".cjs";
232
232
  return (0, import_node_path.join)(tmpDir, `${componentModule.split(import_node_path.sep).join("-").replace(/[^a-z0-9]+/gi, "")}-components.config${ext}`);
233
233
  });
234
- if (process.env.NODE_ENV === "development" && process.env.DEBUG?.startsWith("hanzogui")) {
234
+ if (process.env.NODE_ENV === "development" && process.env.DEBUG?.startsWith("gui")) {
235
235
  console.info(`Building config entry`, configEntry);
236
236
  }
237
237
  let shouldBuild = !props.disableInitialBuild;
@@ -250,7 +250,7 @@ async function bundleConfig(props) {
250
250
  await FS.ensureDir(tmpDir);
251
251
  } catch {}
252
252
  const start = Date.now();
253
- await Promise.all([props.config ? (0, import_bundle.esbundleHanzoguiConfig)({
253
+ await Promise.all([props.config ? (0, import_bundle.esbundleGuiConfig)({
254
254
  entryPoints: [configEntry],
255
255
  external,
256
256
  outfile: configOutPath,
@@ -258,7 +258,7 @@ async function bundleConfig(props) {
258
258
  format: configFormat,
259
259
  ...esbuildExtraOptions
260
260
  }, props.platform || "web") : null, ...baseComponents.map((componentModule, i) => {
261
- return (0, import_bundle.esbundleHanzoguiConfig)({
261
+ return (0, import_bundle.esbundleGuiConfig)({
262
262
  entryPoints: [componentModule],
263
263
  resolvePlatformSpecificEntries: true,
264
264
  external,
@@ -271,8 +271,8 @@ async function bundleConfig(props) {
271
271
  if (!hasLoggedBuild && !props["_skipBuildLog"]) {
272
272
  hasLoggedBuild = true;
273
273
  (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, `
274
- \u27A1 [hanzogui] built config, components, prompt (${Date.now() - start}ms)`);
275
- if (process.env.DEBUG?.startsWith("hanzogui")) {
274
+ \u27A1 [gui] built config, components, prompt (${Date.now() - start}ms)`);
275
+ if (process.env.DEBUG?.startsWith("gui")) {
276
276
  (0, import_cli_color.colorLog)(import_cli_color.Color.Dim, `
277
277
  Config .${import_node_path.sep}${(0, import_node_path.relative)(process.cwd(), configOutPath)}
278
278
  Components ${componentOutPaths.map(p => `.${import_node_path.sep}${(0, import_node_path.relative)(process.cwd(), p)}`).join("\n ")}
@@ -306,17 +306,17 @@ async function bundleConfig(props) {
306
306
  throw new Error(`No config: ${config}`);
307
307
  }
308
308
  if (config._isProxyWorm) {
309
- throw new Error(`Got a proxied config - likely a module loading error. Set DEBUG=hanzogui for details.`);
309
+ throw new Error(`Got a proxied config - likely a module loading error. Set DEBUG=gui for details.`);
310
310
  }
311
311
  loadedConfig = config;
312
312
  if (!config.parsed) {
313
313
  const {
314
- createHanzogui
315
- } = (0, import_requireHanzoguiCore.requireHanzoguiCore)(props.platform || "web");
316
- config = createHanzogui(config);
314
+ createGui
315
+ } = (0, import_requireGuiCore.requireGuiCore)(props.platform || "web");
316
+ config = createGui(config);
317
317
  }
318
318
  if (props.outputCSS) {
319
- await writeHanzoguiCSS(props.outputCSS, config);
319
+ await writeGuiCSS(props.outputCSS, config);
320
320
  }
321
321
  let components = await loadComponents({
322
322
  ...props,
@@ -328,25 +328,25 @@ async function bundleConfig(props) {
328
328
  for (const component of components) {
329
329
  component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName;
330
330
  if (!component.moduleName) {
331
- if (process.env.DEBUG?.includes("hanzogui") || process.env.IS_TAMAGUI_DEV) {
331
+ if (process.env.DEBUG?.includes("gui") || process.env.IS_GUI_DEV) {
332
332
  console.warn(`\u26A0\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(baseComponents)} in ${JSON.stringify(componentOutPaths)}`);
333
333
  }
334
334
  }
335
335
  }
336
- if (process.env.NODE_ENV === "development" && process.env.DEBUG?.startsWith("hanzogui")) {
336
+ if (process.env.NODE_ENV === "development" && process.env.DEBUG?.startsWith("gui")) {
337
337
  console.info("Loaded components", components);
338
338
  }
339
339
  const res = {
340
340
  components,
341
341
  nameToPaths: {},
342
- hanzoguiConfig: config
342
+ guiConfig: config
343
343
  };
344
344
  currentBundle = res;
345
345
  updateLastLoaded(res);
346
346
  return res;
347
347
  } catch (err) {
348
- console.error(`Error bundling hanzogui config: ${err?.message} (run with DEBUG=hanzogui to see stack)`);
349
- if (process.env.DEBUG?.includes("hanzogui")) {
348
+ console.error(`Error bundling gui config: ${err?.message} (run with DEBUG=gui to see stack)`);
349
+ if (process.env.DEBUG?.includes("gui")) {
350
350
  console.error(err.stack);
351
351
  }
352
352
  } finally {
@@ -355,9 +355,9 @@ async function bundleConfig(props) {
355
355
  waitForBundle.clear();
356
356
  }
357
357
  }
358
- async function writeHanzoguiCSS(outputCSS, config) {
358
+ async function writeGuiCSS(outputCSS, config) {
359
359
  const flush = async () => {
360
- (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` \u27A1 [hanzogui] output css: ${outputCSS}`);
360
+ (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` \u27A1 [gui] output css: ${outputCSS}`);
361
361
  await FS.writeFile(outputCSS, css);
362
362
  };
363
363
  const css = config.getCSS();
@@ -447,7 +447,7 @@ async function loadComponentsInner(props, forceExports = false) {
447
447
  loader: import_bundle.esbuildLoaderConfig
448
448
  });
449
449
  }
450
- if (process.env.DEBUG === "hanzogui") {
450
+ if (process.env.DEBUG === "gui") {
451
451
  console.info(`loadModule`, loadModule, format);
452
452
  }
453
453
  let moduleResult;
@@ -480,7 +480,7 @@ async function loadComponentsInner(props, forceExports = false) {
480
480
  } catch (err) {
481
481
  console.info("babel err", err, writtenContents);
482
482
  writtenContents = fileContents;
483
- if (process.env.DEBUG?.startsWith("hanzogui")) {
483
+ if (process.env.DEBUG?.startsWith("gui")) {
484
484
  console.info(`Error parsing babel likely`, err);
485
485
  }
486
486
  try {
@@ -488,9 +488,9 @@ async function loadComponentsInner(props, forceExports = false) {
488
488
  forceExports: false
489
489
  });
490
490
  } catch (err2) {
491
- if (process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD) {
491
+ if (process.env.GUI_ENABLE_WARN_DYNAMIC_LOAD) {
492
492
  console.info(`
493
- Hanzogui attempted but failed to dynamically optimize components in:
493
+ Gui attempted but failed to dynamically optimize components in:
494
494
  ${name}
495
495
  `);
496
496
  console.info(err2);
@@ -513,7 +513,7 @@ isDynamic: `, isDynamic);
513
513
  cacheComponents[key] = results;
514
514
  return results;
515
515
  } catch (err) {
516
- console.info(`Hanzogui error bundling components`, err.message, err.stack);
516
+ console.info(`Gui error bundling components`, err.message, err.stack);
517
517
  return null;
518
518
  } finally {
519
519
  unregister();
@@ -568,7 +568,7 @@ function loadComponentsInnerSync(props, forceExports = false) {
568
568
  loader: import_bundle.esbuildLoaderConfig
569
569
  });
570
570
  }
571
- if (process.env.DEBUG === "hanzogui") {
571
+ if (process.env.DEBUG === "gui") {
572
572
  console.info(`loadModule`, loadModule, require.resolve(loadModule));
573
573
  }
574
574
  const moduleResult = require(loadModule);
@@ -596,7 +596,7 @@ function loadComponentsInnerSync(props, forceExports = false) {
596
596
  } catch (err) {
597
597
  console.info("babel err", err, writtenContents);
598
598
  writtenContents = fileContents;
599
- if (process.env.DEBUG?.startsWith("hanzogui")) {
599
+ if (process.env.DEBUG?.startsWith("gui")) {
600
600
  console.info(`Error parsing babel likely`, err);
601
601
  }
602
602
  } finally {
@@ -607,9 +607,9 @@ function loadComponentsInnerSync(props, forceExports = false) {
607
607
  forceExports: false
608
608
  });
609
609
  } catch (err) {
610
- if (process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD) {
610
+ if (process.env.GUI_ENABLE_WARN_DYNAMIC_LOAD) {
611
611
  console.info(`
612
- Hanzogui attempted but failed to dynamically optimize components in:
612
+ Gui attempted but failed to dynamically optimize components in:
613
613
  ${name}
614
614
  `);
615
615
  console.info(err);
@@ -626,7 +626,7 @@ isDynamic: `, isDynamic);
626
626
  cacheComponents[key] = info;
627
627
  return info;
628
628
  } catch (err) {
629
- console.info(`Hanzogui error bundling components`, err.message, err.stack);
629
+ console.info(`Gui error bundling components`, err.message, err.stack);
630
630
  return null;
631
631
  } finally {
632
632
  unregister();
@@ -651,7 +651,7 @@ function getComponentStaticConfigByName(name, exported) {
651
651
  throw new Error(`Invalid export from package ${name}: ${typeof exported}`);
652
652
  }
653
653
  for (const key in exported) {
654
- const found = getHanzoguiComponent(key, exported[key]);
654
+ const found = getGuiComponent(key, exported[key]);
655
655
  if (found) {
656
656
  const {
657
657
  Component,
@@ -663,14 +663,14 @@ function getComponentStaticConfigByName(name, exported) {
663
663
  }
664
664
  }
665
665
  } catch (err) {
666
- if (process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD) {
667
- console.error(`Hanzogui failed getting components from ${name} (Disable error by setting environment variable TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD=1)`);
666
+ if (process.env.GUI_ENABLE_WARN_DYNAMIC_LOAD) {
667
+ console.error(`Gui failed getting components from ${name} (Disable error by setting environment variable GUI_ENABLE_WARN_DYNAMIC_LOAD=1)`);
668
668
  console.error(err);
669
669
  }
670
670
  }
671
671
  return components;
672
672
  }
673
- function getHanzoguiComponent(name, Component) {
673
+ function getGuiComponent(name, Component) {
674
674
  if (name[0].toUpperCase() !== name[0]) {
675
675
  return;
676
676
  }