@shopify/oxygen-cli 3.1.9-unstable.202401091544.0 → 3.1.9-unstable.202401111534.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,9 @@
10
10
  - 2c0ee45: Update @types/node from 20.10.6 to 20.10.7
11
11
  - 8306b94: Update oclif from 4.1.0 to 4.1.4
12
12
  - f9e3a1f: Update @types/node from 20.10.7 to 20.10.8
13
+ - 28f5b8a: Update oclif from 4.1.4 to 4.2.0
14
+ - 77a6c23: Update eslint-plugin-prettier from 5.1.2 to 5.1.3
15
+ - 325d4a8: Fix spelling error in error message, remove non-existing variable from README
13
16
 
14
17
  ## 3.1.7
15
18
 
package/README.md CHANGED
@@ -46,7 +46,7 @@ oxygen:deploy [options]
46
46
  - -d, --verificationMaxDuration: The maximum duration (in seconds) that the deployment verification is allowed to run before it is considered failed. Accepts values between 10 and 300.
47
47
  - --publicDeployment: set the deployment to be publicly accessible.
48
48
  - --metadataDescription <metadataDescription>: A brief description of the deployment, typically the commit message associated with the changes being deployed.
49
- - --metadataUrl <metadataUrl>: URL that links to the deployment.
49
+ - --metadataUrl <metadataUrl>: URL linking to the workflow/pipeline run in the CI platform from which the deployment is performed.
50
50
  - --metadataUser <metadataUser>: User that initiated the deployment.
51
51
  - --metadataVersion <metadataVersion>: A version identifier for the deployment.
52
52
  - --disableBugsnag: Disable Bugsnag error reporting.
@@ -89,7 +89,7 @@ The following environment variables are relevant, depending on your environment:
89
89
 
90
90
  |- | Bitbucket | CircleCI | Github | Gitlab |
91
91
  |- | --------- | --------| ------ | ------ |
92
- | User | BITBUCKET_COMMIT_AUTHOR | CIRCLE_USERNAME | GITHUB_ACTOR | GITLAB_USER_LOGIN |
92
+ | User | N/A | CIRCLE_USERNAME | GITHUB_ACTOR | GITLAB_USER_LOGIN |
93
93
  | Version | BITBUCKET_COMMIT | CIRCLE_SHA1 | GITHUB_SHA | CI_COMMIT_SHA |
94
94
  | URL | `https://bitbucket.org/${envs.BITBUCKET_WORKSPACE}/${envs.BITBUCKET_REPO_SLUG}/pipelines/results/${envs.BITBUCKET_BUILD_NUMBER}` | CIRCLE_BUILD_URL | `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}` | CI_PIPELINE_URL |
95
95
 
