@zuplo/cli 1.20.0 → 1.22.0

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
@@ -10,5 +10,6 @@ Commands:
10
10
  zup test Runs the tests under /tests against an endpoint
11
11
 
12
12
  Options:
13
- --help Show help [boolean]
13
+ --version Show version number [boolean]
14
+ --help Show help [boolean]
14
15
  ```
package/dist/cli.js CHANGED
@@ -12,7 +12,6 @@ const MIN_NODE_VERSION = "18.0.0";
12
12
  if (gte(process.versions.node, MIN_NODE_VERSION)) {
13
13
  void yargs(hideBin(process.argv))
14
14
  .env("ZUPLO")
15
- .version(false)
16
15
  .command(deleteZup)
17
16
  .command(deploy)
18
17
  .command(list)
@@ -3,7 +3,7 @@ import { validDeployDirectoryValidator } from "../common/validators/file-system-
3
3
  import { YargsChecker } from "../common/validators/lib.js";
4
4
  import { deploy } from "../deploy/handler.js";
5
5
  export default {
6
- desc: "Deploys current Git branch of the current directory.",
6
+ desc: "Deploys current Git branch of the current directory",
7
7
  command: "deploy",
8
8
  builder: (yargs) => {
9
9
  return yargs
@@ -5,6 +5,8 @@ function wait(duration = settings.POLL_INTERVAL) {
5
5
  return new Promise((resolve) => setTimeout(resolve, duration));
6
6
  }
7
7
  export async function pollDeployment(argv, fileId, account, project) {
8
+ const MAX_RETRY_ATTEMPTS_FOR_SERVER_UPDATES = 5;
9
+ let CURRENT_RETRY_ATTEMPTS_FOR_SERVER_UPDATES = 0;
8
10
  for (let pollRetry = 0; pollRetry < settings.MAX_POLL_RETRIES; pollRetry++) {
9
11
  printDiagnosticsToConsole(`Polling for deployment status... (${pollRetry}/${settings.MAX_POLL_RETRIES})`);
10
12
  const response = await fetch(`${settings.ZUPLO_DEVELOPER_API_ENDPOINT}/v1/accounts/${account}/projects/${project}/deployment-status/${fileId}`, {
@@ -41,6 +43,13 @@ export async function pollDeployment(argv, fileId, account, project) {
41
43
  await wait();
42
44
  continue;
43
45
  }
46
+ else if (response.status === 500 &&
47
+ CURRENT_RETRY_ATTEMPTS_FOR_SERVER_UPDATES <
48
+ MAX_RETRY_ATTEMPTS_FOR_SERVER_UPDATES) {
49
+ CURRENT_RETRY_ATTEMPTS_FOR_SERVER_UPDATES++;
50
+ await wait();
51
+ continue;
52
+ }
44
53
  else {
45
54
  logger.error(`Unexpected error from server while polling for deployment: ${response.status} ${response.statusText} ${await response.text()}`);
46
55
  throw new Error(`Unexpected response from server while polling for deployment: ${response.status} ${response.statusText}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/zuplo/cli",
6
6
  "author": "Zuplo, Inc.",