busy-cli 0.1.2 → 0.1.3
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 +6 -2
- package/package.json +1 -1
- package/src/cli/index.ts +7 -2
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(
|
|
16
|
+
.version(packageJson.version);
|
|
13
17
|
// Parse command - parse a single BUSY document
|
|
14
18
|
program
|
|
15
19
|
.command('parse')
|
package/package.json
CHANGED
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(
|
|
28
|
+
.version(packageJson.version);
|
|
24
29
|
|
|
25
30
|
// Parse command - parse a single BUSY document
|
|
26
31
|
program
|