@toptal/davinci-ci 3.1.1-alpha-add-doc-to-storybook-addons-778d5346.4 → 3.1.1-alpha-feature-esm-migration-b7a1c917.27
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/bin/davinci-ci.js +3 -4
- package/package.json +9 -5
- package/src/commands/danger.js +5 -5
- package/src/configs/danger/conventional-commits/dangerfile.cjs +22 -0
- package/src/configs/danger/conventional-commits/plugins/conventional-commits/{index.js → index.cjs} +1 -1
- package/src/configs/danger/conventional-commits/plugins/conventional-pr-title/{index.js → index.cjs} +1 -1
- package/src/configs/danger/conventional-commits/plugins/{index.js → index.cjs} +2 -2
- package/src/configs/danger/plugins/{empty-assignee.js → empty-assignee.cjs} +11 -6
- package/src/configs/danger/toptal/{config.js → config.cjs} +0 -0
- package/src/configs/danger/toptal/{dangerfile.js → dangerfile.cjs} +3 -3
- package/src/configs/danger/toptal/plugins/index.cjs +7 -0
- package/src/configs/danger/toptal/plugins/toptal-commits/{index.js → index.cjs} +1 -1
- package/src/configs/danger/toptal/plugins/toptal-commits/toptal-commits.test.js +5 -1
- package/src/configs/danger/toptal/plugins/toptal-pr-title/{index.js → index.cjs} +1 -1
- package/src/configs/danger/toptal/plugins/toptal-pr-title/toptal-pr-title.test.js +5 -3
- package/src/{index.js → index.cjs} +2 -4
- package/src/configs/danger/conventional-commits/dangerfile.js +0 -17
- package/src/configs/danger/toptal/plugins/index.js +0 -7
package/bin/davinci-ci.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import cliEngine from '@toptal/davinci-cli-shared'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
import dangerCommand from '../src/commands/danger.js'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
cliEngine.loadCommands(commands, 'davinci-ci')
|
|
6
|
+
cliEngine.loadCommands([dangerCommand], 'davinci-ci')
|
|
8
7
|
cliEngine.bootstrap()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/davinci-ci",
|
|
3
|
-
"version": "3.1.1-alpha-
|
|
3
|
+
"version": "3.1.1-alpha-feature-esm-migration-b7a1c917.27+b7a1c917",
|
|
4
4
|
"description": "Continuos integrations tools for frontend projects",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"bin": {
|
|
17
17
|
"davinci-ci": "./bin/davinci-ci.js"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
19
|
+
"type": "module",
|
|
20
|
+
"exports": "./src/index.cjs",
|
|
20
21
|
"files": [
|
|
21
22
|
"src",
|
|
22
23
|
"CHANGELOG.md"
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"url": "git+https://github.com/toptal/davinci.git"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
|
-
"test": "
|
|
30
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' yarn jest"
|
|
30
31
|
},
|
|
31
32
|
"bugs": {
|
|
32
33
|
"url": "https://github.com/toptal/davinci/issues"
|
|
@@ -34,9 +35,12 @@
|
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@commitlint/cli": "^17.4.0",
|
|
36
37
|
"@commitlint/config-conventional": "^17.1.0",
|
|
37
|
-
"@toptal/davinci-cli-shared": "1.10.3-alpha-
|
|
38
|
+
"@toptal/davinci-cli-shared": "1.10.3-alpha-feature-esm-migration-b7a1c917.29+b7a1c917",
|
|
38
39
|
"danger": "^11.0.7",
|
|
39
40
|
"markdown-table": "^2.0.0"
|
|
40
41
|
},
|
|
41
|
-
"
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@jest/globals": "28.1.0"
|
|
44
|
+
},
|
|
45
|
+
"gitHead": "b7a1c917fc2cee48f71652bb6d6eda3ae34c42f5"
|
|
42
46
|
}
|
package/src/commands/danger.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
2
|
davinciProjectConfig,
|
|
3
3
|
runSync,
|
|
4
4
|
print,
|
|
5
5
|
convertToCLIParameters,
|
|
6
6
|
files,
|
|
7
|
-
}
|
|
7
|
+
} from '@toptal/davinci-cli-shared'
|
|
8
8
|
|
|
9
9
|
const commandOptions = [
|
|
10
10
|
{
|
|
@@ -28,11 +28,11 @@ const dangerCommand = ({ options }) => {
|
|
|
28
28
|
|
|
29
29
|
const conventionalCommitsDangerfilePath = files.getPackageFilePath(
|
|
30
30
|
'@toptal/davinci-ci',
|
|
31
|
-
'src/configs/danger/conventional-commits/dangerfile.
|
|
31
|
+
'src/configs/danger/conventional-commits/dangerfile.cjs'
|
|
32
32
|
)
|
|
33
33
|
const toptalCommitsDangerfilePath = files.getPackageFilePath(
|
|
34
34
|
'@toptal/davinci-ci',
|
|
35
|
-
'src/configs/danger/toptal/dangerfile.
|
|
35
|
+
'src/configs/danger/toptal/dangerfile.cjs'
|
|
36
36
|
)
|
|
37
37
|
|
|
38
38
|
let dangerfilePath = dangerfile
|
|
@@ -64,4 +64,4 @@ const dangerCommandCreator = {
|
|
|
64
64
|
options: commandOptions,
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
export default dangerCommandCreator
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const { schedule } = require('danger')
|
|
2
|
+
|
|
3
|
+
const { conventionalCommits } = require('./plugins/conventional-commits/index.cjs')
|
|
4
|
+
const { conventionalPRTitle } = require('./plugins/conventional-pr-title/index.cjs')
|
|
5
|
+
const { checkAssigneeExist } = require('../plugins/empty-assignee.cjs')
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
schedule(conventionalCommits)
|
|
9
|
+
schedule(conventionalPRTitle)
|
|
10
|
+
|
|
11
|
+
const setup = async () => {
|
|
12
|
+
const { davinciProjectConfig } = await import('@toptal/davinci-cli-shared')
|
|
13
|
+
const {
|
|
14
|
+
master: { requireAssignee },
|
|
15
|
+
} = davinciProjectConfig
|
|
16
|
+
|
|
17
|
+
if (requireAssignee) {
|
|
18
|
+
schedule(checkAssigneeExist)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports.default = setup
|
package/src/configs/danger/conventional-commits/plugins/conventional-commits/{index.js → index.cjs}
RENAMED
|
@@ -5,7 +5,7 @@ const { default: lint } = require('@commitlint/lint')
|
|
|
5
5
|
/* eslint-enable */
|
|
6
6
|
const table = require('markdown-table')
|
|
7
7
|
|
|
8
|
-
const { WHITELISTED_USERS } = require('../../../toptal/config')
|
|
8
|
+
const { WHITELISTED_USERS } = require('../../../toptal/config.cjs')
|
|
9
9
|
|
|
10
10
|
const conventionalCommits = async () => {
|
|
11
11
|
if (
|
package/src/configs/danger/conventional-commits/plugins/conventional-pr-title/{index.js → index.cjs}
RENAMED
|
@@ -6,7 +6,7 @@ const { default: lint } = require('@commitlint/lint')
|
|
|
6
6
|
/* eslint-enable */
|
|
7
7
|
const table = require('markdown-table')
|
|
8
8
|
|
|
9
|
-
const { WHITELISTED_USERS } = require('../../../toptal/config')
|
|
9
|
+
const { WHITELISTED_USERS } = require('../../../toptal/config.cjs')
|
|
10
10
|
|
|
11
11
|
const conventionalPRTitle = async () => {
|
|
12
12
|
if (!danger.github) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { conventionalCommits } = require('./conventional-commits')
|
|
2
|
-
const { conventionalPRTitle } = require('./conventional-pr-title')
|
|
1
|
+
const { conventionalCommits } = require('./conventional-commits/index.cjs')
|
|
2
|
+
const { conventionalPRTitle } = require('./conventional-pr-title/index.cjs')
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
5
|
conventionalCommits,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="danger" />
|
|
2
2
|
/* globals danger, fail */
|
|
3
|
-
const { davinciProjectConfig } = require('@toptal/davinci-cli-shared')
|
|
4
3
|
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const setup = async () => {
|
|
5
|
+
const { davinciProjectConfig } = await import('@toptal/davinci-cli-shared')
|
|
6
|
+
const {
|
|
7
|
+
master: { requireAssigneeWhiteList = [] },
|
|
8
|
+
} = davinciProjectConfig
|
|
9
|
+
|
|
10
|
+
const WHITELISTED_USERS = requireAssigneeWhiteList
|
|
8
11
|
|
|
9
|
-
const WHITELISTED_USERS = requireAssigneeWhiteList
|
|
10
|
-
const checkAssigneeExist = () => {
|
|
11
12
|
const isLocalRun = !danger.github
|
|
12
13
|
|
|
13
14
|
if (isLocalRun || WHITELISTED_USERS.includes(danger.github.pr.user.login)) {
|
|
@@ -19,6 +20,10 @@ const checkAssigneeExist = () => {
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
const checkAssigneeExist = () => {
|
|
24
|
+
setup()
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
module.exports = {
|
|
23
28
|
checkAssigneeExist,
|
|
24
29
|
}
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const { schedule } = require('danger')
|
|
2
2
|
const { davinciProjectConfig } = require('@toptal/davinci-cli-shared')
|
|
3
3
|
|
|
4
|
-
const { toptalCommits } = require('./plugins/toptal-commits')
|
|
5
|
-
const { toptalPRTitle } = require('./plugins/toptal-pr-title')
|
|
6
|
-
const { checkAssigneeExist } = require('../plugins/empty-assignee')
|
|
4
|
+
const { toptalCommits } = require('./plugins/toptal-commits/index.cjs')
|
|
5
|
+
const { toptalPRTitle } = require('./plugins/toptal-pr-title/index.cjs')
|
|
6
|
+
const { checkAssigneeExist } = require('../plugins/empty-assignee.cjs')
|
|
7
7
|
|
|
8
8
|
schedule(toptalCommits)
|
|
9
9
|
schedule(toptalPRTitle)
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { jest } from '@jest/globals'
|
|
2
|
+
|
|
3
|
+
import toptalCommitsModule from './index.cjs'
|
|
4
|
+
|
|
5
|
+
const { toptalCommits } = toptalCommitsModule
|
|
2
6
|
|
|
3
7
|
const prepareCommitsWithMessages = (messages = []) => ({
|
|
4
8
|
commits: messages.map(message => ({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { jest } from '@jest/globals'
|
|
2
|
+
|
|
3
|
+
import { toptalPRTitle } from './index.cjs'
|
|
4
|
+
import {
|
|
3
5
|
MISSING_TICKET_CODE_ERROR_MESSAGE,
|
|
4
6
|
DEFAULT_PR_TITLE_ERROR_MESSAGE,
|
|
5
|
-
}
|
|
7
|
+
} from '../../config.cjs'
|
|
6
8
|
|
|
7
9
|
const VALID_PR_TITLE = '[ASD-123] Hello world'
|
|
8
10
|
const INVALID_PR_TITLE = '[ASD-123] hello world'
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const conventionalCommitsPlugins = require('./configs/danger/conventional-commits/plugins')
|
|
1
|
+
const toptalPlugins = require('./configs/danger/toptal/plugins/index.cjs')
|
|
2
|
+
const conventionalCommitsPlugins = require('./configs/danger/conventional-commits/plugins/index.cjs')
|
|
4
3
|
|
|
5
4
|
module.exports = {
|
|
6
|
-
commands: [dangerCommandCreator],
|
|
7
5
|
plugins: {
|
|
8
6
|
conventionalCommit: {
|
|
9
7
|
PRTitle: conventionalCommitsPlugins.conventionalPRTitle,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const { schedule } = require('danger')
|
|
2
|
-
const { davinciProjectConfig } = require('@toptal/davinci-cli-shared')
|
|
3
|
-
|
|
4
|
-
const { conventionalCommits } = require('./plugins/conventional-commits')
|
|
5
|
-
const { conventionalPRTitle } = require('./plugins/conventional-pr-title')
|
|
6
|
-
const { checkAssigneeExist } = require('../plugins/empty-assignee')
|
|
7
|
-
|
|
8
|
-
schedule(conventionalCommits)
|
|
9
|
-
schedule(conventionalPRTitle)
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
master: { requireAssignee },
|
|
13
|
-
} = davinciProjectConfig
|
|
14
|
-
|
|
15
|
-
if (requireAssignee) {
|
|
16
|
-
schedule(checkAssigneeExist)
|
|
17
|
-
}
|