@liendev/lien 0.19.1 → 0.19.3
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 +28 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5777,6 +5777,10 @@ async function generateLaravelConfig(_rootDir, _relativePath) {
|
|
|
5777
5777
|
// Compiled JS in public
|
|
5778
5778
|
"public/**/*.css",
|
|
5779
5779
|
// Compiled CSS in public
|
|
5780
|
+
// Database boilerplate (not useful for semantic search)
|
|
5781
|
+
"database/migrations/**",
|
|
5782
|
+
"database/seeders/**",
|
|
5783
|
+
"database/factories/**",
|
|
5780
5784
|
// Node.js dependencies
|
|
5781
5785
|
"**/node_modules/**",
|
|
5782
5786
|
"node_modules/**",
|
|
@@ -6476,7 +6480,7 @@ async function indexCommand(options) {
|
|
|
6476
6480
|
// src/cli/serve.ts
|
|
6477
6481
|
import chalk7 from "chalk";
|
|
6478
6482
|
import fs20 from "fs/promises";
|
|
6479
|
-
import
|
|
6483
|
+
import path22 from "path";
|
|
6480
6484
|
|
|
6481
6485
|
// src/mcp/server.ts
|
|
6482
6486
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
@@ -6789,8 +6793,8 @@ async function handleFindSimilar(args, ctx) {
|
|
|
6789
6793
|
}
|
|
6790
6794
|
|
|
6791
6795
|
// src/mcp/utils/path-matching.ts
|
|
6792
|
-
function normalizePath(
|
|
6793
|
-
let normalized =
|
|
6796
|
+
function normalizePath(path24, workspaceRoot) {
|
|
6797
|
+
let normalized = path24.replace(/['"]/g, "").trim().replace(/\\/g, "/");
|
|
6794
6798
|
normalized = normalized.replace(/\.(ts|tsx|js|jsx)$/, "");
|
|
6795
6799
|
if (normalized.startsWith(workspaceRoot + "/")) {
|
|
6796
6800
|
normalized = normalized.substring(workspaceRoot.length + 1);
|
|
@@ -6886,10 +6890,10 @@ async function handleGetFilesContext(args, ctx) {
|
|
|
6886
6890
|
log(`Scanned ${SCAN_LIMIT} chunks (limit reached). Test associations may be incomplete for large codebases.`, "warning");
|
|
6887
6891
|
}
|
|
6888
6892
|
const pathCache = /* @__PURE__ */ new Map();
|
|
6889
|
-
const normalizePathCached = (
|
|
6890
|
-
if (pathCache.has(
|
|
6891
|
-
const normalized = normalizePath(
|
|
6892
|
-
pathCache.set(
|
|
6893
|
+
const normalizePathCached = (path24) => {
|
|
6894
|
+
if (pathCache.has(path24)) return pathCache.get(path24);
|
|
6895
|
+
const normalized = normalizePath(path24, workspaceRoot);
|
|
6896
|
+
pathCache.set(path24, normalized);
|
|
6893
6897
|
return normalized;
|
|
6894
6898
|
};
|
|
6895
6899
|
const testAssociationsMap = filepaths.map((filepath) => {
|
|
@@ -7130,9 +7134,9 @@ async function handleGetDependents(args, ctx) {
|
|
|
7130
7134
|
log(`Scanning ${allChunks.length} chunks for imports...`);
|
|
7131
7135
|
const workspaceRoot = process.cwd().replace(/\\/g, "/");
|
|
7132
7136
|
const pathCache = /* @__PURE__ */ new Map();
|
|
7133
|
-
const normalizePathCached = (
|
|
7134
|
-
if (!pathCache.has(
|
|
7135
|
-
return pathCache.get(
|
|
7137
|
+
const normalizePathCached = (path24) => {
|
|
7138
|
+
if (!pathCache.has(path24)) pathCache.set(path24, normalizePath(path24, workspaceRoot));
|
|
7139
|
+
return pathCache.get(path24);
|
|
7136
7140
|
};
|
|
7137
7141
|
const importIndex = buildImportIndex(allChunks, normalizePathCached);
|
|
7138
7142
|
const normalizedTarget = normalizePathCached(validatedArgs.filepath);
|
|
@@ -7198,11 +7202,11 @@ var COMPLEXITY_THRESHOLDS2 = {
|
|
|
7198
7202
|
};
|
|
7199
7203
|
function createPathNormalizer(workspaceRoot) {
|
|
7200
7204
|
const cache = /* @__PURE__ */ new Map();
|
|
7201
|
-
return (
|
|
7202
|
-
const cached = cache.get(
|
|
7205
|
+
return (path24) => {
|
|
7206
|
+
const cached = cache.get(path24);
|
|
7203
7207
|
if (cached !== void 0) return cached;
|
|
7204
|
-
const normalized = normalizePath(
|
|
7205
|
-
cache.set(
|
|
7208
|
+
const normalized = normalizePath(path24, workspaceRoot);
|
|
7209
|
+
cache.set(path24, normalized);
|
|
7206
7210
|
return normalized;
|
|
7207
7211
|
};
|
|
7208
7212
|
}
|
|
@@ -7713,6 +7717,7 @@ init_utils();
|
|
|
7713
7717
|
// src/watcher/index.ts
|
|
7714
7718
|
init_schema();
|
|
7715
7719
|
import chokidar from "chokidar";
|
|
7720
|
+
import path21 from "path";
|
|
7716
7721
|
var FileWatcher = class {
|
|
7717
7722
|
watcher = null;
|
|
7718
7723
|
debounceTimers = /* @__PURE__ */ new Map();
|
|
@@ -7751,9 +7756,12 @@ var FileWatcher = class {
|
|
|
7751
7756
|
persistent: true,
|
|
7752
7757
|
ignoreInitial: true,
|
|
7753
7758
|
// Don't trigger for existing files
|
|
7759
|
+
// Handle atomic saves from modern editors (VS Code, Sublime, etc.)
|
|
7760
|
+
// Editors write to temp file then rename - without this, we get unlink+add instead of change
|
|
7761
|
+
atomic: true,
|
|
7754
7762
|
awaitWriteFinish: {
|
|
7755
|
-
stabilityThreshold:
|
|
7756
|
-
//
|
|
7763
|
+
stabilityThreshold: 300,
|
|
7764
|
+
// Reduced from 500ms for faster detection
|
|
7757
7765
|
pollInterval: 100
|
|
7758
7766
|
},
|
|
7759
7767
|
// Performance optimizations
|
|
@@ -7782,7 +7790,7 @@ var FileWatcher = class {
|
|
|
7782
7790
|
const timer = setTimeout(() => {
|
|
7783
7791
|
this.debounceTimers.delete(filepath);
|
|
7784
7792
|
if (this.onChangeHandler) {
|
|
7785
|
-
const absolutePath =
|
|
7793
|
+
const absolutePath = path21.isAbsolute(filepath) ? filepath : path21.join(this.rootDir, filepath);
|
|
7786
7794
|
try {
|
|
7787
7795
|
const result = this.onChangeHandler({
|
|
7788
7796
|
type,
|
|
@@ -8057,7 +8065,7 @@ async function startMCPServer(options) {
|
|
|
8057
8065
|
|
|
8058
8066
|
// src/cli/serve.ts
|
|
8059
8067
|
async function serveCommand(options) {
|
|
8060
|
-
const rootDir = options.root ?
|
|
8068
|
+
const rootDir = options.root ? path22.resolve(options.root) : process.cwd();
|
|
8061
8069
|
try {
|
|
8062
8070
|
if (options.root) {
|
|
8063
8071
|
try {
|
|
@@ -8105,7 +8113,7 @@ init_lancedb();
|
|
|
8105
8113
|
init_service();
|
|
8106
8114
|
import chalk9 from "chalk";
|
|
8107
8115
|
import fs21 from "fs";
|
|
8108
|
-
import
|
|
8116
|
+
import path23 from "path";
|
|
8109
8117
|
|
|
8110
8118
|
// src/insights/formatters/text.ts
|
|
8111
8119
|
import chalk8 from "chalk";
|
|
@@ -8380,7 +8388,7 @@ function validateFormat(format) {
|
|
|
8380
8388
|
function validateFilesExist(files, rootDir) {
|
|
8381
8389
|
if (!files || files.length === 0) return;
|
|
8382
8390
|
const missingFiles = files.filter((file) => {
|
|
8383
|
-
const fullPath =
|
|
8391
|
+
const fullPath = path23.isAbsolute(file) ? file : path23.join(rootDir, file);
|
|
8384
8392
|
return !fs21.existsSync(fullPath);
|
|
8385
8393
|
});
|
|
8386
8394
|
if (missingFiles.length > 0) {
|