diff --git a/index.js b/index.js index 3cfeca95..c76ac6bc 100644 --- a/index.js +++ b/index.js @@ -11,5 +11,6 @@ module.exports = new TeletypePackage({ cluster: atom.config.get('teletype.pusherCluster'), disableStats: true }, - baseURL: atom.config.get('teletype.baseURL') + baseURL: atom.config.get('teletype.baseURL'), + getAtomVersion: atom.getVersion.bind(atom) }) diff --git a/lib/package-initialization-error-component.js b/lib/package-initialization-error-component.js index 113517fa..7178d541 100644 --- a/lib/package-initialization-error-component.js +++ b/lib/package-initialization-error-component.js @@ -45,8 +45,12 @@ class PackageInitializationErrorComponent { url.searchParams.append('body', '### Diagnostics\n\n' + '```\n' + - initializationError.diagnosticMessage + '\n' + - '```\n' + initializationError.diagnosticMessage + '\n\n' + + '```\n' + + '### Versions\n\n' + + `**Teletype version**: v${getTeletypeVersion()}\n` + + `**Atom version**: ${this.props.getAtomVersion()}\n` + + `**Platform**: ${process.platform}\n` ) return url.href @@ -58,3 +62,7 @@ class PackageInitializationErrorComponent { await packageManager.activatePackage('teletype') } } + +function getTeletypeVersion () { + return require('../package.json').version +} diff --git a/lib/popover-component.js b/lib/popover-component.js index 438160cb..5e1567d0 100644 --- a/lib/popover-component.js +++ b/lib/popover-component.js @@ -23,7 +23,7 @@ class PopoverComponent { const { isClientOutdated, initializationError, authenticationProvider, portalBindingManager, - commandRegistry, clipboard, workspace, notificationManager, packageManager + commandRegistry, clipboard, workspace, notificationManager, packageManager, getAtomVersion } = this.props let activeComponent @@ -36,6 +36,7 @@ class PopoverComponent { activeComponent = $(PackageInitializationErrorComponent, { ref: 'packageInitializationErrorComponent', packageManager, + getAtomVersion, initializationError }) } else if (this.props.authenticationProvider.isSignedIn()) { diff --git a/lib/teletype-package.js b/lib/teletype-package.js index 16b1c291..077d5362 100644 --- a/lib/teletype-package.js +++ b/lib/teletype-package.js @@ -9,9 +9,9 @@ module.exports = class TeletypePackage { constructor (options) { const { - baseURL, clipboard, commandRegistry, credentialCache, notificationManager, - packageManager, pubSubGateway, pusherKey, pusherOptions, - tetherDisconnectWindow, tooltipManager, workspace + baseURL, clipboard, commandRegistry, credentialCache, getAtomVersion, + notificationManager, packageManager, pubSubGateway, pusherKey, + pusherOptions, tetherDisconnectWindow, tooltipManager, workspace } = options this.workspace = workspace @@ -24,6 +24,7 @@ class TeletypePackage { this.pusherKey = pusherKey this.pusherOptions = pusherOptions this.baseURL = baseURL + this.getAtomVersion = getAtomVersion this.tetherDisconnectWindow = tetherDisconnectWindow this.credentialCache = credentialCache || new CredentialCache() this.client = new TeletypeClient({ @@ -132,7 +133,8 @@ class TeletypePackage { clipboard: this.clipboard, workspace: this.workspace, notificationManager: this.notificationManager, - packageManager: this.packageManager + packageManager: this.packageManager, + getAtomVersion: this.getAtomVersion }) this.portalStatusBarIndicator.attach() diff --git a/test/teletype-package.test.js b/test/teletype-package.test.js index 7421616f..023238fc 100644 --- a/test/teletype-package.test.js +++ b/test/teletype-package.test.js @@ -1101,6 +1101,7 @@ suite('TeletypePackage', function () { commandRegistry: env.commands, tooltipManager: env.tooltips, clipboard: new FakeClipboard(), + getAtomVersion: function () { return 'x.y.z' }, tetherDisconnectWindow: 300, credentialCache })