@@ -17,7 +17,9 @@ async function verifyDeploymentCompleted(options, deploymentId) {
17
17
  const elapsedTime = (Date.now() - startTime) / 1e3;
18
18
  if (elapsedTime + delay / 1e3 > timeoutInSeconds) {
19
19
  hooks?.onDeploymentCompletedVerificationError?.();
20
- throw new Error(`Deployment not completed after ${timeoutInSeconds}`);
20
+ throw new Error(
21
+ `Deployment not completed after ${timeoutInSeconds} seconds.`
22
+ );
21
23
  }
22
24
  await new Promise((resolve) => setTimeout(resolve, delay));
23
25
  return check();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/deploy/verify-deployment-completed.ts"],"names":[],"mappings":"AAAA,SAAQ,sBAAqB;AAC7B;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAEP,SAAQ,cAAa;AAErB;AAAA,EAGE;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AASP,eAAsB,0BACpB,SACA,cACgD;AAChD,QAAM,EAAC,QAAQ,QAAQ,kBAAkB,MAAK,IAAI;AAClD,QAAM,YAAY;AAAA,IAChB;AAAA,EACF;AAEA,SAAO,yCAAyC;AAChD,aAAW,qCAAqC,MAAM;AAEtD,MAAI,WAAW;AACf,QAAM,YAAY,KAAK,IAAI;AAE3B,QAAM,iBAAiB,YAAY;AACjC,UAAM,QAAQ;AACd,UAAM,eAAe,KAAK,IAAI,IAAI,aAAa;AAC/C,QAAI,cAAc,QAAQ,MAAO,kBAAkB;AACjD,aAAO,yCAAyC;AAChD,YAAM,IAAI,MAAM,kCAAkC,gBAAgB,EAAE;AAAA,IACtE;AACA;AACA,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,KAAK,CAAC;AACzD,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,QAAQ,YAA4D;AACxE,UAAM,WACJ,MAAM,eAAe;AAAA,MACnB,OAAO;AAAA,MACP,KAAK;AAAA,MACL,KAAK,GAAG,OAAO,aAAa;AAAA,MAC5B,OAAO,OAAO,gBAAgB;AAAA,MAC9B;AAAA,MACA,cAAc;AAAA,QACZ,CAAC,OAAO,qBAAqB,GAAG,OAAO,gBAAgB;AAAA,MACzD;AAAA,IACF,CAAC;AAEH,UAAM,OAAO,SAAS;AACtB,QAAI,KAAK,WAAW,OAAO,UAAU;AACnC,sBAAgB,+CAA+C,MAAM;AACrE,aAAO,wBAAwB;AAC/B,aAAO;AAAA,IACT;AAEA,QAAI,KAAK,WAAW,OAAO,UAAU,KAAK,WAAW,OAAO,WAAW;AACrE,aAAO,qBAAqB,IAAI;AAChC,YAAM,IAAI;AAAA,QACR,KAAK,QACD,cAAc,KAAK,OAAO,kBAAkB,CAAC,YAC3C,KAAK,KACP,KACA,cAAc,KAAK,OAAO,kBAAkB,CAAC;AAAA,MACnD;AAAA,IACF;AAEA,WAAO,eAAe;AAAA,EACxB;AAEA,SAAO,MAAM;AACf","sourcesContent":["import {graphqlRequest} from '@shopify/cli-kit/node/api/graphql';\nimport {\n Logger,\n outputCompleted,\n outputInfo,\n} from '@shopify/cli-kit/node/output';\n\nimport {Header} from '../utils/utils.js';\n\nimport {\n DeploymentConfig,\n DeploymentHooks,\n DeploymentCompletedVerificationError,\n} from './types.js';\nimport {\n DeploymentVerificationDetailsQuery,\n DeploymentVerificationDetailsQueryData,\n DeploymentVerificationDetailsResponse,\n Status,\n} from './graphql/deployment-verification-details.js';\n\ninterface DeploymentVerificationDetailsOptions {\n config: DeploymentConfig;\n hooks?: DeploymentHooks;\n timeoutInSeconds: number;\n logger: Logger;\n}\n\nexport async function verifyDeploymentCompleted(\n options: DeploymentVerificationDetailsOptions,\n deploymentId: string,\n): Promise<DeploymentVerificationDetailsResponse> {\n const {config, logger, timeoutInSeconds, hooks} = options;\n const variables = {\n deploymentId,\n };\n\n hooks?.onDeploymentCompletedVerificationStart?.();\n outputInfo('Verifying deployment completed...', logger);\n\n let attempts = 0;\n const startTime = Date.now();\n\n const handleInterval = async () => {\n const delay = 3000;\n const elapsedTime = (Date.now() - startTime) / 1000;\n if (elapsedTime + delay / 1000 > timeoutInSeconds) {\n hooks?.onDeploymentCompletedVerificationError?.();\n throw new Error(`Deployment not completed after ${timeoutInSeconds}`);\n }\n attempts++;\n await new Promise((resolve) => setTimeout(resolve, delay));\n return check();\n };\n\n const check = async (): Promise<DeploymentVerificationDetailsResponse> => {\n const response: DeploymentVerificationDetailsQueryData =\n await graphqlRequest({\n query: DeploymentVerificationDetailsQuery,\n api: 'Oxygen',\n url: `${config.deploymentUrl}/api/v2/admin/graphql`,\n token: config.deploymentToken.accessToken,\n variables,\n addedHeaders: {\n [Header.OxygenNamespaceHandle]: config.deploymentToken.namespace,\n },\n });\n\n const data = response.deploymentVerificationDetails;\n if (data.status === Status.Deployed) {\n outputCompleted('Deployment to Oxygen completed successfully', logger);\n hooks?.onDeploymentCompleted?.();\n return data;\n }\n\n if (data.status === Status.Failed || data.status === Status.Cancelled) {\n hooks?.onDeploymentFailed?.(data);\n throw new DeploymentCompletedVerificationError(\n data.error\n ? `Deployment ${data.status.toLocaleLowerCase()}, error: ${\n data.error\n }`\n : `Deployment ${data.status.toLocaleLowerCase()}`,\n );\n }\n\n return handleInterval();\n };\n\n return check();\n}\n"]}
1
+ {"version":3,"sources":["../../src/deploy/verify-deployment-completed.ts"],"names":[],"mappings":"AAAA,SAAQ,sBAAqB;AAC7B;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAEP,SAAQ,cAAa;AAErB;AAAA,EAGE;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AASP,eAAsB,0BACpB,SACA,cACgD;AAChD,QAAM,EAAC,QAAQ,QAAQ,kBAAkB,MAAK,IAAI;AAClD,QAAM,YAAY;AAAA,IAChB;AAAA,EACF;AAEA,SAAO,yCAAyC;AAChD,aAAW,qCAAqC,MAAM;AAEtD,MAAI,WAAW;AACf,QAAM,YAAY,KAAK,IAAI;AAE3B,QAAM,iBAAiB,YAAY;AACjC,UAAM,QAAQ;AACd,UAAM,eAAe,KAAK,IAAI,IAAI,aAAa;AAC/C,QAAI,cAAc,QAAQ,MAAO,kBAAkB;AACjD,aAAO,yCAAyC;AAChD,YAAM,IAAI;AAAA,QACR,kCAAkC,gBAAgB;AAAA,MACpD;AAAA,IACF;AACA;AACA,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,KAAK,CAAC;AACzD,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,QAAQ,YAA4D;AACxE,UAAM,WACJ,MAAM,eAAe;AAAA,MACnB,OAAO;AAAA,MACP,KAAK;AAAA,MACL,KAAK,GAAG,OAAO,aAAa;AAAA,MAC5B,OAAO,OAAO,gBAAgB;AAAA,MAC9B;AAAA,MACA,cAAc;AAAA,QACZ,CAAC,OAAO,qBAAqB,GAAG,OAAO,gBAAgB;AAAA,MACzD;AAAA,IACF,CAAC;AAEH,UAAM,OAAO,SAAS;AACtB,QAAI,KAAK,WAAW,OAAO,UAAU;AACnC,sBAAgB,+CAA+C,MAAM;AACrE,aAAO,wBAAwB;AAC/B,aAAO;AAAA,IACT;AAEA,QAAI,KAAK,WAAW,OAAO,UAAU,KAAK,WAAW,OAAO,WAAW;AACrE,aAAO,qBAAqB,IAAI;AAChC,YAAM,IAAI;AAAA,QACR,KAAK,QACD,cAAc,KAAK,OAAO,kBAAkB,CAAC,YAC3C,KAAK,KACP,KACA,cAAc,KAAK,OAAO,kBAAkB,CAAC;AAAA,MACnD;AAAA,IACF;AAEA,WAAO,eAAe;AAAA,EACxB;AAEA,SAAO,MAAM;AACf","sourcesContent":["import {graphqlRequest} from '@shopify/cli-kit/node/api/graphql';\nimport {\n Logger,\n outputCompleted,\n outputInfo,\n} from '@shopify/cli-kit/node/output';\n\nimport {Header} from '../utils/utils.js';\n\nimport {\n DeploymentConfig,\n DeploymentHooks,\n DeploymentCompletedVerificationError,\n} from './types.js';\nimport {\n DeploymentVerificationDetailsQuery,\n DeploymentVerificationDetailsQueryData,\n DeploymentVerificationDetailsResponse,\n Status,\n} from './graphql/deployment-verification-details.js';\n\ninterface DeploymentVerificationDetailsOptions {\n config: DeploymentConfig;\n hooks?: DeploymentHooks;\n timeoutInSeconds: number;\n logger: Logger;\n}\n\nexport async function verifyDeploymentCompleted(\n options: DeploymentVerificationDetailsOptions,\n deploymentId: string,\n): Promise<DeploymentVerificationDetailsResponse> {\n const {config, logger, timeoutInSeconds, hooks} = options;\n const variables = {\n deploymentId,\n };\n\n hooks?.onDeploymentCompletedVerificationStart?.();\n outputInfo('Verifying deployment completed...', logger);\n\n let attempts = 0;\n const startTime = Date.now();\n\n const handleInterval = async () => {\n const delay = 3000;\n const elapsedTime = (Date.now() - startTime) / 1000;\n if (elapsedTime + delay / 1000 > timeoutInSeconds) {\n hooks?.onDeploymentCompletedVerificationError?.();\n throw new Error(\n `Deployment not completed after ${timeoutInSeconds} seconds.`,\n );\n }\n attempts++;\n await new Promise((resolve) => setTimeout(resolve, delay));\n return check();\n };\n\n const check = async (): Promise<DeploymentVerificationDetailsResponse> => {\n const response: DeploymentVerificationDetailsQueryData =\n await graphqlRequest({\n query: DeploymentVerificationDetailsQuery,\n api: 'Oxygen',\n url: `${config.deploymentUrl}/api/v2/admin/graphql`,\n token: config.deploymentToken.accessToken,\n variables,\n addedHeaders: {\n [Header.OxygenNamespaceHandle]: config.deploymentToken.namespace,\n },\n });\n\n const data = response.deploymentVerificationDetails;\n if (data.status === Status.Deployed) {\n outputCompleted('Deployment to Oxygen completed successfully', logger);\n hooks?.onDeploymentCompleted?.();\n return data;\n }\n\n if (data.status === Status.Failed || data.status === Status.Cancelled) {\n hooks?.onDeploymentFailed?.(data);\n throw new DeploymentCompletedVerificationError(\n data.error\n ? `Deployment ${data.status.toLocaleLowerCase()}, error: ${\n data.error\n }`\n : `Deployment ${data.status.toLocaleLowerCase()}`,\n );\n }\n\n return handleInterval();\n };\n\n return check();\n}\n"]}
@@ -174,5 +174,5 @@
174
174
  ]
175
175
  }
176
176
  },
177
- "version": "3.1.9-unstable.202401091544.0"
177
+ "version": "3.1.9-unstable.202401111534.0"
178
178
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "@shopify:registry": "https://registry.npmjs.org"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "3.1.9-unstable.202401091544.0",
8
+ "version": "3.1.9-unstable.202401111534.0",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "build": "tsup --sourcemap --clean --config ./tsup.config.ts && oclif manifest",
@@ -53,7 +53,7 @@
53
53
  "@types/async": "^3.2.24",
54
54
  "@types/node": "^20.10.8",
55
55
  "eslint": "^8.55.0",
56
- "eslint-plugin-prettier": "^5.1.2",
56
+ "eslint-plugin-prettier": "^5.1.3",
57
57
  "node-fetch": "^3.3.2",
58
58
  "oclif": "^4",
59
59
  "tsup": "^8.0.1",