@toptal/davinci-cli-shared 2.2.1 → 2.2.2-alpha-fx-3735-fix-davinci-start-command-71a720cf.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-cli-shared",
3
- "version": "2.2.1",
3
+ "version": "2.2.2-alpha-fx-3735-fix-davinci-start-command-71a720cf.5+71a720cf",
4
4
  "description": "Shared CLI code and CLI engine for davinci",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,19 +23,21 @@
23
23
  "dependencies": {
24
24
  "analytics-node": "^6.2.0",
25
25
  "chalk": "^4.1.2",
26
+ "commander": "^10.0.0",
26
27
  "execa": "^5.1.1",
27
28
  "find-yarn-workspace-root": "^2.0.0",
29
+ "gradient-string": "^2.0.0",
28
30
  "inquirer": "^8.2.0",
29
31
  "isomorphic-git": "^1.21.0",
30
32
  "js-yaml": "^4.1.0",
31
33
  "lodash": "^4.17.21",
34
+ "ora": "^5.4.1",
32
35
  "read-pkg-up": "7.0.1",
33
36
  "semver": "^7.3.7",
34
- "uuid": "^9.0.0",
35
- "commander": "^10.0.0",
36
- "gradient-string": "^2.0.0"
37
+ "uuid": "^9.0.0"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@jest/globals": "^29.4.2"
40
- }
41
+ },
42
+ "gitHead": "71a720cf4a031ff437e886d1de7005d2e97b9541"
41
43
  }
@@ -1,6 +1,7 @@
1
1
  const chalk = require('chalk')
2
2
  const util = require('util')
3
3
  const gradient = require('gradient-string')
4
+ const ora = require('ora')
4
5
 
5
6
  const isObject = obj => typeof obj === 'object'
6
7
  const inspectObject = obj =>
@@ -64,6 +65,36 @@ const prettifyCommands = commands => {
64
65
  .join('\n')
65
66
  }
66
67
 
68
+ /**
69
+ * Start a spinner
70
+ * @param {string} text
71
+ * @param options
72
+ * @returns {ora.Ora}
73
+ */
74
+ const startSpinner = (text, options) => {
75
+ const spinner = ora({
76
+ text,
77
+ spinner: {
78
+ interval: 80,
79
+ frames: [
80
+ '⠋',
81
+ '⠙',
82
+ '⠹',
83
+ '⠸',
84
+ '⠼',
85
+ '⠴',
86
+ '⠦',
87
+ '⠧',
88
+ '⠇',
89
+ '⠏',
90
+ ],
91
+ },
92
+ ...options,
93
+ })
94
+
95
+ return spinner.start()
96
+ }
97
+
67
98
  module.exports = {
68
99
  green,
69
100
  cyan,
@@ -73,4 +104,5 @@ module.exports = {
73
104
  generatePadding,
74
105
  prettifyCommands,
75
106
  davinciGradient,
107
+ startSpinner
76
108
  }