@cmflow/cli 1.1.0 → 2.0.0-alpha.1
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/.prettierignore +5 -0
- package/.prettierrc +10 -0
- package/README.md +130 -32
- package/bin/cm-changelog.js +20 -12
- package/bin/cm-clean.js +4 -7
- package/bin/cm-config.js +8 -8
- package/bin/cm-deploy.js +4 -8
- package/bin/cm-fetch.js +7 -7
- package/bin/cm-finish.js +9 -9
- package/bin/cm-merge.js +7 -7
- package/bin/cm-publish.js +10 -10
- package/bin/cm-push.js +10 -10
- package/bin/cm-rebase.js +10 -10
- package/bin/cm-republish.js +7 -7
- package/bin/cm-start.js +10 -10
- package/bin/cm.js +20 -20
- package/bin/cmrelease.js +2 -2
- package/eslint.config.mjs +67 -0
- package/package.json +27 -21
- package/release.config.mjs +36 -19
- package/src/commands/changelog.js +23 -23
- package/src/commands/clean.js +13 -13
- package/src/commands/config.js +8 -8
- package/src/commands/deploy.js +15 -20
- package/src/commands/fetch.js +7 -10
- package/src/commands/finish.js +18 -19
- package/src/commands/index.js +10 -11
- package/src/commands/merge.js +30 -14
- package/src/commands/prompts/branches.js +20 -20
- package/src/commands/push.js +11 -14
- package/src/commands/rebase.js +17 -19
- package/src/commands/release.js +10 -11
- package/src/commands/republish.js +11 -14
- package/src/commands/start.js +52 -48
- package/src/commands/tasks/merge-branch.js +41 -37
- package/src/commands/tasks/push-branch.js +5 -11
- package/src/commands/tasks/rebase-all-branches.js +19 -24
- package/src/commands/tasks/refresh-repository.js +26 -24
- package/src/commands/tasks/run-test.js +11 -17
- package/src/commands/tasks/update-branch.js +33 -30
- package/src/commands/tasks/update-dependencies.js +38 -32
- package/src/commands/utils/check-install.js +16 -15
- package/src/common/cli/cli.js +55 -57
- package/src/common/cli/docker.js +31 -28
- package/src/common/cli/docker.test.js +94 -96
- package/src/common/cli/git.js +59 -68
- package/src/common/cli/git.test.js +187 -189
- package/src/common/cli/lerna.js +12 -12
- package/src/common/cli/lerna.test.js +38 -40
- package/src/common/cli/npm.js +17 -17
- package/src/common/cli/npm.test.js +38 -40
- package/src/common/cli/yarn.js +17 -17
- package/src/common/cli/yarn.test.js +40 -40
- package/src/common/configure-git-workspace.js +11 -17
- package/src/common/get-config.js +63 -119
- package/src/common/get-package-json.js +4 -4
- package/src/common/get-release-config.js +4 -5
- package/src/common/index.js +10 -10
- package/src/common/run-command.js +26 -28
- package/src/common/run-command.test.js +35 -39
- package/src/index.js +10 -1
- package/src/semantic/core/analyze-commits.js +17 -0
- package/src/semantic/core/conditional.js +25 -0
- package/src/semantic/core/fail.js +21 -0
- package/src/semantic/core/generate-notes.js +11 -0
- package/src/semantic/core/prepare/bump-version.js +38 -0
- package/src/semantic/core/prepare/post.js +38 -0
- package/src/semantic/core/prepare/run.js +22 -0
- package/src/semantic/core/success.js +33 -0
- package/src/semantic/core/verify-conditions.js +32 -0
- package/src/semantic/core/verify-release.js +9 -0
- package/src/semantic/define-config.js +68 -0
- package/src/semantic/docker/publish.js +5 -0
- package/src/semantic/docker/success.js +9 -0
- package/src/semantic/utils/bump-packages-version.js +52 -0
- package/src/semantic/utils/bump-packages-version.test.js +75 -0
- package/src/semantic/utils/calculate-snapshot-version.js +15 -0
- package/src/semantic/utils/calculate-snapshot-version.test.js +67 -0
- package/src/semantic/utils/display-package-info.js +11 -0
- package/src/semantic/utils/display-release-info.js +12 -0
- package/src/semantic/utils/docker-clean-tags.js +51 -0
- package/src/semantic/utils/docker-clean-tags.test.js +61 -0
- package/src/semantic/utils/docker-publish.js +23 -0
- package/src/semantic/utils/docker-publish.test.js +44 -0
- package/src/semantic/utils/log-section.js +5 -0
- package/src/semantic/utils/release-rules.js +15 -0
- package/src/semantic/utils/transform-writer.js +75 -0
- package/src/workflow/index.js +22 -22
- package/tsconfig.json +54 -0
- package/vitest.config.mts +10 -0
- package/bin/cm-publish-pages.js +0 -12
- package/semantic.js +0 -1
- package/src/commands/publish-pages.js +0 -29
- package/src/common/cli/heroku.js +0 -21
- package/src/common/cli/heroku.test.js +0 -62
- package/src/main.js +0 -10
- package/src/semantic-release/actions/analyze-commits.js +0 -14
- package/src/semantic-release/actions/fail.js +0 -16
- package/src/semantic-release/actions/generate-notes.js +0 -12
- package/src/semantic-release/actions/index.js +0 -8
- package/src/semantic-release/actions/prepare.js +0 -114
- package/src/semantic-release/actions/publish.js +0 -17
- package/src/semantic-release/actions/success.js +0 -32
- package/src/semantic-release/actions/verify-conditions.js +0 -30
- package/src/semantic-release/actions/verify-release.js +0 -9
- package/src/semantic-release/get-semantic-config.js +0 -115
- package/src/semantic-release/utils/bump-packages-version.js +0 -51
- package/src/semantic-release/utils/bump-packages-version.test.js +0 -78
- package/src/semantic-release/utils/calculate-snapshot-version.js +0 -10
- package/src/semantic-release/utils/calculate-snapshot-version.test.js +0 -69
- package/src/semantic-release/utils/display-package-info.js +0 -11
- package/src/semantic-release/utils/display-release-info.js +0 -12
- package/src/semantic-release/utils/docker-clean-tags.js +0 -45
- package/src/semantic-release/utils/docker-clean-tags.test.js +0 -63
- package/src/semantic-release/utils/docker-publish.js +0 -47
- package/src/semantic-release/utils/docker-publish.test.js +0 -67
- package/src/semantic-release/utils/ghpages-publish.js +0 -16
- package/src/semantic-release/utils/log-section.js +0 -5
- /package/src/{semantic-release → semantic}/utils/__mock__/test1/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test1/packages/a/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test1/packages/b/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test2/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test2/packages/a/package.json +0 -0
- /package/src/{semantic-release → semantic}/utils/__mock__/test2/packages/b/package.json +0 -0
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
import chalk from
|
|
2
|
-
import Listr from
|
|
3
|
-
import { git } from '../../common/cli/git.js'
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import Listr from "listr";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { git } from "../../common/cli/git.js";
|
|
5
|
+
|
|
6
|
+
async function checkBranchRemoteStatus({ featureBranch, origin, force }) {
|
|
7
|
+
const isBranchExists = git.branchExists(featureBranch, origin);
|
|
7
8
|
|
|
8
9
|
if (isBranchExists && !force) {
|
|
9
|
-
const result = git.checkBranchRemoteStatus(featureBranch)
|
|
10
|
+
const result = git.checkBranchRemoteStatus(featureBranch);
|
|
10
11
|
|
|
11
12
|
if (result) {
|
|
12
|
-
throw new Error(
|
|
13
|
+
throw new Error("Remote branch changed, check diff before continue");
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const updateBranch = ({ origin, featureBranch, fromBranch, force, checkStatus = true, rebase = true }) => {
|
|
18
|
-
return
|
|
19
|
-
title:
|
|
20
|
-
task: () =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
19
|
+
return {
|
|
20
|
+
title: "Rebase branch",
|
|
21
|
+
task: () =>
|
|
22
|
+
new Listr(
|
|
23
|
+
[
|
|
24
|
+
{
|
|
25
|
+
title: "Check status",
|
|
26
|
+
enabled: () => checkStatus,
|
|
27
|
+
task: () =>
|
|
28
|
+
checkBranchRemoteStatus({
|
|
29
|
+
force,
|
|
30
|
+
featureBranch,
|
|
31
|
+
origin
|
|
32
|
+
})
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: `Rebase from ${origin}/${chalk.green(fromBranch)}`,
|
|
36
|
+
enabled: () => rebase,
|
|
37
|
+
task: () => git.rebase(`${origin}/${fromBranch}`).toObservable()
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
{ concurrent: false }
|
|
41
|
+
)
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
1
|
+
import Listr from "listr";
|
|
2
|
+
import { catchError } from "rxjs";
|
|
3
|
+
|
|
4
|
+
import { npm, yarn } from "../../common/index.js";
|
|
5
|
+
import { refreshMetadata, shouldReinstall } from "../utils/check-install.js";
|
|
5
6
|
|
|
6
7
|
export const updateDependencies = ({ useYarn }) => {
|
|
7
|
-
const manager = useYarn ? yarn : npm
|
|
8
|
-
const reinstall = shouldReinstall()
|
|
8
|
+
const manager = useYarn ? yarn : npm;
|
|
9
|
+
const reinstall = shouldReinstall();
|
|
9
10
|
|
|
10
|
-
return
|
|
11
|
-
title:
|
|
11
|
+
return {
|
|
12
|
+
title: "Install",
|
|
12
13
|
enabled: () => reinstall,
|
|
13
|
-
task: () =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
task: () =>
|
|
15
|
+
new Listr(
|
|
16
|
+
[
|
|
17
|
+
{
|
|
18
|
+
title: `Restore dependencies using ${useYarn ? "Yarn" : "Npm"}`,
|
|
19
|
+
task: () =>
|
|
20
|
+
manager
|
|
21
|
+
.restore()
|
|
22
|
+
.toObservable()
|
|
23
|
+
.pipe(
|
|
24
|
+
catchError((error) => {
|
|
25
|
+
if (useYarn) {
|
|
26
|
+
if (error.stderr.startsWith("error Your lockfile needs to be updated")) {
|
|
27
|
+
throw new Error("yarn.lock file is outdated. Run yarn, commit the updated lockfile and try again.");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
31
|
+
throw error;
|
|
32
|
+
})
|
|
33
|
+
)
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: "Refresh metadata",
|
|
37
|
+
task: () => refreshMetadata()
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
{ concurrency: false }
|
|
41
|
+
)
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import isEqual from
|
|
2
|
-
import { getPackageJson, git } from '../../common/index.js'
|
|
1
|
+
import isEqual from "lodash/isEqual.js";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { getPackageJson, git } from "../../common/index.js";
|
|
4
|
+
|
|
5
|
+
function getDeps() {
|
|
6
|
+
const pkg = getPackageJson();
|
|
6
7
|
return {
|
|
7
8
|
dependencies: pkg.dependencies,
|
|
8
9
|
devDependencies: pkg.devDependencies
|
|
9
|
-
}
|
|
10
|
+
};
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export function getHash
|
|
13
|
-
return Buffer.from(JSON.stringify(getDeps())).toString(
|
|
13
|
+
export function getHash() {
|
|
14
|
+
return Buffer.from(JSON.stringify(getDeps())).toString("base64");
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
export function getDepsFromHash
|
|
17
|
+
export function getDepsFromHash() {
|
|
17
18
|
try {
|
|
18
|
-
return JSON.parse(Buffer.from(git.config(
|
|
19
|
-
} catch
|
|
20
|
-
return
|
|
19
|
+
return JSON.parse(Buffer.from(git.config("--local", "npm.hash"), "base64").toString("utf8"));
|
|
20
|
+
} catch {
|
|
21
|
+
return "";
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
export function shouldReinstall
|
|
25
|
-
return !isEqual(getDeps(), getDepsFromHash())
|
|
25
|
+
export function shouldReinstall() {
|
|
26
|
+
return !isEqual(getDeps(), getDepsFromHash());
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
export function refreshMetadata
|
|
29
|
-
git.config(
|
|
29
|
+
export function refreshMetadata() {
|
|
30
|
+
git.config("--local", "npm.hash", `${getHash()}`);
|
|
30
31
|
}
|
package/src/common/cli/cli.js
CHANGED
|
@@ -1,112 +1,110 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import "any-observable/register/rxjs-all.js";
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from "child_process";
|
|
4
|
+
import execa from "execa";
|
|
5
|
+
import { filter, fromEvent, map, merge, takeUntil } from "rxjs";
|
|
5
6
|
export class Cli {
|
|
6
|
-
constructor
|
|
7
|
-
this.cmd = cmd
|
|
7
|
+
constructor(cmd) {
|
|
8
|
+
this.cmd = cmd;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
sync
|
|
11
|
-
return Cli.run(this.cmd, args).sync()
|
|
11
|
+
sync(...args) {
|
|
12
|
+
return Cli.run(this.cmd, args).sync();
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
run
|
|
15
|
-
return Cli.run(this.cmd, args)
|
|
15
|
+
run(...args) {
|
|
16
|
+
return Cli.run(this.cmd, args);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
get
|
|
19
|
-
return Cli.run(this.cmd, args).get()
|
|
19
|
+
get(...args) {
|
|
20
|
+
return Cli.run(this.cmd, args).get();
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
static run
|
|
23
|
+
static run(cmd, args = [], options = {}) {
|
|
23
24
|
const run = (opt = {}) => {
|
|
24
25
|
return execa(cmd, args, {
|
|
25
26
|
cwd: process.cwd(),
|
|
26
27
|
...opt,
|
|
27
28
|
...options
|
|
28
|
-
})
|
|
29
|
-
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
30
31
|
|
|
31
|
-
let isPromise = true
|
|
32
|
+
let isPromise = true;
|
|
32
33
|
|
|
33
34
|
const promise = new Promise((resolve, reject) => {
|
|
34
35
|
setTimeout(async () => {
|
|
35
36
|
if (isPromise) {
|
|
36
37
|
try {
|
|
37
38
|
const result = await run({
|
|
38
|
-
stdio:
|
|
39
|
-
})
|
|
39
|
+
stdio: "inherit"
|
|
40
|
+
});
|
|
40
41
|
|
|
41
|
-
resolve(result)
|
|
42
|
+
resolve(result);
|
|
42
43
|
} catch (err) {
|
|
43
|
-
|
|
44
|
-
reject(err)
|
|
44
|
+
reject(err);
|
|
45
45
|
}
|
|
46
46
|
} else {
|
|
47
|
-
resolve()
|
|
47
|
+
resolve();
|
|
48
48
|
}
|
|
49
|
-
}, 10)
|
|
50
|
-
})
|
|
49
|
+
}, 10);
|
|
50
|
+
});
|
|
51
51
|
|
|
52
52
|
promise.toObservable = (opt) => {
|
|
53
|
-
isPromise = false
|
|
54
|
-
const cp = run(opt)
|
|
55
|
-
const end$ = fromEvent(cp,
|
|
56
|
-
const stdout$ = fromEvent(cp.stdout,
|
|
53
|
+
isPromise = false;
|
|
54
|
+
const cp = run(opt);
|
|
55
|
+
const end$ = fromEvent(cp, "close");
|
|
56
|
+
const stdout$ = fromEvent(cp.stdout, "data").pipe(
|
|
57
57
|
takeUntil(end$),
|
|
58
|
-
map(data => data.toString())
|
|
59
|
-
)
|
|
60
|
-
const stderr$ = fromEvent(cp.stderr,
|
|
58
|
+
map((data) => data.toString())
|
|
59
|
+
);
|
|
60
|
+
const stderr$ = fromEvent(cp.stderr, "data").pipe(
|
|
61
61
|
takeUntil(end$),
|
|
62
|
-
map(data => data.toString())
|
|
63
|
-
)
|
|
62
|
+
map((data) => data.toString())
|
|
63
|
+
);
|
|
64
64
|
|
|
65
|
-
return merge(stdout$, stderr$).pipe(
|
|
66
|
-
|
|
67
|
-
)
|
|
68
|
-
}
|
|
65
|
+
return merge(stdout$, stderr$).pipe(filter(Boolean));
|
|
66
|
+
};
|
|
69
67
|
|
|
70
68
|
promise.toStream = (opt) => {
|
|
71
|
-
isPromise = false
|
|
69
|
+
isPromise = false;
|
|
72
70
|
|
|
73
|
-
return run(opt)
|
|
74
|
-
}
|
|
71
|
+
return run(opt);
|
|
72
|
+
};
|
|
75
73
|
|
|
76
74
|
promise.cwd = (cwd) => {
|
|
77
|
-
options.cwd = cwd
|
|
78
|
-
return promise
|
|
79
|
-
}
|
|
75
|
+
options.cwd = cwd;
|
|
76
|
+
return promise;
|
|
77
|
+
};
|
|
80
78
|
|
|
81
79
|
promise.sync = (opt) => {
|
|
82
|
-
isPromise = false
|
|
80
|
+
isPromise = false;
|
|
83
81
|
return execa.sync(cmd, args, {
|
|
84
82
|
cwd: process.cwd(),
|
|
85
|
-
stdio:
|
|
83
|
+
stdio: "inherit",
|
|
86
84
|
...options,
|
|
87
85
|
...opt
|
|
88
|
-
})
|
|
89
|
-
}
|
|
86
|
+
});
|
|
87
|
+
};
|
|
90
88
|
|
|
91
89
|
promise.getRaw = (opt) => {
|
|
92
|
-
isPromise = false
|
|
90
|
+
isPromise = false;
|
|
93
91
|
return Cli.getRaw(cmd, args, {
|
|
94
92
|
cwd: process.cwd(),
|
|
95
93
|
...options,
|
|
96
94
|
...opt
|
|
97
|
-
})
|
|
98
|
-
}
|
|
95
|
+
});
|
|
96
|
+
};
|
|
99
97
|
|
|
100
|
-
promise.get = promise.getRaw
|
|
98
|
+
promise.get = promise.getRaw;
|
|
101
99
|
|
|
102
|
-
return promise
|
|
100
|
+
return promise;
|
|
103
101
|
}
|
|
104
102
|
|
|
105
|
-
static getRaw
|
|
103
|
+
static getRaw(cmd, args, options) {
|
|
106
104
|
return spawnSync(cmd, args, options)
|
|
107
|
-
.output.filter(o => !!o)
|
|
108
|
-
.map(o => o.toString())
|
|
109
|
-
.join(
|
|
110
|
-
.trim()
|
|
105
|
+
.output.filter((o) => !!o)
|
|
106
|
+
.map((o) => o.toString())
|
|
107
|
+
.join("\n")
|
|
108
|
+
.trim();
|
|
111
109
|
}
|
|
112
110
|
}
|
package/src/common/cli/docker.js
CHANGED
|
@@ -1,63 +1,66 @@
|
|
|
1
|
-
import axios from
|
|
2
|
-
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
import { Cli } from "./cli.js";
|
|
3
4
|
|
|
4
5
|
class DockerCli extends Cli {
|
|
5
|
-
constructor
|
|
6
|
-
super(
|
|
6
|
+
constructor() {
|
|
7
|
+
super("docker");
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
tag
|
|
10
|
-
return this.get(
|
|
10
|
+
tag(...args) {
|
|
11
|
+
return this.get("tag", ...args);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
login
|
|
14
|
-
return this.sync(
|
|
14
|
+
login(...args) {
|
|
15
|
+
return this.sync("login", ...args);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
push
|
|
18
|
-
return this.run(
|
|
18
|
+
push(...args) {
|
|
19
|
+
return this.run("push", ...args);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
async getToken
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
async getToken(username, password) {
|
|
23
|
+
const {
|
|
24
|
+
data: { token }
|
|
25
|
+
} = await axios({
|
|
26
|
+
method: "POST",
|
|
27
|
+
url: "https://hub.docker.com/v2/users/login/",
|
|
25
28
|
headers: {
|
|
26
|
-
Accept:
|
|
27
|
-
|
|
29
|
+
Accept: "application/json",
|
|
30
|
+
"Content-Type": "application/json"
|
|
28
31
|
},
|
|
29
32
|
data: {
|
|
30
33
|
username,
|
|
31
34
|
password
|
|
32
35
|
}
|
|
33
|
-
})
|
|
36
|
+
});
|
|
34
37
|
|
|
35
|
-
return token
|
|
38
|
+
return token;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
async getTags
|
|
41
|
+
async getTags({ token, repository }) {
|
|
39
42
|
const { data } = await axios({
|
|
40
|
-
method:
|
|
43
|
+
method: "GET",
|
|
41
44
|
url: `https://hub.docker.com/v2/repositories/${repository}/tags/?page=1&page_size=500`,
|
|
42
45
|
headers: {
|
|
43
|
-
Accept:
|
|
46
|
+
Accept: "application/json",
|
|
44
47
|
Authorization: `JWT ${token}`
|
|
45
48
|
}
|
|
46
|
-
})
|
|
49
|
+
});
|
|
47
50
|
|
|
48
|
-
return data.results
|
|
51
|
+
return data.results;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
async deleteTag
|
|
54
|
+
async deleteTag(tag, { token, repository }) {
|
|
52
55
|
await axios({
|
|
53
|
-
method:
|
|
56
|
+
method: "DELETE",
|
|
54
57
|
url: `https://hub.docker.com/v2/repositories/${repository}/tags/${tag}/`,
|
|
55
58
|
headers: {
|
|
56
|
-
Accept:
|
|
59
|
+
Accept: "application/json",
|
|
57
60
|
Authorization: `JWT ${token}`
|
|
58
61
|
}
|
|
59
|
-
})
|
|
62
|
+
});
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
export const docker = new DockerCli()
|
|
66
|
+
export const docker = new DockerCli();
|