busy-cli 0.1.2 → 0.2.0

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/index.js CHANGED
@@ -3,13 +3,17 @@ import { Command } from 'commander';
3
3
  import { parseDocument, resolveImports } from '../parser.js';
4
4
  import { writeFile, readFile } from 'fs/promises';
5
5
  import { existsSync } from 'fs';
6
- import { resolve, basename } from 'path';
6
+ import { resolve, basename, dirname } from 'path';
7
+ import { fileURLToPath } from 'url';
7
8
  import { initWorkspace, checkWorkspace, addPackage, removePackage, upgradePackage, listPackages, getPackageInfo, } from '../commands/package.js';
9
+ // Read version from package.json
10
+ const __dirname = dirname(fileURLToPath(import.meta.url));
11
+ const packageJson = JSON.parse(await readFile(resolve(__dirname, '../../package.json'), 'utf-8'));
8
12
  const program = new Command();
9
13
  program
10
14
  .name('busy')
11
15
  .description('BUSY Document Parser CLI')
12
- .version('0.1.0');
16
+ .version(packageJson.version);
13
17
  // Parse command - parse a single BUSY document
14
18
  program
15
19
  .command('parse')
@@ -230,7 +230,7 @@ function createOperation(section, docId, filePath) {
230
230
  const id = `${docId}::${slug}`; // Use :: for concept IDs
231
231
  // Parse steps and checklist from content
232
232
  const { steps, checklist } = parseOperationContent(section);
233
- // Get extends from section heading (e.g., ## [ValidateInput][Operation])
233
+ // Get extends from section heading (e.g., ## [ValidateInput][SomeType])
234
234
  const extends_ = getSectionExtends(section.id);
235
235
  return {
236
236
  kind: 'operation',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busy-cli",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "CLI for BUSY document framework - parse, validate, and manage BUSY workspaces",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -367,7 +367,7 @@ Definition content.
367
367
  const content = `
368
368
  # [Operations]
369
369
 
370
- ## [Run Full Analysis][Operation]
370
+ ## [Run Full Analysis]
371
371
 
372
372
  ### [Steps]
373
373
  1. Analyze data
package/src/cli/index.ts CHANGED
@@ -4,7 +4,8 @@ import { Command } from 'commander';
4
4
  import { parseDocument, resolveImports } from '../parser.js';
5
5
  import { writeFile, readFile } from 'fs/promises';
6
6
  import { existsSync } from 'fs';
7
- import { resolve, basename } from 'path';
7
+ import { resolve, basename, dirname } from 'path';
8
+ import { fileURLToPath } from 'url';
8
9
  import {
9
10
  initWorkspace,
10
11
  checkWorkspace,
@@ -15,12 +16,16 @@ import {
15
16
  getPackageInfo,
16
17
  } from '../commands/package.js';
17
18
 
19
+ // Read version from package.json
20
+ const __dirname = dirname(fileURLToPath(import.meta.url));
21
+ const packageJson = JSON.parse(await readFile(resolve(__dirname, '../../package.json'), 'utf-8'));
22
+
18
23
  const program = new Command();
19
24
 
20
25
  program
21
26
  .name('busy')
22
27
  .description('BUSY Document Parser CLI')
23
- .version('0.1.0');
28
+ .version(packageJson.version);
24
29
 
25
30
  // Parse command - parse a single BUSY document
26
31
  program
@@ -303,7 +303,7 @@ function createOperation(
303
303
  // Parse steps and checklist from content
304
304
  const { steps, checklist } = parseOperationContent(section);
305
305
 
306
- // Get extends from section heading (e.g., ## [ValidateInput][Operation])
306
+ // Get extends from section heading (e.g., ## [ValidateInput][SomeType])
307
307
  const extends_ = getSectionExtends(section.id);
308
308
 
309
309
  return {