@toptal/davinci-monorepo 6.4.1 → 6.4.2-alpha-fx-force-push-alpha-package.6
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": "6.4.
|
|
3
|
+
"version": "6.4.2-alpha-fx-force-push-alpha-package.6+0e7138f7",
|
|
4
4
|
"description": "Monorepo utility tools",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"url": "https://github.com/toptal/davinci/issues"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@toptal/davinci-cli-shared": "1.5.
|
|
31
|
+
"@toptal/davinci-cli-shared": "1.5.1-alpha-fx-force-push-alpha-package.45+0e7138f7",
|
|
32
32
|
"glob": "^7.1.7"
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
|
+
"gitHead": "0e7138f7b9f0c8f22ba0ada9c6ed8143834ee642"
|
|
34
35
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@toptal/davinci-monorepo",
|
|
3
|
-
"version": "6.4.1",
|
|
4
|
-
"description": "Monorepo utility tools",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
8
|
-
"keywords": [
|
|
9
|
-
"lint"
|
|
10
|
-
],
|
|
11
|
-
"author": "Toptal",
|
|
12
|
-
"homepage": "https://github.com/toptal/davinci/tree/master/packages/monorepo#readme",
|
|
13
|
-
"license": "ISC",
|
|
14
|
-
"main": "src/index.js",
|
|
15
|
-
"bin": {
|
|
16
|
-
"davinci-monorepo": "bin/davinci-monorepo.js"
|
|
17
|
-
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/toptal/davinci.git"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build:package": "../../bin/build-package.js",
|
|
24
|
-
"prepublishOnly": "../../bin/prepublish.js",
|
|
25
|
-
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
26
|
-
},
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/toptal/davinci/issues"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@toptal/davinci-cli-shared": "1.5.0",
|
|
32
|
-
"glob": "^7.1.7"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const getCircularityErrorMessage = require('./get-circularity-error-message')
|
|
2
|
-
|
|
3
|
-
describe('getCircularityErrorMessage', () => {
|
|
4
|
-
it('returns one cycle path', () => {
|
|
5
|
-
expect(
|
|
6
|
-
getCircularityErrorMessage([
|
|
7
|
-
['lib-1', 'lib-3', 'lib-4', 'lib-5', 'lib-1']
|
|
8
|
-
])
|
|
9
|
-
).toEqual(
|
|
10
|
-
'Circular dependencies found:\n1. lib-1 -> lib-3 -> lib-4 -> lib-5 -> lib-1\n'
|
|
11
|
-
)
|
|
12
|
-
})
|
|
13
|
-
})
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const getGraphCyclePaths = require('./get-graph-cycle-paths')
|
|
2
|
-
|
|
3
|
-
const NO_CYCLES_GRAPH = {
|
|
4
|
-
'lib-1': ['typescript', 'lib-3'],
|
|
5
|
-
'lib-2': ['react'],
|
|
6
|
-
'lib-3': []
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const ONE_CYCLE_GRAPH = {
|
|
10
|
-
'lib-1': ['typescript', 'lib-3'],
|
|
11
|
-
'lib-2': ['react'],
|
|
12
|
-
'lib-3': ['lib-1']
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const TWO_CYCLES_GRAPH = {
|
|
16
|
-
'lib-1': ['typescript', 'lib-3'],
|
|
17
|
-
'lib-2': ['react'],
|
|
18
|
-
'lib-3': ['lib-1', 'lib-4'],
|
|
19
|
-
'lib-4': ['lib-3']
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const LONG_CYCLE_GRAPH = {
|
|
23
|
-
'lib-1': ['typescript', 'lib-3'],
|
|
24
|
-
'lib-2': ['react'],
|
|
25
|
-
'lib-3': ['lib-4'],
|
|
26
|
-
'lib-4': ['lib-5', 'lib-2'],
|
|
27
|
-
'lib-5': ['lib-1']
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
describe('getGraphCyclePaths', () => {
|
|
31
|
-
it('returns no cycle paths', () => {
|
|
32
|
-
expect(getGraphCyclePaths(NO_CYCLES_GRAPH)).toEqual([])
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
it('returns one cycle path', () => {
|
|
36
|
-
expect(getGraphCyclePaths(ONE_CYCLE_GRAPH)).toEqual([
|
|
37
|
-
['lib-1', 'lib-3', 'lib-1']
|
|
38
|
-
])
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
it('returns two cycles paths', () => {
|
|
42
|
-
expect(getGraphCyclePaths(TWO_CYCLES_GRAPH)).toEqual([
|
|
43
|
-
['lib-1', 'lib-3', 'lib-1'],
|
|
44
|
-
['lib-3', 'lib-4', 'lib-3']
|
|
45
|
-
])
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('returns long cycle path', () => {
|
|
49
|
-
expect(getGraphCyclePaths(LONG_CYCLE_GRAPH)).toEqual([
|
|
50
|
-
['lib-1', 'lib-3', 'lib-4', 'lib-5', 'lib-1']
|
|
51
|
-
])
|
|
52
|
-
})
|
|
53
|
-
})
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const glob = require('glob')
|
|
2
|
-
const fs = require('fs')
|
|
3
|
-
|
|
4
|
-
const getWorkspaces = require('./get-workspaces')
|
|
5
|
-
|
|
6
|
-
const LIB_1 = {
|
|
7
|
-
name: 'lib-1',
|
|
8
|
-
dependencies: { typescript: '4.2.0' }
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const LIB_2 = {
|
|
12
|
-
name: 'lib-2',
|
|
13
|
-
dependencies: { react: '17.0.0' }
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
jest.mock(
|
|
17
|
-
'test-project/package.json',
|
|
18
|
-
() => ({
|
|
19
|
-
workspaces: ['libs/*']
|
|
20
|
-
}),
|
|
21
|
-
{ virtual: true }
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
jest.mock('test-project/libs/lib-1/package.json', () => LIB_1, {
|
|
25
|
-
virtual: true
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
jest.mock('test-project/libs/lib-2/package.json', () => LIB_2, {
|
|
29
|
-
virtual: true
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
describe('getWorkspaces', () => {
|
|
33
|
-
let fsExistsSyncMock
|
|
34
|
-
let globSyncMock
|
|
35
|
-
|
|
36
|
-
beforeEach(() => {
|
|
37
|
-
fsExistsSyncMock = jest.spyOn(fs, 'existsSync')
|
|
38
|
-
globSyncMock = jest.spyOn(glob, 'sync')
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
afterEach(() => {
|
|
42
|
-
fsExistsSyncMock.mockRestore()
|
|
43
|
-
globSyncMock.mockRestore()
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
it('gets workspaces correctly', () => {
|
|
47
|
-
fsExistsSyncMock.mockImplementation(() => true)
|
|
48
|
-
globSyncMock.mockImplementation(() => ['libs/lib-1', 'libs/lib-2'])
|
|
49
|
-
|
|
50
|
-
expect(getWorkspaces('./test-project')).toEqual([LIB_1, LIB_2])
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('ignores workspaces without package json', () => {
|
|
54
|
-
fsExistsSyncMock.mockImplementation(path => {
|
|
55
|
-
if (path.includes('lib-1/package.json')) {
|
|
56
|
-
return false
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return true
|
|
60
|
-
})
|
|
61
|
-
globSyncMock.mockImplementation(() => ['libs/lib-1', 'libs/lib-2'])
|
|
62
|
-
|
|
63
|
-
expect(getWorkspaces('./test-project')).toEqual([LIB_2])
|
|
64
|
-
})
|
|
65
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const makeWorkspacesGraph = require('./make-workspaces-graph')
|
|
2
|
-
|
|
3
|
-
const workspaces = [
|
|
4
|
-
{
|
|
5
|
-
name: 'lib-1',
|
|
6
|
-
dependencies: { typescript: '4.2.0', 'lib-3': '1.0.0' }
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
name: 'lib-2',
|
|
10
|
-
dependencies: { react: '17.0.0' }
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
name: 'lib-3'
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
|
|
17
|
-
describe('makeWorkspacesGraph', () => {
|
|
18
|
-
it('makes a graph from workspaces', () => {
|
|
19
|
-
expect(makeWorkspacesGraph(workspaces)).toEqual({
|
|
20
|
-
'lib-1': ['typescript', 'lib-3'],
|
|
21
|
-
'lib-2': ['react'],
|
|
22
|
-
'lib-3': []
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
|
-
})
|