@testsmith/api-spector 0.3.2 → 0.3.3

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/bin/cli.js CHANGED
@@ -72,11 +72,27 @@ if (command.runner === 'electron') {
72
72
  electron = require('electron')
73
73
  } catch (err) {
74
74
  const msg = err && err.message ? err.message : String(err)
75
- const looksLikeBinaryMissing = /Electron failed to install correctly|Cannot find module 'electron'/i.test(msg)
75
+ const notInstalled = /Cannot find module 'electron'/i.test(msg)
76
+ const binaryMissing = /Electron failed to install correctly/i.test(msg)
76
77
  console.error('')
77
78
  console.error(' API Spector — failed to launch the UI.')
78
79
  console.error('')
79
- if (looksLikeBinaryMissing) {
80
+ if (notInstalled) {
81
+ console.error(' The electron package is not installed alongside API Spector.')
82
+ console.error(' Versions 0.3.1 and 0.3.2 shipped without it by mistake.')
83
+ console.error('')
84
+ console.error(' Fix options:')
85
+ console.error('')
86
+ console.error(' 1. Update API Spector (0.3.3 or later includes electron):')
87
+ console.error(' npm install -D @testsmith/api-spector@latest')
88
+ console.error(' (use -g instead of -D if you installed globally)')
89
+ console.error('')
90
+ console.error(' 2. Or keep this version and install electron yourself:')
91
+ console.error(' npm install -D electron@31')
92
+ console.error('')
93
+ console.error(' CLI subcommands (run / mock / record / contract / wsdl) do not')
94
+ console.error(' need electron and work even while this is broken.')
95
+ } else if (binaryMissing) {
80
96
  const installDir = path.dirname(__dirname)
81
97
  console.error(' Electron is installed, but its platform binary is missing — the')
82
98
  console.error(' download during `npm install` did not complete (often a proxy or')
@@ -85,13 +101,14 @@ if (command.runner === 'electron') {
85
101
  console.error(' Fix options (try in order):')
86
102
  console.error('')
87
103
  console.error(' 1. Reinstall and force the postinstall script to run:')
88
- console.error(' npm install -g @testsmith/api-spector --force')
104
+ console.error(' npm install -D @testsmith/api-spector --force')
105
+ console.error(' (use -g instead of -D if you installed globally)')
89
106
  console.error('')
90
107
  console.error(' 2. Behind a proxy? Set npm + electron mirrors and reinstall:')
91
108
  console.error(' npm config set proxy http://your-proxy:port')
92
109
  console.error(' npm config set https-proxy http://your-proxy:port')
93
110
  console.error(' set ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/')
94
- console.error(' npm install -g @testsmith/api-spector --force')
111
+ console.error(' npm install -D @testsmith/api-spector --force')
95
112
  console.error('')
96
113
  console.error(' 3. Re-run electron\'s postinstall manually:')
97
114
  console.error(` cd "${path.join(installDir, 'node_modules', 'electron')}"`)
@@ -393,7 +393,7 @@ async function main() {
393
393
  if (envName && !env) {
394
394
  console.warn(cliCommon.color(`Warning: environment "${envName}" not found. Running without environment.`, cliCommon.C.yellow));
395
395
  }
396
- const version = `v${"0.3.2"}`;
396
+ const version = `v${"0.3.3"}`;
397
397
  console.log("");
398
398
  console.log(cliCommon.color(" API Test Runner" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
399
399
  console.log(cliCommon.color(` Workspace: ${wsPath}`, cliCommon.C.gray));