@toptal/davinci-cli-shared 1.6.1-alpha-fx-2996-add-error-message-for-missing-engine.21 → 1.7.1-alpha-update-cypress.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1543](https://github.com/toptal/davinci/pull/1543) [`9b67beb3`](https://github.com/toptal/davinci/commit/9b67beb3aaf0e24193b2deaba3126c41e3ec9280) Thanks [@denieler](https://github.com/denieler)! - ---
8
+ - add package utils to check package prerequisites (peer dependencies packages to be installed)
9
+ - add yarn list command adapter
10
+
11
+ * [#1542](https://github.com/toptal/davinci/pull/1542) [`04fe7ffa`](https://github.com/toptal/davinci/commit/04fe7ffa161027d081c6ae870716bb06a2fcf73f) Thanks [@LashaJini](https://github.com/LashaJini)! - - Add `getDirectories` function to list directories relative to path
12
+ - Add `getPackageDirectories` function to list davinci package directories
13
+
3
14
  ## 1.6.0
4
15
 
5
16
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-cli-shared",
3
- "version": "1.6.1-alpha-fx-2996-add-error-message-for-missing-engine.21+227d5ea7",
3
+ "version": "1.7.1-alpha-update-cypress.2+14a7c055",
4
4
  "description": "Shared CLI code and CLI engine for davinci",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,5 +22,5 @@
22
22
  "semver": "^7.3.7",
23
23
  "vorpal": "^1.12.0"
24
24
  },
25
- "gitHead": "227d5ea750c2b2ce9f4abd1ff33bbe1838ae9d28"
25
+ "gitHead": "14a7c05537b0c44bd97d9f795d6618b145d46f35"
26
26
  }
@@ -1,4 +1,5 @@
1
1
  const path = require('path')
2
+ const { readdirSync } = require('fs')
2
3
 
3
4
  const getPackageFileContent = (davinciPackageName, filename) =>
4
5
  require(getPackageFilePath(davinciPackageName, filename))
@@ -29,10 +30,20 @@ const projectHasPackage = pkg => {
29
30
  }
30
31
  }
31
32
 
33
+ const getDirectories = source =>
34
+ readdirSync(source, { withFileTypes: true })
35
+ .filter(dirent => dirent.isDirectory())
36
+ .map(dirent => dirent.name)
37
+
38
+ const getPackageDirectories = () =>
39
+ getDirectories(path.join(process.cwd(), 'packages'))
40
+
32
41
  module.exports = {
33
42
  getPackageFileContent,
34
43
  getPackageFilePath,
35
44
  getProjectRootFilePath,
36
45
  getProjectRootFileContent,
37
46
  projectHasPackage,
47
+ getDirectories,
48
+ getPackageDirectories,
38
49
  }