@lazykedar/lazydocs 2.0.1 → 2.0.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/a.js +1 -1
- package/dist/cli.js +5 -1
- package/dist/o/r.js +1 -1
- package/package.json +1 -1
package/dist/a.js
CHANGED
|
@@ -57,7 +57,7 @@ function analyzeCode(dir, maxTokens = 6000) {
|
|
|
57
57
|
const fileStats = [];
|
|
58
58
|
// Load project config
|
|
59
59
|
let projectConfig = {};
|
|
60
|
-
const configPath = path.join(
|
|
60
|
+
const configPath = path.join(dir, '.lazydocs.json');
|
|
61
61
|
if (fs.existsSync(configPath)) {
|
|
62
62
|
try {
|
|
63
63
|
projectConfig = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
package/dist/cli.js
CHANGED
|
@@ -270,7 +270,7 @@ program
|
|
|
270
270
|
type: 'input',
|
|
271
271
|
name: 'input',
|
|
272
272
|
message: 'Input directory:',
|
|
273
|
-
default: './src',
|
|
273
|
+
default: fs.existsSync('./src') ? './src' : '.',
|
|
274
274
|
},
|
|
275
275
|
{
|
|
276
276
|
type: 'list',
|
|
@@ -285,6 +285,10 @@ program
|
|
|
285
285
|
]);
|
|
286
286
|
Object.assign(options, answers);
|
|
287
287
|
}
|
|
288
|
+
// Fallback to current directory if default input directory does not exist
|
|
289
|
+
if (options.input === './src' && !fs.existsSync('./src')) {
|
|
290
|
+
options.input = '.';
|
|
291
|
+
}
|
|
288
292
|
// Set default output
|
|
289
293
|
if (!options.output) {
|
|
290
294
|
const defaults = {
|
package/dist/o/r.js
CHANGED
|
@@ -66,7 +66,7 @@ async function generateReadme(inputDir, outputFile, apiKey, aiOptions, customTem
|
|
|
66
66
|
}));
|
|
67
67
|
// Try to read project name from package.json
|
|
68
68
|
let projectName = 'Your Project';
|
|
69
|
-
const packageJsonPath = path.join(
|
|
69
|
+
const packageJsonPath = path.join(inputDir, 'package.json');
|
|
70
70
|
if (fs.existsSync(packageJsonPath)) {
|
|
71
71
|
try {
|
|
72
72
|
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
package/package.json
CHANGED