@hanzogui/static 3.0.5 → 4.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 (67) hide show
  1. package/dist/check-dep-versions.cjs +201 -96
  2. package/dist/checkDeps.cjs +163 -92
  3. package/dist/constants.cjs +32 -30
  4. package/dist/exports.cjs +15 -13
  5. package/dist/extractor/accessSafe.cjs +25 -23
  6. package/dist/extractor/babelParse.cjs +30 -28
  7. package/dist/extractor/buildClassName.cjs +59 -35
  8. package/dist/extractor/bundle.cjs +159 -104
  9. package/dist/extractor/bundleConfig.cjs +463 -263
  10. package/dist/extractor/concatClassName.cjs +41 -29
  11. package/dist/extractor/createEvaluator.cjs +54 -41
  12. package/dist/extractor/createExtractor.cjs +1338 -661
  13. package/dist/extractor/createLogger.cjs +30 -25
  14. package/dist/extractor/detectModuleFormat.cjs +22 -16
  15. package/dist/extractor/ensureImportingConcat.cjs +31 -25
  16. package/dist/extractor/errors.cjs +12 -10
  17. package/dist/extractor/esbuildAliasPlugin.cjs +28 -16
  18. package/dist/extractor/esbuildTsconfigPaths.cjs +58 -36
  19. package/dist/extractor/evaluateAstNode.cjs +104 -59
  20. package/dist/extractor/extractHelpers.cjs +130 -67
  21. package/dist/extractor/extractMediaStyle.cjs +110 -69
  22. package/dist/extractor/extractToClassNames.cjs +336 -230
  23. package/dist/extractor/extractToNative.cjs +244 -149
  24. package/dist/extractor/findTopmostFunction.cjs +22 -13
  25. package/dist/extractor/generatedUid.cjs +39 -28
  26. package/dist/extractor/getGuiConfigPathFromOptionsConfig.cjs +20 -14
  27. package/dist/extractor/getPrefixLogs.cjs +12 -10
  28. package/dist/extractor/getPropValueFromAttributes.cjs +52 -34
  29. package/dist/extractor/getSourceModule.cjs +73 -37
  30. package/dist/extractor/getStaticBindingsForScope.cjs +131 -68
  31. package/dist/extractor/hoistClassNames.cjs +46 -32
  32. package/dist/extractor/literalToAst.cjs +67 -42
  33. package/dist/extractor/loadFile.cjs +9 -3
  34. package/dist/extractor/loadGui.cjs +198 -109
  35. package/dist/extractor/logLines.cjs +27 -19
  36. package/dist/extractor/normalizeTernaries.cjs +66 -44
  37. package/dist/extractor/propsToFontFamilyCache.cjs +15 -11
  38. package/dist/extractor/regenerateConfig.cjs +109 -81
  39. package/dist/extractor/removeUnusedHooks.cjs +73 -41
  40. package/dist/extractor/timer.cjs +23 -14
  41. package/dist/extractor/validHTMLAttributes.cjs +61 -59
  42. package/dist/extractor/watchGuiConfig.cjs +35 -23
  43. package/dist/getPragmaOptions.cjs +34 -19
  44. package/dist/helpers/memoize.cjs +24 -16
  45. package/dist/helpers/requireGuiCore.cjs +22 -15
  46. package/dist/index.cjs +26 -24
  47. package/dist/registerRequire.cjs +132 -77
  48. package/dist/server.cjs +35 -28
  49. package/dist/types.cjs +7 -5
  50. package/dist/worker.cjs +62 -40
  51. package/package.json +15 -15
  52. package/src/checkDeps.ts +1 -1
  53. package/src/extractor/bundle.ts +1 -1
  54. package/src/extractor/bundleConfig.ts +5 -5
  55. package/src/extractor/createExtractor.ts +28 -13
  56. package/src/extractor/createLogger.ts +1 -3
  57. package/src/extractor/extractToNative.ts +35 -9
  58. package/src/extractor/loadGui.ts +4 -4
  59. package/src/extractor/regenerateConfig.ts +2 -2
  60. package/src/getPragmaOptions.ts +2 -2
  61. package/src/helpers/requireGuiCore.ts +6 -6
  62. package/src/registerRequire.ts +4 -4
  63. package/src/worker.ts +1 -1
  64. package/types/extractor/createExtractor.d.ts.map +1 -1
  65. package/types/extractor/createLogger.d.ts.map +1 -1
  66. package/types/extractor/extractToNative.d.ts.map +1 -1
  67. package/types/worker.d.ts +1 -1
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- };
17
+ }
18
+ return to;
19
+ };
18
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
21
+ value: true
20
22
  }), mod);
