@expo/cli 0.18.30 → 0.18.31

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/build/bin/cli CHANGED
@@ -120,7 +120,7 @@ const args = (0, _arg().default)({
120
120
  });
121
121
  if (args["--version"]) {
122
122
  // Version is added in the build script.
123
- console.log("0.18.30");
123
+ console.log("0.18.31");
124
124
  process.exit(0);
125
125
  }
126
126
  if (args["--non-interactive"]) {
@@ -58,32 +58,38 @@ class DetachedClient {
58
58
  });
59
59
  }
60
60
  async flush() {
61
- if (!this.records.length) {
62
- return debug("No records to flush, skipping...");
61
+ try {
62
+ if (!this.records.length) {
63
+ return debug("No records to flush, skipping...");
64
+ }
65
+ const file = _tempy().default.file({
66
+ name: "expo-telemetry.json"
67
+ });
68
+ const data = {
69
+ actor: this.actor,
70
+ records: this.records
71
+ };
72
+ this.records = [];
73
+ await _fs().default.promises.mkdir(_path().default.dirname(file), {
74
+ recursive: true
75
+ });
76
+ await _fs().default.promises.writeFile(file, JSON.stringify(data));
77
+ const child = (0, _childProcess().spawn)(process.execPath, [
78
+ require.resolve("./flushDetached"),
79
+ file
80
+ ], {
81
+ detached: true,
82
+ windowsHide: true,
83
+ shell: false,
84
+ stdio: "ignore"
85
+ });
86
+ child.unref();
87
+ debug("Detached flush started");
88
+ } catch (error) {
89
+ // This could fail if any direct or indirect import used by this code changes during an upgrade to the `expo` dependency via `npx expo install --fix`,
90
+ // since this file may no longer be present after the upgrade, but before the process under the old Expo CLI version is terminated.
91
+ debug("Exception while initiating detached flush:", error);
63
92
  }
64
- const file = _tempy().default.file({
65
- name: "expo-telemetry.json"
66
- });
67
- const data = {
68
- actor: this.actor,
69
- records: this.records
70
- };
71
- this.records = [];
72
- await _fs().default.promises.mkdir(_path().default.dirname(file), {
73
- recursive: true
74
- });
75
- await _fs().default.promises.writeFile(file, JSON.stringify(data));
76
- const child = (0, _childProcess().spawn)(process.execPath, [
77
- require.resolve("./flushDetached"),
78
- file
79
- ], {
80
- detached: true,
81
- windowsHide: true,
82
- shell: false,
83
- stdio: "ignore"
84
- });
85
- child.unref();
86
- debug("Detached flush started");
87
93
  }
88
94
  }
