spaps 0.2.5 ā 0.2.7
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/bin/spaps.js +38 -0
- package/package.json +1 -1
- package/src/docs-html.js +763 -0
- package/src/docs-system.js +806 -0
- package/src/local-server.js +2 -94
package/bin/spaps.js
CHANGED
|
@@ -14,6 +14,7 @@ const path = require('path');
|
|
|
14
14
|
const fs = require('fs');
|
|
15
15
|
const { handleError } = require('../src/error-handler');
|
|
16
16
|
const { showInteractiveHelp, showQuickHelp } = require('../src/help-system');
|
|
17
|
+
const { showInteractiveDocs, showQuickReference, searchDocs } = require('../src/docs-system');
|
|
17
18
|
|
|
18
19
|
const version = require('../package.json').version;
|
|
19
20
|
|
|
@@ -194,6 +195,43 @@ program
|
|
|
194
195
|
}
|
|
195
196
|
});
|
|
196
197
|
|
|
198
|
+
// Docs command - SDK documentation
|
|
199
|
+
program
|
|
200
|
+
.command('docs')
|
|
201
|
+
.description('Browse SDK documentation')
|
|
202
|
+
.option('-i, --interactive', 'Interactive documentation browser')
|
|
203
|
+
.option('-s, --search <query>', 'Search documentation')
|
|
204
|
+
.option('--json', 'Output in JSON format')
|
|
205
|
+
.action(async (options) => {
|
|
206
|
+
if (options.search) {
|
|
207
|
+
const results = searchDocs(options.search);
|
|
208
|
+
|
|
209
|
+
if (options.json) {
|
|
210
|
+
console.log(JSON.stringify({ results }, null, 2));
|
|
211
|
+
} else {
|
|
212
|
+
console.log(chalk.yellow(`\nš Search results for "${options.search}":\n`));
|
|
213
|
+
|
|
214
|
+
if (results.length === 0) {
|
|
215
|
+
console.log(chalk.gray(' No results found'));
|
|
216
|
+
} else {
|
|
217
|
+
results.forEach((result, i) => {
|
|
218
|
+
console.log(chalk.green(` ${i + 1}. ${result.title}`));
|
|
219
|
+
console.log(chalk.gray(` ${result.preview}`));
|
|
220
|
+
console.log();
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
console.log(chalk.blue(' Run: npx spaps docs --interactive'));
|
|
225
|
+
console.log(chalk.blue(' to browse full documentation\n'));
|
|
226
|
+
}
|
|
227
|
+
} else if (options.interactive) {
|
|
228
|
+
await showInteractiveDocs();
|
|
229
|
+
} else {
|
|
230
|
+
// Default to quick reference
|
|
231
|
+
showQuickReference();
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
197
235
|
// Help command enhancement
|
|
198
236
|
program.on('--help', () => {
|
|
199
237
|
console.log();
|