uilint 0.2.27 → 0.2.29
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/index.js
CHANGED
|
@@ -3641,7 +3641,7 @@ program.command("update").description("Update existing style guide with new styl
|
|
|
3641
3641
|
});
|
|
3642
3642
|
});
|
|
3643
3643
|
program.command("install").description("Install UILint integration").option("--force", "Overwrite existing configuration files").action(async (options) => {
|
|
3644
|
-
const { installUI } = await import("./install-ui-
|
|
3644
|
+
const { installUI } = await import("./install-ui-GZBZK2XI.js");
|
|
3645
3645
|
await installUI({ force: options.force });
|
|
3646
3646
|
});
|
|
3647
3647
|
program.command("serve").description("Start WebSocket server for real-time UI linting").option("-p, --port <number>", "Port to listen on", "9234").action(async (options) => {
|
|
@@ -1037,6 +1037,20 @@ function buildGlobalConfigItems(selections) {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
return items;
|
|
1039
1039
|
}
|
|
1040
|
+
var MIN_NODE_MAJOR = 20;
|
|
1041
|
+
var MIN_NODE_MINOR = 19;
|
|
1042
|
+
function checkNodeVersion() {
|
|
1043
|
+
const ver = process.versions.node || "";
|
|
1044
|
+
const parts = ver.split(".");
|
|
1045
|
+
const major = Number.parseInt(parts[0] || "", 10);
|
|
1046
|
+
const minor = Number.parseInt(parts[1] || "", 10);
|
|
1047
|
+
const meetsRequirement = Number.isFinite(major) && Number.isFinite(minor) && (major > MIN_NODE_MAJOR || major === MIN_NODE_MAJOR && minor >= MIN_NODE_MINOR);
|
|
1048
|
+
return {
|
|
1049
|
+
ok: meetsRequirement,
|
|
1050
|
+
current: ver,
|
|
1051
|
+
required: `${MIN_NODE_MAJOR}.${MIN_NODE_MINOR}.0`
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1040
1054
|
function Header({ subtitle }) {
|
|
1041
1055
|
return /* @__PURE__ */ jsx6(Box5, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs5(Box5, { children: [
|
|
1042
1056
|
/* @__PURE__ */ jsx6(Text6, { bold: true, color: "cyan", children: "\u25C6 UILint" }),
|
|
@@ -1093,7 +1107,8 @@ function InstallApp({
|
|
|
1093
1107
|
onError
|
|
1094
1108
|
}) {
|
|
1095
1109
|
const { exit } = useApp5();
|
|
1096
|
-
const [phase, setPhase] = useState6("
|
|
1110
|
+
const [phase, setPhase] = useState6("checking-requirements");
|
|
1111
|
+
const [nodeVersionCheck, setNodeVersionCheck] = useState6(null);
|
|
1097
1112
|
const [project, setProject] = useState6(null);
|
|
1098
1113
|
const [detectedProjects, setDetectedProjects] = useState6([]);
|
|
1099
1114
|
const [selectedProject, setSelectedProject] = useState6(null);
|
|
@@ -1106,6 +1121,24 @@ function InstallApp({
|
|
|
1106
1121
|
const [selectedInjectionPoint, setSelectedInjectionPoint] = useState6(void 0);
|
|
1107
1122
|
const isEslintSelected = selectedFeatureIds.some((id) => id.startsWith("eslint:"));
|
|
1108
1123
|
const isNextSelected = selectedFeatureIds.some((id) => id.startsWith("next:"));
|
|
1124
|
+
useEffect2(() => {
|
|
1125
|
+
if (phase !== "checking-requirements") return;
|
|
1126
|
+
const timer = setTimeout(() => {
|
|
1127
|
+
const result = checkNodeVersion();
|
|
1128
|
+
setNodeVersionCheck(result);
|
|
1129
|
+
if (result.ok) {
|
|
1130
|
+
setPhase("scanning");
|
|
1131
|
+
} else {
|
|
1132
|
+
setError(
|
|
1133
|
+
new Error(
|
|
1134
|
+
`Node.js v${result.required}+ is required. You are running v${result.current}.`
|
|
1135
|
+
)
|
|
1136
|
+
);
|
|
1137
|
+
setPhase("error");
|
|
1138
|
+
}
|
|
1139
|
+
}, 300);
|
|
1140
|
+
return () => clearTimeout(timer);
|
|
1141
|
+
}, [phase]);
|
|
1109
1142
|
useEffect2(() => {
|
|
1110
1143
|
if (phase !== "scanning") return;
|
|
1111
1144
|
projectPromise.then((proj) => {
|
|
@@ -1243,6 +1276,15 @@ function InstallApp({
|
|
|
1243
1276
|
const handleCancel = () => {
|
|
1244
1277
|
exit();
|
|
1245
1278
|
};
|
|
1279
|
+
if (phase === "checking-requirements") {
|
|
1280
|
+
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
1281
|
+
/* @__PURE__ */ jsx6(Header, { subtitle: "Install" }),
|
|
1282
|
+
/* @__PURE__ */ jsxs5(Box5, { children: [
|
|
1283
|
+
/* @__PURE__ */ jsx6(Spinner, {}),
|
|
1284
|
+
/* @__PURE__ */ jsx6(Text6, { children: " Checking requirements..." })
|
|
1285
|
+
] })
|
|
1286
|
+
] });
|
|
1287
|
+
}
|
|
1246
1288
|
if (phase === "scanning") {
|
|
1247
1289
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
|
|
1248
1290
|
/* @__PURE__ */ jsx6(Header, { subtitle: "Install" }),
|
|
@@ -4711,4 +4753,4 @@ ${pc.blue("Running tests with coverage...")}`);
|
|
|
4711
4753
|
export {
|
|
4712
4754
|
installUI
|
|
4713
4755
|
};
|
|
4714
|
-
//# sourceMappingURL=install-ui-
|
|
4756
|
+
//# sourceMappingURL=install-ui-GZBZK2XI.js.map
|