uilint 0.2.12 → 0.2.13

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
@@ -2796,7 +2796,7 @@ program.command("update").description("Update existing style guide with new styl
2796
2796
  });
2797
2797
  });
2798
2798
  program.command("install").description("Install UILint integration").option("--force", "Overwrite existing configuration files").action(async (options) => {
2799
- const { installUI } = await import("./install-ui-LK7HD2IM.js");
2799
+ const { installUI } = await import("./install-ui-ITXPOUVQ.js");
2800
2800
  await installUI({ force: options.force });
2801
2801
  });
2802
2802
  program.command("serve").description("Start WebSocket server for real-time UI linting").option("-p, --port <number>", "Port to listen on", "9234").action(async (options) => {
@@ -3371,6 +3371,8 @@ async function execute(plan, options = {}) {
3371
3371
 
3372
3372
  // src/commands/install-ui.tsx
3373
3373
  import { ruleRegistry as ruleRegistry3 } from "uilint-eslint";
3374
+ import { existsSync as existsSync13 } from "fs";
3375
+ import { join as join14 } from "path";
3374
3376
 
3375
3377
  // src/commands/install/installers/genstyleguide.ts
3376
3378
  import { join as join11 } from "path";
@@ -3988,15 +3990,30 @@ async function warnOnPackageManagerMismatch(projectPromise) {
3988
3990
  const executionPm = detectExecutionPackageManager();
3989
3991
  if (!executionPm) return;
3990
3992
  const project = await projectPromise;
3991
- const projectPm = project.packageManager;
3992
- if (executionPm === projectPm) return;
3993
- const recommendedCmd = getRecommendedCommand(projectPm);
3993
+ const packageManagers = /* @__PURE__ */ new Set();
3994
+ const hasRootPackageJson = existsSync13(join14(project.projectPath, "package.json"));
3995
+ if (hasRootPackageJson) {
3996
+ packageManagers.add(project.packageManager);
3997
+ } else {
3998
+ for (const pkg of project.packages) {
3999
+ const pm = detectPackageManager(pkg.path);
4000
+ packageManagers.add(pm);
4001
+ }
4002
+ }
4003
+ const specificPackageManagers = Array.from(packageManagers).filter(
4004
+ (pm) => pm !== "npm" || hasRootPackageJson
4005
+ );
4006
+ if (specificPackageManagers.length === 0) return;
4007
+ if (specificPackageManagers.includes(executionPm)) return;
4008
+ const primaryPm = specificPackageManagers[0];
4009
+ const recommendedCmd = getRecommendedCommand(primaryPm);
4010
+ const pmList = specificPackageManagers.length === 1 ? specificPackageManagers[0] : specificPackageManagers.join(", ");
3994
4011
  printBox(
3995
4012
  "Package manager mismatch detected",
3996
4013
  [
3997
- `This project uses ${projectPm}, but you ran this command with ${executionPm}.`,
4014
+ `This project uses ${pmList}, but you ran this command with ${executionPm}.`,
3998
4015
  "",
3999
- `This may create unwanted lockfiles (e.g., package-lock.json).`,
4016
+ `Running with ${executionPm} may create unwanted lockfiles.`,
4000
4017
  "",
4001
4018
  "Recommended:",
4002
4019
  ` ${recommendedCmd}`,
@@ -4052,4 +4069,4 @@ async function installUI(options = {}, executeOptions = {}) {
4052
4069
  export {
4053
4070
  installUI
4054
4071
  };
4055
- //# sourceMappingURL=install-ui-LK7HD2IM.js.map
4072
+ //# sourceMappingURL=install-ui-ITXPOUVQ.js.map