@dxos/cli 2.4.13 → 2.4.15

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/es/main.js CHANGED
@@ -29,7 +29,7 @@ var _extensions = require("./extensions");
29
29
  //
30
30
 
31
31
  /* babel-plugin-inline-import '../known-extensions.yml' */
32
- const KNOWN_EXTENSIONS = "# This is an autogenerated file. Do not edit this file directly.\n---\n - \n moduleName: \"@dxos/cli-app\"\n describe: \"App proxy extension.\"\n command: \n - \"app\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-bot\"\n describe: \"Bot extension.\"\n command: \n - \"bot\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-chat\"\n describe: \"Chat extension.\"\n command: \n - \"chat\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-console\"\n describe: \"KUBE console extension.\"\n command: \n - \"console\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-data\"\n describe: \"Party management.\"\n command: \n - \n command: \"party\"\n describe: \"Party management.\"\n - \n command: \"storage\"\n describe: \"Storage management.\"\n initRequired: true\n destroyRequired: true\n - \n moduleName: \"@dxos/cli-dxns\"\n describe: \"DXNS extension.\"\n command: \n - \"dxns\"\n initRequired: true\n destroyRequired: true\n - \n moduleName: \"@dxos/cli-echo\"\n describe: \"ECHO extension.\"\n command: \n - \"echo\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-halo\"\n describe: \"HALO extension.\"\n command: \n - \"halo\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-ipfs\"\n describe: \"IPFS extension.\"\n command: \n - \"ipfs\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-kube\"\n describe: \"KUBE extension.\"\n command: \n - \"kube\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-mdns\"\n describe: \"MDNS extension.\"\n command: \n - \"mdns\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-mesh\"\n describe: \"MESH extension.\"\n command: \n - \"mesh\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-pad\"\n describe: \"Pad extension.\"\n command: \n - \"pad\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-signal\"\n describe: \"Signal server extension.\"\n command: \n - \n command: \"signal\"\n describe: \"Signal server as process.\"\n - \n command: \"container-signal\"\n describe: \"Signal server as container.\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-wns\"\n describe: \"Registry extension.\"\n command: \n - \n command: \"wns\"\n describe: \"Registry operations.\"\n - \n command: \"faucet\"\n describe: \"Faucet management.\"\n - \n command: \"keys\"\n describe: \"Keys management.\"\n initRequired: false\n destroyRequired: false\n\n";
32
+ const KNOWN_EXTENSIONS = "# This is an autogenerated file. Do not edit this file directly.\n---\n - \n moduleName: \"@dxos/cli-app\"\n describe: \"App proxy extension.\"\n command: \n - \"app\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-bot\"\n describe: \"Bot extension.\"\n command: \n - \"bot\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-chat\"\n describe: \"Chat extension.\"\n command: \n - \"chat\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-console\"\n describe: \"KUBE console extension.\"\n command: \n - \"console\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-data\"\n describe: \"Party and Device management.\"\n command: \n - \n command: \"party\"\n describe: \"Party management.\"\n - \n command: \"storage\"\n describe: \"Storage management.\"\n - \n command: \"device\"\n describe: \"Device management.\"\n initRequired: true\n destroyRequired: true\n - \n moduleName: \"@dxos/cli-dxns\"\n describe: \"DXNS extension.\"\n command: \n - \"dxns\"\n initRequired: true\n destroyRequired: true\n - \n moduleName: \"@dxos/cli-echo\"\n describe: \"ECHO extension.\"\n command: \n - \"echo\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-halo\"\n describe: \"HALO extension.\"\n command: \n - \"halo\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-ipfs\"\n describe: \"IPFS extension.\"\n command: \n - \"ipfs\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-kube\"\n describe: \"KUBE extension.\"\n command: \n - \"kube\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-mdns\"\n describe: \"MDNS extension.\"\n command: \n - \"mdns\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-mesh\"\n describe: \"MESH extension.\"\n command: \n - \"mesh\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-pad\"\n describe: \"Pad extension.\"\n command: \n - \"pad\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-signal\"\n describe: \"Signal server extension.\"\n command: \n - \n command: \"signal\"\n describe: \"Signal server as process.\"\n - \n command: \"container-signal\"\n describe: \"Signal server as container.\"\n initRequired: false\n destroyRequired: false\n - \n moduleName: \"@dxos/cli-wns\"\n describe: \"Registry extension.\"\n command: \n - \n command: \"wns\"\n describe: \"Registry operations.\"\n - \n command: \"faucet\"\n describe: \"Faucet management.\"\n - \n command: \"keys\"\n describe: \"Keys management.\"\n initRequired: false\n destroyRequired: false\n\n";
33
33
  const {
34
34
  logError
35
35
  } = (0, _cliCore.getLoggers)();
@@ -217,6 +217,10 @@ const ServicesModule = ({
217
217
  type: 'boolean',
218
218
  default: false,
219
219
  description: 'Dev build'
220
+ }).option('replace-args', {
221
+ type: 'boolean',
222
+ description: 'Replace default arguments with provided.',
223
+ default: false
220
224
  }),
