@toptal/davinci-monorepo 8.5.2-alpha-fx-5804-prohibit-customization-of-davinci-graphql-codegen-tool-aaf8d7d2.31 → 8.5.2-alpha-fx-5898-fix-metrics-issue-bf194466.12
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-monorepo",
|
|
3
|
-
"version": "8.5.2-alpha-fx-
|
|
3
|
+
"version": "8.5.2-alpha-fx-5898-fix-metrics-issue-bf194466.12+bf194466",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"lint"
|
|
6
6
|
],
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@nodelib/fs.walk": "^1.2.6",
|
|
29
29
|
"@oclif/core": "^1.16.1",
|
|
30
|
-
"@toptal/davinci-cli-shared": "2.5.1-alpha-fx-
|
|
30
|
+
"@toptal/davinci-cli-shared": "2.5.1-alpha-fx-5898-fix-metrics-issue-bf194466.40+bf194466",
|
|
31
31
|
"chalk": "^4.1.2",
|
|
32
32
|
"codeowners": "5.1.1",
|
|
33
33
|
"dependency-cruiser": "^16.3.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "bf1944664ac1673c7a55917fb929b55182895cf9"
|
|
54
54
|
}
|
package/src/commands/metrics.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import childProcessLib from 'child_process'
|
|
2
|
+
import fs from 'fs'
|
|
2
3
|
|
|
3
4
|
const lernaGraphCommand =
|
|
4
|
-
'yarn --silent --cwd=../.. lerna list --all --toposort --graph --loglevel silent'
|
|
5
|
+
'yarn --silent --cwd=../.. lerna list --all --toposort --graph --loglevel silent > lerna-output.json'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Generates and returns a graph of monorepo packages
|
|
8
9
|
*/
|
|
9
10
|
export const createGetLernaGraph =
|
|
10
|
-
|
|
11
|
+
() =>
|
|
11
12
|
(options = {}) => {
|
|
12
13
|
const { onlyLocalDependencies = false, excludedPackages = new Set() } =
|
|
13
14
|
options
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
// execute lerna command
|
|
17
|
+
childProcessLib.execSync(lernaGraphCommand)
|
|
18
|
+
// read from lerna-output.json
|
|
19
|
+
const lernaOutput = fs.readFileSync('lerna-output.json', 'utf8')
|
|
20
|
+
|
|
21
|
+
// remove lerna-output.json
|
|
22
|
+
fs.unlinkSync('lerna-output.json')
|
|
23
|
+
// parse the output
|
|
24
|
+
const packagesGraph = JSON.parse(lernaOutput)
|
|
17
25
|
|
|
18
26
|
excludedPackages.forEach(packageName => delete packagesGraph[packageName])
|
|
19
27
|
|