uilint 0.2.44 → 0.2.46

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.
@@ -9,12 +9,12 @@ import {
9
9
  injectCoverageConfig,
10
10
  installEslintPlugin,
11
11
  uninstallEslintPlugin
12
- } from "./chunk-KNZVCCXM.js";
12
+ } from "./chunk-5536ROOI.js";
13
13
  import {
14
14
  GENSTYLEGUIDE_COMMAND_MD,
15
15
  loadSkill,
16
16
  toInstallSpecifier
17
- } from "./chunk-TWUDB36F.js";
17
+ } from "./chunk-VSBVUS56.js";
18
18
  import {
19
19
  updateManifestRule
20
20
  } from "./chunk-ZDSDZNIB.js";
@@ -33,14 +33,14 @@ import {
33
33
  runTestsWithCoverage
34
34
  } from "./chunk-JPE27ROY.js";
35
35
 
36
- // src/commands/install-ui.tsx
36
+ // src/commands/init-ui.tsx
37
37
  import { render } from "ink";
38
38
 
39
- // src/commands/install/components/InstallApp.tsx
39
+ // src/commands/init/components/InstallApp.tsx
40
40
  import { useState as useState7, useEffect as useEffect2 } from "react";
41
41
  import { Box as Box6, Text as Text7, useApp as useApp5, useInput as useInput6 } from "ink";
42
42
 
43
- // src/commands/install/components/Spinner.tsx
43
+ // src/commands/init/components/Spinner.tsx
44
44
  import { useState, useEffect } from "react";
45
45
  import { Text } from "ink";
46
46
  import { jsx } from "react/jsx-runtime";
@@ -58,7 +58,7 @@ function Spinner() {
58
58
  return /* @__PURE__ */ jsx(Text, { color: "cyan", children: frames[frame] });
59
59
  }
60
60
 
61
- // src/commands/install/components/ProjectSelector.tsx
61
+ // src/commands/init/components/ProjectSelector.tsx
62
62
  import { useState as useState2 } from "react";
63
63
  import { Box, Text as Text2, useInput, useApp } from "ink";
64
64
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
@@ -151,7 +151,7 @@ function ProjectSelector({
151
151
  ] });
152
152
  }
153
153
 
154
- // src/commands/install/components/MultiSelect.tsx
154
+ // src/commands/init/components/MultiSelect.tsx
155
155
  import { useState as useState3, useCallback } from "react";
156
156
  import { Box as Box2, Text as Text3, useInput as useInput2, useApp as useApp2 } from "ink";
157
157
  import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -321,12 +321,12 @@ function ConfigSelector({
321
321
  ] });
322
322
  }
323
323
 
324
- // src/commands/install/components/RuleSelector.tsx
324
+ // src/commands/init/components/RuleSelector.tsx
325
325
  import { useState as useState5, useMemo } from "react";
326
326
  import { Box as Box4, Text as Text5, useInput as useInput4, useApp as useApp3 } from "ink";
327
327
  import { getRulesByCategory, getCategoryMeta } from "uilint-eslint";
328
328
 
329
- // src/commands/install/components/OptionField.tsx
329
+ // src/commands/init/components/OptionField.tsx
330
330
  import { useState as useState4 } from "react";
331
331
  import { Box as Box3, Text as Text4, useInput as useInput3 } from "ink";
332
332
  import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
@@ -577,7 +577,7 @@ function convertFieldValue(value, field, defaultValue) {
577
577
  return value;
578
578
  }
579
579
 
580
- // src/commands/install/components/RuleSelector.tsx
580
+ // src/commands/init/components/RuleSelector.tsx
581
581
  import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
582
582
  function SeverityBadge({ severity }) {
583
583
  if (severity === "error") {
@@ -1018,7 +1018,7 @@ function RuleSelector({
1018
1018
  ] });
1019
1019
  }
1020
1020
 
1021
- // src/commands/install/components/InjectionPointSelector.tsx
1021
+ // src/commands/init/components/InjectionPointSelector.tsx
1022
1022
  import { useState as useState6 } from "react";
1023
1023
  import { Box as Box5, Text as Text6, useInput as useInput5, useApp as useApp4 } from "ink";
1024
1024
  import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -1081,7 +1081,7 @@ function InjectionPointSelector({
1081
1081
  ] });
1082
1082
  }
1083
1083
 
