@kevisual/project-search 0.0.2 → 0.0.4

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.
Files changed (3) hide show
  1. package/dist/app.js +30 -21
  2. package/dist/remote.js +28 -19
  3. package/package.json +6 -6
package/dist/app.js CHANGED
@@ -26926,6 +26926,31 @@ class Scheduler {
26926
26926
  }
26927
26927
  }
26928
26928
 
26929
+ // src/project/utils.ts
26930
+ function normalizeIgnorePattern(pattern) {
26931
+ if (pattern.includes("*") || pattern.includes("?")) {
26932
+ return pattern;
26933
+ }
26934
+ if (pattern.endsWith("/")) {
26935
+ return `**/${pattern.replace(/\/$/, "")}/**`;
26936
+ }
26937
+ return `**/${pattern}/**`;
26938
+ }
26939
+ var defaultIgnorePatterns = [
26940
+ "node_modules",
26941
+ "dist",
26942
+ "pack-dist",
26943
+ "build",
26944
+ "out",
26945
+ "coverage",
26946
+ ".git",
26947
+ ".svn",
26948
+ ".hg",
26949
+ ".next",
26950
+ ".astro",
26951
+ ".swc"
26952
+ ];
26953
+
26929
26954
  // src/project/project-search/index.ts
26930
26955
  var MANUAL_FIELDS = ["title", "tags", "summary", "description", "link"];
26931
26956
  var INDEX_NAME = "project-files";
