@shopify/cli 3.0.15 ā 3.0.18
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/CHANGELOG.md +34 -0
- package/dist/commands/logs.js +12 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/version.js +1 -2
- package/dist/commands/version.js.map +1 -1
- package/dist/hooks/postrun.js +9 -0
- package/dist/hooks/postrun.js.map +1 -0
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/hooks/monorail.js +0 -21
- package/dist/hooks/monorail.js.map +0 -1
- package/dist/services/monorail.js +0 -63
- package/dist/services/monorail.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @shopify/cli
|
|
2
2
|
|
|
3
|
+
## 3.0.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 84438079: Add logging to file and command to access logs
|
|
8
|
+
- fa518a0d: Report events with the analytics helper from cli-kit
|
|
9
|
+
- Updated dependencies [84438079]
|
|
10
|
+
- Updated dependencies [fa518a0d]
|
|
11
|
+
- Updated dependencies [fd10fc01]
|
|
12
|
+
- Updated dependencies [0243890b]
|
|
13
|
+
- Updated dependencies [cb1caa7c]
|
|
14
|
+
- @shopify/cli-kit@3.0.18
|
|
15
|
+
|
|
16
|
+
## 3.0.17
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 336ae141: Fix analytics report for dev command
|
|
21
|
+
- Updated dependencies [df0d0347]
|
|
22
|
+
- Updated dependencies [6657a57c]
|
|
23
|
+
- @shopify/cli-kit@3.0.17
|
|
24
|
+
|
|
25
|
+
## 3.0.16
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- eb915dee: Loose version requirements to help dependency managers dedupe dependencies
|
|
30
|
+
- a750e67c: Improve dependency upgrade messages to leverage new shopify upgrade command
|
|
31
|
+
- Updated dependencies [eb915dee]
|
|
32
|
+
- Updated dependencies [85ee088d]
|
|
33
|
+
- Updated dependencies [2ecbff43]
|
|
34
|
+
- Updated dependencies [a750e67c]
|
|
35
|
+
- @shopify/cli-kit@3.0.16
|
|
36
|
+
|
|
3
37
|
## 3.0.15
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { output } from '@shopify/cli-kit';
|
|
3
|
+
|
|
4
|
+
class Logs extends Command {
|
|
5
|
+
async run() {
|
|
6
|
+
await output.pageLogs();
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
Logs.description = "View full debug logs from the Shopify CLI";
|
|
10
|
+
|
|
11
|
+
export { Logs as default };
|
|
12
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sources":["../../src/cli/commands/logs.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {output} from '@shopify/cli-kit'\n\nexport default class Logs extends Command {\n static description = 'View full debug logs from the Shopify CLI'\n\n async run(): Promise<void> {\n await output.pageLogs()\n }\n}\n"],"names":[],"mappings":";;;AAGA,MAAqB,aAAa,OAAQ,CAAA;AAAA,EAGxC,MAAM,GAAqB,GAAA;AACzB,IAAA,MAAM,OAAO,QAAS,EAAA,CAAA;AAAA,GACxB;AACF,CAAA;AANqB,KACZ,WAAc,GAAA,2CAAA;;;;"}
|
package/dist/commands/version.js
CHANGED
|
@@ -8,8 +8,7 @@ const _Version = class extends Command {
|
|
|
8
8
|
output.info(output.content`Current ${_Version.description}: ${output.token.yellow(currentVersion)}`.value);
|
|
9
9
|
const lastVersion = await dependency.checkForNewVersion(cliDependency, currentVersion);
|
|
10
10
|
if (lastVersion) {
|
|
11
|
-
output.info(
|
|
12
|
-
output.info(dependency.getOutputUpdateCLIReminder(dependency.dependencyManagerUsedForCreating(), [cliDependency]));
|
|
11
|
+
output.info(dependency.getOutputUpdateCLIReminder(dependency.dependencyManagerUsedForCreating(), lastVersion));
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
14
|
getCurrentVersion() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../src/cli/commands/version.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {output, dependency} from '@shopify/cli-kit'\n\nexport default class Version extends Command {\n static description = 'Shopify CLI version'\n\n async run(): Promise<void> {\n const cliDependency = '@shopify/cli'\n const currentVersion = this.getCurrentVersion()\n output.info(output.content`Current ${Version.description}: ${output.token.yellow(currentVersion)}`.value)\n const lastVersion = await dependency.checkForNewVersion(cliDependency, currentVersion)\n if (lastVersion) {\n output.info(
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../src/cli/commands/version.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {output, dependency} from '@shopify/cli-kit'\n\nexport default class Version extends Command {\n static description = 'Shopify CLI version'\n\n async run(): Promise<void> {\n const cliDependency = '@shopify/cli'\n const currentVersion = this.getCurrentVersion()\n output.info(output.content`Current ${Version.description}: ${output.token.yellow(currentVersion)}`.value)\n const lastVersion = await dependency.checkForNewVersion(cliDependency, currentVersion)\n if (lastVersion) {\n output.info(dependency.getOutputUpdateCLIReminder(dependency.dependencyManagerUsedForCreating(), lastVersion))\n }\n }\n\n getCurrentVersion(): string {\n return this.config.version\n }\n}\n"],"names":[],"mappings":";;;AAGA,MAAqB,QAAA,GAArB,cAAqC,OAAQ,CAAA;AAAA,EAG3C,MAAM,GAAqB,GAAA;AACzB,IAAA,MAAM,aAAgB,GAAA,cAAA,CAAA;AACtB,IAAM,MAAA,cAAA,GAAiB,KAAK,iBAAkB,EAAA,CAAA;AAC9C,IAAO,MAAA,CAAA,IAAA,CAAK,MAAO,CAAA,OAAA,CAAA,QAAA,EAAkB,QAAQ,CAAA,WAAA,CAAA,EAAA,EAAgB,OAAO,KAAM,CAAA,MAAA,CAAO,cAAc,CAAA,CAAA,CAAA,CAAI,KAAK,CAAA,CAAA;AACxG,IAAA,MAAM,WAAc,GAAA,MAAM,UAAW,CAAA,kBAAA,CAAmB,eAAe,cAAc,CAAA,CAAA;AACrF,IAAA,IAAI,WAAa,EAAA;AACf,MAAA,MAAA,CAAO,KAAK,UAAW,CAAA,0BAAA,CAA2B,WAAW,gCAAiC,EAAA,EAAG,WAAW,CAAC,CAAA,CAAA;AAAA,KAC/G;AAAA,GACF;AAAA,EAEA,iBAA4B,GAAA;AAC1B,IAAA,OAAO,KAAK,MAAO,CAAA,OAAA,CAAA;AAAA,GACrB;AACF,CAAA,CAAA;AAhBA,IAAqB,OAArB,GAAA,SAAA;AAAqB,QACZ,WAAc,GAAA,qBAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postrun.js","sources":["../../src/hooks/postrun.ts"],"sourcesContent":["import {analytics} from '@shopify/cli-kit'\nimport {Hook} from '@oclif/core'\n\n// This hook is called after each successful command run. More info: https://oclif.io/docs/hooks\nexport const hook: Hook.Postrun = async (options) => {\n const command = options.Command.id.replace(/:/g, ' ')\n await analytics.reportEvent(command, options.argv)\n}\n"],"names":[],"mappings":";;AAIa,MAAA,IAAA,GAAqB,OAAO,OAAY,KAAA;AACnD,EAAA,MAAM,UAAU,OAAQ,CAAA,OAAA,CAAQ,EAAG,CAAA,OAAA,CAAQ,MAAM,GAAG,CAAA,CAAA;AACpD,EAAA,MAAM,SAAU,CAAA,WAAA,CAAY,OAAS,EAAA,OAAA,CAAQ,IAAI,CAAA,CAAA;AACnD;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { settings, run, flush } from '@oclif/core';
|
|
2
2
|
import Bugsnag from '@bugsnag/js';
|
|
3
|
-
import { environment, error } from '@shopify/cli-kit';
|
|
3
|
+
import { output, environment, error } from '@shopify/cli-kit';
|
|
4
4
|
|
|
5
|
-
var version = "3.0.
|
|
5
|
+
var version = "3.0.18";
|
|
6
6
|
|
|
7
7
|
function runCLI() {
|
|
8
|
+
output.initiateLogging({ filename: "shopify.cli.log" });
|
|
8
9
|
if (environment.local.isDebug()) {
|
|
9
10
|
settings.debug = true;
|
|
10
11
|
} else {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// CLI\nimport {version as cliVersion} from '../package.json'\nimport {run, settings, flush} from '@oclif/core'\nimport Bugsnag from '@bugsnag/js'\nimport {error as kitError, environment} from '@shopify/cli-kit'\n\nfunction runCLI() {\n if (environment.local.isDebug()) {\n settings.debug = true\n } else {\n Bugsnag.start({\n apiKey: '9e1e6889176fd0c795d5c659225e0fae',\n logger: null,\n appVersion: cliVersion,\n autoTrackSessions: false,\n })\n }\n\n run(undefined, import.meta.url)\n .then(flush)\n .catch((error: Error): Promise<void | Error> => {\n if (error instanceof kitError.AbortSilent) {\n process.exit(1)\n }\n const kitMapper = kitError.mapper\n const kitHandle = kitError.handler\n // eslint-disable-next-line promise/no-nesting\n return kitMapper(error)\n .then(bugsnagHandle)\n .then((error: Error) => {\n return kitHandle(error)\n })\n .then(() => {\n process.exit(1)\n })\n })\n}\n\nconst bugsnagHandle = async (errorToReport: Error): Promise<Error> => {\n if (!settings.debug && kitError.shouldReport(errorToReport)) {\n const reportedError = Object.assign(Object.create(errorToReport), {})\n if (reportedError.stack) reportedError.stack = reportedError.stack.replace(new RegExp('file:///', 'g'), '/')\n await new Promise((resolve, reject) => {\n Bugsnag.notify(reportedError, undefined, resolve)\n })\n }\n return Promise.resolve(errorToReport)\n}\n\nexport default runCLI\n"],"names":["cliVersion","error","kitError"],"mappings":";;;;;;AAMA,SAAkB,MAAA,GAAA;AAChB,EAAI,IAAA,WAAA,CAAY,KAAM,CAAA,OAAA,EAAW,EAAA;AAC/B,IAAA,QAAA,CAAS,KAAQ,GAAA,IAAA,CAAA;AAAA,GACZ,MA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,CAAA,CAAA;AAC3G,IAAA,MAAM,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAW,KAAA;AACrC,MAAQ,OAAA,CAAA,MAAA,CAAO,aAAe,EAAA,KAAA,CAAA,EAAW,OAAO,CAAA,CAAA;AAAA,KACjD,CAAA,CAAA;AAAA,GACH;AACA,EAAO,OAAA,OAAA,CAAQ,QAAQ,aAAa,CAAA,CAAA;AACtC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// CLI\nimport {version as cliVersion} from '../package.json'\nimport {run, settings, flush} from '@oclif/core'\nimport Bugsnag from '@bugsnag/js'\nimport {error as kitError, environment, output} from '@shopify/cli-kit'\n\nfunction runCLI() {\n output.initiateLogging({filename: 'shopify.cli.log'})\n if (environment.local.isDebug()) {\n settings.debug = true\n } else {\n Bugsnag.start({\n apiKey: '9e1e6889176fd0c795d5c659225e0fae',\n logger: null,\n appVersion: cliVersion,\n autoTrackSessions: false,\n })\n }\n\n run(undefined, import.meta.url)\n .then(flush)\n .catch((error: Error): Promise<void | Error> => {\n if (error instanceof kitError.AbortSilent) {\n process.exit(1)\n }\n const kitMapper = kitError.mapper\n const kitHandle = kitError.handler\n // eslint-disable-next-line promise/no-nesting\n return kitMapper(error)\n .then(bugsnagHandle)\n .then((error: Error) => {\n return kitHandle(error)\n })\n .then(() => {\n process.exit(1)\n })\n })\n}\n\nconst bugsnagHandle = async (errorToReport: Error): Promise<Error> => {\n if (!settings.debug && kitError.shouldReport(errorToReport)) {\n const reportedError = Object.assign(Object.create(errorToReport), {})\n if (reportedError.stack) reportedError.stack = reportedError.stack.replace(new RegExp('file:///', 'g'), '/')\n await new Promise((resolve, reject) => {\n Bugsnag.notify(reportedError, undefined, resolve)\n })\n }\n return Promise.resolve(errorToReport)\n}\n\nexport default runCLI\n"],"names":["cliVersion","error","kitError"],"mappings":";;;;;;AAMA,SAAkB,MAAA,GAAA;AAChB,EAAA,MAAA,CAAO,eA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AAG,EAAE,CAAA,CAAA;AACpE,IAAA,IAAI,aAAc,CAAA,KAAA;AAAO,MAAc,aAAA,CAAA,KAAA,GAAQ,cAAc,KAAM,CAAA,OAAA,CAAQ,IAAI,MAAO,CAAA,UAAA,EAAY,GAAG,CAAA,EAAG,GAAG,CAAA,CAAA;AAC3G,IAAA,MAAM,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAW,KAAA;AACrC,MAAQ,OAAA,CAAA,MAAA,CAAO,aAAe,EAAA,KAAA,CAAA,EAAW,OAAO,CAAA,CAAA;AAAA,KACjD,CAAA,CAAA;AAAA,GACH;AACA,EAAO,OAAA,OAAA,CAAQ,QAAQ,aAAa,CAAA,CAAA;AACtC,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.18",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A CLI tool to build for the Shopify platform",
|
|
6
6
|
"type": "module",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@bugsnag/js": "^7.16.7",
|
|
51
|
-
"@oclif/core": "1.
|
|
51
|
+
"@oclif/core": "^1.0",
|
|
52
52
|
"@oclif/plugin-help": "^5.1.12",
|
|
53
53
|
"@oclif/plugin-plugins": "^2.1.0",
|
|
54
|
-
"@shopify/
|
|
55
|
-
"@shopify/
|
|
54
|
+
"@shopify/plugin-ngrok": "^0.2.9",
|
|
55
|
+
"@shopify/cli-kit": "^3.0.18"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"vitest": "0.13.1"
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"-h"
|
|
97
97
|
],
|
|
98
98
|
"hooks": {
|
|
99
|
-
"postrun": "dist/hooks/
|
|
99
|
+
"postrun": "dist/hooks/postrun"
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
}
|
package/dist/hooks/monorail.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { reportEvent } from '../services/monorail.js';
|
|
2
|
-
import { environment, output } from '@shopify/cli-kit';
|
|
3
|
-
|
|
4
|
-
const hook = async (options) => {
|
|
5
|
-
try {
|
|
6
|
-
if (environment.local.isDebug() || environment.local.analyticsDisabled()) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const command = options.Command.id.replace(/:/g, " ");
|
|
10
|
-
await reportEvent(command, options.argv);
|
|
11
|
-
} catch (error) {
|
|
12
|
-
const message = "Failed to report usage analytics";
|
|
13
|
-
if (error instanceof Error) {
|
|
14
|
-
message.concat(`: ${error.message}`);
|
|
15
|
-
}
|
|
16
|
-
output.debug(message);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { hook };
|
|
21
|
-
//# sourceMappingURL=monorail.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monorail.js","sources":["../../src/hooks/monorail.ts"],"sourcesContent":["import {reportEvent} from '../services/monorail'\nimport {Hook} from '@oclif/core'\nimport {environment, output} from '@shopify/cli-kit'\n\nexport const hook: Hook.Postrun = async (options) => {\n try {\n if (environment.local.isDebug() || environment.local.analyticsDisabled()) {\n return\n }\n const command = options.Command.id.replace(/:/g, ' ')\n await reportEvent(command, options.argv)\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n const message = 'Failed to report usage analytics'\n if (error instanceof Error) {\n message.concat(`: ${error.message}`)\n }\n output.debug(message)\n }\n}\n"],"names":[],"mappings":";;;AAIa,MAAA,IAAA,GAAqB,OAAO,OAAY,KAAA;AACnD,EAAI,IAAA;AACF,IAAA,IAAI,YAAY,KAAM,CAAA,OAAA,MAAa,WAAY,CAAA,KAAA,CAAM,mBAAqB,EAAA;AACxE,MAAA,OAAA;AAAA,KACF;AACA,IAAA,MAAM,UAAU,OAAQ,CAAA,OAAA,CAAQ,EAAG,CAAA,OAAA,CAAQ,MAAM,GAAG,CAAA,CAAA;AACpD,IAAM,MAAA,WAAA,CAAY,OAAS,EAAA,OAAA,CAAQ,IAAI,CAAA,CAAA;AAAA,WAEhC,KAAP,EAAA;AACA,IAAA,MAAM,OAAU,GAAA,kCAAA,CAAA;AAChB,IAAA,IAAI,iBAAiB,KAAO,EAAA;AAC1B,MAAQ,OAAA,CAAA,MAAA,CAAO,CAAK,EAAA,EAAA,KAAA,CAAM,OAAS,CAAA,CAAA,CAAA,CAAA;AAAA,KACrC;AACA,IAAA,MAAA,CAAO,MAAM,OAAO,CAAA,CAAA;AAAA,GACtB;AACF;;;;"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { http, output, path, store, os, ruby, environment } from '@shopify/cli-kit';
|
|
2
|
-
|
|
3
|
-
var version = "3.0.15";
|
|
4
|
-
|
|
5
|
-
const url = "https://monorail-edge.shopifysvc.com/v1/produce";
|
|
6
|
-
const reportEvent = async (command, args) => {
|
|
7
|
-
const currentTime = new Date().getTime();
|
|
8
|
-
const payload = await buildPayload(command, args, currentTime);
|
|
9
|
-
const body = JSON.stringify(payload);
|
|
10
|
-
const headers = buildHeaders(currentTime);
|
|
11
|
-
const response = await http.fetch(url, { method: "POST", body, headers });
|
|
12
|
-
if (response.status === 200) {
|
|
13
|
-
output.debug(`Analytics event sent: ${body}`);
|
|
14
|
-
} else {
|
|
15
|
-
output.debug(`Failed to report usage analytics: ${response.statusText}`);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const buildHeaders = (currentTime) => {
|
|
19
|
-
return {
|
|
20
|
-
"Content-Type": "application/json; charset=utf-8",
|
|
21
|
-
"X-Monorail-Edge-Event-Created-At-Ms": currentTime.toString(),
|
|
22
|
-
"X-Monorail-Edge-Event-Sent-At-Ms": currentTime.toString()
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
const buildPayload = async (command, args = [], currentTime) => {
|
|
26
|
-
let directory = process.cwd();
|
|
27
|
-
const pathFlagIndex = args.indexOf("--path");
|
|
28
|
-
if (pathFlagIndex >= 0) {
|
|
29
|
-
directory = path.resolve(args[pathFlagIndex + 1]);
|
|
30
|
-
}
|
|
31
|
-
const appInfo = store.getAppInfo(directory);
|
|
32
|
-
const { platform, arch } = os.platformAndArch();
|
|
33
|
-
const rawPartnerId = appInfo?.orgId;
|
|
34
|
-
let partnerIdAsInt;
|
|
35
|
-
if (rawPartnerId !== void 0) {
|
|
36
|
-
partnerIdAsInt = parseInt(rawPartnerId, 10);
|
|
37
|
-
if (isNaN(partnerIdAsInt)) {
|
|
38
|
-
partnerIdAsInt = void 0;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
schema_id: "app_cli3_command/1.0",
|
|
43
|
-
payload: {
|
|
44
|
-
project_type: "node",
|
|
45
|
-
command,
|
|
46
|
-
args: args.join(" "),
|
|
47
|
-
time_start: currentTime,
|
|
48
|
-
time_end: currentTime,
|
|
49
|
-
total_time: 0,
|
|
50
|
-
success: true,
|
|
51
|
-
uname: `${platform} ${arch}`,
|
|
52
|
-
cli_version: version,
|
|
53
|
-
ruby_version: await ruby.version() || "",
|
|
54
|
-
node_version: process.version.replace("v", ""),
|
|
55
|
-
is_employee: await environment.local.isShopify(),
|
|
56
|
-
api_key: appInfo?.appId,
|
|
57
|
-
partner_id: partnerIdAsInt
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export { reportEvent, url };
|
|
63
|
-
//# sourceMappingURL=monorail.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"monorail.js","sources":["../../src/services/monorail.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport {version} from '../../package.json'\nimport {environment, http, os, output, path, ruby, store} from '@shopify/cli-kit'\n\nexport const url = 'https://monorail-edge.shopifysvc.com/v1/produce'\n\nexport const reportEvent = async (command: string, args: string[]) => {\n const currentTime = new Date().getTime()\n const payload = await buildPayload(command, args, currentTime)\n const body = JSON.stringify(payload)\n const headers = buildHeaders(currentTime)\n\n const response = await http.fetch(url, {method: 'POST', body, headers})\n if (response.status === 200) {\n output.debug(`Analytics event sent: ${body}`)\n } else {\n output.debug(`Failed to report usage analytics: ${response.statusText}`)\n }\n}\n\nconst buildHeaders = (currentTime: number) => {\n return {\n 'Content-Type': 'application/json; charset=utf-8',\n 'X-Monorail-Edge-Event-Created-At-Ms': currentTime.toString(),\n 'X-Monorail-Edge-Event-Sent-At-Ms': currentTime.toString(),\n }\n}\n\nconst buildPayload = async (command: string, args: string[] = [], currentTime: number) => {\n let directory = process.cwd()\n const pathFlagIndex = args.indexOf('--path')\n if (pathFlagIndex >= 0) {\n directory = path.resolve(args[pathFlagIndex + 1])\n }\n const appInfo = store.getAppInfo(directory)\n const {platform, arch} = os.platformAndArch()\n\n const rawPartnerId = appInfo?.orgId\n let partnerIdAsInt: number | undefined\n if (rawPartnerId !== undefined) {\n partnerIdAsInt = parseInt(rawPartnerId, 10)\n if (isNaN(partnerIdAsInt)) {\n partnerIdAsInt = undefined\n }\n }\n\n return {\n schema_id: 'app_cli3_command/1.0',\n payload: {\n project_type: 'node',\n command,\n args: args.join(' '),\n time_start: currentTime,\n time_end: currentTime,\n total_time: 0,\n success: true,\n uname: `${platform} ${arch}`,\n cli_version: version,\n ruby_version: (await ruby.version()) || '',\n node_version: process.version.replace('v', ''),\n is_employee: await environment.local.isShopify(),\n api_key: appInfo?.appId,\n partner_id: partnerIdAsInt,\n },\n }\n}\n"],"names":[],"mappings":";;;;AAIO,MAAM,GAAM,GAAA,kDAAA;AAEN,MAAA,WAAA,GAAc,OAAO,OAAA,EAAiB,IAAmB,KAAA;AACpE,EAAA,MAAM,WAAc,GAAA,IAAI,IAAK,EAAA,CAAE,OAAQ,EAAA,CAAA;AACvC,EAAA,MAAM,OAAU,GAAA,MAAM,YAAa,CAAA,OAAA,EAAS,MAAM,W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