skrypt-ai 0.1.4 → 0.1.5

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/cli.js CHANGED
@@ -5,7 +5,7 @@ import { initCommand } from './commands/init.js';
5
5
  import { watchCommand } from './commands/watch.js';
6
6
  import { autofixCommand } from './commands/autofix.js';
7
7
  import { reviewPRCommand } from './commands/review-pr.js';
8
- const VERSION = '0.1.4';
8
+ const VERSION = '0.1.5';
9
9
  async function checkForUpdates() {
10
10
  try {
11
11
  const res = await fetch('https://registry.npmjs.org/skrypt-ai/latest', {
@@ -103,7 +103,8 @@ export function classifyElements(elements) {
103
103
  for (const element of elements) {
104
104
  const classification = classifyElement(element);
105
105
  const group = groups.get(classification.type);
106
- group.push(element);
106
+ if (group)
107
+ group.push(element);
107
108
  }
108
109
  return groups;
109
110
  }
@@ -115,7 +116,7 @@ export function getRecommendedStructure(elements) {
115
116
  const sections = [];
116
117
  const stats = { api: 0, guide: 0, tutorial: 0, overview: 0 };
117
118
  // API Reference section
118
- const apiElements = classified.get('api');
119
+ const apiElements = classified.get('api') ?? [];
119
120
  if (apiElements.length > 0) {
120
121
  sections.push({
121
122
  name: 'API Reference',
@@ -125,7 +126,7 @@ export function getRecommendedStructure(elements) {
125
126
  stats.api = apiElements.length;
126
127
  }
127
128
  // Guides section
128
- const guideElements = classified.get('guide');
129
+ const guideElements = classified.get('guide') ?? [];
129
130
  if (guideElements.length > 0) {
130
131
  sections.push({
131
132
  name: 'Guides',
@@ -135,7 +136,7 @@ export function getRecommendedStructure(elements) {
135
136
  stats.guide = guideElements.length;
136
137
  }
137
138
  // Tutorials section
138
- const tutorialElements = classified.get('tutorial');
139
+ const tutorialElements = classified.get('tutorial') ?? [];
139
140
  if (tutorialElements.length > 0) {
140
141
  sections.push({
141
142
  name: 'Tutorials',
@@ -145,7 +146,7 @@ export function getRecommendedStructure(elements) {
145
146
  stats.tutorial = tutorialElements.length;
146
147
  }
147
148
  // Overview/Other
148
- const overviewElements = classified.get('overview');
149
+ const overviewElements = classified.get('overview') ?? [];
149
150
  if (overviewElements.length > 0) {
150
151
  sections.push({
151
152
  name: 'Overview',
@@ -91,7 +91,6 @@ pub fn parse_config(s: &str) -> Config {
91
91
  expect(result.files.length).toBeGreaterThanOrEqual(4);
92
92
  expect(result.totalElements).toBeGreaterThanOrEqual(8);
93
93
  // Check we found elements from each language
94
- const allElements = result.files.flatMap(f => f.elements);
95
94
  const languages = new Set(result.files.map(f => f.language));
96
95
  expect(languages.has('typescript')).toBe(true);
97
96
  expect(languages.has('python')).toBe(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skrypt-ai",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "AI-powered documentation generator with code examples",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",