uilint 0.2.60 → 0.2.61
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/{chunk-3LKX26SH.js → chunk-SQFSFBUP.js} +264 -24
- package/dist/chunk-SQFSFBUP.js.map +1 -0
- package/dist/index.js +41 -2
- package/dist/index.js.map +1 -1
- package/dist/{init-ui-D43GYBCT.js → init-ui-Z54KCM7G.js} +2 -2
- package/dist/{remove-ui-WPXAIH3W.js → remove-ui-U2VUMSP7.js} +2 -2
- package/package.json +5 -5
- package/dist/chunk-3LKX26SH.js.map +0 -1
- /package/dist/{init-ui-D43GYBCT.js.map → init-ui-Z54KCM7G.js.map} +0 -0
- /package/dist/{remove-ui-WPXAIH3W.js.map → remove-ui-U2VUMSP7.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1618,6 +1618,37 @@ function pickAppRoot(params) {
|
|
|
1618
1618
|
if (containing) return containing.projectPath;
|
|
1619
1619
|
return matches[0].projectPath;
|
|
1620
1620
|
}
|
|
1621
|
+
function detectPostToolUseHook(projectRoot) {
|
|
1622
|
+
const claudeSettingsPath = join3(projectRoot, ".claude", "settings.json");
|
|
1623
|
+
if (existsSync5(claudeSettingsPath)) {
|
|
1624
|
+
try {
|
|
1625
|
+
const content = readFileSync(claudeSettingsPath, "utf-8");
|
|
1626
|
+
const settings = JSON.parse(content);
|
|
1627
|
+
const hooks = settings.hooks?.PostToolUse;
|
|
1628
|
+
if (Array.isArray(hooks)) {
|
|
1629
|
+
const hasEditHook = hooks.some(
|
|
1630
|
+
(h) => h.matcher?.includes("Edit") || h.matcher?.includes("Write")
|
|
1631
|
+
);
|
|
1632
|
+
if (hasEditHook) {
|
|
1633
|
+
return { enabled: true, provider: "claude" };
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
} catch {
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
const cursorHooksPath = join3(projectRoot, ".cursor", "hooks.json");
|
|
1640
|
+
if (existsSync5(cursorHooksPath)) {
|
|
1641
|
+
try {
|
|
1642
|
+
const content = readFileSync(cursorHooksPath, "utf-8");
|
|
1643
|
+
const hooks = JSON.parse(content);
|
|
1644
|
+
if (hooks.hooks?.afterFileEdit?.length > 0) {
|
|
1645
|
+
return { enabled: true, provider: "cursor" };
|
|
1646
|
+
}
|
|
1647
|
+
} catch {
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
return { enabled: false, provider: null };
|
|
1651
|
+
}
|
|
1621
1652
|
var cache = /* @__PURE__ */ new Map();
|
|
1622
1653
|
var eslintInstances = /* @__PURE__ */ new Map();
|
|
1623
1654
|
var visionAnalyzer = null;
|
|
@@ -2617,6 +2648,14 @@ async function serve(options) {
|
|
|
2617
2648
|
workspaceRoot: wsRoot,
|
|
2618
2649
|
serverCwd: cwd
|
|
2619
2650
|
});
|
|
2651
|
+
const hookInfo = detectPostToolUseHook(appRoot);
|
|
2652
|
+
sendMessage(ws, {
|
|
2653
|
+
type: "workspace:capabilities",
|
|
2654
|
+
postToolUseHook: hookInfo
|
|
2655
|
+
});
|
|
2656
|
+
if (hookInfo.enabled) {
|
|
2657
|
+
logInfo(`${pc.dim("[ws]")} Post-tool-use hook detected: ${pc.bold(hookInfo.provider)}`);
|
|
2658
|
+
}
|
|
2620
2659
|
const eslintConfigPath = findEslintConfigFile(appRoot);
|
|
2621
2660
|
const currentRuleConfigs = eslintConfigPath ? readRuleConfigsFromConfig(eslintConfigPath) : /* @__PURE__ */ new Map();
|
|
2622
2661
|
sendMessage(ws, {
|
|
@@ -3777,11 +3816,11 @@ program.command("update").description("Update existing style guide with new styl
|
|
|
3777
3816
|
});
|
|
3778
3817
|
});
|
|
3779
3818
|
program.command("init").description("Initialize UILint integration").option("--force", "Overwrite existing configuration files").action(async (options) => {
|
|
3780
|
-
const { initUI } = await import("./init-ui-
|
|
3819
|
+
const { initUI } = await import("./init-ui-Z54KCM7G.js");
|
|
3781
3820
|
await initUI({ force: options.force });
|
|
3782
3821
|
});
|
|
3783
3822
|
program.command("remove").description("Remove UILint components from your project").option("--dry-run", "Preview changes without removing anything").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
3784
|
-
const { removeUI } = await import("./remove-ui-
|
|
3823
|
+
const { removeUI } = await import("./remove-ui-U2VUMSP7.js");
|
|
3785
3824
|
await removeUI({ dryRun: options.dryRun, yes: options.yes });
|
|
3786
3825
|
});
|
|
3787
3826
|
program.command("serve").description("Start WebSocket server for real-time UI linting").option("-p, --port <number>", "Port to listen on", "9234").action(async (options) => {
|