@toptal/davinci-cli-shared 1.5.5-alpha-fx-2957-remove-syntax-init-command.101 → 1.5.5-alpha-fx-2956-keep-davinci-syntax-working-if-jest-doesnt-exist.114

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/utils/files.js +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-cli-shared",
3
- "version": "1.5.5-alpha-fx-2957-remove-syntax-init-command.101+ec9567da",
3
+ "version": "1.5.5-alpha-fx-2956-keep-davinci-syntax-working-if-jest-doesnt-exist.114+7549f735",
4
4
  "description": "Shared CLI code and CLI engine for davinci",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,5 +20,5 @@
20
20
  "js-yaml": "^4.1.0",
21
21
  "vorpal": "^1.12.0"
22
22
  },
23
- "gitHead": "ec9567daa3ea1c1c117063b4e5725009eb9a74b0"
23
+ "gitHead": "7549f735e99cf32c246453473521064ef8e31cc8"
24
24
  }
@@ -19,9 +19,20 @@ const getProjectRootFilePath = filename => {
19
19
  return path.join(currentRunningDir, filename)
20
20
  }
21
21
 
22
+ const projectHasPackage = pkg => {
23
+ try {
24
+ require.resolve(pkg)
25
+
26
+ return true
27
+ } catch {
28
+ return false
29
+ }
30
+ }
31
+
22
32
  module.exports = {
23
33
  getPackageFileContent,
24
34
  getPackageFilePath,
25
35
  getProjectRootFilePath,
26
36
  getProjectRootFileContent,
37
+ projectHasPackage,
27
38
  }