21
23
  var checkDeps_exports = {};
22
24
  __export(checkDeps_exports, {
@@ -24,10 +26,17 @@ __export(checkDeps_exports, {
24
26
  checkDeps: () => checkDeps
25
27
  });
26
28
  module.exports = __toCommonJS(checkDeps_exports);
27
- var import_node_fs = require("node:fs"),
28
- import_node_path = require("node:path"),
29
- import_check_dep_versions = require("./check-dep-versions.cjs"),
30
- DEPENDENCY_TYPE = /* @__PURE__ */(DEPENDENCY_TYPE2 => (DEPENDENCY_TYPE2.dependencies = "dependencies", DEPENDENCY_TYPE2.devDependencies = "devDependencies", DEPENDENCY_TYPE2.optionalDependencies = "optionalDependencies", DEPENDENCY_TYPE2.peerDependencies = "peerDependencies", DEPENDENCY_TYPE2.resolutions = "resolutions", DEPENDENCY_TYPE2))(DEPENDENCY_TYPE || {});
29
+ var import_node_fs = require("node:fs");
30
+ var import_node_path = require("node:path");
31
+ var import_check_dep_versions = require("./check-dep-versions.cjs");
32
+ var DEPENDENCY_TYPE = /* @__PURE__ */(DEPENDENCY_TYPE2 => {
33
+ DEPENDENCY_TYPE2["dependencies"] = "dependencies";
34
+ DEPENDENCY_TYPE2["devDependencies"] = "devDependencies";
35
+ DEPENDENCY_TYPE2["optionalDependencies"] = "optionalDependencies";
36
+ DEPENDENCY_TYPE2["peerDependencies"] = "peerDependencies";
37
+ DEPENDENCY_TYPE2["resolutions"] = "resolutions";
38
+ return DEPENDENCY_TYPE2;
39
+ })(DEPENDENCY_TYPE || {});
31
40
  const CRITICAL_PACKAGES = ["@hanzogui/web", "@hanzogui/core", "@hanzo/gui"];
32
41
  function checkDuplicateInstalls(root) {
33
42
  const nodeModules = (0, import_node_path.join)(root, "node_modules");
@@ -36,15 +45,22 @@ function checkDuplicateInstalls(root) {
36
45
  for (const pkg of CRITICAL_PACKAGES) {
37
46
  const locations = findAllInstances(nodeModules, pkg);
38
47
  if (locations.length > 1) {
39
- const realPaths = /* @__PURE__ */new Set(),
40
- distinctLocations = [];
41
- for (const loc of locations) try {
42
- const real = (0, import_node_fs.realpathSync)(loc);
43
- realPaths.has(real) || (realPaths.add(real), distinctLocations.push((0, import_node_path.relative)(root, loc)));
44
- } catch {
45
- distinctLocations.push((0, import_node_path.relative)(root, loc));
48
+ const realPaths = /* @__PURE__ */new Set();
49
+ const distinctLocations = [];
50
+ for (const loc of locations) {
51
+ try {
52
+ const real = (0, import_node_fs.realpathSync)(loc);
53
+ if (!realPaths.has(real)) {
54
+ realPaths.add(real);
55
+ distinctLocations.push((0, import_node_path.relative)(root, loc));
56
+ }
57
+ } catch {
58
+ distinctLocations.push((0, import_node_path.relative)(root, loc));
59
+ }
60
+ }
61
+ if (distinctLocations.length > 1) {
62
+ duplicates.set(pkg, distinctLocations);
46
63
  }
47
- distinctLocations.length > 1 && duplicates.set(pkg, distinctLocations);
48
64
  }
49
65
  }
50
66
  if (duplicates.size === 0) return "";
@@ -61,48 +77,68 @@ function checkDuplicateInstalls(root) {
61
77
  }
62
78
  lines.push("");
63
79
  }
64
- return lines.push("Fix: run your package manager's dedupe command:"), lines.push(" bun install (bun auto-dedupes)"), lines.push(" npx yarn-deduplicate && yarn install"), lines.push(" npm dedupe"), lines.push(""), lines.push("If that doesn't help, delete node_modules and lockfile, then reinstall."), lines.join(`
65
- `);
80
+ lines.push("Fix: run your package manager's dedupe command:");
81
+ lines.push(" bun install (bun auto-dedupes)");
82
+ lines.push(" npx yarn-deduplicate && yarn install");
83
+ lines.push(" npm dedupe");
84
+ lines.push("");
85
+ lines.push("If that doesn't help, delete node_modules and lockfile, then reinstall.");
86
+ return lines.join("\n");
66
87
  }
67
88
  function findAllInstances(nodeModulesDir, packageName, found = [], depth = 0) {
68
89
  if (depth > 4 || !(0, import_node_fs.existsSync)(nodeModulesDir)) return found;
69
90
  const pkgDir = (0, import_node_path.join)(nodeModulesDir, ...packageName.split("/"));
70
- (0, import_node_fs.existsSync)((0, import_node_path.join)(pkgDir, "package.json")) && found.push(pkgDir);
91
+ if ((0, import_node_fs.existsSync)((0, import_node_path.join)(pkgDir, "package.json"))) {
92
+ found.push(pkgDir);
93
+ }
71
94
  try {
72
95
  const entries = (0, import_node_fs.readdirSync)(nodeModulesDir);
73
- for (const entry of entries) if (!entry.startsWith(".")) if (entry.startsWith("@")) {
74
- const scopeDir = (0, import_node_path.join)(nodeModulesDir, entry);
75
- try {
76
- const scopeEntries = (0, import_node_fs.readdirSync)(scopeDir);
77
- for (const scopeEntry of scopeEntries) {
78
- const nested = (0, import_node_path.join)(scopeDir, scopeEntry, "node_modules");
79
- (0, import_node_fs.existsSync)(nested) && findAllInstances(nested, packageName, found, depth + 1);
96
+ for (const entry of entries) {
97
+ if (entry.startsWith(".")) continue;
98
+ if (entry.startsWith("@")) {
99
+ const scopeDir = (0, import_node_path.join)(nodeModulesDir, entry);
100
+ try {
101
+ const scopeEntries = (0, import_node_fs.readdirSync)(scopeDir);
102
+ for (const scopeEntry of scopeEntries) {
103
+ const nested = (0, import_node_path.join)(scopeDir, scopeEntry, "node_modules");
104
+ if ((0, import_node_fs.existsSync)(nested)) {
105
+ findAllInstances(nested, packageName, found, depth + 1);
106
+ }
107
+ }
108
+ } catch {}
109
+ } else {
110
+ const nested = (0, import_node_path.join)(nodeModulesDir, entry, "node_modules");
111
+ if ((0, import_node_fs.existsSync)(nested)) {
112
+ findAllInstances(nested, packageName, found, depth + 1);
80
113
  }
81
- } catch {}
82
- } else {
83
- const nested = (0, import_node_path.join)(nodeModulesDir, entry, "node_modules");
84
- (0, import_node_fs.existsSync)(nested) && findAllInstances(nested, packageName, found, depth + 1);
114
+ }
85
115
  }
86
116
  } catch {}
87
117
  return found;
88
118
  }
89
119
  function checkLockfileDuplicates(root) {
90
- const bunLock = (0, import_node_path.join)(root, "bun.lock"),
91
- yarnLock = (0, import_node_path.join)(root, "yarn.lock"),
92
- npmLock = (0, import_node_path.join)(root, "package-lock.json");
93
- return (0, import_node_fs.existsSync)(bunLock) ? checkBunLockDuplicates(bunLock) : (0, import_node_fs.existsSync)(yarnLock) ? checkYarnLockDuplicates(yarnLock) : (0, import_node_fs.existsSync)(npmLock) ? checkNpmLockDuplicates(npmLock) : "";
120
+ const bunLock = (0, import_node_path.join)(root, "bun.lock");
121
+ const yarnLock = (0, import_node_path.join)(root, "yarn.lock");
122
+ const npmLock = (0, import_node_path.join)(root, "package-lock.json");
123
+ if ((0, import_node_fs.existsSync)(bunLock)) return checkBunLockDuplicates(bunLock);
124
+ if ((0, import_node_fs.existsSync)(yarnLock)) return checkYarnLockDuplicates(yarnLock);
125
+ if ((0, import_node_fs.existsSync)(npmLock)) return checkNpmLockDuplicates(npmLock);
126
+ return "";
94
127
  }
95
128
  function checkBunLockDuplicates(lockPath) {
96
129
  try {
97
- const content = (0, import_node_fs.readFileSync)(lockPath, "utf8"),
98
- duplicates = /* @__PURE__ */new Map(),
99
- criticalSet = new Set(CRITICAL_PACKAGES),
100
- packagePattern = /["'](@gui\/[\w-]+|gui)@([^"'\s,]+)["']/g;
130
+ const content = (0, import_node_fs.readFileSync)(lockPath, "utf8");
131
+ const duplicates = /* @__PURE__ */new Map();
132
+ const criticalSet = new Set(CRITICAL_PACKAGES);
133
+ const packagePattern = /["'](@gui\/[\w-]+|gui)@([^"'\s,]+)["']/g;
101
134
  let match;
102
- for (; (match = packagePattern.exec(content)) !== null;) {
103
- const name = match[1],
104
- version = match[2];
105
- version.startsWith("workspace:") || criticalSet.has(name) && (duplicates.has(name) || duplicates.set(name, /* @__PURE__ */new Set()), duplicates.get(name).add(version));
135
+ while ((match = packagePattern.exec(content)) !== null) {
136
+ const name = match[1];
137
+ const version = match[2];
138
+ if (version.startsWith("workspace:")) continue;
139
+ if (!criticalSet.has(name)) continue;
140
+ if (!duplicates.has(name)) duplicates.set(name, /* @__PURE__ */new Set());
141
+ duplicates.get(name).add(version);
106
142
  }
107
143
  return formatLockfileDuplicates(duplicates, "bun.lock");
108
144
  } catch {
@@ -111,18 +147,21 @@ function checkBunLockDuplicates(lockPath) {
111
147
  }
112
148
  function checkYarnLockDuplicates(lockPath) {
113
149
  try {
114
- const content = (0, import_node_fs.readFileSync)(lockPath, "utf8"),
115
- duplicates = /* @__PURE__ */new Map(),
116
- criticalSet = new Set(CRITICAL_PACKAGES),
117
- entryPattern = /^"?(@gui\/[\w-]+|gui)@[^":\n]+[":]?\s*$/gm,
118
- versionPattern = /^\s+version\s+"([^"]+)"/gm;
150
+ const content = (0, import_node_fs.readFileSync)(lockPath, "utf8");
151
+ const duplicates = /* @__PURE__ */new Map();
152
+ const criticalSet = new Set(CRITICAL_PACKAGES);
153
+ const entryPattern = /^"?(@gui\/[\w-]+|gui)@[^":\n]+[":]?\s*$/gm;
154
+ const versionPattern = /^\s+version\s+"([^"]+)"/gm;
119
155
  let entryMatch;
120
- for (; (entryMatch = entryPattern.exec(content)) !== null;) {
156
+ while ((entryMatch = entryPattern.exec(content)) !== null) {
121
157
  const name = entryMatch[1];
122
158
  if (!criticalSet.has(name)) continue;
123
159
  versionPattern.lastIndex = entryMatch.index;
124
160
  const verMatch = versionPattern.exec(content);
125
- verMatch && (duplicates.has(name) || duplicates.set(name, /* @__PURE__ */new Set()), duplicates.get(name).add(verMatch[1]));
161
+ if (verMatch) {
162
+ if (!duplicates.has(name)) duplicates.set(name, /* @__PURE__ */new Set());
163
+ duplicates.get(name).add(verMatch[1]);
164
+ }
126
165
  }
127
166
  return formatLockfileDuplicates(duplicates, "yarn.lock");
128
167
  } catch {
@@ -131,16 +170,20 @@ function checkYarnLockDuplicates(lockPath) {
131
170
  }
132
171
  function checkNpmLockDuplicates(lockPath) {
133
172
  try {
134
- const lock = JSON.parse((0, import_node_fs.readFileSync)(lockPath, "utf8")),
135
- duplicates = /* @__PURE__ */new Map(),
136
- criticalSet = new Set(CRITICAL_PACKAGES),
137
- packages = lock.packages || {};
173
+ const lock = JSON.parse((0, import_node_fs.readFileSync)(lockPath, "utf8"));
174
+ const duplicates = /* @__PURE__ */new Map();
175
+ const criticalSet = new Set(CRITICAL_PACKAGES);
176
+ const packages = lock.packages || {};
138
177
  for (const [path, info] of Object.entries(packages)) {
139
178
  if (!path) continue;
140
179
  const name = info.name || path.split("node_modules/").pop();
141
- if (!name || !criticalSet.has(name)) continue;
180
+ if (!name) continue;
181
+ if (!criticalSet.has(name)) continue;
142
182
  const version = info.version;
143
- version && (duplicates.has(name) || duplicates.set(name, /* @__PURE__ */new Set()), duplicates.get(name).add(version));
183
+ if (version) {
184
+ if (!duplicates.has(name)) duplicates.set(name, /* @__PURE__ */new Set());
185
+ duplicates.get(name).add(version);
186
+ }
144
187
  }
145
188
  return formatLockfileDuplicates(duplicates, "package-lock.json");
146
189
  } catch {
@@ -149,52 +192,80 @@ function checkNpmLockDuplicates(lockPath) {
149
192
  }
150
193
  function formatLockfileDuplicates(duplicates, lockfileName) {
151
194
  const multiVersion = /* @__PURE__ */new Map();
152
- for (const [name, versions] of duplicates) versions.size > 1 && multiVersion.set(name, [...versions].sort());
195
+ for (const [name, versions] of duplicates) {
196
+ if (versions.size > 1) {
197
+ multiVersion.set(name, [...versions].sort());
198
+ }
199
+ }
153
200
  if (multiVersion.size === 0) return "";
154
201
  const lines = [`Found multiple resolved versions in ${lockfileName}:`, ""];
155
- for (const [name, versions] of multiVersion) lines.push(` ${name}: ${versions.join(", ")}`);
156
- return lines.push(""), lines.push("Multiple versions cause duplicate runtime instances, breaking config/theme detection."), lines.push("Fix: ensure all hanzo-gui packages use the same version range, then dedupe."), lines.join(`
157
- `);
202
+ for (const [name, versions] of multiVersion) {
203
+ lines.push(` ${name}: ${versions.join(", ")}`);
204
+ }
205
+ lines.push("");
206
+ lines.push("Multiple versions cause duplicate runtime instances, breaking config/theme detection.");
207
+ lines.push("Fix: ensure all hanzo-gui packages use the same version range, then dedupe.");
208
+ return lines.join("\n");
158
209
  }
159
210
  function checkConfigExists(root) {
160
- const configNames = ["gui.config.ts", "gui.config.tsx", "gui.config.js", "gui.config.mjs", "gui.config.cjs"],
161
- searchDirs = [root, (0, import_node_path.join)(root, "src"), (0, import_node_path.join)(root, "app"), (0, import_node_path.join)(root, "config")];
162
- for (const dir of searchDirs) for (const name of configNames) if ((0, import_node_fs.existsSync)((0, import_node_path.join)(dir, name))) return "";
211
+ const configNames = ["gui.config.ts", "gui.config.tsx", "gui.config.js", "gui.config.mjs", "gui.config.cjs"];
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
+ for (const dir of searchDirs) {
214
+ for (const name of configNames) {
215
+ if ((0, import_node_fs.existsSync)((0, import_node_path.join)(dir, name))) {
216
+ return "";
217
+ }
218
+ }
219
+ }
163
220
  const buildConfigNames = ["gui.build.ts", "gui.build.js", "gui.build.mjs", "gui.build.cjs"];
164
221
  for (const name of buildConfigNames) {
165
222
  const buildPath = (0, import_node_path.join)(root, name);
166
- if ((0, import_node_fs.existsSync)(buildPath)) try {
167
- const match = (0, import_node_fs.readFileSync)(buildPath, "utf8").match(/config\s*:\s*['"`]([^'"`]+)['"`]/);
168
- if (match) {
169
- const configPath = (0, import_node_path.join)(root, match[1]);
223
+ if ((0, import_node_fs.existsSync)(buildPath)) {
224
+ try {
225
+ const content = (0, import_node_fs.readFileSync)(buildPath, "utf8");
226
+ const match = content.match(/config\s*:\s*['"`]([^'"`]+)['"`]/);
227
+ if (match) {
228
+ const configPath = (0, import_node_path.join)(root, match[1]);
229
+ if ((0, import_node_fs.existsSync)(configPath)) return "";
230
+ }
231
+ } catch {}
232
+ }
233
+ }
234
+ const pkgJsonPath = (0, import_node_path.join)(root, "package.json");
235
+ if ((0, import_node_fs.existsSync)(pkgJsonPath)) {
236
+ try {
237
+ const pkg = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf8"));
238
+ if (pkg.gui?.config) {
239
+ const configPath = (0, import_node_path.join)(root, pkg.gui.config);
170
240
  if ((0, import_node_fs.existsSync)(configPath)) return "";
171
241
  }
172
242
  } catch {}
173
243
  }
174
- const pkgJsonPath = (0, import_node_path.join)(root, "package.json");
175
- if ((0, import_node_fs.existsSync)(pkgJsonPath)) try {
176
- const pkg = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf8"));
177
- if (pkg.gui?.config) {
178
- const configPath = (0, import_node_path.join)(root, pkg.gui.config);
179
- if ((0, import_node_fs.existsSync)(configPath)) return "";
180
- }
181
- } catch {}
182
- if ((0, import_node_fs.existsSync)(pkgJsonPath)) try {
183
- if (JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf8")).workspaces) return "";
184
- } catch {}
185
- 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 Hanzo GUI configuration" at runtime.`, "", "See: https://gui.hanzo.ai/docs/core/configuration"].join(`
186
- `);
244
+ if ((0, import_node_fs.existsSync)(pkgJsonPath)) {
245
+ try {
246
+ const pkg = JSON.parse((0, import_node_fs.readFileSync)(pkgJsonPath, "utf8"));
247
+ if (pkg.workspaces) return "";
248
+ } catch {}
249
+ }
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.hanzo.ai/docs/core/configuration"].join("\n");
187
251
  }
188
252
  async function checkDeps(root) {
189
- const issues = [],
190
- workspaceMismatchSummary = new import_check_dep_versions.CDVC(root).toMismatchSummary();
191
- workspaceMismatchSummary && issues.push(workspaceMismatchSummary);
253
+ const issues = [];
254
+ const workspaceMismatchSummary = new import_check_dep_versions.CDVC(root).toMismatchSummary();
255
+ if (workspaceMismatchSummary) issues.push(workspaceMismatchSummary);
192
256
  const lockfileSummary = checkLockfileDuplicates(root);
193
- lockfileSummary && issues.push(lockfileSummary);
257
+ if (lockfileSummary) issues.push(lockfileSummary);
194
258
  const duplicatesSummary = checkDuplicateInstalls(root);
195
- duplicatesSummary && issues.push(duplicatesSummary);
259
+ if (duplicatesSummary) issues.push(duplicatesSummary);
196
260
  const configSummary = checkConfigExists(root);
197
- configSummary && issues.push(configSummary), issues.length === 0 && (console.info("Gui dependencies look good \u2705"), process.exit(0));
198
- for (let i = 0; i < issues.length; i++) i > 0 && console.error(""), console.error(issues[i]);
261
+ if (configSummary) issues.push(configSummary);
262
+ if (issues.length === 0) {
263
+ console.info(`Gui dependencies look good \u2705`);
264
+ process.exit(0);
265
+ }
266
+ for (let i = 0; i < issues.length; i++) {
267
+ if (i > 0) console.error("");
268
+ console.error(issues[i]);
269
+ }
199
270
  process.exit(1);
200
271
  }
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var constants_exports = {};
33
35
  __export(constants_exports, {
34
36
  CSS_FILE_NAME: () => CSS_FILE_NAME,
@@ -39,11 +41,11 @@ __export(constants_exports, {
39
41
  });
40
42
  module.exports = __toCommonJS(constants_exports);
41
43
  var import_find_cache_dir = __toESM(require("find-cache-dir"));
42
- const CSS_FILE_NAME = "__snack.css",
43
- MEDIA_SEP = "_",
44
- cacheDir = (0, import_find_cache_dir.default)({
45
- name: "hanzo-gui",
46
- create: !0
47
- }),
48
- FAILED_EVAL = /* @__PURE__ */Symbol("failed_style_eval"),
49
- SHOULD_DEBUG = process.env.DEBUG === "*" || process.env.DEBUG?.startsWith("@hanzo/gui");
44
+ const CSS_FILE_NAME = "__snack.css";
45
+ const MEDIA_SEP = "_";
46
+ const cacheDir = (0, import_find_cache_dir.default)({
47
+ name: "hanzo-gui",
48
+ create: true
49
+ });
50
+ const FAILED_EVAL = /* @__PURE__ */Symbol("failed_style_eval");
51
+ const SHOULD_DEBUG = process.env.DEBUG === "*" || process.env.DEBUG?.startsWith("@hanzo/gui");
package/dist/exports.cjs CHANGED
@@ -3,21 +3,23 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
14
  get: () => from[key],
14
15
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
16
  });
16
- return to;
17
- },
18
- __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ }
18
+ return to;
19
+ };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
21
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
20
- value: !0
22
+ value: true
21
23
  }), mod);
22
24
  var exports_exports = {};
23
25
  __export(exports_exports, {
@@ -29,8 +31,8 @@ __export(exports_exports, {
29
31
  module.exports = __toCommonJS(exports_exports);
30
32
  __reExport(exports_exports, require("./checkDeps.cjs"), module.exports);
31
33
  __reExport(exports_exports, require("./types.cjs"), module.exports);
32
- var import_createExtractor = require("./extractor/createExtractor.cjs"),
33
- import_literalToAst = require("./extractor/literalToAst.cjs");
34
+ var import_createExtractor = require("./extractor/createExtractor.cjs");
35
+ var import_literalToAst = require("./extractor/literalToAst.cjs");
34
36
  __reExport(exports_exports, require("./constants.cjs"), module.exports);
35
37
  __reExport(exports_exports, require("./extractor/extractToClassNames.cjs"), module.exports);
36
38
  __reExport(exports_exports, require("./extractor/concatClassName.cjs"), module.exports);
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var accessSafe_exports = {};
33
35
  __export(accessSafe_exports, {
34
36
  accessSafe: () => accessSafe
@@ -42,5 +44,5 @@ function accessSafe(obj, member) {
42
44
  // obj !== null
43
45
  t.binaryExpression("!==", obj, t.nullLiteral())),
44
46
  // obj.member
45
- t.memberExpression(obj, t.identifier(member), !1));
47
+ t.memberExpression(obj, t.identifier(member), false));
46
48
  }
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var babelParse_exports = {};
33
35
  __export(babelParse_exports, {
34
36
  babelParse: () => babelParse,
@@ -36,12 +38,12 @@ __export(babelParse_exports, {
36
38
  });
37
39
  module.exports = __toCommonJS(babelParse_exports);
38
40
  var babelParser = __toESM(require("@babel/parser"));
39
- const plugins = ["asyncGenerators", "classProperties", "dynamicImport", "functionBind", "jsx", "numericSeparator", "objectRestSpread", "optionalCatchBinding", "decorators-legacy", "typescript", "optionalChaining", "nullishCoalescingOperator"],
40
- parserOptions = Object.freeze({
41
- plugins,
42
- sourceType: "module"
43
- }),
44
- parser = babelParser.parse.bind(babelParser);
41
+ const plugins = ["asyncGenerators", "classProperties", "dynamicImport", "functionBind", "jsx", "numericSeparator", "objectRestSpread", "optionalCatchBinding", "decorators-legacy", "typescript", "optionalChaining", "nullishCoalescingOperator"];
42
+ const parserOptions = Object.freeze({
43
+ plugins,
44
+ sourceType: "module"
45
+ });
46
+ const parser = babelParser.parse.bind(babelParser);
45
47
  function babelParse(code, fileName) {
46
48
  const codeString = code.toString();
47
49
  try {