@herodevs/cli 0.1.12 → 0.1.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.
package/README.md CHANGED
@@ -18,7 +18,7 @@ $ npm install -g @herodevs/cli
18
18
  $ @herodevs/cli COMMAND
19
19
  running command...
20
20
  $ @herodevs/cli (--version)
21
- @herodevs/cli/0.1.12 darwin-arm64 node-v18.17.1
21
+ @herodevs/cli/0.1.14 darwin-arm64 node-v18.17.1
22
22
  $ @herodevs/cli --help [COMMAND]
23
23
  USAGE
24
24
  $ @herodevs/cli COMMAND
@@ -41,7 +41,6 @@ USAGE
41
41
  * [`@herodevs/cli plugins:uninstall PLUGIN...`](#herodevscli-pluginsuninstall-plugin-1)
42
42
  * [`@herodevs/cli plugins:uninstall PLUGIN...`](#herodevscli-pluginsuninstall-plugin-2)
43
43
  * [`@herodevs/cli plugins update`](#herodevscli-plugins-update)
44
- * [`@herodevs/cli update verify`](#herodevscli-update-verify)
45
44
 
46
45
  ## `@herodevs/cli committer [GET-ALL]`
47
46
 
@@ -63,7 +62,7 @@ EXAMPLES
63
62
  $ @herodevs/cli committer
64
63
  ```
65
64
 
66
- _See code: [dist/commands/committer/index.ts](https://github.com/herodevs/cli/blob/v0.1.12/dist/commands/committer/index.ts)_
65
+ _See code: [dist/commands/committer/index.ts](https://github.com/herodevs/cli/blob/v0.1.14/dist/commands/committer/index.ts)_
67
66
 
68
67
  ## `@herodevs/cli committer:get-all [flags [-s][-e][-x]]`
69
68
 
@@ -74,8 +73,8 @@ USAGE
74
73
  $ @herodevs/cli committer get-all [flags [-s][-e][-x]]
75
74
 
76
75
  FLAGS
77
- -e, --endDate=<value> [default: 2022-08-31] End Date (format: yyyy-MM-dd)
78
- -s, --startDate=<value> [default: 2023-08-31] Start Date (format: yyyy-MM-dd)
76
+ -e, --endDate=<value> [default: 2022-09-01] End Date (format: yyyy-MM-dd)
77
+ -s, --startDate=<value> [default: 2023-09-01] Start Date (format: yyyy-MM-dd)
79
78
  -x, --exclude=<value>... Path Exclusions (eg -x="./src/bin" -x="./dist")
80
79
 
81
80
  GLOBAL FLAGS
@@ -87,7 +86,7 @@ EXAMPLES
87
86
  $ @herodevs/cli committer get-all
88
87
  ```
89
88
 
90
- _See code: [dist/commands/committer/get-all.ts](https://github.com/herodevs/cli/blob/v0.1.12/dist/commands/committer/get-all.ts)_
89
+ _See code: [dist/commands/committer/get-all.ts](https://github.com/herodevs/cli/blob/v0.1.14/dist/commands/committer/get-all.ts)_
91
90
 
92
91
  ## `@herodevs/cli help [COMMANDS]`
93
92
 
@@ -354,24 +353,4 @@ DESCRIPTION
354
353
  ```
355
354
 
356
355
  _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v3.2.5/src/commands/plugins/update.ts)_
357
-
358
- ## `@herodevs/cli update verify`
359
-
360
- verifies version
361
-
362
- ```
363
- USAGE
364
- $ @herodevs/cli update verify [-q]
365
-
366
- FLAGS
367
- -q, --quiet Prints/returns nothing if version is up to date
368
-
369
- DESCRIPTION
370
- verifies version
371
-
372
- EXAMPLES
373
- $ @herodevs/cli update verify
374
- ```
375
-
376
- _See code: [dist/commands/update/verify.ts](https://github.com/herodevs/cli/blob/v0.1.12/dist/commands/update/verify.ts)_
377
356
  <!-- commandsstop -->
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herodevs/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "HeroDevs NES Developer Kit",
5
5
  "author": "@herodevs",
6
6
  "bin": {
@@ -56,9 +56,6 @@
56
56
  "topics": {
57
57
  "committer": {
58
58
  "description": "Committer actions"
59
- },
60
- "update:verify": {
61
- "description": "Verifies software version"
62
59
  }
63
60
  }
64
61
  },
@@ -0,0 +1 @@
1
+ export * from './log-colors';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./log-colors"), exports);
@@ -0,0 +1,28 @@
1
+ export declare const enum Color {
2
+ Reset = "\u001B[0m",
3
+ Bright = "\u001B[1m",
4
+ Dim = "\u001B[2m",
5
+ Underscore = "\u001B[4m",
6
+ Blink = "\u001B[5m",
7
+ Reverse = "\u001B[7m",
8
+ Hidden = "\u001B[8m",
9
+ FgBlack = "\u001B[30m",
10
+ FgRed = "\u001B[31m",
11
+ FgGreen = "\u001B[32m",
12
+ FgYellow = "\u001B[33m",
13
+ FgBlue = "\u001B[34m",
14
+ FgMagenta = "\u001B[35m",
15
+ FgCyan = "\u001B[36m",
16
+ FgWhite = "\u001B[37m",
17
+ FgGray = "\u001B[90m",
18
+ BgBlack = "\u001B[40m",
19
+ BgRed = "\u001B[41m",
20
+ BgGreen = "\u001B[42m",
21
+ BgYellow = "\u001B[43m",
22
+ BgBlue = "\u001B[44m",
23
+ BgMagenta = "\u001B[45m",
24
+ BgCyan = "\u001B[46m",
25
+ BgWhite = "\u001B[47m",
26
+ BgGray = "\u001B[100m"
27
+ }
28
+ export declare function color(color: Color): (...args: string[]) => string;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.color = void 0;
4
+ function color(color) {
5
+ return (...args) => {
6
+ return `${color}${args.join(` ${color}` /*reset color for nested color*/)}${"\u001B[0m" /* Color.Reset */}`;
7
+ };
8
+ }
9
+ exports.color = color;
@@ -4,6 +4,10 @@ exports.ensureVersionIsUpToDate = exports.isVersionUpToDate = void 0;
4
4
  const shell_1 = require("./shell");
5
5
  const config_1 = require("../config");
6
6
  const latest_version_1 = require("@badisi/latest-version");
7
+ const enums_1 = require("../enums");
8
+ const red = (0, enums_1.color)("\u001B[31m" /* Color.FgRed */);
9
+ const yellow = (0, enums_1.color)("\u001B[33m" /* Color.FgYellow */);
10
+ const green = (0, enums_1.color)("\u001B[32m" /* Color.FgGreen */);
7
11
  async function wrapCommandToHandleDebugging(command, message, commandInstance) {
8
12
  let result = '';
9
13
  try {
@@ -22,34 +26,38 @@ async function wrapCommandToHandleDebugging(command, message, commandInstance) {
22
26
  }
23
27
  return result;
24
28
  }
29
+ function reconstituteCommandPositionalsAndFlags(command) {
30
+ var _a;
31
+ return [
32
+ ...(_a = command.id) === null || _a === void 0 ? void 0 : _a.split(':'),
33
+ ...Object.keys(command.flags).map((flag) => `--${flag}='${command.flags[flag]}'`)
34
+ ].join(' ');
35
+ }
25
36
  async function isVersionUpToDate(command, quietIfSuccessful = false) {
26
37
  const versionData = await (0, latest_version_1.default)(config_1.env.packageName);
27
- if (versionData && versionData.latest && versionData.latest === config_1.env.packageVersion) {
38
+ if (versionData && versionData.latest && versionData.latest === '') { //env.packageVersion) {
28
39
  if (!quietIfSuccessful) {
29
40
  command.log(`${config_1.env.packageName}@${versionData.latest} is up to date`);
30
41
  }
31
42
  return true;
32
43
  }
33
- command.log(`Your version: ${config_1.env.packageName}@${config_1.env.packageVersion} is not up to date`);
34
- command.log(`Latest version: ${config_1.env.packageName}@${versionData.latest}`);
44
+ command.log(`${yellow('Your version:', red(`${config_1.env.packageName}@${config_1.env.packageVersion}`), `is not up to date`)}`);
45
+ command.log(`${yellow('Latest version:', red(`${config_1.env.packageName}@${versionData.latest}`))}`);
35
46
  return false;
36
47
  }
37
48
  exports.isVersionUpToDate = isVersionUpToDate;
38
49
  async function ensureVersionIsUpToDate(command) {
39
50
  const versionUpToDate = await isVersionUpToDate(command);
40
51
  if (!versionUpToDate) {
41
- // clear npx cache
42
- await wrapCommandToHandleDebugging(`npm_config_yes=true npx clear-npx-cache`, `DEBUGGING: skipping clear cache`, command);
43
- // update package
44
- const updated = await wrapCommandToHandleDebugging(`npm_config_yes=true npx -q ${config_1.env.packageName}@latest update verify`, `DEBUGGING: skipping package update`, command);
45
- if (updated) {
46
- command.log([
47
- `\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n`,
48
- `The ${config_1.env.packageName} package was updated; however, you must re-run your command.`,
49
- `\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n`,
50
- ].join(' '));
51
- await command.config.runCommand('update:verify', ['-q']);
52
- }
52
+ // see `update-plugin-behavior` branch for previous implementation of auto-update
53
+ const commandAndPositionals = reconstituteCommandPositionalsAndFlags(command);
54
+ command.log([
55
+ `\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n`,
56
+ `${red(`ERROR:`)} Did not run command.\n\n`,
57
+ ` - Rerun your command with the ${yellow('@latest')} tag to ensure correct output:\n\n\n`,
58
+ `\t${yellow(`npx ${config_1.env.packageName}@latest ${commandAndPositionals}`)}\n`,
59
+ `\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n`,
60
+ ].join(' '));
53
61
  return process.exit(1);
54
62
  }
55
63
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.12",
2
+ "version": "0.1.14",
3
3
  "commands": {
4
4
  "committer:get-all": {
5
5
  "id": "committer:get-all",
@@ -41,7 +41,7 @@
41
41
  "summary": "Start Date (format: yyyy-MM-dd)",
42
42
  "required": false,
43
43
  "multiple": false,
44
- "default": "2023-08-31"
44
+ "default": "2023-09-01"
45
45
  },
46
46
  "endDate": {
47
47
  "name": "endDate",
@@ -50,7 +50,7 @@
50
50
  "summary": "End Date (format: yyyy-MM-dd)",
51
51
  "required": false,
52
52
  "multiple": false,
53
- "default": "2022-08-31"
53
+ "default": "2022-09-01"
54
54
  },
55
55
  "exclude": {
56
56
  "name": "exclude",
@@ -101,28 +101,6 @@
101
101
  "name": "get-all"
102
102
  }
103
103
  }
104
- },
105
- "update:verify": {
106
- "id": "update:verify",
107
- "description": "verifies version",
108
- "strict": true,
109
- "pluginName": "@herodevs/cli",
110
- "pluginAlias": "@herodevs/cli",
111
- "pluginType": "core",
112
- "aliases": [],
113
- "examples": [
114
- "<%= config.bin %> <%= command.id %>"
115
- ],
116
- "flags": {
117
- "quiet": {
118
- "name": "quiet",
119
- "type": "boolean",
120
- "char": "q",
121
- "description": "Prints/returns nothing if version is up to date",
122
- "allowNo": false
123
- }
124
- },
125
- "args": {}
126
104
  }
127
105
  }
128
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herodevs/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "HeroDevs NES Developer Kit",
5
5
  "author": "@herodevs",
6
6
  "bin": {
@@ -56,9 +56,6 @@
56
56
  "topics": {
57
57
  "committer": {
58
58
  "description": "Committer actions"
59
- },
60
- "update:verify": {
61
- "description": "Verifies software version"
62
59
  }
63
60
  }
64
61
  },
@@ -1,10 +0,0 @@
1
- import { Command } from '@oclif/core';
2
- export default class UpdateVerify extends Command {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
- };
8
- static args: {};
9
- run(): Promise<void>;
10
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const shared_1 = require("../../shared");
5
- class UpdateVerify extends core_1.Command {
6
- async run() {
7
- const { flags } = await this.parse(UpdateVerify);
8
- await (0, shared_1.isVersionUpToDate)(this, flags.quiet);
9
- }
10
- }
11
- exports.default = UpdateVerify;
12
- UpdateVerify.description = 'verifies version';
13
- UpdateVerify.examples = [
14
- '<%= config.bin %> <%= command.id %>',
15
- ];
16
- UpdateVerify.flags = {
17
- quiet: core_1.Flags.boolean({ char: 'q', description: 'Prints/returns nothing if version is up to date' }),
18
- };
19
- UpdateVerify.args = {
20
- // file: Args.string({description: 'file to read'}),
21
- };