feat(cli): Add CLI support with command parsing and version display
This commit is contained in:
parent
761f9ca1b6
commit
c4a082031e
@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-03-01 - 1.3.0 - feat(cli)
|
||||||
|
Add CLI support with command parsing and version display
|
||||||
|
|
||||||
|
- Added a basic CLI interface using smartcli.
|
||||||
|
- Implemented command parsing with a 'restart' command.
|
||||||
|
- Integrated project version display in the CLI.
|
||||||
|
|
||||||
## 2025-03-01 - 1.2.0 - feat(core)
|
## 2025-03-01 - 1.2.0 - feat(core)
|
||||||
Introduce ProcessMonitor with memory management and spawning features
|
Introduce ProcessMonitor with memory management and spawning features
|
||||||
|
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild --web --allowimplicitany)",
|
"build": "(tsbuild --web --allowimplicitany)",
|
||||||
"buildDocs": "(tsdoc)"
|
"buildDocs": "(tsdoc)",
|
||||||
|
"start": "(tsrun ./cli.ts -v)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.25",
|
"@git.zone/tsbuild": "^2.1.25",
|
||||||
@ -22,6 +23,7 @@
|
|||||||
"@types/node": "^22.13.8"
|
"@types/node": "^22.13.8"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@push.rocks/projectinfo": "^5.0.2",
|
||||||
"@push.rocks/smartcli": "^4.0.11",
|
"@push.rocks/smartcli": "^4.0.11",
|
||||||
"@push.rocks/smartpath": "^5.0.18",
|
"@push.rocks/smartpath": "^5.0.18",
|
||||||
"pidusage": "^4.0.0",
|
"pidusage": "^4.0.0",
|
||||||
|
13
pnpm-lock.yaml
generated
13
pnpm-lock.yaml
generated
@ -8,6 +8,9 @@ importers:
|
|||||||
|
|
||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@push.rocks/projectinfo':
|
||||||
|
specifier: ^5.0.2
|
||||||
|
version: 5.0.2
|
||||||
'@push.rocks/smartcli':
|
'@push.rocks/smartcli':
|
||||||
specifier: ^4.0.11
|
specifier: ^4.0.11
|
||||||
version: 4.0.11
|
version: 4.0.11
|
||||||
@ -710,6 +713,9 @@ packages:
|
|||||||
'@push.rocks/mongodump@1.0.8':
|
'@push.rocks/mongodump@1.0.8':
|
||||||
resolution: {integrity: sha512-oDufyjNBg8I50OaJvbHhc0RnRpJQ544dr9her0G6sA8JmI3hD2/amTdcPLVIX1kzYf5GsTUKeWuRaZgdNqz3ew==}
|
resolution: {integrity: sha512-oDufyjNBg8I50OaJvbHhc0RnRpJQ544dr9her0G6sA8JmI3hD2/amTdcPLVIX1kzYf5GsTUKeWuRaZgdNqz3ew==}
|
||||||
|
|
||||||
|
'@push.rocks/projectinfo@5.0.2':
|
||||||
|
resolution: {integrity: sha512-zzieCal6jwR++o+fDl8gMpWkNV2cGEsbT96vCNZu/H9kr0iqRmapOiA4DFadkhOnhlDqvRr6TPaXESu2YUbI8Q==}
|
||||||
|
|
||||||
'@push.rocks/qenv@6.1.0':
|
'@push.rocks/qenv@6.1.0':
|
||||||
resolution: {integrity: sha512-1FUFMlSVwFSFg8LbqfkzJ2LLP4lMGApUtgOpsvrde6+AxBmB4gjoNgCUH7z3xXfDAtYqcrtSELXBNE0xVL1MqQ==}
|
resolution: {integrity: sha512-1FUFMlSVwFSFg8LbqfkzJ2LLP4lMGApUtgOpsvrde6+AxBmB4gjoNgCUH7z3xXfDAtYqcrtSELXBNE0xVL1MqQ==}
|
||||||
|
|
||||||
@ -5412,6 +5418,13 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- aws-crt
|
- aws-crt
|
||||||
|
|
||||||
|
'@push.rocks/projectinfo@5.0.2':
|
||||||
|
dependencies:
|
||||||
|
'@push.rocks/smartfile': 10.0.41
|
||||||
|
'@push.rocks/smartpath': 5.0.18
|
||||||
|
'@push.rocks/smartpromise': 4.2.3
|
||||||
|
'@push.rocks/smartstring': 4.0.15
|
||||||
|
|
||||||
'@push.rocks/qenv@6.1.0':
|
'@push.rocks/qenv@6.1.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@api.global/typedrequest': 3.1.10
|
'@api.global/typedrequest': 3.1.10
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tspm',
|
name: '@git.zone/tspm',
|
||||||
version: '1.2.0',
|
version: '1.3.0',
|
||||||
description: 'a no fuzz process manager'
|
description: 'a no fuzz process manager'
|
||||||
}
|
}
|
||||||
|
21
ts/cli.ts
Normal file
21
ts/cli.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import * as plugins from './plugins.js';
|
||||||
|
import * as paths from './paths.js';
|
||||||
|
|
||||||
|
export const run = async () => {
|
||||||
|
const tspmProjectinfo = new plugins.projectinfo.ProjectInfo(paths.packageDir);
|
||||||
|
|
||||||
|
const smartcliInstance = new plugins.smartcli.Smartcli();
|
||||||
|
smartcliInstance.addVersion(tspmProjectinfo.npm.version);
|
||||||
|
|
||||||
|
smartcliInstance.standardCommand().subscribe({
|
||||||
|
next: (argvArg) => {
|
||||||
|
console.log(`Please specify a command.`)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
smartcliInstance.addCommand('restart').subscribe({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
smartcliInstance.startParse();
|
||||||
|
}
|
@ -1,2 +1,11 @@
|
|||||||
export * from './classes.tspm.js';
|
export * from './classes.tspm.js';
|
||||||
export * from './classes.processmonitor.js';
|
export * from './classes.processmonitor.js';
|
||||||
|
|
||||||
|
import * as cli from './cli.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* called to run as cli
|
||||||
|
*/
|
||||||
|
export const runCli = async () => {
|
||||||
|
await cli.run();
|
||||||
|
}
|
@ -8,10 +8,12 @@ export {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @push.rocks scope
|
// @push.rocks scope
|
||||||
|
import * as projectinfo from '@push.rocks/projectinfo';
|
||||||
import * as smartpath from '@push.rocks/smartpath';
|
import * as smartpath from '@push.rocks/smartpath';
|
||||||
import * as smartcli from '@push.rocks/smartcli';
|
import * as smartcli from '@push.rocks/smartcli';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
projectinfo,
|
||||||
smartpath,
|
smartpath,
|
||||||
smartcli,
|
smartcli,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user