fast-json-stringify 4.2.0 → 5.0.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.
@@ -13,5 +13,3 @@ on:
13
13
  jobs:
14
14
  test:
15
15
  uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
16
- with:
17
- auto-merge-exclude: 'chalk'
package/ajv.js CHANGED
@@ -7,7 +7,7 @@ const ajvFormats = require('ajv-formats')
7
7
  module.exports = buildAjv
8
8
 
9
9
  function buildAjv (options) {
10
- const ajvInstance = new Ajv({ ...options, strictSchema: false, uriResolver: fastUri })
10
+ const ajvInstance = new Ajv({ ...options, strictSchema: false, validateSchema: false, uriResolver: fastUri })
11
11
  ajvFormats(ajvInstance)
12
12
 
13
13
  const validateDateTimeFormat = ajvFormats.get('date-time').validate
@@ -2,8 +2,7 @@
2
2
 
3
3
  const { spawn } = require('child_process')
4
4
 
5
- const chalk = require('chalk')
6
- const inquirer = require('inquirer')
5
+ const cliSelect = require('cli-select')
7
6
  const simpleGit = require('simple-git')
8
7
 
9
8
  const git = simpleGit(process.cwd())
@@ -11,24 +10,27 @@ const git = simpleGit(process.cwd())
11
10
  const COMMAND = 'npm run bench'
12
11
  const DEFAULT_BRANCH = 'master'
13
12
  const PERCENT_THRESHOLD = 5
13
+ const greyColor = '\x1b[30m'
14
+ const redColor = '\x1b[31m'
15
+ const greenColor = '\x1b[32m'
16
+ const resetColor = '\x1b[0m'
14
17
 
15
18
  async function selectBranchName (message, branches) {
16
- const result = await inquirer.prompt([{
19
+ console.log(message)
20
+ const result = await cliSelect({
17
21
  type: 'list',
18
22
  name: 'branch',
19
- choices: branches,
20
- loop: false,
21
- pageSize: 20,
22
- message
23
- }])
24
- return result.branch
23
+ values: branches
24
+ })
25
+ console.log(result.value)
26
+ return result.value
25
27
  }
26
28
 
27
29
  async function executeCommandOnBranch (command, branch) {
28
- console.log(chalk.grey(`Checking out "${branch}"`))
30
+ console.log(`${greyColor}Checking out "${branch}"${resetColor}`)
29
31
  await git.checkout(branch)
30
32
 
31
- console.log(chalk.grey(`Execute "${command}"`))
33
+ console.log(`${greyColor}Execute "${command}"${resetColor}`)
32
34
  const childProcess = spawn(command, { stdio: 'pipe', shell: true })
33
35
 
34
36
  let result = ''
@@ -74,9 +76,9 @@ function compareResults (featureBranch, mainBranch) {
74
76
  const message = alignedName + percentString.padStart(7, '.')
75
77
 
76
78
  if (roundedPercent > PERCENT_THRESHOLD) {
77
- console.log(chalk.green(message))
79
+ console.log(`${greenColor}${message}${resetColor}`)
78
80
  } else if (roundedPercent < -PERCENT_THRESHOLD) {
79
- console.log(chalk.red(message))
81
+ console.log(`${redColor}${message}${resetColor}`)
80
82
  } else {
81
83
  console.log(message)
82
84
  }
@@ -110,5 +112,5 @@ function compareResults (featureBranch, mainBranch) {
110
112
  await git.checkout(currentBranch.commit)
111
113
  await git.checkout(currentBranch.name)
112
114
 
113
- console.log(chalk.gray(`Back to ${currentBranch.name} ${currentBranch.commit}`))
115
+ console.log(`${greyColor}Back to ${currentBranch.name} ${currentBranch.commit}${resetColor}`)
114
116
  })()