@toptal/davinci-monorepo 8.2.6-alpha-fx-4370-fix-eslint-75892570.4 → 8.3.0

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,12 @@
1
1
  # @toptal/davinci-monorepo
2
2
 
3
+ ## 8.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2129](https://github.com/toptal/davinci/pull/2129) [`fbbb35be`](https://github.com/toptal/davinci/commit/fbbb35bedfbe58982dc9d116b2c8197ddb1390cc) Thanks [@dmaklygin](https://github.com/dmaklygin)!
8
+ - add pnpm support in monorepo validation procedure
9
+
3
10
  ## 8.2.5
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-monorepo",
3
- "version": "8.2.6-alpha-fx-4370-fix-eslint-75892570.4+75892570",
3
+ "version": "8.3.0",
4
4
  "description": "Monorepo utility tools",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -33,26 +33,25 @@
33
33
  "url": "https://github.com/toptal/davinci/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@nodelib/fs.walk": "^1.2.6",
37
36
  "@oclif/core": "^1.16.1",
38
- "@toptal/davinci-cli-shared": "2.3.6-alpha-fx-4370-fix-eslint-75892570.4+75892570",
37
+ "@toptal/davinci-cli-shared": "2.3.5",
39
38
  "chalk": "^4.1.2",
40
- "codeowners": "5.1.1",
41
39
  "dependency-cruiser": "^12.5.0",
42
- "ervy": "^1.0.7",
43
40
  "execa": "^5.1.1",
44
- "find-up": "5.0.0",
45
41
  "find-yarn-workspace-root": "^2.0.0",
46
42
  "glob": "^8.0.3",
43
+ "ramda": "^0.28.0",
44
+ "@nodelib/fs.walk": "^1.2.6",
45
+ "ervy": "^1.0.7",
46
+ "find-up": "5.0.0",
47
47
  "ignore": "^5.2.0",
48
48
  "is-directory": "^0.3.1",
49
49
  "lodash": "4.17.21",
50
50
  "ora": "^5.4.1",
51
- "ramda": "^0.28.0",
52
- "true-case-path": "^1.0.3"
51
+ "true-case-path": "^1.0.3",
52
+ "codeowners": "5.1.1"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@jest/globals": "^29.4.2"
56
- },
57
- "gitHead": "75892570e2a84a286eb798fa07c5b416bc8e2337"
56
+ }
58
57
  }
@@ -1,4 +1,5 @@
1
1
  import execaLib from 'execa'
2
+ import findUp from 'find-up'
2
3
 
3
4
  const yarnCommandExists = commandToRun => {
4
5
  try {
@@ -12,6 +13,12 @@ const yarnCommandExists = commandToRun => {
12
13
  return true
13
14
  }
14
15
 
16
+ const isPNPMWorkspace = () => {
17
+ const cwd = process.cwd()
18
+
19
+ return findUp.sync.exists('pnpm-workspace.yaml', { cwd })
20
+ }
21
+
15
22
  /**
16
23
  * Checks if the project is monorepo, so it is supposed to have `lerna` command available (later
17
24
  * it can be extended to support other monorepos) and workspaces enabled in project configuration.
@@ -20,12 +27,17 @@ const yarnCommandExists = commandToRun => {
20
27
  */
21
28
  const checkIfMonorepo = () => {
22
29
  const lernaIsAvailable = yarnCommandExists('lerna --version')
23
- const workspacesExist = yarnCommandExists('workspaces info')
30
+ const pnpmWorkspaceExists = isPNPMWorkspace()
31
+ const yarnWorkspaceExists = yarnCommandExists('workspaces info')
32
+ const workspacesExist = yarnWorkspaceExists || pnpmWorkspaceExists
33
+ const isMonorepo =
34
+ (lernaIsAvailable && yarnWorkspaceExists) || pnpmWorkspaceExists
24
35
 
25
36
  return {
26
- isMonorepo: lernaIsAvailable && workspacesExist,
37
+ isMonorepo,
27
38
  lernaIsAvailable,
28
39
  workspacesExist,
40
+ pnpmWorkspaceExists,
29
41
  }
30
42
  }
31
43