@toptal/davinci-ci 3.0.2-alpha-enables-import-mdx-files-and-render-them-as-component-8132b63b.5 → 3.0.2-alpha-fx-3227-migrate-graphql-codegen-to-esm-2d855cc0.20

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 CHANGED
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import cliEngine from '@toptal/davinci-cli-shared'
2
3
 
3
- const cliEngine = require('@toptal/davinci-cli-shared')
4
+ import dangerCommand from '../src/commands/danger.js'
4
5
 
5
- const { commands } = require('../src')
6
-
7
- cliEngine.loadCommands(commands, 'davinci-ci')
6
+ cliEngine.loadCommands([dangerCommand], 'davinci-ci')
8
7
  cliEngine.bootstrap()
package/jest.config.js ADDED
@@ -0,0 +1,4 @@
1
+ export default {
2
+ transform: {},
3
+ testPathIgnorePatterns: ['node_modules', 'dist-package', 'dist'],
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-ci",
3
- "version": "3.0.2-alpha-enables-import-mdx-files-and-render-them-as-component-8132b63b.5+8132b63b",
3
+ "version": "3.0.2-alpha-fx-3227-migrate-graphql-codegen-to-esm-2d855cc0.20+2d855cc0",
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
- "main": "./src/index.js",
19
+ "type": "module",
20
+ "exports": "./src/index.cjs",
20
21
  "repository": {
21
22
  "type": "git",
22
23
  "url": "git+https://github.com/toptal/davinci.git"
@@ -24,7 +25,7 @@
24
25
  "scripts": {
25
26
  "build:package": "../../bin/build-package.js",
26
27
  "prepublishOnly": "../../bin/prepublish.js",
27
- "test": "echo \"Error: run tests from root\" && exit 1"
28
+ "test": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' yarn jest"
28
29
  },
29
30
  "bugs": {
30
31
  "url": "https://github.com/toptal/davinci/issues"
@@ -32,9 +33,12 @@
32
33
  "dependencies": {
33
34
  "@commitlint/cli": "^17.0.2",
34
35
  "@commitlint/config-conventional": "^17.1.0",
35
- "@toptal/davinci-cli-shared": "1.10.2-alpha-enables-import-mdx-files-and-render-them-as-component-8132b63b.5+8132b63b",
36
+ "@toptal/davinci-cli-shared": "1.10.2-alpha-fx-3227-migrate-graphql-codegen-to-esm-2d855cc0.20+2d855cc0",
36
37
  "danger": "^11.0.7",
37
38
  "markdown-table": "^2.0.0"
38
39
  },
39
- "gitHead": "8132b63b1430d430d324adbb60d89452d5df94af"
40
+ "devDependencies": {
41
+ "@jest/globals": "28.1.0"
42
+ },
43
+ "gitHead": "2d855cc0729370b50d41a93578d551d4ec77fd47"
40
44
  }
@@ -1,10 +1,10 @@
1
- const {
1
+ import {
2
2
  davinciProjectConfig,
3
3
  runSync,
4
4
  print,
5
5
  convertToCLIParameters,
6
6
  files,
7
- } = require('@toptal/davinci-cli-shared')
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.js'
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.js'
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
- module.exports = dangerCommandCreator
67
+ export default dangerCommandCreator
@@ -1,9 +1,10 @@
1
1
  const { schedule } = require('danger')
2
2
  const { davinciProjectConfig } = require('@toptal/davinci-cli-shared')
3
3
 
4
- const { conventionalCommits } = require('./plugins/conventional-commits')
5
- const { conventionalPRTitle } = require('./plugins/conventional-pr-title')
6
- const { checkAssigneeExist } = require('../plugins/empty-assignee')
4
+ const { conventionalCommits } = require('./plugins/conventional-commits/index.cjs')
5
+ const { conventionalPRTitle } = require('./plugins/conventional-pr-title/index.cjs')
6
+ const { checkAssigneeExist } = require('../plugins/empty-assignee.cjs')
7
+
7
8
 
8
9
  schedule(conventionalCommits)
9
10
  schedule(conventionalPRTitle)
@@ -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 (
@@ -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,
@@ -0,0 +1,16 @@
1
+ const { schedule } = require('danger')
2
+
3
+ const { toptalCommits } = require('./plugins/toptal-commits/index.cjs')
4
+ const { toptalPRTitle } = require('./plugins/toptal-pr-title/index.cjs')
5
+ const { checkAssigneeExist } = require('../plugins/empty-assignee.cjs')
6
+
7
+ schedule(toptalCommits)
8
+ schedule(toptalPRTitle)
9
+
10
+ const {
11
+ master: { requireAssignee },
12
+ } = davinciProjectConfig
13
+
14
+ if (requireAssignee) {
15
+ schedule(checkAssigneeExist)
16
+ }
@@ -0,0 +1,7 @@
1
+ const { toptalCommits } = require('./toptal-commits/index.cjs')
2
+ const { toptalPRTitle } = require('./toptal-pr-title/index.cjs')
3
+
4
+ module.exports = {
5
+ toptalCommits,
6
+ toptalPRTitle,
7
+ }
@@ -3,7 +3,7 @@ const {
3
3
  MAX_COMMIT_LINE_LENGTH,
4
4
  VALID_COMMIT_TITLE_REGEX,
5
5
  WHITELISTED_USERS,
6
- } = require('../../config')
6
+ } = require('../../config.cjs')
7
7
 
8
8
  const validateCommitMessage = message => {
9
9
  const errors = []
@@ -5,7 +5,7 @@ const {
5
5
  WHITELISTED_USERS,
6
6
  DEFAULT_PR_TITLE_ERROR_MESSAGE,
7
7
  MISSING_TICKET_CODE_ERROR_MESSAGE,
8
- } = require('../../config')
8
+ } = require('../../config.cjs')
9
9
 
10
10
  const getTicketCode = text => {
11
11
  const ticketCode = text.match(VALID_PR_CODE_REGEX)
@@ -1,9 +1,7 @@
1
- const dangerCommandCreator = require('./commands/danger')
2
- const toptalPlugins = require('./configs/danger/toptal/plugins')
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,7 +0,0 @@
1
- const { toptalCommits } = require('./toptal-commits')
2
- const { toptalPRTitle } = require('./toptal-pr-title')
3
-
4
- module.exports = {
5
- toptalCommits,
6
- toptalPRTitle,
7
- }