@@ -27096,8 +27121,7 @@ class ProjectSearch {
27096
27121
  const ignoreFile = path2.join(projectPath, ".gitignore");
27097
27122
  const gitIgnore = fs.existsSync(ignoreFile) ? fs.readFileSync(ignoreFile, "utf-8").split(`
27098
27123
  `).map((l) => l.trim()).filter((l) => l && !l.startsWith("#")) : [];
27099
- const defaultIgnore = ["node_modules", "dist", "pack-dist", "build", "out", "coverage", ".git", ".svn", ".hg", ".next", ".astro", ".swc"];
27100
- const allIgnore = [...defaultIgnore, ...gitIgnore];
27124
+ const allIgnore = [...defaultIgnorePatterns, ...gitIgnore].map(normalizeIgnorePattern);
27101
27125
  const files = await import_fast_glob.default("**", {
27102
27126
  cwd: projectPath,
27103
27127
  ignore: allIgnore,
@@ -27267,21 +27291,6 @@ var $unsubscribe = wrapper.unsubscribe;
27267
27291
  // src/project/project-listener/listener.ts
27268
27292
  import path3 from "node:path";
27269
27293
  import fs2 from "node:fs";
27270
- var defaultIgnore = [
27271
- "node_modules",
27272
- "dist",
27273
- "pack-dist",
27274
- "build",
27275
- "out",
27276
- "coverage",
27277
- ".git",
27278
- ".svn",
27279
- ".hg",
27280
- ".next",
27281
- ".astro",
27282
- ".swc"
27283
- ];
27284
-
27285
27294
  class ProjectListener {
27286
27295
  projectPath;
27287
27296
  subscribe = null;
@@ -27302,7 +27311,7 @@ class ProjectListener {
27302
27311
  ignorePatterns = fs2.readFileSync(ignoreFile, "utf-8").split(`
27303
27312
  `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
27304
27313
  }
27305
- const allIgnore = [...defaultIgnore, ...ignorePatterns];
27314
+ const allIgnore = [...defaultIgnorePatterns, ...ignorePatterns];
27306
27315
  const sub = await $subscribe(this.projectPath, async (err, events) => {
27307
27316
  if (err)
27308
27317
  throw err;
@@ -27337,7 +27346,7 @@ class ProjectListener {
27337
27346
  }
27338
27347
  }
27339
27348
  }, {
27340
- ignore: allIgnore.map((pattern) => `**/${pattern}/**`),
27349
+ ignore: allIgnore.map(normalizeIgnorePattern),
27341
27350
  backend: "watchman"
27342
27351
  });
27343
27352
  this.subscribe = sub;
@@ -28082,7 +28091,7 @@ var manager = useContextKey("project-manager", new ProjectManager({
28082
28091
  var import_fast_glob2 = __toESM(require_out4(), 1);
28083
28092
  import path4 from "node:path";
28084
28093
  import fs4 from "node:fs";
28085
- var defaultIgnore2 = [
28094
+ var defaultIgnore = [
28086
28095
  "node_modules",
28087
28096
  "dist",
28088
28097
  "pack-dist",
@@ -28103,7 +28112,7 @@ class FileSearch {
28103
28112
  const ignoreFile = path4.join(cwd, ".gitignore");
28104
28113
  const gitIgnorePatterns = fs4.existsSync(ignoreFile) ? fs4.readFileSync(ignoreFile, "utf-8").split(`
28105
28114
  `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#")) : [];
28106
- const allIgnore = [...defaultIgnore2, ...ignore, ...gitIgnorePatterns];
28115
+ const allIgnore = [...defaultIgnore, ...ignore, ...gitIgnorePatterns];
28107
28116
  const files = await import_fast_glob2.default("**", {
28108
28117
  cwd,
28109
28118
  ignore: allIgnore,
package/dist/remote.js CHANGED
@@ -26926,6 +26926,31 @@ class Scheduler {
26926
26926
  }
26927
26927
  }
26928
26928
 
26929
+ // src/project/utils.ts
26930
+ function normalizeIgnorePattern(pattern) {
26931
+ if (pattern.includes("*") || pattern.includes("?")) {
26932
+ return pattern;
26933
+ }
26934
+ if (pattern.endsWith("/")) {
26935
+ return `**/${pattern.replace(/\/$/, "")}/**`;
26936
+ }
26937
+ return `**/${pattern}/**`;
26938
+ }
26939
+ var defaultIgnorePatterns = [
26940
+ "node_modules",
26941
+ "dist",
26942
+ "pack-dist",
26943
+ "build",
26944
+ "out",
26945
+ "coverage",
26946
+ ".git",
26947
+ ".svn",
26948
+ ".hg",
26949
+ ".next",
26950
+ ".astro",
26951
+ ".swc"
26952
+ ];
26953
+
26929
26954
  // src/project/project-search/index.ts
26930
26955
  var MANUAL_FIELDS = ["title", "tags", "summary", "description", "link"];
26931
26956
  var INDEX_NAME = "project-files";
@@ -27096,8 +27121,7 @@ class ProjectSearch {
27096
27121
  const ignoreFile = path2.join(projectPath, ".gitignore");
27097
27122
  const gitIgnore = fs.existsSync(ignoreFile) ? fs.readFileSync(ignoreFile, "utf-8").split(`
27098
27123
  `).map((l) => l.trim()).filter((l) => l && !l.startsWith("#")) : [];
27099
- const defaultIgnore = ["node_modules", "dist", "pack-dist", "build", "out", "coverage", ".git", ".svn", ".hg", ".next", ".astro", ".swc"];
27100
- const allIgnore = [...defaultIgnore, ...gitIgnore];
27124
+ const allIgnore = [...defaultIgnorePatterns, ...gitIgnore].map(normalizeIgnorePattern);
27101
27125
  const files = await import_fast_glob.default("**", {
27102
27126
  cwd: projectPath,
27103
27127
  ignore: allIgnore,
@@ -27267,21 +27291,6 @@ var $unsubscribe = wrapper.unsubscribe;
27267
27291
  // src/project/project-listener/listener.ts
27268
27292
  import path3 from "node:path";
27269
27293
  import fs2 from "node:fs";
27270
- var defaultIgnore = [
27271
- "node_modules",
27272
- "dist",
27273
- "pack-dist",
27274
- "build",
27275
- "out",
27276
- "coverage",
27277
- ".git",
27278
- ".svn",
27279
- ".hg",
27280
- ".next",
27281
- ".astro",
27282
- ".swc"
27283
- ];
27284
-
27285
27294
  class ProjectListener {
27286
27295
  projectPath;
27287
27296
  subscribe = null;
@@ -27302,7 +27311,7 @@ class ProjectListener {
27302
27311
  ignorePatterns = fs2.readFileSync(ignoreFile, "utf-8").split(`
27303
27312
  `).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
27304
27313
  }
27305
- const allIgnore = [...defaultIgnore, ...ignorePatterns];
27314
+ const allIgnore = [...defaultIgnorePatterns, ...ignorePatterns];
27306
27315
  const sub = await $subscribe(this.projectPath, async (err, events) => {
27307
27316
  if (err)
27308
27317
  throw err;
@@ -27337,7 +27346,7 @@ class ProjectListener {
27337
27346
  }
27338
27347
  }
27339
27348
  }, {
27340
- ignore: allIgnore.map((pattern) => `**/${pattern}/**`),
27349
+ ignore: allIgnore.map(normalizeIgnorePattern),
27341
27350
  backend: "watchman"
27342
27351
  });
27343
27352
  this.subscribe = sub;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/project-search",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,16 +23,16 @@
23
23
  "@kevisual/router": "^0.1.1",
24
24
  "fast-glob": "^3.3.3",
25
25
  "meilisearch": "^0.55.0",
26
- "zod": "^4.3.6"
27
- },
28
- "dependencies": {
29
- "@parcel/watcher": "^2.5.6",
26
+ "zod": "^4.3.6",
30
27
  "es-toolkit": "^1.45.1",
31
28
  "eventemitter3": "^5.0.4"
32
29
  },
30
+ "dependencies": {
31
+ "@parcel/watcher": "^2.5.6"
32
+ },
33
33
  "exports": {
34
34
  ".": "./dist/app.js",
35
- "./route": "./dist/app.js",
35
+ "./routes": "./dist/app.js",
36
36
  "./remote": "./dist/remote.js"
37
37
  },
38
38
  "publishConfig": {