@ottocode/server 0.1.211 → 0.1.212
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/package.json +3 -3
- package/src/routes/files.ts +13 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ottocode/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.212",
|
|
4
4
|
"description": "HTTP API server for ottocode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typecheck": "tsc --noEmit"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@ottocode/sdk": "0.1.
|
|
53
|
-
"@ottocode/database": "0.1.
|
|
52
|
+
"@ottocode/sdk": "0.1.212",
|
|
53
|
+
"@ottocode/database": "0.1.212",
|
|
54
54
|
"drizzle-orm": "^0.44.5",
|
|
55
55
|
"hono": "^4.9.9",
|
|
56
56
|
"zod": "^4.1.8"
|
package/src/routes/files.ts
CHANGED
|
@@ -10,14 +10,7 @@ import { resolveBinary } from '@ottocode/sdk/tools/bin-manager';
|
|
|
10
10
|
|
|
11
11
|
const execAsync = promisify(exec);
|
|
12
12
|
|
|
13
|
-
const EXCLUDED_FILES = new Set([
|
|
14
|
-
'.DS_Store',
|
|
15
|
-
'bun.lockb',
|
|
16
|
-
'.env',
|
|
17
|
-
'.env.local',
|
|
18
|
-
'.env.production',
|
|
19
|
-
'.env.development',
|
|
20
|
-
]);
|
|
13
|
+
const EXCLUDED_FILES = new Set(['.DS_Store', 'bun.lockb']);
|
|
21
14
|
|
|
22
15
|
const EXCLUDED_DIRS = new Set([
|
|
23
16
|
'node_modules',
|
|
@@ -35,6 +28,13 @@ const EXCLUDED_DIRS = new Set([
|
|
|
35
28
|
'.cache',
|
|
36
29
|
'__pycache__',
|
|
37
30
|
'.tsbuildinfo',
|
|
31
|
+
'target',
|
|
32
|
+
'.cargo',
|
|
33
|
+
'.rustup',
|
|
34
|
+
'vendor',
|
|
35
|
+
'.gradle',
|
|
36
|
+
'.idea',
|
|
37
|
+
'.vscode',
|
|
38
38
|
]);
|
|
39
39
|
|
|
40
40
|
function shouldExcludeFile(name: string): boolean {
|
|
@@ -53,10 +53,13 @@ async function listFilesWithRg(
|
|
|
53
53
|
const rgBin = await resolveBinary('rg');
|
|
54
54
|
|
|
55
55
|
return new Promise((resolve) => {
|
|
56
|
-
const args = ['--files', '--hidden', '--glob', '
|
|
56
|
+
const args = ['--files', '--hidden', '--glob', '!.*/', '--sort', 'path'];
|
|
57
57
|
if (includeIgnored) {
|
|
58
58
|
args.push('--no-ignore');
|
|
59
59
|
}
|
|
60
|
+
for (const dir of EXCLUDED_DIRS) {
|
|
61
|
+
args.push('--glob', `!**/${dir}/`);
|
|
62
|
+
}
|
|
60
63
|
|
|
61
64
|
const proc = spawn(rgBin, args, { cwd: projectRoot });
|
|
62
65
|
let stdout = '';
|
|
@@ -269,7 +272,7 @@ export function registerFilesRoutes(app: Hono) {
|
|
|
269
272
|
try {
|
|
270
273
|
const projectRoot = c.req.query('project') || process.cwd();
|
|
271
274
|
const maxDepth = Number.parseInt(c.req.query('maxDepth') || '10', 10);
|
|
272
|
-
const limit = Number.parseInt(c.req.query('limit') || '
|
|
275
|
+
const limit = Number.parseInt(c.req.query('limit') || '10000', 10);
|
|
273
276
|
|
|
274
277
|
let result = await listFilesWithRg(projectRoot, limit, true);
|
|
275
278
|
|
|
@@ -336,11 +339,9 @@ export function registerFilesRoutes(app: Hono) {
|
|
|
336
339
|
}> = [];
|
|
337
340
|
|
|
338
341
|
for (const entry of entries) {
|
|
339
|
-
if (entry.name.startsWith('.') && entry.name !== '.otto') continue;
|
|
340
342
|
const relPath = relative(projectRoot, join(targetDir, entry.name));
|
|
341
343
|
|
|
342
344
|
if (entry.isDirectory()) {
|
|
343
|
-
if (shouldExcludeDir(entry.name)) continue;
|
|
344
345
|
const ignored = matchesGitignorePattern(relPath, gitignorePatterns);
|
|
345
346
|
items.push({
|
|
346
347
|
name: entry.name,
|