@toptal/davinci-monorepo 8.2.6-alpha-fx-4370-fix-eslint-75892570.4 → 8.3.1-alpha-fix-davinci-syntax-rules-2c95b5bc.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 +7 -0
 - package/package.json +3 -3
 - package/src/utils/check-if-monorepo.js +14 -2
 
    
        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. 
     | 
| 
      
 3 
     | 
    
         
            +
              "version": "8.3.1-alpha-fix-davinci-syntax-rules-2c95b5bc.2+2c95b5bc",
         
     | 
| 
       4 
4 
     | 
    
         
             
              "description": "Monorepo utility tools",
         
     | 
| 
       5 
5 
     | 
    
         
             
              "publishConfig": {
         
     | 
| 
       6 
6 
     | 
    
         
             
                "access": "public"
         
     | 
| 
         @@ -35,7 +35,7 @@ 
     | 
|
| 
       35 
35 
     | 
    
         
             
              "dependencies": {
         
     | 
| 
       36 
36 
     | 
    
         
             
                "@nodelib/fs.walk": "^1.2.6",
         
     | 
| 
       37 
37 
     | 
    
         
             
                "@oclif/core": "^1.16.1",
         
     | 
| 
       38 
     | 
    
         
            -
                "@toptal/davinci-cli-shared": "2.3.6-alpha- 
     | 
| 
      
 38 
     | 
    
         
            +
                "@toptal/davinci-cli-shared": "2.3.6-alpha-fix-davinci-syntax-rules-2c95b5bc.7+2c95b5bc",
         
     | 
| 
       39 
39 
     | 
    
         
             
                "chalk": "^4.1.2",
         
     | 
| 
       40 
40 
     | 
    
         
             
                "codeowners": "5.1.1",
         
     | 
| 
       41 
41 
     | 
    
         
             
                "dependency-cruiser": "^12.5.0",
         
     | 
| 
         @@ -54,5 +54,5 @@ 
     | 
|
| 
       54 
54 
     | 
    
         
             
              "devDependencies": {
         
     | 
| 
       55 
55 
     | 
    
         
             
                "@jest/globals": "^29.4.2"
         
     | 
| 
       56 
56 
     | 
    
         
             
              },
         
     | 
| 
       57 
     | 
    
         
            -
              "gitHead": " 
     | 
| 
      
 57 
     | 
    
         
            +
              "gitHead": "2c95b5bc55f56027d5b1dce4955d0a20cdc640a4"
         
     | 
| 
       58 
58 
     | 
    
         
             
            }
         
     | 
| 
         @@ -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  
     | 
| 
      
 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 
     | 
| 
      
 37 
     | 
    
         
            +
                isMonorepo,
         
     | 
| 
       27 
38 
     | 
    
         
             
                lernaIsAvailable,
         
     | 
| 
       28 
39 
     | 
    
         
             
                workspacesExist,
         
     | 
| 
      
 40 
     | 
    
         
            +
                pnpmWorkspaceExists,
         
     | 
| 
       29 
41 
     | 
    
         
             
              }
         
     | 
| 
       30 
42 
     | 
    
         
             
            }
         
     | 
| 
       31 
43 
     | 
    
         |