221
225
  handler: (0, _cliCore.asyncHandler)(async argv => {
222
226
  const {
@@ -228,7 +232,8 @@ const ServicesModule = ({
228
232
  profilePath: profile,
229
233
  storagePath,
230
234
  binds: additionalBinds = [],
231
- dev
235
+ dev,
236
+ replaceArgs
232
237
  } = argv;
233
238
  const service = getServiceInfo(moduleName, serviceName);
234
239
  const dockerImage = new _cliCore.DockerImage({
@@ -236,7 +241,7 @@ const ServicesModule = ({
236
241
  dev
237
242
  });
238
243
  const forwardArgs = forward ? JSON.parse(forward).args : [];
239
- const command = service.command.split(' ').concat(forwardArgs);
244
+ const command = replaceArgs ? forwardArgs : service.command.split(' ').concat(forwardArgs);
240
245
  const {
241
246
  name = service.container_name
242
247
  } = argv;
@@ -153,6 +153,16 @@ class Pluggable {
153
153
 
154
154
  return this._modulePath;
155
155
  }
156
+
157
+ get module() {
158
+ var _module$default;
159
+
160
+ const module = require(this.modulePath);
161
+
162
+ const moduleCli = (_module$default = module.default) !== null && _module$default !== void 0 ? _module$default : module; // Difference between `module.exports` and `export default`.
163
+
164
+ return moduleCli;
165
+ }
156
166
  /**
157
167
  * Checks if workspace is defined.
158
168
  */
@@ -230,7 +240,7 @@ class Pluggable {
230
240
 
231
241
 
232
242
  async init(state) {
233
- return require(this.modulePath).init(state);
243
+ return this.module.init(state);
234
244
  }
235
245
  /**
236
246
  * Destroy extension in a scope of main CLI.
@@ -239,7 +249,7 @@ class Pluggable {
239
249
 
240
250
 
241
251
  async destroy(state) {
242
- return require(this.modulePath).destroy(state);
252
+ return this.module.destroy(state);
243
253
  }
244
254
  /**
245
255
  * Runs command of an CLI extension.
@@ -263,11 +273,10 @@ class Pluggable {
263
273
  spinner
264
274
  });
265
275
  await (0, _extensions.addInstalled)(moduleName, this.getInfo());
266
-
267
276
  const {
268
277
  init,
269
278
  destroy
270
- } = require(this.modulePath);
279
+ } = this.module;
271
280
 
272
281
  if (init || destroy) {
273
282
  console.log(`${moduleName} was successfully installed. Please run your command again.`);
@@ -279,19 +288,19 @@ class Pluggable {
279
288
  }
280
289
  }
281
290
 
282
- return require(this.modulePath).runAsExtension(state, argv);
291
+ return this.module.runAsExtension(state, argv);
283
292
  }
284
293
 
285
294
  getInfo() {
286
295
  this._cleanCache();
287
296
 
288
- return require(this.modulePath).info;
297
+ return this.module.info;
289
298
  }
290
299
 
291
300
  getDockerCompose() {
292
301
  this._cleanCache();
293
302
 
294
- return require(this.modulePath).dockerCompose;
303
+ return this.module.dockerCompose;
295
304
  }
296
305
 
297
306
  _cleanCache() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/cli",
3
- "version": "2.4.13",
3
+ "version": "2.4.15",
4
4
  "description": "DXOS CLI",
5
5
  "homepage": "https://github.com/dxos/cli/tree/master/packages/cli#readme",
6
6
  "license": "AGPL-3.0",
@@ -37,9 +37,9 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@babel/runtime": "7.7.2",
40
- "@dxos/cli-core": "^2.4.13",
41
- "@dxos/debug": "~2.12.20",
42
- "@dxos/random-access-multi-storage": "~2.12.20",
40
+ "@dxos/cli-core": "^2.4.15",
41
+ "@dxos/debug": "~2.12.22",
42
+ "@dxos/random-access-multi-storage": "~2.12.22",
43
43
  "assert": "^2.0.0",
44
44
  "find-root": "^1.1.0",
45
45
  "fs-extra": "^8.1.0",
@@ -71,7 +71,7 @@
71
71
  "babel-loader": "^8.0.0",
72
72
  "babel-plugin-add-module-exports": "^1.0.0",
73
73
  "babel-plugin-inline-import": "^3.0.0",
74
- "jest": "^25.1.0",
74
+ "jest": "^27.2.0",
75
75
  "json2yaml": "^1.1.0",
76
76
  "semistandard": "14.2.0",
77
77
  "yaml2json": "^1.0.2"
@@ -92,5 +92,5 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "gitHead": "e2815efa9ccb8b6b011c1b2860c2afcde804288d"
95
+ "gitHead": "7ed53a9522c434b01358303873d654d23466aad2"
96
96
  }