@toptal/davinci-monorepo 8.3.8-alpha-FX-5419-check-for-nx-ff539ea3.6 → 8.4.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.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2412](https://github.com/toptal/davinci/pull/2412) [`e0df16d2`](https://github.com/toptal/davinci/commit/e0df16d2e60c2ccd302059ff28f6311af488719f) Thanks [@sashuk](https://github.com/sashuk)!
8
+ - check if nx build system exists
9
+
3
10
  ## 8.3.7
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.8-alpha-FX-5419-check-for-nx-ff539ea3.6+ff539ea3",
3
+ "version": "8.4.0",
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-5419-check-for-nx-ff539ea3.9+ff539ea3",
30
+ "@toptal/davinci-cli-shared": "^2.5.0",
31
31
  "chalk": "^4.1.2",
32
32
  "codeowners": "5.1.1",
33
33
  "dependency-cruiser": "^12.5.0",
@@ -48,6 +48,5 @@
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
51
- },
52
- "gitHead": "ff539ea36b6c5c80df5115f09224a27007c0a99d"
51
+ }
53
52
  }
@@ -20,6 +20,20 @@ describe('checkIfMonorepo', () => {
20
20
  })
21
21
  })
22
22
 
23
+ describe('when project does not have `nx` installed', () => {
24
+ it('returns false for `nxIsAvailable`', () => {
25
+ execa.sync
26
+ .mockImplementation(() => true)
27
+ .mockImplementation(() => {
28
+ throw new Error('Cannot execute nx')
29
+ })
30
+ const { nxIsAvailable, isMonorepo } = checkIfMonorepo()
31
+
32
+ expect(nxIsAvailable).toBe(false)
33
+ expect(isMonorepo).toBe(false)
34
+ })
35
+ })
36
+
23
37
  describe('when project does not have workspaces configured', () => {
24
38
  afterEach(() => execa.sync.mockClear())
25
39
 
@@ -36,7 +50,16 @@ describe('checkIfMonorepo', () => {
36
50
 
37
51
  describe('when project has `lerna` installed and workspaces are configured', () => {
38
52
  it('returns true for `isMonorepo`', () => {
39
- execa.sync.mockImplementation(() => true)
53
+ execa.sync.mockImplementation(() => true).mockImplementation(() => false)
54
+ const { isMonorepo } = checkIfMonorepo()
55
+
56
+ expect(isMonorepo).toBe(true)
57
+ })
58
+ })
59
+
60
+ describe('when project has `nx` installed and workspaces are configured', () => {
61
+ it('returns true for `isMonorepo`', () => {
62
+ execa.sync.mockImplementation(() => false).mockImplementation(() => true)
40
63
  const { isMonorepo } = checkIfMonorepo()
41
64
 
42
65
  expect(isMonorepo).toBe(true)