@shopify/oxygen-cli 4.6.8-unstable.202501231554.0 → 4.6.8-unstable.202501241531.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,9 @@
7
7
  - 74edaa5: Update vite from 6.0.9 to 6.0.11
8
8
  - 72bb19f: Update oclif from 4.17.16 to 4.17.17
9
9
  - 0c8184e: Update @types/node from 22.10.7 to 22.10.9
10
+ - 79e1e6c: Update @changesets/cli from 2.27.11 to 2.27.12
11
+ - 0445c53: Update @types/node from 22.10.9 to 22.10.10
12
+ - 6806b95: Include worker startup time in error message when deployment fails because it exceeded the CPU time limit
10
13
 
11
14
  ## 4.6.6
12
15
 
@@ -1,4 +1,4 @@
1
- declare const DeploymentVerificationDetailsQuery = "\n query DeploymentVerificationDetails($deploymentId: ID!) {\n deploymentVerificationDetails(id: $deploymentId) {\n url\n status\n error\n }\n }\n";
1
+ declare const DeploymentVerificationDetailsQuery = "\n query DeploymentVerificationDetails($deploymentId: ID!) {\n deploymentVerificationDetails(id: $deploymentId) {\n url\n status\n error\n startupTime\n }\n }\n";
2
2
  interface DeploymentVerificationDetailsQueryData {
3
3
  deploymentVerificationDetails: DeploymentVerificationDetailsResponse | null;
4
4
  }
@@ -6,6 +6,7 @@ interface DeploymentVerificationDetailsResponse {
6
6
  url: string;
7
7
  status: string;
8
8
  error?: string;
9
+ startupTime?: number;
9
10
  }
