@diagramers/cli 1.0.44 → 1.0.46
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/index.js +24 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
@@ -5,16 +5,36 @@ const commander_1 = require("commander");
|
|
5
5
|
const init_1 = require("./commands/init");
|
6
6
|
const update_1 = require("./commands/update");
|
7
7
|
const extend_1 = require("./commands/extend");
|
8
|
+
const fs_1 = require("fs");
|
9
|
+
const path_1 = require("path");
|
8
10
|
const program = new commander_1.Command();
|
11
|
+
// Dynamically read CLI version
|
12
|
+
const cliPkg = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '..', 'package.json'), 'utf8'));
|
13
|
+
let apiVersion = 'not installed';
|
14
|
+
try {
|
15
|
+
const apiPkgPath = require.resolve('@diagramers/api/package.json', { paths: [process.cwd()] });
|
16
|
+
if ((0, fs_1.existsSync)(apiPkgPath)) {
|
17
|
+
const apiPkg = JSON.parse((0, fs_1.readFileSync)(apiPkgPath, 'utf8'));
|
18
|
+
apiVersion = apiPkg.version;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
catch { }
|
9
22
|
program
|
10
23
|
.name('diagramers')
|
11
24
|
.description('CLI tool for managing diagramers projects')
|
12
|
-
.version(
|
13
|
-
|
25
|
+
.version(cliPkg.version, '-V, --version', 'output the current version')
|
26
|
+
.addHelpText('after', `\nSub-library versions:\n @diagramers/cli: ${cliPkg.version}\n @diagramers/api: ${apiVersion}\n`);
|
27
|
+
// Custom version command for full version info
|
28
|
+
program
|
29
|
+
.command('version')
|
30
|
+
.description('Show CLI and sub-library versions')
|
31
|
+
.action(() => {
|
32
|
+
console.log(`@diagramers/cli: ${cliPkg.version}`);
|
33
|
+
console.log(`@diagramers/api: ${apiVersion}`);
|
34
|
+
});
|
14
35
|
(0, init_1.initCommand)(program);
|
15
36
|
(0, update_1.updateCommand)(program);
|
16
37
|
(0, extend_1.extendCommand)(program);
|
17
|
-
// Add help text
|
18
38
|
program.addHelpText('after', `
|
19
39
|
Examples:
|
20
40
|
$ diagramers init api my-new-project
|
@@ -26,9 +46,9 @@ Examples:
|
|
26
46
|
$ diagramers extend --relation user-posts --type mongodb
|
27
47
|
$ diagramers extend --list
|
28
48
|
`);
|
29
|
-
program.parse();
|
30
49
|
// If no command is provided, show help
|
31
50
|
if (!process.argv.slice(2).length) {
|
32
51
|
program.outputHelp();
|
33
52
|
}
|
53
|
+
program.parse(process.argv);
|
34
54
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,8CAAkD;AAClD,8CAAkD;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,8CAAkD;AAClD,8CAAkD;AAElD,2BAA8C;AAC9C,+BAA4B;AAE5B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,+BAA+B;AAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACvF,IAAI,UAAU,GAAG,eAAe,CAAC;AACjC,IAAI,CAAC;IACH,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC/F,IAAI,IAAA,eAAU,EAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;QAC5D,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;IAC9B,CAAC;AACH,CAAC;AAAC,MAAM,CAAC,CAAA,CAAC;AAEV,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,2CAA2C,CAAC;KACxD,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,4BAA4B,CAAC;KACtE,WAAW,CAAC,OAAO,EAAE,+CAA+C,MAAM,CAAC,OAAO,wBAAwB,UAAU,IAAI,CAAC,CAAC;AAE7H,+CAA+C;AAC/C,OAAO;KACJ,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,GAAG,EAAE;IACX,OAAO,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,oBAAoB,UAAU,EAAE,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC;AAEL,IAAA,kBAAW,EAAC,OAAO,CAAC,CAAC;AACrB,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC;AACvB,IAAA,sBAAa,EAAC,OAAO,CAAC,CAAC;AAEvB,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;CAU5B,CAAC,CAAC;AAEH,uCAAuC;AACvC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC;AAED,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@diagramers/cli",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.46",
|
4
4
|
"description": "Diagramers CLI - Command-line tools for managing Diagramers projects",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"bin": {
|
@@ -19,20 +19,20 @@
|
|
19
19
|
"publish": "./scripts/publish.sh"
|
20
20
|
},
|
21
21
|
"dependencies": {
|
22
|
-
"commander": "^11.1.0",
|
23
|
-
"inquirer": "^9.2.12",
|
24
22
|
"chalk": "^4.1.2",
|
23
|
+
"commander": "^11.1.0",
|
25
24
|
"fs-extra": "^11.2.0",
|
26
25
|
"glob": "^10.3.10",
|
26
|
+
"inquirer": "^9.2.12",
|
27
27
|
"yaml": "^2.3.4"
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
|
-
"@types/inquirer": "^9.0.7",
|
31
30
|
"@types/fs-extra": "^11.0.4",
|
32
31
|
"@types/glob": "^8.1.0",
|
32
|
+
"@types/inquirer": "^9.0.7",
|
33
33
|
"@types/node": "^20.10.0",
|
34
|
-
"
|
35
|
-
"
|
34
|
+
"ts-node": "^10.9.2",
|
35
|
+
"typescript": "^5.8.3"
|
36
36
|
},
|
37
37
|
"keywords": [
|
38
38
|
"diagramers",
|