uilint 0.2.27 → 0.2.28

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-CCZ3XJDE.js");
3644
+ const { installUI } = await import("./install-ui-RGTAARNC.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,17 @@ function buildGlobalConfigItems(selections) {
1037
1037
  }
1038
1038
  return items;
1039
1039
  }
1040
+ var MIN_NODE_VERSION = 20;
1041
+ function checkNodeVersion() {
1042
+ const ver = process.versions.node || "";
1043
+ const majorStr = ver.split(".")[0] || "";
1044
+ const major = Number.parseInt(majorStr, 10);
1045
+ return {
1046
+ ok: Number.isFinite(major) && major >= MIN_NODE_VERSION,
1047
+ current: ver,
1048
+ required: MIN_NODE_VERSION
1049
+ };
1050
+ }
1040
1051
  function Header({ subtitle }) {
1041
1052
  return /* @__PURE__ */ jsx6(Box5, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs5(Box5, { children: [
1042
1053
  /* @__PURE__ */ jsx6(Text6, { bold: true, color: "cyan", children: "\u25C6 UILint" }),
@@ -1093,7 +1104,8 @@ function InstallApp({
1093
1104
  onError
1094
1105
  }) {
1095
1106
  const { exit } = useApp5();
1096
- const [phase, setPhase] = useState6("scanning");
1107
+ const [phase, setPhase] = useState6("checking-requirements");
1108
+ const [nodeVersionCheck, setNodeVersionCheck] = useState6(null);
1097
1109
  const [project, setProject] = useState6(null);
1098
1110
  const [detectedProjects, setDetectedProjects] = useState6([]);
1099
1111
  const [selectedProject, setSelectedProject] = useState6(null);
@@ -1106,6 +1118,24 @@ function InstallApp({
1106
1118
  const [selectedInjectionPoint, setSelectedInjectionPoint] = useState6(void 0);
1107
1119
  const isEslintSelected = selectedFeatureIds.some((id) => id.startsWith("eslint:"));
1108
1120
  const isNextSelected = selectedFeatureIds.some((id) => id.startsWith("next:"));
1121
+ useEffect2(() => {
1122
+ if (phase !== "checking-requirements") return;
1123
+ const timer = setTimeout(() => {
1124
+ const result = checkNodeVersion();
1125
+ setNodeVersionCheck(result);
1126
+ if (result.ok) {
1127
+ setPhase("scanning");
1128
+ } else {
1129
+ setError(
1130
+ new Error(
1131
+ `Node.js ${result.required}+ is required. You are running Node.js ${result.current}.`
1132
+ )
1133
+ );
1134
+ setPhase("error");
1135
+ }
1136
+ }, 300);
1137
+ return () => clearTimeout(timer);
1138
+ }, [phase]);
1109
1139
  useEffect2(() => {
1110
1140
  if (phase !== "scanning") return;
1111
1141
  projectPromise.then((proj) => {
@@ -1243,6 +1273,15 @@ function InstallApp({
1243
1273
  const handleCancel = () => {
1244
1274
  exit();
1245
1275
  };
1276
+ if (phase === "checking-requirements") {
1277
+ return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
1278
+ /* @__PURE__ */ jsx6(Header, { subtitle: "Install" }),
1279
+ /* @__PURE__ */ jsxs5(Box5, { children: [
1280
+ /* @__PURE__ */ jsx6(Spinner, {}),
1281
+ /* @__PURE__ */ jsx6(Text6, { children: " Checking requirements..." })
1282
+ ] })
1283
+ ] });
1284
+ }
1246
1285
  if (phase === "scanning") {
1247
1286
  return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
1248
1287
  /* @__PURE__ */ jsx6(Header, { subtitle: "Install" }),
@@ -4711,4 +4750,4 @@ ${pc.blue("Running tests with coverage...")}`);
4711
4750
  export {
4712
4751
  installUI
4713
4752
  };
4714
- //# sourceMappingURL=install-ui-CCZ3XJDE.js.map
4753
+ //# sourceMappingURL=install-ui-RGTAARNC.js.map