@dhis2/cli 5.2.0-alpha.9 → 5.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/package.json +6 -6
- package/src/commands/debug/cache.js +21 -16
- package/src/commands/debug.js +1 -1
- package/src/index.js +18 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2/cli",
|
|
3
|
-
"version": "5.2.0
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "A command line interface for DHIS2 development workflows",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Austin McGee <austin@dhis2.org>",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"node": ">=12"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@dhis2/cli-app": "5.2.0
|
|
16
|
-
"@dhis2/cli-cluster": "5.2.0
|
|
17
|
-
"@dhis2/cli-create": "5.2.0-alpha.
|
|
15
|
+
"@dhis2/cli-app": "5.2.0",
|
|
16
|
+
"@dhis2/cli-cluster": "5.2.0",
|
|
17
|
+
"@dhis2/cli-create": "5.2.0-alpha.14",
|
|
18
18
|
"@dhis2/cli-helpers-engine": "^3.2.1",
|
|
19
|
-
"@dhis2/cli-style": "^
|
|
20
|
-
"@dhis2/cli-utils": "5.2.0
|
|
19
|
+
"@dhis2/cli-style": "^10.7.9",
|
|
20
|
+
"@dhis2/cli-utils": "5.2.0",
|
|
21
21
|
"cli-table3": "^0.6.0",
|
|
22
22
|
"envinfo": "^7.5.0",
|
|
23
23
|
"inquirer": "^7.1.0"
|
|
@@ -33,18 +33,18 @@ const parse = async ({ item = '/', getCache }) => {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const builder = yargs => {
|
|
36
|
+
const builder = (yargs) => {
|
|
37
37
|
yargs.command(
|
|
38
38
|
'location [item]',
|
|
39
39
|
'Get the filesystem location of a cache item',
|
|
40
40
|
{},
|
|
41
|
-
async argv => {
|
|
41
|
+
async (argv) => {
|
|
42
42
|
const { loc } = await parse(argv)
|
|
43
43
|
reporter.print(loc)
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
|
|
47
|
-
yargs.command('list [item]', 'List cache items', {}, async argv => {
|
|
47
|
+
yargs.command('list [item]', 'List cache items', {}, async (argv) => {
|
|
48
48
|
const { item, cache, exists } = await parse(argv)
|
|
49
49
|
if (!exists) {
|
|
50
50
|
reporter.info(`Cached item ${chalk.bold(item)} does not exist`)
|
|
@@ -55,7 +55,7 @@ const builder = yargs => {
|
|
|
55
55
|
head: ['Name', 'Size', 'Modified'],
|
|
56
56
|
})
|
|
57
57
|
if (stat.children) {
|
|
58
|
-
Object.keys(stat.children).forEach(name => {
|
|
58
|
+
Object.keys(stat.children).forEach((name) => {
|
|
59
59
|
printStats(table, name, stat.children[name])
|
|
60
60
|
})
|
|
61
61
|
} else {
|
|
@@ -64,19 +64,24 @@ const builder = yargs => {
|
|
|
64
64
|
reporter.print(table)
|
|
65
65
|
})
|
|
66
66
|
|
|
67
|
-
yargs.command(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
67
|
+
yargs.command(
|
|
68
|
+
'status [item]',
|
|
69
|
+
'Get cache item status',
|
|
70
|
+
{},
|
|
71
|
+
async (argv) => {
|
|
72
|
+
const { item, exists, loc } = await parse(argv)
|
|
73
|
+
reporter.print('CACHE STATUS')
|
|
74
|
+
reporter.print(
|
|
75
|
+
`\t${chalk.green.bold(item)}\t\t${
|
|
76
|
+
exists
|
|
77
|
+
? `${chalk.blue.bold('EXISTS')}`
|
|
78
|
+
: chalk.red.bold('DOES NOT EXIST')
|
|
79
|
+
}\t@ ${loc}`
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
)
|
|
78
83
|
|
|
79
|
-
yargs.command('purge [item]', 'Purge cache item', {}, async argv => {
|
|
84
|
+
yargs.command('purge [item]', 'Purge cache item', {}, async (argv) => {
|
|
80
85
|
const { item, isRoot, exists, cache } = await parse(argv)
|
|
81
86
|
if (!exists) {
|
|
82
87
|
reporter.info(`Cached item ${chalk.bold(item)} does not exist`)
|
package/src/commands/debug.js
CHANGED
package/src/index.js
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {
|
|
2
|
+
namespace,
|
|
3
|
+
createModuleLoader,
|
|
4
|
+
chalk,
|
|
5
|
+
} = require('@dhis2/cli-helpers-engine')
|
|
2
6
|
|
|
3
7
|
const command = namespace('d2', {
|
|
4
8
|
desc: 'DHIS2 CLI',
|
|
5
|
-
builder: yargs => {
|
|
9
|
+
builder: (yargs) => {
|
|
6
10
|
const loader = createModuleLoader({
|
|
7
11
|
parentModule: __filename,
|
|
8
12
|
})
|
|
9
13
|
|
|
14
|
+
if (!yargs.argv._?.[0]) {
|
|
15
|
+
console.log(
|
|
16
|
+
chalk.yellowBright(
|
|
17
|
+
`Check the D2 CLI documentation: ${chalk.underline(
|
|
18
|
+
'https://developers.dhis2.org/docs/cli'
|
|
19
|
+
)}. To create new web apps, you can also now run ${chalk.cyan(
|
|
20
|
+
'npm create @dhis2/app'
|
|
21
|
+
)}.\n`
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
10
26
|
yargs.command(loader('@dhis2/cli-app'))
|
|
11
27
|
yargs.command(loader('@dhis2/cli-cluster'))
|
|
12
28
|
yargs.command(loader('@dhis2/cli-create'))
|