1084
- // src/commands/install/installers/registry.ts
1084
+ // src/commands/init/installers/registry.ts
1085
1085
  var installers = [];
1086
1086
  function registerInstaller(installer) {
1087
1087
  if (installers.some((i) => i.id === installer.id)) {
@@ -1240,7 +1240,7 @@ function providersFileExists(projectPath, appRoot) {
1240
1240
  return null;
1241
1241
  }
1242
1242
 
1243
- // src/commands/install/installers/next-overlay.ts
1243
+ // src/commands/init/installers/next-overlay.ts
1244
1244
  function getInjectionPoints(projectPath, appRoot) {
1245
1245
  const points = [];
1246
1246
  const traceResult = traceClientBoundaries(projectPath, appRoot);
@@ -1439,7 +1439,7 @@ var nextOverlayInstaller = {
1439
1439
  }
1440
1440
  };
1441
1441
 
1442
- // src/commands/install/components/InstallApp.tsx
1442
+ // src/commands/init/components/InstallApp.tsx
1443
1443
  import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1444
1444
  function getTargetStatus(target) {
1445
1445
  if (!target.isInstalled) {
@@ -1846,7 +1846,7 @@ function InstallApp({
1846
1846
  ] });
1847
1847
  }
1848
1848
 
1849
- // src/commands/install/analyze.ts
1849
+ // src/commands/init/analyze.ts
1850
1850
  import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
1851
1851
  import { join as join4 } from "path";
1852
1852
  import { findWorkspaceRoot } from "uilint-core/node";
@@ -2092,7 +2092,7 @@ function findPackages(rootDir, options) {
2092
2092
  });
2093
2093
  }
2094
2094
 
2095
- // src/commands/install/analyze.ts
2095
+ // src/commands/init/analyze.ts
2096
2096
  function safeParseJson(filePath) {
2097
2097
  try {
2098
2098
  const content = readFileSync4(filePath, "utf-8");
@@ -2152,7 +2152,11 @@ async function analyze(projectPath = process.cwd()) {
2152
2152
  });
2153
2153
  }
2154
2154
  }
2155
- const rawPackages = findPackages(workspaceRoot);
2155
+ let rawPackages = findPackages(workspaceRoot);
2156
+ const projectHasPackageJson = existsSync4(join4(projectPath, "package.json"));
2157
+ if (projectHasPackageJson && projectPath !== workspaceRoot) {
2158
+ rawPackages = rawPackages.filter((pkg) => pkg.path === projectPath);
2159
+ }
2156
2160
  const packages = rawPackages.map((pkg) => {
2157
2161
  const eslintConfigPath = findEslintConfigFile(pkg.path);
2158
2162
  let eslintConfigFilename = null;
@@ -2197,7 +2201,7 @@ async function analyze(projectPath = process.cwd()) {
2197
2201
  };
2198
2202
  }
2199
2203
 
2200
- // src/commands/install/execute.ts
2204
+ // src/commands/init/execute.ts
2201
2205
  import {
2202
2206
  existsSync as existsSync11,
2203
2207
  mkdirSync,
@@ -3773,7 +3777,7 @@ function touchFiles(filePaths) {
3773
3777
  }
3774
3778
  }
3775
3779
 
3776
- // src/commands/install/execute.ts
3780
+ // src/commands/init/execute.ts
3777
3781
  import { findWorkspaceRoot as findWorkspaceRoot2 } from "uilint-core/node";
3778
3782
 
3779
3783
  // src/utils/tsconfig-inject.ts
@@ -3803,7 +3807,7 @@ function injectTsconfigExclusion(projectPath) {
3803
3807
  }
3804
3808
  }
3805
3809
 
