sdocs-dev 1.4.0 → 1.4.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/bin/sdocs-dev.js +15 -6
- package/package.json +1 -1
package/bin/sdocs-dev.js
CHANGED
|
@@ -44,6 +44,7 @@ SDocs (sdocs.dev) renders markdown with clean styling you can adjust.
|
|
|
44
44
|
Content lives in the URL hash — nothing hits a server.
|
|
45
45
|
|
|
46
46
|
Use it (or offer it) when the user wants to read, share, or export a \`.md\` file.
|
|
47
|
+
Also handy for copying specific code - SDocs code blocks have copy buttons.
|
|
47
48
|
|
|
48
49
|
The \`sdoc\` CLI is installed globally:
|
|
49
50
|
- \`sdoc file.md\` — open styled in browser (great for easy reading).
|
|
@@ -178,28 +179,36 @@ async function runSetup({ force = false } = {}) {
|
|
|
178
179
|
const opencodeAlreadyDone = fileHasBlock(path.join(os.homedir(), '.config', 'opencode', 'AGENTS.md'));
|
|
179
180
|
if (opencodeAlreadyDone) {
|
|
180
181
|
writeSetupState({ setupCompleted: new Date().toISOString(), writtenTo: [], declined: false });
|
|
182
|
+
console.log('\nSDocs is already set up in all detected agent configs. Nothing to do.');
|
|
181
183
|
return;
|
|
182
184
|
}
|
|
183
|
-
console.log('\
|
|
185
|
+
console.log('\n\u2728\u2500\u2500\u2500\u2500\u2500\u2500\u2500 SDocs setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2728');
|
|
186
|
+
console.log('First run only - wire SDocs into your coding agents.\n');
|
|
187
|
+
console.log('No coding-agent configs detected.');
|
|
184
188
|
const a = await ask('Do you use opencode? [y/N] ');
|
|
185
189
|
const writtenTo = [];
|
|
186
190
|
if (a === 'y' || a === 'yes') {
|
|
187
191
|
const target = path.join(os.homedir(), '.config', 'opencode', 'AGENTS.md');
|
|
188
192
|
try { appendBlockTo(target); writtenTo.push(target); console.log(`\u2713 Wrote SDocs section to ${target}`); }
|
|
189
193
|
catch (e) { console.error(`Failed to write ${target}: ${e.message}`); }
|
|
194
|
+
console.log('Done. Run `sdoc setup` any time to revisit.');
|
|
195
|
+
} else {
|
|
196
|
+
console.log('Skipped. Run `sdoc setup` any time to revisit.');
|
|
190
197
|
}
|
|
191
198
|
writeSetupState({ setupCompleted: new Date().toISOString(), writtenTo, declined: writtenTo.length === 0 });
|
|
192
|
-
console.log('Run `sdoc setup` any time to revisit.');
|
|
193
199
|
return;
|
|
194
200
|
}
|
|
195
201
|
|
|
196
|
-
console.log('\
|
|
202
|
+
console.log('\n\u2728\u2500\u2500\u2500\u2500\u2500\u2500\u2500 SDocs setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2728');
|
|
203
|
+
console.log('First run only - wire SDocs into your coding agents.\n');
|
|
197
204
|
console.log('Detected: ' + detected.map(t => t.name).join(', '));
|
|
198
205
|
console.log('\nWill append a short SDocs section to:');
|
|
199
206
|
for (const t of detected) console.log(' ' + t.filePath);
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
console.log(
|
|
207
|
+
const RULE = '\u2550'.repeat(36);
|
|
208
|
+
const previewBody = AGENT_BLOCK.replace(AGENT_BLOCK_MARKER + '\n', '').trim();
|
|
209
|
+
console.log(`\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 Block to add \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
210
|
+
console.log(previewBody);
|
|
211
|
+
console.log(RULE + '\n');
|
|
203
212
|
|
|
204
213
|
const a = await ask('Add to all? [Y/n/skip] ');
|
|
205
214
|
const skipped = a === 'skip' || (a && a !== 'y' && a !== 'yes');
|