10
11
  declare enum Status {
11
12
  Pending = "PENDING",
@@ -4,6 +4,7 @@ const DeploymentVerificationDetailsQuery = `
4
4
  url
5
5
  status
6
6
  error
7
+ startupTime
7
8
  }
8
9
  }
9
10
  `;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/deploy/graphql/deployment-verification-details.ts"],"names":["Status"],"mappings":"AAAO,MAAM,kCAAqC,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAoBtC,IAAA,MAAA,qBAAAA,OAAL,KAAA;AACL,EAAAA,QAAA,SAAU,CAAA,GAAA,SAAA,CAAA;AACV,EAAAA,QAAA,UAAW,CAAA,GAAA,UAAA,CAAA;AACX,EAAAA,QAAA,QAAS,CAAA,GAAA,QAAA,CAAA;AACT,EAAAA,QAAA,WAAY,CAAA,GAAA,WAAA,CAAA;AAJF,EAAAA,OAAAA,OAAAA,CAAAA;AAAA,CAAA,EAAA,MAAA,IAAA,EAAA","file":"deployment-verification-details.js","sourcesContent":["export const DeploymentVerificationDetailsQuery = `\n query DeploymentVerificationDetails($deploymentId: ID!) {\n deploymentVerificationDetails(id: $deploymentId) {\n url\n status\n error\n }\n }\n`;\n\nexport interface DeploymentVerificationDetailsQueryData {\n deploymentVerificationDetails: DeploymentVerificationDetailsResponse | null;\n}\n\nexport interface DeploymentVerificationDetailsResponse {\n url: string;\n status: string;\n error?: string;\n}\n\nexport enum Status {\n Pending = 'PENDING',\n Deployed = 'DEPLOYED',\n Failed = 'FAILED',\n Cancelled = 'CANCELLED',\n}\n"]}
1
+ {"version":3,"sources":["../../../src/deploy/graphql/deployment-verification-details.ts"],"names":["Status"],"mappings":"AAAO,MAAM,kCAAqC,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAsBtC,IAAA,MAAA,qBAAAA,OAAL,KAAA;AACL,EAAAA,QAAA,SAAU,CAAA,GAAA,SAAA,CAAA;AACV,EAAAA,QAAA,UAAW,CAAA,GAAA,UAAA,CAAA;AACX,EAAAA,QAAA,QAAS,CAAA,GAAA,QAAA,CAAA;AACT,EAAAA,QAAA,WAAY,CAAA,GAAA,WAAA,CAAA;AAJF,EAAAA,OAAAA,OAAAA,CAAAA;AAAA,CAAA,EAAA,MAAA,IAAA,EAAA","file":"deployment-verification-details.js","sourcesContent":["export const DeploymentVerificationDetailsQuery = `\n query DeploymentVerificationDetails($deploymentId: ID!) {\n deploymentVerificationDetails(id: $deploymentId) {\n url\n status\n error\n startupTime\n }\n }\n`;\n\nexport interface DeploymentVerificationDetailsQueryData {\n deploymentVerificationDetails: DeploymentVerificationDetailsResponse | null;\n}\n\nexport interface DeploymentVerificationDetailsResponse {\n url: string;\n status: string;\n error?: string;\n startupTime?: number;\n}\n\nexport enum Status {\n Pending = 'PENDING',\n Deployed = 'DEPLOYED',\n Failed = 'FAILED',\n Cancelled = 'CANCELLED',\n}\n"]}
@@ -48,7 +48,7 @@ async function verifyDeploymentCompleted(options, deploymentId) {
48
48
  if (data.status === Status.Failed || data.status === Status.Cancelled) {
49
49
  hooks?.onDeploymentFailed?.(data);
50
50
  throw new DeploymentCompletedVerificationError(
51
- data.error ? `Deployment ${data.status.toLocaleLowerCase()}, error: ${data.error}` : `Deployment ${data.status.toLocaleLowerCase()}`
51
+ data.error ? `Deployment ${data.status.toLocaleLowerCase()}, error: ${data.error}${data.startupTime && data.error.includes("exceeded CPU time limit") ? ` (Startup time: ${data.startupTime}ms exceeded CPU time limit)` : ""}` : `Deployment ${data.status.toLocaleLowerCase()}`
52
52
  );
53
53
  }
54
54
  return handleInterval();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/deploy/verify-deployment-completed.ts"],"names":[],"mappings":";;;;;;AA4BA,eAAsB,yBAAA,CACpB,SACA,YACgD,EAAA;AAChD,EAAA,MAAM,EAAC,MAAA,EAAQ,MAAQ,EAAA,gBAAA,EAAkB,OAAS,GAAA,OAAA,CAAA;AAClD,EAAA,MAAM,SAAY,GAAA;AAAA,IAChB,YAAA;AAAA,GACF,CAAA;AAEA,EAAA,KAAA,EAAO,sCAAyC,IAAA,CAAA;AAChD,EAAA,UAAA,CAAW,qCAAqC,MAAM,CAAA,CAAA;AAGtD,EAAM,MAAA,SAAA,GAAY,KAAK,GAAI,EAAA,CAAA;AAE3B,EAAA,MAAM,iBAAiB,YAAY;AACjC,IAAA,MAAM,KAAQ,GAAA,GAAA,CAAA;AACd,IAAA,MAAM,WAAe,GAAA,CAAA,IAAA,CAAK,GAAI,EAAA,GAAI,SAAa,IAAA,GAAA,CAAA;AAC/C,IA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CAAA,MAAA,KAAW,OAAO,SAAW,EAAA;AACrE,MAAA,KAAA,EAAO,qBAAqB,IAAI,CAAA,CAAA;AAChC,MAAA,MAAM,IAAI,oCAAA;AAAA,QACR,IAAK,CAAA,KAAA,GACD,CAAc,WAAA,EAAA,IAAA,CAAK,OAAO,iBAAkB,EAAC,CAC3C,SAAA,EAAA,IAAA,CAAK,KACP,CACA,CAAA,GAAA,CAAA,WAAA,EAAc,IAAK,CAAA,MAAA,CAAO,mBAAmB,CAAA,CAAA;AAAA,OACnD,CAAA;AAAA,KACF;AAEA,IAAA,OAAO,cAAe,EAAA,CAAA;AAAA,GACxB,CAAA;AAEA,EAAA,OAAO,KAAM,EAAA,CAAA;AACf","file":"verify-deployment-completed.js","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 == null) {\n hooks?.onDeploymentCompletedVerificationError?.();\n throw new DeploymentCompletedVerificationError('Deployment not found');\n }\n\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":";;;;;;AA4BA,eAAsB,yBAAA,CACpB,SACA,YACgD,EAAA;AAChD,EAAA,MAAM,EAAC,MAAA,EAAQ,MAAQ,EAAA,gBAAA,EAAkB,OAAS,GAAA,OAAA,CAAA;AAClD,EAAA,MAAM,SAAY,GAAA;AAAA,IAChB,YAAA;AAAA,GACF,CAAA;AAEA,EAAA,KAAA,EAAO,sCAAyC,IAAA,CAAA;AAChD,EAAA,UAAA,CAAW,qCAAqC,MAAM,CAAA,CAAA;AAGtD,EAAM,MAAA,SAAA,GAAY,KAAK,GAAI,EAAA,CAAA;AAE3B,EAAA,MAAM,iBAAiB,YAAY;AACjC,IAAA,MAAM,KAAQ,GAAA,GAAA,CAAA;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/B,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AAEA,IAAA,IAAI,KAAK,MAAW,KAAA,MAAA,CAAO,UAAU,IAAK,CAAA,MAAA,KAAW,OAAO,SAAW,EAAA;AACrE,MAAA,KAAA,EAAO,qBAAqB,IAAI,CAAA,CAAA;AAChC,MAAA,MAAM,IAAI,oCAAA;AAAA,QACR,IAAK,CAAA,KAAA,GACD,CAAc,WAAA,EAAA,IAAA,CAAK,MAAO,CAAA,iBAAA,EAAmB,CAAA,SAAA,EAC3C,IAAK,CAAA,KACP,CACE,EAAA,IAAA,CAAK,WAAe,IAAA,IAAA,CAAK,KAAM,CAAA,QAAA,CAAS,yBAAyB,CAAA,GAC7D,CAAmB,gBAAA,EAAA,IAAA,CAAK,WAAW,CAAA,2BAAA,CAAA,GACnC,EACN,CAAA,CAAA,GACA,CAAc,WAAA,EAAA,IAAA,CAAK,MAAO,CAAA,iBAAA,EAAmB,CAAA,CAAA;AAAA,OACnD,CAAA;AAAA,KACF;AAEA,IAAA,OAAO,cAAe,EAAA,CAAA;AAAA,GACxB,CAAA;AAEA,EAAA,OAAO,KAAM,EAAA,CAAA;AACf","file":"verify-deployment-completed.js","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 == null) {\n hooks?.onDeploymentCompletedVerificationError?.();\n throw new DeploymentCompletedVerificationError('Deployment not found');\n }\n\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 data.startupTime && data.error.includes('exceeded CPU time limit')\n ? ` (Startup time: ${data.startupTime}ms exceeded CPU time limit)`\n : ''\n }`\n : `Deployment ${data.status.toLocaleLowerCase()}`,\n );\n }\n\n return handleInterval();\n };\n\n return check();\n}\n"]}
@@ -203,5 +203,5 @@
203
203
  ]
204
204
  }
205
205
  },
206
- "version": "4.6.8-unstable.202501231554.0"
206
+ "version": "4.6.8-unstable.202501241531.0"
207
207
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "@shopify:registry": "https://registry.npmjs.org"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "4.6.8-unstable.202501231554.0",
8
+ "version": "4.6.8-unstable.202501241531.0",
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "build": "tsup --sourcemap --clean --config ./tsup.config.ts && oclif manifest",
@@ -47,11 +47,11 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@bugsnag/source-maps": "^2.3.3",
50
- "@changesets/cli": "^2.27.11",
50
+ "@changesets/cli": "^2.27.12",
51
51
  "@shopify/eslint-plugin": "^46.0.0",
52
52
  "@shopify/prettier-config": "^1.1.2",
53
53
  "@types/async": "^3.2.24",
54
- "@types/node": "^22.10.9",
54
+ "@types/node": "^22.10.10",
55
55
  "eslint": "^8.57.1",
56
56
  "eslint-plugin-prettier": "^5.2.3",
57
57
  "node-fetch": "^3.3.2",