3806
- // src/commands/install/execute.ts
3810
+ // src/commands/init/execute.ts
3807
3811
  async function executeAction(action, options) {
3808
3812
  const { dryRun = false } = options;
3809
3813
  try {
@@ -4506,10 +4510,10 @@ async function execute(plan, options = {}) {
4506
4510
  };
4507
4511
  }
4508
4512
 
4509
- // src/commands/install-ui.tsx
4513
+ // src/commands/init-ui.tsx
4510
4514
  import { ruleRegistry as ruleRegistry2 } from "uilint-eslint";
4511
4515
 
4512
- // src/commands/install/installers/genstyleguide.ts
4516
+ // src/commands/init/installers/genstyleguide.ts
4513
4517
  import { join as join12 } from "path";
4514
4518
  var genstyleguideInstaller = {
4515
4519
  id: "genstyleguide",
@@ -4584,7 +4588,7 @@ var genstyleguideInstaller = {
4584
4588
  }
4585
4589
  };
4586
4590
 
4587
- // src/commands/install/installers/skill.ts
4591
+ // src/commands/init/installers/skill.ts
4588
4592
  import { existsSync as existsSync12 } from "fs";
4589
4593
  import { join as join13 } from "path";
4590
4594
  var skillInstaller = {
@@ -4696,7 +4700,7 @@ var skillInstaller = {
4696
4700
  }
4697
4701
  };
4698
4702
 
4699
- // src/commands/install/installers/eslint.ts
4703
+ // src/commands/init/installers/eslint.ts
4700
4704
  import { join as join14 } from "path";
4701
4705
  import { ruleRegistry, getRulesByCategory as getRulesByCategory2, getCategoryMeta as getCategoryMeta2 } from "uilint-eslint";
4702
4706
  async function promptForField(field, currentValue) {
@@ -5079,7 +5083,7 @@ ${semanticCat?.icon ?? "\u{1F9E0}"} ${semanticCat?.name ?? "Semantic rules"} (${
5079
5083
  }
5080
5084
  };
5081
5085
 
5082
- // src/commands/install/installers/vite-overlay.ts
5086
+ // src/commands/init/installers/vite-overlay.ts
5083
5087
  var viteOverlayInstaller = {
5084
5088
  id: "vite",
5085
5089
  name: "Vite overlay",
@@ -5191,14 +5195,14 @@ var viteOverlayInstaller = {
5191
5195
  }
5192
5196
  };
5193
5197
 
5194
- // src/commands/install/installers/index.ts
5198
+ // src/commands/init/installers/index.ts
5195
5199
  registerInstaller(genstyleguideInstaller);
5196
5200
  registerInstaller(skillInstaller);
5197
5201
  registerInstaller(eslintInstaller);
5198
5202
  registerInstaller(nextOverlayInstaller);
5199
5203
  registerInstaller(viteOverlayInstaller);
5200
5204
 
5201
- // src/commands/install-ui.tsx
5205
+ // src/commands/init-ui.tsx
5202
5206
  import { jsx as jsx8 } from "react/jsx-runtime";
5203
5207
  function limitList(items, max) {
5204
5208
  if (items.length <= max) return items;
@@ -5355,11 +5359,11 @@ function selectionsToUserChoices(selections, project, eslintRules, injectionPoin
5355
5359
  function isInteractiveTerminal() {
5356
5360
  return Boolean(process.stdin.isTTY && process.stdout.isTTY);
5357
5361
  }
5358
- async function installUI(options = {}, executeOptions = {}) {
5362
+ async function initUI(options = {}, executeOptions = {}) {
5359
5363
  const projectPath = process.cwd();
5360
5364
  if (!isInteractiveTerminal()) {
5361
5365
  console.error("\n\u2717 Interactive mode requires a TTY terminal.");
5362
- console.error("Run uilint install in an interactive terminal.\n");
5366
+ console.error("Run uilint init in an interactive terminal.\n");
5363
5367
  process.exit(1);
5364
5368
  }
5365
5369
  const projectPromise = analyze(projectPath);
@@ -5377,7 +5381,7 @@ async function installUI(options = {}, executeOptions = {}) {
5377
5381
  console.log("\nNo changes selected");
5378
5382
  process.exit(0);
5379
5383
  }
5380
- const { createPlan } = await import("./plan-N453UW4O.js");
5384
+ const { createPlan } = await import("./plan-ZWGKTWQ3.js");
5381
5385
  const plan = createPlan(project, choices, { force: options.force });
5382
5386
  if (hasUninstalls && uninstallSelections) {
5383
5387
  for (const selection of uninstallSelections) {
@@ -5427,6 +5431,6 @@ ${pc.blue("Running tests with coverage...")}`);
5427
5431
  await waitUntilExit();
5428
5432
  }
5429
5433
  export {
5430
- installUI
5434
+ initUI
5431
5435
  };
5432
- //# sourceMappingURL=install-ui-COFD7H2I.js.map
5436
+ //# sourceMappingURL=init-ui-RQKFF33G.js.map