@hanzogui/static 3.0.6 → 4.4.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.
- package/dist/check-dep-versions.cjs +201 -96
- package/dist/checkDeps.cjs +163 -92
- package/dist/constants.cjs +32 -30
- package/dist/exports.cjs +15 -13
- package/dist/extractor/accessSafe.cjs +25 -23
- package/dist/extractor/babelParse.cjs +30 -28
- package/dist/extractor/buildClassName.cjs +59 -35
- package/dist/extractor/bundle.cjs +163 -105
- package/dist/extractor/bundleConfig.cjs +467 -264
- package/dist/extractor/concatClassName.cjs +41 -29
- package/dist/extractor/createEvaluator.cjs +54 -41
- package/dist/extractor/createExtractor.cjs +1338 -661
- package/dist/extractor/createLogger.cjs +30 -25
- package/dist/extractor/detectModuleFormat.cjs +22 -16
- package/dist/extractor/ensureImportingConcat.cjs +31 -25
- package/dist/extractor/errors.cjs +12 -10
- package/dist/extractor/esbuildAliasPlugin.cjs +28 -16
- package/dist/extractor/esbuildTsconfigPaths.cjs +58 -36
- package/dist/extractor/evaluateAstNode.cjs +104 -59
- package/dist/extractor/extractHelpers.cjs +130 -67
- package/dist/extractor/extractMediaStyle.cjs +110 -69
- package/dist/extractor/extractToClassNames.cjs +336 -230
- package/dist/extractor/extractToNative.cjs +244 -149
- package/dist/extractor/findTopmostFunction.cjs +22 -13
- package/dist/extractor/generatedUid.cjs +39 -28
- package/dist/extractor/getGuiConfigPathFromOptionsConfig.cjs +20 -14
- package/dist/extractor/getPrefixLogs.cjs +12 -10
- package/dist/extractor/getPropValueFromAttributes.cjs +52 -34
- package/dist/extractor/getSourceModule.cjs +73 -37
- package/dist/extractor/getStaticBindingsForScope.cjs +131 -68
- package/dist/extractor/hasTopLevelAwait.cjs +62 -0
- package/dist/extractor/hoistClassNames.cjs +46 -32
- package/dist/extractor/literalToAst.cjs +67 -42
- package/dist/extractor/loadFile.cjs +9 -3
- package/dist/extractor/loadGui.cjs +198 -109
- package/dist/extractor/logLines.cjs +27 -19
- package/dist/extractor/normalizeTernaries.cjs +66 -44
- package/dist/extractor/propsToFontFamilyCache.cjs +15 -11
- package/dist/extractor/regenerateConfig.cjs +109 -81
- package/dist/extractor/removeUnusedHooks.cjs +73 -41
- package/dist/extractor/timer.cjs +23 -14
- package/dist/extractor/validHTMLAttributes.cjs +61 -59
- package/dist/extractor/watchGuiConfig.cjs +35 -23
- package/dist/getPragmaOptions.cjs +34 -19
- package/dist/helpers/memoize.cjs +24 -16
- package/dist/helpers/requireGuiCore.cjs +22 -15
- package/dist/index.cjs +26 -24
- package/dist/registerRequire.cjs +170 -77
- package/dist/server.cjs +35 -28
- package/dist/types.cjs +7 -5
- package/dist/worker.cjs +62 -40
- package/package.json +15 -15
- package/src/checkDeps.ts +1 -1
- package/src/extractor/babelParse.ts +1 -0
- package/src/extractor/bundle.ts +6 -6
- package/src/extractor/bundleConfig.ts +10 -10
- package/src/extractor/createExtractor.ts +28 -13
- package/src/extractor/createLogger.ts +1 -3
- package/src/extractor/extractToNative.ts +35 -9
- package/src/extractor/hasTopLevelAwait.ts +28 -0
- package/src/extractor/loadGui.ts +4 -4
- package/src/extractor/regenerateConfig.ts +2 -2
- package/src/getPragmaOptions.ts +2 -2
- package/src/helpers/requireGuiCore.ts +6 -6
- package/src/registerRequire.ts +52 -5
- package/src/worker.ts +1 -1
- package/types/extractor/babelParse.d.ts.map +1 -1
- package/types/extractor/bundle.d.ts.map +1 -1
- package/types/extractor/bundleConfig.d.ts.map +1 -1
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/createLogger.d.ts.map +1 -1
- package/types/extractor/extractToNative.d.ts.map +1 -1
- package/types/extractor/hasTopLevelAwait.d.ts +2 -0
- package/types/extractor/hasTopLevelAwait.d.ts.map +1 -0
- package/types/registerRequire.d.ts.map +1 -1
- package/types/worker.d.ts +1 -1
package/dist/checkDeps.cjs
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
41
|
-
for (const loc of locations)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
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"))
|
|
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)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
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
|
-
}
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
103
|
-
const name = match[1]
|
|
104
|
-
|
|
105
|
-
version.startsWith("workspace:")
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
|
180
|
+
if (!name) continue;
|
|
181
|
+
if (!criticalSet.has(name)) continue;
|
|
142
182
|
const version = info.version;
|
|
143
|
-
|
|
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)
|
|
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)
|
|
156
|
-
|
|
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
|
-
|
|
162
|
-
for (const dir of searchDirs)
|
|
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))
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
191
|
-
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
|
|
257
|
+
if (lockfileSummary) issues.push(lockfileSummary);
|
|
194
258
|
const duplicatesSummary = checkDuplicateInstalls(root);
|
|
195
|
-
duplicatesSummary
|
|
259
|
+
if (duplicatesSummary) issues.push(duplicatesSummary);
|
|
196
260
|
const configSummary = checkConfigExists(root);
|
|
197
|
-
|
|
198
|
-
|
|
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
|
}
|
package/dist/constants.cjs
CHANGED
|
@@ -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
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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),
|
|
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
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
const plugins = ["asyncGenerators", "classProperties", "dynamicImport", "functionBind", "jsx", "numericSeparator", "objectRestSpread", "optionalCatchBinding", "decorators-legacy", "typescript", "optionalChaining", "nullishCoalescingOperator", "topLevelAwait"];
|
|
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 {
|