helpshelf 0.4.0 → 0.4.1

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1579,7 +1579,12 @@ function readDocsDirectory(dir) {
1579
1579
  const files = readdirSync5(dir).filter((f) => f.endsWith(".md"));
1580
1580
  const articles = [];
1581
1581
  for (const file of files) {
1582
- const content = readFileSync3(join9(dir, file), "utf-8");
1582
+ let content;
1583
+ try {
1584
+ content = readFileSync3(join9(dir, file), "utf-8");
1585
+ } catch {
1586
+ continue;
1587
+ }
1583
1588
  const slug = basename3(file, ".md");
1584
1589
  const { frontmatter, body } = parseFrontmatter2(content);
1585
1590
  const title = frontmatter.title || slug.replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
@@ -1675,10 +1680,14 @@ async function initCommand() {
1675
1680
  }
1676
1681
  const gitignorePath = join10(dir, ".gitignore");
1677
1682
  if (existsSync10(gitignorePath)) {
1678
- const gitignore = readFileSync4(gitignorePath, "utf-8");
1679
- if (!gitignore.includes(".helpshelf/snapshot.json")) {
1680
- writeFileSync3(gitignorePath, gitignore.trimEnd() + "\n\n# HelpShelf\n.helpshelf/snapshot.json\n");
1681
- console.log(chalk3.green(" \u2713"), "Added .helpshelf/snapshot.json to .gitignore");
1683
+ try {
1684
+ const gitignore = readFileSync4(gitignorePath, "utf-8");
1685
+ if (!gitignore.includes(".helpshelf/snapshot.json")) {
1686
+ writeFileSync3(gitignorePath, gitignore.trimEnd() + "\n\n# HelpShelf\n.helpshelf/snapshot.json\n");
1687
+ console.log(chalk3.green(" \u2713"), "Added .helpshelf/snapshot.json to .gitignore");
1688
+ }
1689
+ } catch {
1690
+ console.log(chalk3.yellow(" \u26A0"), "Could not read .gitignore (file may be on iCloud)");
1682
1691
  }
1683
1692
  }
1684
1693
  console.log();
@@ -1768,7 +1777,7 @@ async function screenshotCommand(options) {
1768
1777
 
1769
1778
  // src/index.ts
1770
1779
  var program = new Command();
1771
- program.name("helpshelf").description("AI-agent toolkit for auto-generating support docs").version("0.4.0");
1780
+ program.name("helpshelf").description("AI-agent toolkit for auto-generating support docs").version("0.4.1");
1772
1781
  program.command("scan").description("Scan your codebase \u2192 snapshot.json + docs-template.json").option("-d, --dir <path>", "Project directory to scan", ".").option("-o, --output <path>", "Output file path", ".helpshelf/snapshot.json").option("--no-readme", "Skip README parsing").option("--no-deps", "Skip dependency analysis").option("--no-api", "Skip API route detection").option("--no-env", "Skip environment variable detection").option("--verbose", "Show detailed scan output").option("--quiet", "Suppress output (for programmatic use)").option("-u, --url <url>", "Also capture screenshots from a running app (e.g., http://localhost:3000)").option("-e, --email <email>", "Login email for screenshot auth").option("-p, --password <password>", "Login password for screenshot auth").option("-m, --max-pages <n>", "Max pages to screenshot", "20").action(scanCommand);
1773
1782
  program.command("screenshot").description("Capture screenshots of your running app's pages").requiredOption("-u, --url <url>", "URL of your running app (e.g., http://localhost:3000)").option("-e, --email <email>", "Login email for authenticated pages").option("-p, --password <password>", "Login password").option("-s, --snapshot <path>", "Path to scan snapshot (for route intelligence)", ".helpshelf/snapshot.json").option("-o, --output <path>", "Output directory for screenshots", ".helpshelf/screenshots").option("-m, --max-pages <n>", "Maximum pages to capture", "20").action(screenshotCommand);
1774
1783
  program.command("push").description("Push docs to HelpShelf (creates account if needed)").option("--email <email>", "HelpShelf account email").option("--domain <domain>", "Your app domain (for help center URL)").option("--docs-dir <path>", "Directory containing markdown docs", ".helpshelf/docs").option("--site <hash>", "Existing HelpShelf site hash").option("--api-key <key>", "Existing HelpShelf API key").option("--api-url <url>", "HelpShelf API URL", "https://app.helpshelf.com").option("--dry-run", "Preview what would be pushed without sending").action(pushCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "helpshelf",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Scan your codebase and auto-generate support docs for HelpShelf",
5
5
  "type": "module",
6
6
  "bin": {