@cmflow/cli 0.76.1 → 0.76.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.
- package/bin/cm-changelog.js +2 -3
- package/bin/cm-clean.js +2 -3
- package/bin/cm-config.js +3 -4
- package/bin/cm-deploy.js +2 -3
- package/bin/cm-fetch.js +2 -3
- package/bin/cm-finish.js +2 -3
- package/bin/cm-merge.js +2 -3
- package/bin/cm-publish-pages.js +2 -3
- package/bin/cm-publish.js +2 -3
- package/bin/cm-push.js +2 -3
- package/bin/cm-rebase.js +2 -3
- package/bin/cm-republish.js +2 -3
- package/bin/cm-start.js +2 -3
- package/bin/cm.js +2 -7
- package/bin/cmrelease.js +1 -3
- package/package.json +16 -14
- package/release.config.js +1 -1
- package/semantic.js +1 -1
- package/src/commands/clean.js +2 -1
- package/src/commands/config.js +1 -1
- package/src/commands/deploy.js +2 -2
- package/src/commands/fetch.js +1 -1
- package/src/commands/finish.js +3 -3
- package/src/commands/index.js +11 -11
- package/src/commands/merge.js +2 -2
- package/src/commands/prompts/branches.js +1 -1
- package/src/commands/publish-pages.js +1 -1
- package/src/commands/push.js +2 -2
- package/src/commands/rebase.js +5 -5
- package/src/commands/release.js +18 -2
- package/src/commands/republish.js +2 -2
- package/src/commands/start.js +5 -5
- package/src/commands/tasks/merge-branch.js +1 -1
- package/src/commands/tasks/push-branch.js +1 -1
- package/src/commands/tasks/rebase-all-branches.js +1 -1
- package/src/commands/tasks/refresh-repository.js +2 -2
- package/src/commands/tasks/run-test.js +1 -1
- package/src/commands/tasks/update-branch.js +1 -1
- package/src/commands/tasks/update-dependencies.js +3 -3
- package/src/commands/utils/check-install.js +3 -2
- package/src/common/cli/cli.js +4 -2
- package/src/common/cli/docker.js +1 -1
- package/src/common/cli/docker.test.js +6 -13
- package/src/common/cli/git.js +1 -1
- package/src/common/cli/git.test.js +5 -9
- package/src/common/cli/heroku.js +1 -1
- package/src/common/cli/heroku.test.js +4 -10
- package/src/common/cli/lerna.js +1 -1
- package/src/common/cli/lerna.test.js +4 -9
- package/src/common/cli/npm.js +4 -4
- package/src/common/cli/npm.test.js +4 -10
- package/src/common/cli/yarn.js +4 -4
- package/src/common/cli/yarn.test.js +4 -9
- package/src/common/configure-git-workspace.js +1 -1
- package/src/common/get-config.js +24 -4
- package/src/common/index.js +10 -10
- package/src/common/run-command.js +2 -2
- package/src/common/run-command.test.js +4 -8
- package/src/index.js +1 -1
- package/src/main.js +5 -5
- package/src/semantic-release/actions/analyze-commits.js +2 -4
- package/src/semantic-release/actions/fail.js +2 -2
- package/src/semantic-release/actions/generate-notes.js +2 -3
- package/src/semantic-release/actions/index.js +8 -8
- package/src/semantic-release/actions/prepare.js +3 -5
- package/src/semantic-release/actions/publish.js +3 -3
- package/src/semantic-release/actions/success.js +3 -5
- package/src/semantic-release/actions/verify-conditions.js +2 -3
- package/src/semantic-release/actions/verify-release.js +2 -4
- package/src/semantic-release/get-semantic-config.js +2 -2
- package/src/semantic-release/utils/bump-packages-version.test.js +1 -4
- package/src/semantic-release/utils/calculate-snapshot-version.js +1 -1
- package/src/semantic-release/utils/calculate-snapshot-version.test.js +3 -10
- package/src/semantic-release/utils/display-package-info.js +1 -1
- package/src/semantic-release/utils/display-release-info.js +1 -1
- package/src/semantic-release/utils/docker-clean-tags.js +1 -1
- package/src/semantic-release/utils/docker-clean-tags.test.js +3 -12
- package/src/semantic-release/utils/docker-publish.js +2 -5
- package/src/semantic-release/utils/docker-publish.test.js +17 -33
- package/src/semantic-release/utils/ghpages-publish.js +1 -1
package/bin/cm-changelog.js
CHANGED
package/bin/cm-clean.js
CHANGED
package/bin/cm-config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import commander from 'commander'
|
|
2
|
+
const commander = require('commander')
|
|
3
|
+
const { commands, runCommand } = require('../src')
|
|
5
4
|
|
|
6
5
|
commander
|
|
7
6
|
.usage('cmconfig')
|
|
@@ -12,4 +11,4 @@ commander
|
|
|
12
11
|
runCommand(commands.Config, {
|
|
13
12
|
verbose: commander.verbose
|
|
14
13
|
})
|
|
15
|
-
release()
|
|
14
|
+
require('../src').release()
|
package/bin/cm-deploy.js
CHANGED
package/bin/cm-fetch.js
CHANGED
package/bin/cm-finish.js
CHANGED
package/bin/cm-merge.js
CHANGED
package/bin/cm-publish-pages.js
CHANGED
package/bin/cm-publish.js
CHANGED
package/bin/cm-push.js
CHANGED
package/bin/cm-rebase.js
CHANGED
package/bin/cm-republish.js
CHANGED
package/bin/cm-start.js
CHANGED
package/bin/cm.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import url from 'url'
|
|
6
|
-
import path from 'path'
|
|
7
|
-
|
|
8
|
-
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
|
9
|
-
const cliPkg = fs.readJsonSync(path.join(__dirname, '../package.json'))
|
|
3
|
+
const commander = require('commander')
|
|
4
|
+
const cliPkg = require('../package.json')
|
|
10
5
|
|
|
11
6
|
commander
|
|
12
7
|
.version(cliPkg.version)
|
package/bin/cmrelease.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmflow/cli",
|
|
3
|
-
"version": "0.76.
|
|
3
|
+
"version": "0.76.2",
|
|
4
4
|
"description": "An awesome Git Flow",
|
|
5
5
|
"author": "camfou",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"email": "camfou@gmail.com",
|
|
8
8
|
"main": "./src/index.js",
|
|
9
9
|
"module": "./src/main.js",
|
|
10
|
-
"type": "module",
|
|
11
10
|
"private": false,
|
|
12
11
|
"bin": {
|
|
13
12
|
"cm": "./bin/cm.js",
|
|
@@ -33,6 +32,7 @@
|
|
|
33
32
|
"commander": "5.1.0",
|
|
34
33
|
"conventional-changelog": "3.1.25",
|
|
35
34
|
"conventional-changelog-cli": "2.2.2",
|
|
35
|
+
"esm": "3.2.25",
|
|
36
36
|
"execa": "5.1.1",
|
|
37
37
|
"figures": "3.2.0",
|
|
38
38
|
"fs-extra": "^10.1.0",
|
|
@@ -42,20 +42,22 @@
|
|
|
42
42
|
"listr": "0.14.3",
|
|
43
43
|
"lodash": "4.17.20",
|
|
44
44
|
"rxjs": "6.6.3",
|
|
45
|
-
"semantic-release": "
|
|
45
|
+
"semantic-release": "19.0.5",
|
|
46
46
|
"semver": "7.3.7",
|
|
47
47
|
"split": "1.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
50
|
+
"@babel/core": "7.12.10",
|
|
51
|
+
"@babel/preset-env": "7.12.11",
|
|
52
|
+
"babel-jest": "26.6.3",
|
|
53
|
+
"eslint": "7.15.0",
|
|
54
|
+
"eslint-config-standard": "16.0.2",
|
|
55
|
+
"eslint-plugin-import": "2.22.1",
|
|
53
56
|
"eslint-plugin-node": "11.1.0",
|
|
54
|
-
"eslint-plugin-promise": "
|
|
55
|
-
"eslint-plugin-standard": "
|
|
56
|
-
"eslint-plugin-n": "16.3.0",
|
|
57
|
+
"eslint-plugin-promise": "4.2.1",
|
|
58
|
+
"eslint-plugin-standard": "4.0.2",
|
|
57
59
|
"husky": "4.3.6",
|
|
58
|
-
"jest": "^
|
|
60
|
+
"jest": "^24.9.0",
|
|
59
61
|
"jest-junit": "^11.0.1",
|
|
60
62
|
"lint-staged": "10.5.3"
|
|
61
63
|
},
|
|
@@ -77,10 +79,10 @@
|
|
|
77
79
|
},
|
|
78
80
|
"scripts": {
|
|
79
81
|
"test": "yarn lint && yarn test_unit",
|
|
80
|
-
"test_unit": "
|
|
81
|
-
"lint": "eslint -c .eslintrc
|
|
82
|
-
"lint_ci": "eslint -c .eslintrc
|
|
83
|
-
"lint_fix": "eslint -c .eslintrc
|
|
82
|
+
"test_unit": "jest",
|
|
83
|
+
"lint": "eslint -c .eslintrc src/**",
|
|
84
|
+
"lint_ci": "eslint -c .eslintrc src/** --format junit --output-file ./reports/eslint.xml",
|
|
85
|
+
"lint_fix": "eslint -c .eslintrc src/** --fix",
|
|
84
86
|
"release": "node bin/cmrelease.js",
|
|
85
87
|
"release_dry_run": "node bin/cmrelease.js --dry-run",
|
|
86
88
|
"build_changelog": "node bin/cm-changelog.js"
|
package/release.config.js
CHANGED
package/semantic.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
module.exports = require('./src/semantic-release/actions')
|
package/src/commands/clean.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
|
|
1
2
|
import chalk from 'chalk'
|
|
2
3
|
import figures from 'figures'
|
|
3
|
-
import { dockerCleanTags } from '../semantic-release/utils/docker-clean-tags
|
|
4
|
+
import { dockerCleanTags } from '../semantic-release/utils/docker-clean-tags'
|
|
4
5
|
|
|
5
6
|
export class Clean {
|
|
6
7
|
mapContext (commander, context) {
|
package/src/commands/config.js
CHANGED
package/src/commands/deploy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { deployOnDockerHub, deployOnHeroku } from '../semantic-release/utils/docker-publish
|
|
4
|
-
import { getConfig } from '../common
|
|
3
|
+
import { deployOnDockerHub, deployOnHeroku } from '../semantic-release/utils/docker-publish'
|
|
4
|
+
import { getConfig } from '../common'
|
|
5
5
|
|
|
6
6
|
export class Deploy {
|
|
7
7
|
mapContext (commander, context) {
|
package/src/commands/fetch.js
CHANGED
package/src/commands/finish.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { Rebase } from './rebase
|
|
4
|
-
import { git } from '../common/cli/git
|
|
5
|
-
import { pushBranch } from './tasks/push-branch
|
|
3
|
+
import { Rebase } from './rebase'
|
|
4
|
+
import { git } from '../common/cli/git'
|
|
5
|
+
import { pushBranch } from './tasks/push-branch'
|
|
6
6
|
|
|
7
7
|
export class Finish extends Rebase {
|
|
8
8
|
mapContext (commander, context) {
|
package/src/commands/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from './changelog
|
|
2
|
-
export * from './finish
|
|
3
|
-
export * from './fetch
|
|
4
|
-
export * from './push
|
|
5
|
-
export * from './start
|
|
6
|
-
export * from './republish
|
|
7
|
-
export * from './rebase
|
|
8
|
-
export * from './publish-pages
|
|
9
|
-
export * from './clean
|
|
10
|
-
export * from './deploy
|
|
11
|
-
export * from './merge
|
|
1
|
+
export * from './changelog'
|
|
2
|
+
export * from './finish'
|
|
3
|
+
export * from './fetch'
|
|
4
|
+
export * from './push'
|
|
5
|
+
export * from './start'
|
|
6
|
+
export * from './republish'
|
|
7
|
+
export * from './rebase'
|
|
8
|
+
export * from './publish-pages'
|
|
9
|
+
export * from './clean'
|
|
10
|
+
export * from './deploy'
|
|
11
|
+
export * from './merge'
|
package/src/commands/merge.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { mergeBranch } from './tasks/merge-branch
|
|
4
|
-
import { git } from '../common
|
|
3
|
+
import { mergeBranch } from './tasks/merge-branch'
|
|
4
|
+
import { git } from '../common'
|
|
5
5
|
|
|
6
6
|
export class Merge {
|
|
7
7
|
getTasks (context) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { ghPagesPublish } from '../semantic-release/utils/ghpages-publish
|
|
3
|
+
import { ghPagesPublish } from '../semantic-release/utils/ghpages-publish'
|
|
4
4
|
|
|
5
5
|
export class PublishPages {
|
|
6
6
|
mapContext (commander, context) {
|
package/src/commands/push.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { Rebase } from './rebase
|
|
4
|
-
import { pushBranch } from './tasks/push-branch
|
|
3
|
+
import { Rebase } from './rebase'
|
|
4
|
+
import { pushBranch } from './tasks/push-branch'
|
|
5
5
|
|
|
6
6
|
export class Push extends Rebase {
|
|
7
7
|
mapContext (commander, context) {
|
package/src/commands/rebase.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { Fetch } from './fetch
|
|
4
|
-
import { git } from '../common/cli/git
|
|
5
|
-
import { updateBranch } from './tasks/update-branch
|
|
6
|
-
import { updateDependencies } from './tasks/update-dependencies
|
|
7
|
-
import { runTest } from './tasks/run-test
|
|
3
|
+
import { Fetch } from './fetch'
|
|
4
|
+
import { git } from '../common/cli/git'
|
|
5
|
+
import { updateBranch } from './tasks/update-branch'
|
|
6
|
+
import { updateDependencies } from './tasks/update-dependencies'
|
|
7
|
+
import { runTest } from './tasks/run-test'
|
|
8
8
|
|
|
9
9
|
export class Rebase extends Fetch {
|
|
10
10
|
mapContext (commander, context) {
|
package/src/commands/release.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
const getConfig = require('semantic-release/lib/get-config')
|
|
2
|
+
const getNextVersion = require('semantic-release/lib/get-next-version')
|
|
3
|
+
const { calculateSnapshotVersion } = require('../semantic-release/utils/calculate-snapshot-version')
|
|
4
|
+
|
|
5
|
+
require.cache[require.resolve('semantic-release/lib/get-config')].exports = async (context, cliOptions) => {
|
|
6
|
+
context.config = require('../common/get-config').getConfig()
|
|
7
|
+
|
|
8
|
+
return getConfig(context, cliOptions)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
require.cache[require.resolve('semantic-release/lib/get-next-version')].exports = (context) => {
|
|
12
|
+
if (context.branch.type === 'prerelease') {
|
|
13
|
+
return calculateSnapshotVersion(context)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return getNextVersion(context)
|
|
17
|
+
}
|
|
2
18
|
|
|
3
19
|
delete process.env.CIRCLE_PR_NUMBER
|
|
4
20
|
delete process.env.CIRCLE_PULL_REQUEST
|
|
5
21
|
delete process.env.CI_PULL_REQUEST
|
|
6
22
|
|
|
7
23
|
export function release (options = {}) {
|
|
8
|
-
|
|
24
|
+
require('semantic-release')({
|
|
9
25
|
dryRun: process.argv.includes('--dry-run'),
|
|
10
26
|
ci: false,
|
|
11
27
|
noCi: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { Fetch } from './fetch
|
|
4
|
-
import { rebaseAllBranches } from './tasks/rebase-all-branches
|
|
3
|
+
import { Fetch } from './fetch'
|
|
4
|
+
import { rebaseAllBranches } from './tasks/rebase-all-branches'
|
|
5
5
|
|
|
6
6
|
export class Republish extends Fetch {
|
|
7
7
|
mapContext (commander, context) {
|
package/src/commands/start.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import figures from 'figures'
|
|
3
|
-
import { git } from '../common/cli/git
|
|
4
|
-
import { branches } from './prompts/branches
|
|
5
|
-
import { Fetch } from './fetch
|
|
3
|
+
import { git } from '../common/cli/git'
|
|
4
|
+
import { branches } from './prompts/branches'
|
|
5
|
+
import { Fetch } from './fetch'
|
|
6
6
|
|
|
7
|
-
import { updateDependencies } from './tasks/update-dependencies
|
|
8
|
-
import { WORKFLOW_CONFIGURATION } from '../workflow
|
|
7
|
+
import { updateDependencies } from './tasks/update-dependencies'
|
|
8
|
+
import { WORKFLOW_CONFIGURATION } from '../workflow'
|
|
9
9
|
|
|
10
10
|
function sanitize (name) {
|
|
11
11
|
return name.replace(/[/\\_|. ]/gi, '-').split('-').filter(Boolean).join('-')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EMPTY } from 'rxjs'
|
|
2
|
-
import { catchError } from 'rxjs/operators
|
|
2
|
+
import { catchError } from 'rxjs/operators'
|
|
3
3
|
import Listr from 'listr'
|
|
4
|
-
import { git } from '../../common
|
|
4
|
+
import { git } from '../../common'
|
|
5
5
|
|
|
6
6
|
function pipe (observable, output) {
|
|
7
7
|
observable.pipe(catchError((err) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import Listr from 'listr'
|
|
3
|
-
import { git } from '../../common/cli/git
|
|
3
|
+
import { git } from '../../common/cli/git'
|
|
4
4
|
|
|
5
5
|
async function checkBranchRemoteStatus ({ featureBranch, origin, force }) {
|
|
6
6
|
const isBranchExists = git.branchExists(featureBranch, origin)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { npm, yarn } from '../../common
|
|
2
|
-
import { refreshMetadata, shouldReinstall } from '../utils/check-install
|
|
1
|
+
import { npm, yarn } from '../../common'
|
|
2
|
+
import { refreshMetadata, shouldReinstall } from '../utils/check-install'
|
|
3
3
|
import Listr from 'listr'
|
|
4
|
-
import { catchError } from 'rxjs/operators
|
|
4
|
+
import { catchError } from 'rxjs/operators'
|
|
5
5
|
|
|
6
6
|
export const updateDependencies = ({ useYarn }) => {
|
|
7
7
|
const manager = useYarn ? yarn : npm
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import isEqual from 'lodash/isEqual
|
|
2
|
-
import { getPackageJson
|
|
1
|
+
import isEqual from 'lodash/isEqual'
|
|
2
|
+
import { getPackageJson } from '../../common/get-package-json'
|
|
3
|
+
import { git } from '../../common'
|
|
3
4
|
|
|
4
5
|
function getDeps () {
|
|
5
6
|
const pkg = getPackageJson()
|
package/src/common/cli/cli.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import 'any-observable/register/rxjs-all
|
|
1
|
+
import 'any-observable/register/rxjs-all' // eslint-disable-line import/no-unassigned-import
|
|
2
2
|
import execa from 'execa'
|
|
3
3
|
import streamToObservable from '@samverschueren/stream-to-observable'
|
|
4
|
-
import { filter, merge } from 'rxjs/operators
|
|
4
|
+
import { filter, merge } from 'rxjs/operators'
|
|
5
5
|
import split from 'split'
|
|
6
6
|
import { spawnSync } from 'child_process'
|
|
7
|
+
|
|
7
8
|
export class Cli {
|
|
8
9
|
constructor (cmd) {
|
|
9
10
|
this.cmd = cmd
|
|
@@ -73,6 +74,7 @@ export class Cli {
|
|
|
73
74
|
|
|
74
75
|
promise.sync = (opt) => {
|
|
75
76
|
isPromise = false
|
|
77
|
+
|
|
76
78
|
return execa.sync(cmd, args, {
|
|
77
79
|
cwd: process.cwd(),
|
|
78
80
|
stdio: 'inherit',
|
package/src/common/cli/docker.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
import execa from 'execa'
|
|
3
|
+
import { docker } from './docker'
|
|
4
|
+
import { Cli } from './cli'
|
|
2
5
|
|
|
3
|
-
jest.
|
|
4
|
-
|
|
5
|
-
})
|
|
6
|
-
jest.unstable_mockModule('execa', () => {
|
|
7
|
-
const execaMock = jest.fn()
|
|
8
|
-
execaMock.sync = jest.fn()
|
|
9
|
-
return { default: execaMock }
|
|
10
|
-
})
|
|
11
|
-
const { default: execa } = await import('execa')
|
|
12
|
-
const { default: axios } = await import('axios')
|
|
13
|
-
const { docker } = await import('./docker.js')
|
|
14
|
-
const { Cli } = await import('./cli.js')
|
|
6
|
+
jest.mock('axios')
|
|
7
|
+
jest.mock('execa')
|
|
15
8
|
|
|
16
9
|
execa.mockReturnValue({})
|
|
17
10
|
|
package/src/common/cli/git.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import execa from 'execa'
|
|
2
|
+
import { git } from './git'
|
|
3
|
+
import { Cli } from './cli'
|
|
4
|
+
|
|
5
|
+
jest.mock('execa')
|
|
2
6
|
|
|
3
|
-
jest.unstable_mockModule('execa', () => {
|
|
4
|
-
const execaMock = jest.fn()
|
|
5
|
-
execaMock.sync = jest.fn()
|
|
6
|
-
return { default: execaMock }
|
|
7
|
-
})
|
|
8
|
-
const { default: execa } = await import('execa')
|
|
9
|
-
const { git } = await import('./git.js')
|
|
10
|
-
const { Cli } = await import('./cli.js')
|
|
11
7
|
execa.sync.mockImplementation((...args) => {
|
|
12
8
|
return {
|
|
13
9
|
stdout: `CMD: ${[].concat(...args.filter(arg => typeof arg === 'string' || Array.isArray(arg))).join(' ')}`
|
package/src/common/cli/heroku.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import execa from 'execa'
|
|
2
|
+
import { Cli } from './cli'
|
|
3
|
+
import { heroku } from './heroku'
|
|
2
4
|
|
|
3
|
-
jest.
|
|
4
|
-
const execaMock = jest.fn()
|
|
5
|
-
execaMock.sync = jest.fn()
|
|
6
|
-
return { default: execaMock }
|
|
7
|
-
})
|
|
8
|
-
const { default: execa } = await import('execa')
|
|
9
|
-
|
|
10
|
-
const { Cli } = await import('./cli.js')
|
|
11
|
-
const { heroku } = await import('./heroku.js')
|
|
5
|
+
jest.mock('execa')
|
|
12
6
|
|
|
13
7
|
execa.sync.mockImplementation((...args) => {
|
|
14
8
|
return {
|
package/src/common/cli/lerna.js
CHANGED