bdy 1.18.27-dev → 1.18.29-dev

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.18.27-dev",
4
+ "version": "1.18.29-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -188,7 +188,7 @@ const checkPath = async (dir, options) => {
188
188
  return { path, git };
189
189
  };
190
190
  const createOrGetProject = async (path, options) => {
191
- const workspace = input_1.default.restApiWorkspace(options.workspace);
191
+ const workspace = input_1.default.restApiWorkspace(options.workspace, false, true);
192
192
  const client = input_1.default.restApiTokenClient();
193
193
  let project = options.project;
194
194
  let url;
@@ -138,11 +138,13 @@ commandSandboxCreate.action(async (options) => {
138
138
  output_1.default.exitError(texts_1.ERR_SANDBOX_APPS_TIMEOUT);
139
139
  }
140
140
  }
141
- output_1.default.green((0, texts_1.TXT_SANDBOX_CREATED)(result.identifier));
141
+ output_1.default.dim('Identifier: ', false);
142
+ output_1.default.cyan(result.identifier);
142
143
  output_1.default.dim('SSH: ', false);
143
144
  output_1.default.cyan(`ssh ${result.ssh_host} -p ${result.ssh_port}`);
144
145
  output_1.default.dim('Web terminal: ', false);
145
146
  output_1.default.cyan(result.html_url);
147
+ output_1.default.green(texts_1.TXT_SANDBOX_CREATED);
146
148
  output_1.default.exitNormal();
147
149
  });
148
150
  exports.default = commandSandboxCreate;
@@ -11,6 +11,9 @@ const commandSandboxEndpointAdd = (0, utils_1.getBasicCommandSandboxEndpoint)('a
11
11
  commandSandboxEndpointAdd.alias('create');
12
12
  commandSandboxEndpointAdd.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_SANDBOX_ENDPOINT_CREATE}`);
13
13
  commandSandboxEndpointAdd.action(async (identifier, options) => {
14
+ const humanId = require('human-id').default;
15
+ if (!options.name)
16
+ options.name = humanId({ separator: '-', capitalize: false });
14
17
  const workspace = input_1.default.restApiWorkspace(options.workspace);
15
18
  const project = input_1.default.restApiProject(options.project);
16
19
  const client = input_1.default.restApiTokenClient();
@@ -475,12 +475,12 @@ class Input {
475
475
  }
476
476
  return p;
477
477
  }
478
- static restApiWorkspace(workspace, allowNull) {
478
+ static restApiWorkspace(workspace, allowNull, ignoreProjectConfig = false) {
479
479
  const ProjectCfg = require('./project/cfg').default;
480
480
  let w = process.env.BUDDY_WORKSPACE;
481
481
  if (workspace)
482
482
  w = workspace;
483
- if (!w)
483
+ if (!w && !ignoreProjectConfig)
484
484
  w = ProjectCfg.getWorkspace();
485
485
  if (!w)
486
486
  w = cfg_1.default.getWorkspace();
@@ -588,8 +588,7 @@ const TXT_SANDBOX_CREATING = (name, identifier) => {
588
588
  return `Creating sandbox: ${name} (${identifier})`;
589
589
  };
590
590
  exports.TXT_SANDBOX_CREATING = TXT_SANDBOX_CREATING;
591
- const TXT_SANDBOX_CREATED = (identifier) => `Sandbox created: ${identifier}`;
592
- exports.TXT_SANDBOX_CREATED = TXT_SANDBOX_CREATED;
591
+ exports.TXT_SANDBOX_CREATED = 'Sandbox created';
593
592
  const TXT_SANDBOX_UPDATED = (identifier, htmlUrl) => htmlUrl
594
593
  ? `Sandbox updated: ${identifier}\n${htmlUrl}`
595
594
  : `Sandbox updated: ${identifier}`;
@@ -521,7 +521,7 @@ const getBasicCommandSandboxEndpoint = (name, desc) => {
521
521
  command.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
522
522
  command.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
523
523
  command.argument('<identifier>', texts_1.OPTION_SANDBOX_IDENTIFIER);
524
- command.requiredOption('-n, --name <name>', texts_1.OPTION_SANDBOX_ENDPOINT_NAME);
524
+ command.option('-n, --name <name>', texts_1.OPTION_SANDBOX_ENDPOINT_NAME);
525
525
  command.option('-e, --endpoint <endpoint>', texts_1.OPTION_SANDBOX_ENDPOINT_PORT);
526
526
  command.option('-t, --type <type>', texts_1.OPTION_SANDBOX_ENDPOINT_TYPE, 'HTTP');
527
527
  command.option('-r, --ep-region <region>', texts_1.OPTION_REGION); // region
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.18.27-dev",
4
+ "version": "1.18.29-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "scripts": {