@thegetty/quire-cli 1.0.0-rc.15 → 1.0.0-rc.16
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/CHANGELOG.md +0 -6
- package/package.json +5 -2
- package/patches/README.md +5 -0
- package/patches/install-npm-version+1.0.8.patch +12119 -0
- package/src/LOGGING.md +16 -0
- package/src/commands/config/config-get.js +35 -0
- package/src/commands/config/config-reset.js +34 -0
- package/src/commands/config/config-set.js +37 -0
package/src/LOGGING.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
## Logging
|
|
3
|
+
|
|
4
|
+
- https://betterstack.com/community/guides/logging/nodejs-logging-best-practices/
|
|
5
|
+
|
|
6
|
+
### `debug-js`
|
|
7
|
+
- https://github.com/debug-js/debug
|
|
8
|
+
- https://github.com/commenthol/debug-level
|
|
9
|
+
|
|
10
|
+
### Pino
|
|
11
|
+
- https://betterstack.com/community/guides/logging/how-to-install-setup-and-use-pino-to-log-node-js-applications/
|
|
12
|
+
- https://github.com/pinojs/pino
|
|
13
|
+
|
|
14
|
+
### Winston
|
|
15
|
+
- https://betterstack.com/community/guides/logging/how-to-install-setup-and-use-winston-and-morgan-to-log-node-js-applications/
|
|
16
|
+
- https://github.com/winstonjs/winston
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Command from '#src/Command.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Quire CLI `config get` Command
|
|
5
|
+
*
|
|
6
|
+
* @class ConfigGetCommand
|
|
7
|
+
* @extends {Command}
|
|
8
|
+
*/
|
|
9
|
+
export default class ConfigGetCommand extends Command {
|
|
10
|
+
static definition = {
|
|
11
|
+
name: 'config-get',
|
|
12
|
+
description: 'Get the value of a Quire CLI configuration property',
|
|
13
|
+
summary: 'get a cli configuration property',
|
|
14
|
+
version: '1.0.0',
|
|
15
|
+
args: [
|
|
16
|
+
[ '[property]', 'configuration property' ]
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
constructor() {
|
|
21
|
+
super(ConfigGetCommand.definition)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {String} key
|
|
26
|
+
* @param {Object} options
|
|
27
|
+
* @return {Promise}
|
|
28
|
+
*/
|
|
29
|
+
async action(property, options = {}) {
|
|
30
|
+
for (const [ key, value ] of Object.entries(this.config.store)) {
|
|
31
|
+
if (key.startsWith('__internal__') && !options.debug) continue
|
|
32
|
+
console.info(`${key}: ${JSON.stringify(value, null, 2)}`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Command from '#src/Command.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Quire CLI `config reset` Command
|
|
5
|
+
*
|
|
6
|
+
* @class ConfigResetCommand
|
|
7
|
+
* @extends {Command}
|
|
8
|
+
*/
|
|
9
|
+
export default class ConfigResetCommand extends Command {
|
|
10
|
+
static definition = {
|
|
11
|
+
name: 'config-reset',
|
|
12
|
+
description: 'Reset the Quire CLI configuration to the default',
|
|
13
|
+
summary: 'reset cli configuration properties to default values',
|
|
14
|
+
version: '1.0.0',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
super(ConfigResetCommand.definition)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @return {Promise}
|
|
23
|
+
*/
|
|
24
|
+
async action(options = {}) {
|
|
25
|
+
if (options.debug) {
|
|
26
|
+
console.info('Command \'%s\' called with options %o', this.name(), options)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
for (const [ key, value ] of Object.entries(this.config.store)) {
|
|
30
|
+
if (key.startsWith('__internal__') && !options.debug) continue
|
|
31
|
+
console.info(`${key}: ${JSON.stringify(value, null, 2)}`)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Command from '#src/Command.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Quire CLI `config set` Command
|
|
5
|
+
*
|
|
6
|
+
* @class ConfigCommand
|
|
7
|
+
* @extends {Command}
|
|
8
|
+
*/
|
|
9
|
+
export default class ConfigSetCommand extends Command {
|
|
10
|
+
static definition = {
|
|
11
|
+
name: 'config-set',
|
|
12
|
+
description: 'Set a Quire CLI configuration property',
|
|
13
|
+
summary: 'set a cli configuration property',
|
|
14
|
+
version: '1.0.0',
|
|
15
|
+
args: [
|
|
16
|
+
[ '[key]', 'configuration property key' ],
|
|
17
|
+
[ '[value]', 'configuration property value' ]
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
super(ConfigSetCommand.definition)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @param {String} key
|
|
27
|
+
* @param {String} value
|
|
28
|
+
* @param {Object} options
|
|
29
|
+
* @return {Promise}
|
|
30
|
+
*/
|
|
31
|
+
async action(key, value, options = {}) {
|
|
32
|
+
for (const [ key, value ] of Object.entries(this.config.store)) {
|
|
33
|
+
if (key.startsWith('__internal__') && !options.debug) continue
|
|
34
|
+
console.info(`${key}: ${JSON.stringify(value, null, 2)}`)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|