@mono-labs/cli 0.0.209 → 0.0.210

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.
@@ -46,13 +46,24 @@ async function generateDocsIndex({ docsDir, excludeFile, }) {
46
46
  const match = contents.match(/^#\s+(.+)$/m);
47
47
  if (!match)
48
48
  continue;
49
- const title = match[1].trim();
49
+ const rawTitle = match[1].trim();
50
50
  const relativeLink = `./${entry.name}`;
51
- links.push(`[${title}](${relativeLink})`);
51
+ /**
52
+ * Detect leading non-alphanumeric characters (emoji / symbols).
53
+ * This matches one or more Unicode characters that are NOT letters or numbers.
54
+ */
55
+ const leadingSymbolMatch = rawTitle.match(/^([^\p{L}\p{N}]+)\s*(.+)$/u);
56
+ if (leadingSymbolMatch) {
57
+ const [, symbol, title] = leadingSymbolMatch;
58
+ links.push(`- ${symbol} [${title}](${relativeLink})`);
59
+ }
60
+ else {
61
+ links.push(`- [${rawTitle}](${relativeLink})`);
62
+ }
52
63
  }
53
- // Sort alphabetically by title for stability
64
+ // Sort alphabetically by rendered text (stable output)
54
65
  links.sort((a, b) => a.localeCompare(b));
55
- // Append Back to Readme (hardcoded)
66
+ // Append Back to Readme
56
67
  links.push('');
57
68
  links.push('🏠 ← [Back to README](../README.md)');
58
69
  return links.join('\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.209",
3
+ "version": "0.0.210",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types.d.ts",
@@ -53,18 +53,29 @@ export async function generateDocsIndex({
53
53
  const match = contents.match(/^#\s+(.+)$/m);
54
54
  if (!match) continue;
55
55
 
56
- const title = match[1].trim();
56
+ const rawTitle = match[1].trim();
57
57
  const relativeLink = `./${entry.name}`;
58
58
 
59
- links.push(`[${title}](${relativeLink})`);
59
+ /**
60
+ * Detect leading non-alphanumeric characters (emoji / symbols).
61
+ * This matches one or more Unicode characters that are NOT letters or numbers.
62
+ */
63
+ const leadingSymbolMatch = rawTitle.match(/^([^\p{L}\p{N}]+)\s*(.+)$/u);
64
+
65
+ if (leadingSymbolMatch) {
66
+ const [, symbol, title] = leadingSymbolMatch;
67
+ links.push(`- ${symbol} [${title}](${relativeLink})`);
68
+ } else {
69
+ links.push(`- [${rawTitle}](${relativeLink})`);
70
+ }
60
71
  }
61
72
 
62
- // Sort alphabetically by title for stability
73
+ // Sort alphabetically by rendered text (stable output)
63
74
  links.sort((a, b) => a.localeCompare(b));
64
75
 
65
- // Append Back to Readme (hardcoded)
76
+ // Append Back to Readme
66
77
  links.push('');
67
-
68
78
  links.push('🏠 ← [Back to README](../README.md)');
79
+
69
80
  return links.join('\n');
70
81
  }