89
95
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/utils/telemetry/DetachedClient.ts"],"sourcesContent":["import { spawn } from 'child_process';\nimport fs from 'fs';\nimport path from 'path';\nimport tempy from 'tempy';\n\nimport type { TelemetryClient, TelemetryRecord, TelemetryRecordWithDate } from './types';\nimport type { Actor } from '../../api/user/user';\n\nconst debug = require('debug')('expo:telemetry:detachedClient') as typeof console.log;\n\nexport type DetachedTelemetry = {\n actor?: Actor;\n records: TelemetryRecordWithDate[];\n};\n\nexport class DetachedClient implements TelemetryClient {\n private actor: Actor | undefined;\n private records: TelemetryRecordWithDate[] = [];\n\n get isIdentified() {\n return !!this.actor;\n }\n\n async identify(actor?: Actor) {\n if (!actor) return;\n debug('Actor received');\n this.actor = actor;\n }\n\n async record(record: TelemetryRecord) {\n debug('Event received: %s', record.event);\n this.records.push({ ...record, originalTimestamp: new Date() });\n }\n\n async flush() {\n if (!this.records.length) {\n return debug('No records to flush, skipping...');\n }\n\n const file = tempy.file({ name: 'expo-telemetry.json' });\n const data: DetachedTelemetry = { actor: this.actor, records: this.records };\n\n this.records = [];\n\n await fs.promises.mkdir(path.dirname(file), { recursive: true });\n await fs.promises.writeFile(file, JSON.stringify(data));\n\n const child = spawn(process.execPath, [require.resolve('./flushDetached'), file], {\n detached: true,\n windowsHide: true,\n shell: false,\n stdio: 'ignore',\n });\n\n child.unref();\n\n debug('Detached flush started');\n }\n}\n"],"names":["DetachedClient","debug","require","records","isIdentified","actor","identify","record","event","push","originalTimestamp","Date","flush","length","file","tempy","name","data","fs","promises","mkdir","path","dirname","recursive","writeFile","JSON","stringify","child","spawn","process","execPath","resolve","detached","windowsHide","shell","stdio","unref"],"mappings":"AAAA;;;;+BAeaA,gBAAc;;aAAdA,cAAc;;;yBAfL,eAAe;;;;;;;8DAC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GAAE,EAAA,QAAA,CAACC,QAAQ,CAACK,SAAS,CAACV,IAAI,EAAEW,IAAI,CAACC,SAAS,CAACT,IAAI,CAAC,CAAC,CAAC;QAExD,MAAMU,KAAK,GAAGC,IAAAA,aAAK,EAAA,MAAA,EAACC,OAAO,CAACC,QAAQ,EAAE;YAAC5B,OAAO,CAAC6B,OAAO,CAAC,iBAAiB,CAAC;YAAEjB,IAAI;SAAC,EAAE;YAChFkB,QAAQ,EAAE,IAAI;YACdC,WAAW,EAAE,IAAI;YACjBC,KAAK,EAAE,KAAK;YACZC,KAAK,EAAE,QAAQ;SAChB,CAAC,AAAC;QAEHR,KAAK,CAACS,KAAK,EAAE,CAAC;QAEdnC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAClC;CACD"}
1
+ {"version":3,"sources":["../../../../src/utils/telemetry/DetachedClient.ts"],"sourcesContent":["import { spawn } from 'child_process';\nimport fs from 'fs';\nimport path from 'path';\nimport tempy from 'tempy';\n\nimport type { TelemetryClient, TelemetryRecord, TelemetryRecordWithDate } from './types';\nimport type { Actor } from '../../api/user/user';\n\nconst debug = require('debug')('expo:telemetry:detachedClient') as typeof console.log;\n\nexport type DetachedTelemetry = {\n actor?: Actor;\n records: TelemetryRecordWithDate[];\n};\n\nexport class DetachedClient implements TelemetryClient {\n private actor: Actor | undefined;\n private records: TelemetryRecordWithDate[] = [];\n\n get isIdentified() {\n return !!this.actor;\n }\n\n async identify(actor?: Actor) {\n if (!actor) return;\n debug('Actor received');\n this.actor = actor;\n }\n\n async record(record: TelemetryRecord) {\n debug('Event received: %s', record.event);\n this.records.push({ ...record, originalTimestamp: new Date() });\n }\n\n async flush() {\n try {\n if (!this.records.length) {\n return debug('No records to flush, skipping...');\n }\n\n const file = tempy.file({ name: 'expo-telemetry.json' });\n const data: DetachedTelemetry = { actor: this.actor, records: this.records };\n\n this.records = [];\n\n await fs.promises.mkdir(path.dirname(file), { recursive: true });\n await fs.promises.writeFile(file, JSON.stringify(data));\n\n const child = spawn(process.execPath, [require.resolve('./flushDetached'), file], {\n detached: true,\n windowsHide: true,\n shell: false,\n stdio: 'ignore',\n });\n\n child.unref();\n\n debug('Detached flush started');\n } catch (error) {\n // This could fail if any direct or indirect import used by this code changes during an upgrade to the `expo` dependency via `npx expo install --fix`,\n // since this file may no longer be present after the upgrade, but before the process under the old Expo CLI version is terminated.\n debug('Exception while initiating detached flush:', error);\n }\n }\n}\n"],"names":["DetachedClient","debug","require","records","isIdentified","actor","identify","record","event","push","originalTimestamp","Date","flush","length","file","tempy","name","data","fs","promises","mkdir","path","dirname","recursive","writeFile","JSON","stringify","child","spawn","process","execPath","resolve","detached","windowsHide","shell","stdio","unref","error"],"mappings":"AAAA;;;;+BAeaA,gBAAc;;aAAdA,cAAc;;;yBAfL,eAAe;;;;;;;8DACtB,IAAI;;;;;;;8DACF,MAAM;;;;;;;8DACL,OAAO;;;;;;;;;;;AAKzB,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,+BAA+B,CAAC,AAAsB,AAAC;AAO/E,MAAMF,cAAc;IAEzB,AAAQG,OAAO,GAA8B,EAAE,CAAC;QAE5CC,YAAY,GAAG;QACjB,OAAO,CAAC,CAAC,IAAI,CAACC,KAAK,CAAC;IACtB;UAEMC,QAAQ,CAACD,KAAa,EAAE;QAC5B,IAAI,CAACA,KAAK,EAAE,OAAO;QACnBJ,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACxB,IAAI,CAACI,KAAK,GAAGA,KAAK,CAAC;IACrB;UAEME,MAAM,CAACA,MAAuB,EAAE;QACpCN,KAAK,CAAC,oBAAoB,EAAEM,MAAM,CAACC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAACL,OAAO,CAACM,IAAI,CAAC;YAAE,GAAGF,MAAM;YAAEG,iBAAiB,EAAE,IAAIC,IAAI,EAAE;SAAE,CAAC,CAAC;IAClE;UAEMC,KAAK,GAAG;QACZ,IAAI;YACF,IAAI,CAAC,IAAI,CAACT,OAAO,CAACU,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+ version: "0.18.31"
83
83
  },
84
84
  ci: _ciInfo().isCI ? {
85
85
  name: _ciInfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.18.30",
3
+ "version": "0.18.31",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -173,5 +173,5 @@
173
173
  "tree-kill": "^1.2.2",
174
174
  "tsd": "^0.28.1"
175
175
  },
176
- "gitHead": "babb6c584ab401bf9b75574aebd4ead1a423ec81"
176
+ "gitHead": "672a1e49651614f047f5f104fa2bb65ac7fb050e"
177
177
  }