@wooksjs/event-cli 0.2.21 → 0.2.23

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/dist/index.cjs CHANGED
@@ -61,7 +61,7 @@ class WooksCli extends wooks.WooksAdapterBase {
61
61
  const pathParams = (firstFlagIndex
62
62
  ? argv.slice(0, firstFlagIndex - 1)
63
63
  : argv);
64
- const path = '/' + pathParams.map((v) => encodeURIComponent(v)).join('/');
64
+ const path = '/' + pathParams.map((v) => encodeURI(v).replace(/\//g, '%2F')).join('/');
65
65
  const { restoreCtx, clearCtx } = createCliContext({ argv, pathParams }, this.mergeEventOptions((_a = this.opts) === null || _a === void 0 ? void 0 : _a.eventOptions));
66
66
  const handlers = this.wooks.lookup('CLI', path) || ((_b = this.opts) === null || _b === void 0 ? void 0 : _b.onNotFound) && [this.opts.onNotFound] || null;
67
67
  if (handlers) {
@@ -78,7 +78,7 @@ class WooksCli extends wooks.WooksAdapterBase {
78
78
  : JSON.stringify(r, null, ' ')));
79
79
  }
80
80
  else if (response instanceof Error) {
81
- console.error('' + response.message + '');
81
+ this.onError(response);
82
82
  }
83
83
  else if (response) {
84
84
  if (response) {
@@ -116,17 +116,16 @@ class WooksCli extends wooks.WooksAdapterBase {
116
116
  else {
117
117
  this.error('' +
118
118
  'Unknown command: ' +
119
- '' +
120
119
  pathParams.join(' '));
121
120
  process.exit(1);
122
121
  }
123
122
  }
124
123
  error(e) {
125
124
  if (typeof e === 'string') {
126
- console.error('' + e + '');
125
+ console.error('' + 'ERROR: ' + '' + e);
127
126
  }
128
127
  else {
129
- console.error('' + e.message + '');
128
+ console.error('' + 'ERROR: ' + '' + e.message);
130
129
  }
131
130
  }
132
131
  }
package/dist/index.mjs CHANGED
@@ -59,7 +59,7 @@ class WooksCli extends WooksAdapterBase {
59
59
  const pathParams = (firstFlagIndex
60
60
  ? argv.slice(0, firstFlagIndex - 1)
61
61
  : argv);
62
- const path = '/' + pathParams.map((v) => encodeURIComponent(v)).join('/');
62
+ const path = '/' + pathParams.map((v) => encodeURI(v).replace(/\//g, '%2F')).join('/');
63
63
  const { restoreCtx, clearCtx } = createCliContext({ argv, pathParams }, this.mergeEventOptions((_a = this.opts) === null || _a === void 0 ? void 0 : _a.eventOptions));
64
64
  const handlers = this.wooks.lookup('CLI', path) || ((_b = this.opts) === null || _b === void 0 ? void 0 : _b.onNotFound) && [this.opts.onNotFound] || null;
65
65
  if (handlers) {
@@ -76,7 +76,7 @@ class WooksCli extends WooksAdapterBase {
76
76
  : JSON.stringify(r, null, ' ')));
77
77
  }
78
78
  else if (response instanceof Error) {
79
- console.error('' + response.message + '');
79
+ this.onError(response);
80
80
  }
81
81
  else if (response) {
82
82
  if (response) {
@@ -114,17 +114,16 @@ class WooksCli extends WooksAdapterBase {
114
114
  else {
115
115
  this.error('' +
116
116
  'Unknown command: ' +
117
- '' +
118
117
  pathParams.join(' '));
119
118
  process.exit(1);
120
119
  }
121
120
  }
122
121
  error(e) {
123
122
  if (typeof e === 'string') {
124
- console.error('' + e + '');
123
+ console.error('' + 'ERROR: ' + '' + e);
125
124
  }
126
125
  else {
127
- console.error('' + e.message + '');
126
+ console.error('' + 'ERROR: ' + '' + e.message);
128
127
  }
129
128
  }
130
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wooksjs/event-cli",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "@wooksjs/event-cli",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -31,8 +31,8 @@
31
31
  "url": "https://github.com/wooksjs/wooksjs/issues"
32
32
  },
33
33
  "peerDependencies": {
34
- "wooks": "0.2.21",
35
- "@wooksjs/event-core": "0.2.21"
34
+ "wooks": "0.2.23",
35
+ "@wooksjs/event-core": "0.2.23"
36
36
  },
37
37
  "dependencies": {
38
38
  "minimist": "^1.2.6",