@dinoxx/dinox-cli 1.0.13 → 1.0.14
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SKILLS_REPO_URL } from '../../constants/links.js';
|
|
1
2
|
import { printYaml } from '../../utils/output.js';
|
|
2
3
|
import { getPackageVersion } from '../../utils/version.js';
|
|
3
4
|
export function registerInfoCommand(program) {
|
|
@@ -10,11 +11,13 @@ export function registerInfoCommand(program) {
|
|
|
10
11
|
const payload = {
|
|
11
12
|
name: 'dino',
|
|
12
13
|
version: getPackageVersion(),
|
|
14
|
+
skills_repo: SKILLS_REPO_URL,
|
|
13
15
|
};
|
|
14
16
|
if (jsonOutput) {
|
|
15
17
|
printYaml(payload);
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
18
20
|
console.log(payload.version);
|
|
21
|
+
console.log(`skills repo: ${payload.skills_repo}`);
|
|
19
22
|
});
|
|
20
23
|
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
-
|
|
2
|
+
type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
|
|
3
|
+
type LogFn = (...parts: unknown[]) => void;
|
|
4
|
+
type UpdateCommandDeps = {
|
|
5
|
+
detectPackageManager: () => PackageManager;
|
|
6
|
+
runUpdate: (pm: PackageManager) => Promise<void>;
|
|
7
|
+
getVersion: () => string;
|
|
8
|
+
log: LogFn;
|
|
9
|
+
};
|
|
10
|
+
export declare function registerUpdateCommand(program: Command, overrides?: Partial<UpdateCommandDeps>): void;
|
|
11
|
+
export {};
|
package/dist/commands/update.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
+
import { SKILLS_REPO_URL } from '../constants/links.js';
|
|
2
3
|
import { getPackageVersion } from '../utils/version.js';
|
|
3
4
|
const PACKAGE_NAME = '@dinoxx/dinox-cli';
|
|
4
5
|
function detectPackageManager() {
|
|
@@ -32,15 +33,30 @@ function runUpdate(pm) {
|
|
|
32
33
|
child.on('error', reject);
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
function resolveDeps(overrides) {
|
|
37
|
+
return {
|
|
38
|
+
detectPackageManager,
|
|
39
|
+
runUpdate,
|
|
40
|
+
getVersion: getPackageVersion,
|
|
41
|
+
log: console.log,
|
|
42
|
+
...overrides,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function printSkillsReminder(log) {
|
|
46
|
+
log(`skills repo: ${SKILLS_REPO_URL}`);
|
|
47
|
+
log('ai reminder: review and update local Dinox skills after CLI updates (especially dino-dinox and dino-update-cli).');
|
|
48
|
+
}
|
|
49
|
+
export function registerUpdateCommand(program, overrides = {}) {
|
|
50
|
+
const deps = resolveDeps(overrides);
|
|
36
51
|
program
|
|
37
52
|
.command('update')
|
|
38
53
|
.description(`Update ${PACKAGE_NAME} to the latest version`)
|
|
39
54
|
.action(async () => {
|
|
40
|
-
const pm = detectPackageManager();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
await runUpdate(pm);
|
|
44
|
-
|
|
55
|
+
const pm = deps.detectPackageManager();
|
|
56
|
+
deps.log(`current version: ${deps.getVersion()}`);
|
|
57
|
+
deps.log(`updating ${PACKAGE_NAME} via ${pm}...`);
|
|
58
|
+
await deps.runUpdate(pm);
|
|
59
|
+
deps.log('done');
|
|
60
|
+
printSkillsReminder(deps.log);
|
|
45
61
|
});
|
|
46
62
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SKILLS_REPO_URL = "https://github.com/ryzencool/dinox-cli-skills";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const SKILLS_REPO_URL = 'https://github.com/ryzencool/dinox-cli-skills';
|