@git.zone/tsdoc 1.10.0 → 1.10.2
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_ts/aidocs_classes/commit.js +4 -4
- package/dist_ts/aidocs_classes/description.js +3 -3
- package/dist_ts/aidocs_classes/projectcontext.js +7 -7
- package/dist_ts/aidocs_classes/readme.js +4 -4
- package/dist_ts/classes.aidoc.js +15 -2
- package/dist_ts/classes.typedoc.js +5 -5
- package/dist_ts/cli.js +2 -2
- package/dist_ts/context/config-manager.js +8 -8
- package/dist_ts/context/context-analyzer.js +2 -2
- package/dist_ts/context/context-cache.js +5 -5
- package/dist_ts/context/enhanced-context.js +2 -2
- package/dist_ts/context/iterative-context-builder.js +2 -2
- package/dist_ts/context/lazy-file-loader.js +26 -8
- package/dist_ts/plugins.d.ts +4 -1
- package/dist_ts/plugins.js +8 -2
- package/package.json +12 -11
- package/readme.md +38 -227
- package/ts/aidocs_classes/commit.ts +3 -3
- package/ts/aidocs_classes/description.ts +2 -2
- package/ts/aidocs_classes/projectcontext.ts +8 -10
- package/ts/aidocs_classes/readme.ts +3 -3
- package/ts/classes.aidoc.ts +17 -1
- package/ts/classes.typedoc.ts +4 -4
- package/ts/cli.ts +1 -1
- package/ts/context/config-manager.ts +7 -7
- package/ts/context/context-analyzer.ts +1 -1
- package/ts/context/context-cache.ts +4 -4
- package/ts/context/enhanced-context.ts +1 -1
- package/ts/context/iterative-context-builder.ts +1 -1
- package/ts/context/lazy-file-loader.ts +23 -7
- package/ts/plugins.ts +9 -0
|
@@ -463,7 +463,7 @@ Do not wrap the JSON in markdown code blocks or add any other text.`,
|
|
|
463
463
|
}
|
|
464
464
|
|
|
465
465
|
// Load from disk
|
|
466
|
-
const contents = await plugins.
|
|
466
|
+
const contents = await plugins.fsInstance.file(filePath).encoding('utf8').read() as string;
|
|
467
467
|
const tokenCount = this.countTokens(contents);
|
|
468
468
|
const relativePath = plugins.path.relative(this.projectRoot, filePath);
|
|
469
469
|
|
|
@@ -31,16 +31,32 @@ export class LazyFileLoader {
|
|
|
31
31
|
|
|
32
32
|
for (const globPattern of globs) {
|
|
33
33
|
try {
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const virtualDir = await plugins.smartfileFactory.virtualDirectoryFromPath(this.projectRoot);
|
|
35
|
+
// Filter files based on glob pattern using simple pattern matching
|
|
36
|
+
const smartFiles = virtualDir.filter(file => {
|
|
37
|
+
// Simple glob matching
|
|
38
|
+
const relativePath = file.relative;
|
|
39
|
+
if (globPattern.includes('**')) {
|
|
40
|
+
// Handle ** patterns - match any path
|
|
41
|
+
const pattern = globPattern.replace(/\*\*/g, '.*').replace(/\*/g, '[^/]*');
|
|
42
|
+
return new RegExp(`^${pattern}$`).test(relativePath);
|
|
43
|
+
} else if (globPattern.includes('*')) {
|
|
44
|
+
// Handle single * patterns
|
|
45
|
+
const pattern = globPattern.replace(/\*/g, '[^/]*');
|
|
46
|
+
return new RegExp(`^${pattern}$`).test(relativePath);
|
|
47
|
+
} else {
|
|
48
|
+
// Exact match
|
|
49
|
+
return relativePath === globPattern;
|
|
50
|
+
}
|
|
51
|
+
}).listFiles();
|
|
36
52
|
|
|
37
|
-
for (const smartFile of
|
|
53
|
+
for (const smartFile of smartFiles) {
|
|
38
54
|
try {
|
|
39
|
-
const meta = await this.getMetadata(smartFile.
|
|
55
|
+
const meta = await this.getMetadata(smartFile.absolutePath);
|
|
40
56
|
metadata.push(meta);
|
|
41
57
|
} catch (error) {
|
|
42
58
|
// Skip files that can't be read
|
|
43
|
-
console.warn(`Failed to get metadata for ${smartFile.
|
|
59
|
+
console.warn(`Failed to get metadata for ${smartFile.absolutePath}:`, error.message);
|
|
44
60
|
}
|
|
45
61
|
}
|
|
46
62
|
} catch (error) {
|
|
@@ -104,7 +120,7 @@ export class LazyFileLoader {
|
|
|
104
120
|
// Load files in parallel
|
|
105
121
|
const loadPromises = metadata.map(async (meta) => {
|
|
106
122
|
try {
|
|
107
|
-
const contents = await plugins.
|
|
123
|
+
const contents = await plugins.fsInstance.file(meta.path).encoding('utf8').read() as string;
|
|
108
124
|
const tokenCount = tokenizer(contents);
|
|
109
125
|
|
|
110
126
|
const fileInfo: IFileInfo = {
|
|
@@ -138,7 +154,7 @@ export class LazyFileLoader {
|
|
|
138
154
|
tokenizer: (content: string) => number
|
|
139
155
|
): Promise<IFileInfo> {
|
|
140
156
|
const meta = await this.getMetadata(filePath);
|
|
141
|
-
const contents = await plugins.
|
|
157
|
+
const contents = await plugins.fsInstance.file(filePath).encoding('utf8').read() as string;
|
|
142
158
|
const tokenCount = tokenizer(contents);
|
|
143
159
|
const relativePath = plugins.path.relative(this.projectRoot, filePath);
|
|
144
160
|
|
package/ts/plugins.ts
CHANGED
|
@@ -10,6 +10,7 @@ import * as smartai from '@push.rocks/smartai';
|
|
|
10
10
|
import * as smartcli from '@push.rocks/smartcli';
|
|
11
11
|
import * as smartdelay from '@push.rocks/smartdelay';
|
|
12
12
|
import * as smartfile from '@push.rocks/smartfile';
|
|
13
|
+
import * as smartfs from '@push.rocks/smartfs';
|
|
13
14
|
import * as smartgit from '@push.rocks/smartgit';
|
|
14
15
|
import * as smartinteract from '@push.rocks/smartinteract';
|
|
15
16
|
import * as smartlog from '@push.rocks/smartlog';
|
|
@@ -25,6 +26,7 @@ export {
|
|
|
25
26
|
smartcli,
|
|
26
27
|
smartdelay,
|
|
27
28
|
smartfile,
|
|
29
|
+
smartfs,
|
|
28
30
|
smartgit,
|
|
29
31
|
smartinteract,
|
|
30
32
|
smartlog,
|
|
@@ -34,6 +36,13 @@ export {
|
|
|
34
36
|
smarttime,
|
|
35
37
|
};
|
|
36
38
|
|
|
39
|
+
// Create a shared SmartFs instance for filesystem operations
|
|
40
|
+
const smartFsNodeProvider = new smartfs.SmartFsProviderNode();
|
|
41
|
+
export const fsInstance = new smartfs.SmartFs(smartFsNodeProvider);
|
|
42
|
+
|
|
43
|
+
// Create a shared SmartFileFactory for in-memory file operations
|
|
44
|
+
export const smartfileFactory = smartfile.SmartFileFactory.nodeFs();
|
|
45
|
+
|
|
37
46
|
// @git.zone scope
|
|
38
47
|
import * as tspublish from '@git.zone/tspublish';
|
|
39
48
|
|