@cmflow/cli 3.4.0-alpha.1 → 3.4.0-alpha.3
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/README.md +102 -298
- package/dist/bin/cm.mjs +9985 -1348
- package/dist/bin/cmrelease.mjs +3875 -1193
- package/dist/{cli-truncate-CXNquMRK.mjs → cli-truncate-Bi2MjGwF.mjs} +177 -6
- package/dist/cli-truncate-DMcpM5Q7.mjs +2 -0
- package/dist/cli-truncate-DMcpM5Q7.mjs.map +1 -0
- package/dist/{cli-truncate-BmHD4ngn.mjs → cli-truncate-DsW0mgI_.mjs} +177 -6
- package/dist/{common-CwPbT3So.mjs → common-BdfXquG0.mjs} +31 -36
- package/dist/common-BdfXquG0.mjs.map +1 -0
- package/dist/compile-packages-BB08_q2B.mjs +2 -0
- package/dist/compile-packages-BB08_q2B.mjs.map +1 -0
- package/dist/docker-Cc30aRzl.mjs +34 -0
- package/dist/docker-Cc30aRzl.mjs.map +1 -0
- package/dist/docker-clean-tags-EvFdWykP.mjs +2 -0
- package/dist/docker-clean-tags-EvFdWykP.mjs.map +1 -0
- package/dist/docker-publish-CG0aN9se.mjs +2 -0
- package/dist/docker-publish-CG0aN9se.mjs.map +1 -0
- package/dist/find-packages-611B-66T.mjs +42 -0
- package/dist/find-packages-611B-66T.mjs.map +1 -0
- package/dist/get-config-8ivgd1KC.mjs +9 -0
- package/dist/get-config-8ivgd1KC.mjs.map +1 -0
- package/dist/get-east-asian-width-Tfn8qoqd.mjs.map +1 -1
- package/dist/{get-east-asian-width-eFfEkHwo.mjs → get-east-asian-width-wiVWCFXf.mjs} +4 -4
- package/dist/log-update-CLbF3iV6.mjs +6 -0
- package/dist/log-update-CLbF3iV6.mjs.map +1 -0
- package/dist/{log-update-B2GqeeDd.mjs → log-update-CTXRtajW.mjs} +185 -14
- package/dist/{log-update-BldA9lkm.mjs → log-update-Dy1vPMGY.mjs} +185 -14
- package/dist/npm-VM_GgazT.mjs +2 -0
- package/dist/npm-VM_GgazT.mjs.map +1 -0
- package/dist/{semver-D8gwMSFO.mjs → semver-DFjVbN1S.mjs} +2 -2
- package/dist/semver-DFjVbN1S.mjs.map +1 -0
- package/dist/source-CwLcYLzI.mjs +7 -0
- package/dist/source-CwLcYLzI.mjs.map +1 -0
- package/dist/{wrap-ansi-DsMb4WnZ.mjs → wrap-ansi-9ugahFCy.mjs} +2 -2
- package/dist/wrap-ansi-9ugahFCy.mjs.map +1 -0
- package/dist/{wrap-ansi-CWIezXNl.mjs → wrap-ansi-BRr0GA6g.mjs} +5 -5
- package/dist/{wrap-ansi-T0rz0Urp.mjs → wrap-ansi-Cupoo4Yg.mjs} +5 -5
- package/dist/wrap-ansi-dwgEjNWf.mjs +2 -0
- package/dist/write-package-cxki9d3K.mjs +8 -0
- package/dist/write-package-cxki9d3K.mjs.map +1 -0
- package/dist/write-packages-CxCAl_AG.mjs +10 -0
- package/dist/write-packages-CxCAl_AG.mjs.map +1 -0
- package/package.json +9 -41
- package/tsdown.config.ts +5 -14
- package/.oxfmtrc.json +0 -11
- package/.yarn/install-state.gz +0 -0
- package/.yarn/releases/yarn-4.18.0.cjs +0 -1000
- package/.yarnrc.yml +0 -10
- package/bin/cm-checkfeatures.ts +0 -10
- package/bin/cm-clean.ts +0 -10
- package/bin/cm-config.ts +0 -10
- package/bin/cm-deploy.ts +0 -10
- package/bin/cm-expedit.ts +0 -19
- package/bin/cm-fetch.ts +0 -10
- package/bin/cm-finish.ts +0 -10
- package/bin/cm-jira-releases.ts +0 -10
- package/bin/cm-merge.ts +0 -10
- package/bin/cm-publish.ts +0 -10
- package/bin/cm-pull.ts +0 -8
- package/bin/cm-push.ts +0 -10
- package/bin/cm-rebase.ts +0 -10
- package/bin/cm-release.ts +0 -5
- package/bin/cm-republish.ts +0 -10
- package/bin/cm-start.ts +0 -10
- package/bin/cm.ts +0 -40
- package/dist/cli-truncate-DbOyuy2e.mjs +0 -2
- package/dist/cli-truncate-DbOyuy2e.mjs.map +0 -1
- package/dist/common-CwPbT3So.mjs.map +0 -1
- package/dist/docker-clean-tags-Cd-E8IqJ.mjs +0 -2
- package/dist/docker-clean-tags-Cd-E8IqJ.mjs.map +0 -1
- package/dist/docker-publish-B0E0qYYB.mjs +0 -2
- package/dist/docker-publish-B0E0qYYB.mjs.map +0 -1
- package/dist/get-config-DoOyLztI.mjs +0 -41
- package/dist/get-config-DoOyLztI.mjs.map +0 -1
- package/dist/log-update-By8Z-mak.mjs +0 -6
- package/dist/log-update-By8Z-mak.mjs.map +0 -1
- package/dist/semver-D8gwMSFO.mjs.map +0 -1
- package/dist/src/index.mjs +0 -18
- package/dist/src/index.mjs.map +0 -1
- package/dist/src/semantic/core/analyze-commits.mjs +0 -2
- package/dist/src/semantic/core/analyze-commits.mjs.map +0 -1
- package/dist/src/semantic/core/conditional.mjs +0 -2
- package/dist/src/semantic/core/conditional.mjs.map +0 -1
- package/dist/src/semantic/core/exit.mjs +0 -2
- package/dist/src/semantic/core/exit.mjs.map +0 -1
- package/dist/src/semantic/core/prepare/bump-version.mjs +0 -48
- package/dist/src/semantic/core/prepare/bump-version.mjs.map +0 -1
- package/dist/src/semantic/core/prepare/commit.mjs +0 -2
- package/dist/src/semantic/core/prepare/commit.mjs.map +0 -1
- package/dist/src/semantic/core/prepare/release-info.mjs +0 -2
- package/dist/src/semantic/core/prepare/release-info.mjs.map +0 -1
- package/dist/src/semantic/core/run.mjs +0 -2
- package/dist/src/semantic/core/run.mjs.map +0 -1
- package/dist/src/semantic/core/sync-repository.mjs +0 -2
- package/dist/src/semantic/core/sync-repository.mjs.map +0 -1
- package/dist/src/semantic/core/verify-conditions.mjs +0 -2
- package/dist/src/semantic/core/verify-conditions.mjs.map +0 -1
- package/dist/src/semantic/core/verify-release.mjs +0 -2
- package/dist/src/semantic/core/verify-release.mjs.map +0 -1
- package/dist/src/semantic/docker/publish.mjs +0 -2
- package/dist/src/semantic/docker/publish.mjs.map +0 -1
- package/dist/src/semantic/docker/success.mjs +0 -2
- package/dist/src/semantic/docker/success.mjs.map +0 -1
- package/dist/strip-ansi-Aeu5cmZe.mjs +0 -174
- package/dist/strip-ansi-Cl0pRo-s.mjs +0 -2
- package/dist/strip-ansi-Cl0pRo-s.mjs.map +0 -1
- package/dist/wrap-ansi-BeIjar2W.mjs +0 -2
- package/dist/wrap-ansi-DsMb4WnZ.mjs.map +0 -1
- package/mise.toml +0 -2
- package/oxlint.json +0 -25
- package/release.config.mjs +0 -39
- package/src/commands/checkfeatures.ts +0 -39
- package/src/commands/clean.ts +0 -36
- package/src/commands/config.ts +0 -31
- package/src/commands/deploy.ts +0 -39
- package/src/commands/fetch.ts +0 -30
- package/src/commands/finish.ts +0 -50
- package/src/commands/index.ts +0 -13
- package/src/commands/jira-releases.ts +0 -97
- package/src/commands/merge.ts +0 -58
- package/src/commands/prompts/branches.ts +0 -46
- package/src/commands/pull.ts +0 -44
- package/src/commands/push.ts +0 -48
- package/src/commands/rebase.ts +0 -56
- package/src/commands/release.ts +0 -21
- package/src/commands/republish.ts +0 -34
- package/src/commands/start.ts +0 -123
- package/src/commands/tasks/merge-branch.ts +0 -80
- package/src/commands/tasks/push-branch.ts +0 -19
- package/src/commands/tasks/rebase-all-branches.ts +0 -37
- package/src/commands/tasks/refresh-repository.ts +0 -38
- package/src/commands/tasks/run-test.ts +0 -28
- package/src/commands/tasks/update-branch.ts +0 -49
- package/src/commands/tasks/update-dependencies.ts +0 -43
- package/src/commands/utils/check-install.ts +0 -31
- package/src/common/back/directus/directus-flow.test.ts +0 -63
- package/src/common/back/directus/directus-flow.ts +0 -48
- package/src/common/back/http/http-proxy.ts +0 -21
- package/src/common/back/http/http-request.spec.ts +0 -50
- package/src/common/back/http/http-request.ts +0 -74
- package/src/common/back/jira/get-sorted-releases.ts +0 -40
- package/src/common/back/jira/interfaces/JiraIIssue.d.ts +0 -100
- package/src/common/back/jira/jira-releases.ts +0 -47
- package/src/common/back/jira/jira-request.spec.ts +0 -59
- package/src/common/back/jira/jira-request.ts +0 -29
- package/src/common/back/jira/jira-search.spec.ts +0 -44
- package/src/common/back/jira/jira-search.ts +0 -17
- package/src/common/cli/bun.test.ts +0 -58
- package/src/common/cli/bun.ts +0 -33
- package/src/common/cli/cli.ts +0 -127
- package/src/common/cli/docker.test.ts +0 -141
- package/src/common/cli/docker.ts +0 -66
- package/src/common/cli/git.test.ts +0 -215
- package/src/common/cli/git.ts +0 -121
- package/src/common/cli/lerna.test.ts +0 -58
- package/src/common/cli/lerna.ts +0 -25
- package/src/common/cli/npm.test.ts +0 -58
- package/src/common/cli/npm.ts +0 -33
- package/src/common/cli/pnpm.test.ts +0 -58
- package/src/common/cli/pnpm.ts +0 -34
- package/src/common/cli/yarn.test.ts +0 -58
- package/src/common/cli/yarn.ts +0 -33
- package/src/common/configure-git-workspace.ts +0 -39
- package/src/common/get-config.ts +0 -159
- package/src/common/get-package-json.ts +0 -15
- package/src/common/get-package-manager.ts +0 -13
- package/src/common/get-release-config.ts +0 -9
- package/src/common/index.ts +0 -14
- package/src/common/run-command.test.ts +0 -66
- package/src/common/run-command.ts +0 -67
- package/src/common/types.ts +0 -26
- package/src/common/vendor.d.ts +0 -4
- package/src/index.ts +0 -14
- package/src/semantic/core/analyze-commits.ts +0 -21
- package/src/semantic/core/conditional.ts +0 -62
- package/src/semantic/core/exit.ts +0 -15
- package/src/semantic/core/prepare/bump-version.ts +0 -41
- package/src/semantic/core/prepare/commit.ts +0 -30
- package/src/semantic/core/prepare/release-info.ts +0 -6
- package/src/semantic/core/run.ts +0 -23
- package/src/semantic/core/sync-repository.ts +0 -55
- package/src/semantic/core/verify-conditions.ts +0 -41
- package/src/semantic/core/verify-release.ts +0 -10
- package/src/semantic/define-config.ts +0 -42
- package/src/semantic/docker/publish.ts +0 -6
- package/src/semantic/docker/success.ts +0 -10
- package/src/semantic/utils/__mock__/test1/package.json +0 -7
- package/src/semantic/utils/__mock__/test1/packages/a/package.json +0 -9
- package/src/semantic/utils/__mock__/test1/packages/b/package.json +0 -7
- package/src/semantic/utils/__mock__/test2/package.json +0 -4
- package/src/semantic/utils/__mock__/test2/packages/a/package.json +0 -7
- package/src/semantic/utils/__mock__/test2/packages/b/package.json +0 -5
- package/src/semantic/utils/bump-packages-version.test.ts +0 -76
- package/src/semantic/utils/bump-packages-version.ts +0 -53
- package/src/semantic/utils/calculate-snapshot-version.test.ts +0 -69
- package/src/semantic/utils/calculate-snapshot-version.ts +0 -17
- package/src/semantic/utils/display-package-info.ts +0 -12
- package/src/semantic/utils/display-release-info.ts +0 -13
- package/src/semantic/utils/docker-clean-tags.test.ts +0 -62
- package/src/semantic/utils/docker-clean-tags.ts +0 -58
- package/src/semantic/utils/docker-publish.test.ts +0 -45
- package/src/semantic/utils/docker-publish.ts +0 -24
- package/src/semantic/utils/log-section.ts +0 -9
- package/src/semantic/utils/release-rules.ts +0 -15
- package/src/semantic/utils/transform-writer.ts +0 -101
- package/src/workflow/index.ts +0 -42
- package/tsconfig.build.json +0 -29
- package/tsconfig.json +0 -30
- package/vitest.config.mts +0 -9
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import execa from "execa";
|
|
2
|
-
import { yarn } from "./yarn.js";
|
|
3
|
-
import { Cli } from "./cli.js";
|
|
4
|
-
|
|
5
|
-
vi.mock("execa", () => {
|
|
6
|
-
const sync = vi.fn();
|
|
7
|
-
const execaMock = Object.assign(vi.fn(), { sync });
|
|
8
|
-
return { default: execaMock };
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
type ExecaMock = {
|
|
12
|
-
sync: { mockImplementation(fn: (...args: unknown[]) => unknown): void };
|
|
13
|
-
mockReturnValue(v: unknown): void;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const execaMock = execa as unknown as ExecaMock;
|
|
17
|
-
|
|
18
|
-
execaMock.sync.mockImplementation((...args) => {
|
|
19
|
-
return {
|
|
20
|
-
stdout: `CMD: ${([] as unknown[]).concat(...(args as (string | string[])[]).filter((arg) => typeof arg === "string" || Array.isArray(arg))).join(" ")}`
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
execaMock.mockReturnValue({});
|
|
24
|
-
|
|
25
|
-
describe("YarnCli", () => {
|
|
26
|
-
beforeEach(() => {
|
|
27
|
-
vi.spyOn(Cli, "getRaw").mockImplementation((...args: unknown[]) => {
|
|
28
|
-
return `CMD: ${([] as unknown[]).concat(...(args as (string | string[])[]).filter((arg) => typeof arg === "string" || Array.isArray(arg))).join(" ")}`;
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
describe("newVersion", () => {
|
|
32
|
-
it("should run newVersion cmd", () => {
|
|
33
|
-
const result = yarn.newVersion("1.0.0");
|
|
34
|
-
|
|
35
|
-
expect(result.stdout).toEqual("CMD: yarn version --no-git-tag-version --new-version 1.0.0");
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
describe("run", () => {
|
|
39
|
-
it('should run "run" cmd', async () => {
|
|
40
|
-
await yarn.run("run-arg");
|
|
41
|
-
|
|
42
|
-
expect(execa).toHaveBeenCalledWith("yarn", ["run-arg"], {
|
|
43
|
-
cwd: process.cwd(),
|
|
44
|
-
stdio: "inherit"
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe("install", () => {
|
|
49
|
-
it('should run "install" cmd', async () => {
|
|
50
|
-
await yarn.install("install-arg");
|
|
51
|
-
|
|
52
|
-
expect(execa).toHaveBeenCalledWith("yarn", ["install", "install-arg"], {
|
|
53
|
-
cwd: process.cwd(),
|
|
54
|
-
stdio: "inherit"
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
});
|
package/src/common/cli/yarn.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Cli } from "./cli.js";
|
|
2
|
-
|
|
3
|
-
class YarnCli extends Cli {
|
|
4
|
-
constructor() {
|
|
5
|
-
super("yarn");
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
newVersion(version: string) {
|
|
9
|
-
return this.version("--no-git-tag-version", "--new-version", version);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
version(...args: string[]) {
|
|
13
|
-
return this.sync("version", ...args);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
run(...args: string[]) {
|
|
17
|
-
return super.run(...args);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
install(...args: string[]) {
|
|
21
|
-
return super.run("install", ...args);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Reinstall dependencies without yarn.lock mutation
|
|
26
|
-
* @returns {Promise<unknown>}
|
|
27
|
-
*/
|
|
28
|
-
restore() {
|
|
29
|
-
return super.run("install", "--immutable");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const yarn = new YarnCli();
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { git } from "./cli/git.js";
|
|
2
|
-
|
|
3
|
-
interface GitWorkspaceContext {
|
|
4
|
-
logger: { info: (...args: unknown[]) => void };
|
|
5
|
-
config: {
|
|
6
|
-
SCM_TOKEN?: string;
|
|
7
|
-
REPOSITORY_URL?: string;
|
|
8
|
-
ORIGIN?: string;
|
|
9
|
-
GIT_USER_NAME?: string;
|
|
10
|
-
GIT_USER_EMAIL?: string;
|
|
11
|
-
GIT_DISABLE_SSL?: string | boolean;
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function configureGitWorkspace(context: GitWorkspaceContext) {
|
|
17
|
-
const {
|
|
18
|
-
logger,
|
|
19
|
-
config: { SCM_TOKEN, REPOSITORY_URL, ORIGIN, GIT_USER_NAME, GIT_USER_EMAIL, GIT_DISABLE_SSL }
|
|
20
|
-
} = context;
|
|
21
|
-
|
|
22
|
-
if (GIT_USER_NAME && GIT_USER_EMAIL) {
|
|
23
|
-
git.config("--global", "user.name", `"${GIT_USER_NAME}"`);
|
|
24
|
-
git.config("--global", "user.email", `"${GIT_USER_EMAIL}"`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (GIT_DISABLE_SSL) {
|
|
28
|
-
logger.info("Disable SSL verification");
|
|
29
|
-
git.config("--global", "http.sslVerify", "false");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (SCM_TOKEN) {
|
|
33
|
-
const repository = (REPOSITORY_URL ?? "").replace("https://", "");
|
|
34
|
-
|
|
35
|
-
logger.info(`Configure remote repository ${repository}`);
|
|
36
|
-
git.remote("remove", ORIGIN ?? "origin").sync();
|
|
37
|
-
git.remote("add", ORIGIN ?? "origin", `https://${SCM_TOKEN}@${repository}`).sync();
|
|
38
|
-
}
|
|
39
|
-
}
|
package/src/common/get-config.ts
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
|
|
4
|
-
import hasYarn from "has-yarn";
|
|
5
|
-
import get from "lodash/get.js";
|
|
6
|
-
|
|
7
|
-
import { git } from "./cli/git.js";
|
|
8
|
-
import { getPackageJson } from "./get-package-json.js";
|
|
9
|
-
|
|
10
|
-
export function getCI() {
|
|
11
|
-
const { env } = process;
|
|
12
|
-
const { GIT_USER_NAME, GIT_USER_EMAIL } = env;
|
|
13
|
-
if (env.CI) {
|
|
14
|
-
if (env.GITLAB_CI) {
|
|
15
|
-
const { CI_BUILD_ID, CI_JOB_ID, CI_COMMIT_SHA, CI_COMMIT_BRANCH } = env;
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
CI_NAME: "GitLab CI",
|
|
19
|
-
USER: GIT_USER_NAME || "GitLab CI",
|
|
20
|
-
EMAIL: GIT_USER_EMAIL || "gitlab@gitlab.com",
|
|
21
|
-
BUILD_NUMBER: CI_BUILD_ID || CI_JOB_ID,
|
|
22
|
-
CI_ORIGIN: "origin-git",
|
|
23
|
-
REF_COMMIT: CI_COMMIT_SHA,
|
|
24
|
-
IS_PULL_REQUEST: false,
|
|
25
|
-
BRANCH_NAME: CI_COMMIT_BRANCH
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (env.CIRCLECI) {
|
|
30
|
-
const { CIRCLE_BUILD_NUM, CIRCLE_SHA1, CIRCLE_PULL_REQUEST, CIRCLE_BRANCH } = env;
|
|
31
|
-
return {
|
|
32
|
-
CI_NAME: "Circle CI",
|
|
33
|
-
USER: GIT_USER_NAME || "Circle CI",
|
|
34
|
-
EMAIL: GIT_USER_EMAIL || "circle@circleci.com",
|
|
35
|
-
BUILD_NUMBER: CIRCLE_BUILD_NUM,
|
|
36
|
-
CI_ORIGIN: "origin-git",
|
|
37
|
-
REF_COMMIT: CIRCLE_SHA1,
|
|
38
|
-
IS_PULL_REQUEST: CIRCLE_PULL_REQUEST && CIRCLE_PULL_REQUEST !== "false",
|
|
39
|
-
BRANCH_NAME: CIRCLE_BRANCH
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (env.GITHUB_ACTION) {
|
|
44
|
-
const { GITHUB_ACTION, GITHUB_SHA, GITHUB_REF, GITHUB_ACTOR } = env;
|
|
45
|
-
return {
|
|
46
|
-
CI_NAME: "Github CI",
|
|
47
|
-
USER: GIT_USER_NAME || GITHUB_ACTOR || "Github CI",
|
|
48
|
-
EMAIL: GIT_USER_EMAIL || "action@github.com",
|
|
49
|
-
BUILD_NUMBER: GITHUB_ACTION,
|
|
50
|
-
CI_ORIGIN: "origin-git",
|
|
51
|
-
REF_COMMIT: GITHUB_SHA,
|
|
52
|
-
IS_PULL_REQUEST: false,
|
|
53
|
-
BRANCH_NAME: (GITHUB_REF as string).replace("refs/heads/", "")
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
NAME: "Unsupported CI",
|
|
59
|
-
BUILD_NUMBER: "",
|
|
60
|
-
CI_ORIGIN: "origin-git",
|
|
61
|
-
IS_PULL_REQUEST: false,
|
|
62
|
-
BRANCH_NAME: git.getBranchName()
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
// / local
|
|
66
|
-
return {
|
|
67
|
-
NAME: "LOCAL",
|
|
68
|
-
BUILD_NUMBER: "1",
|
|
69
|
-
CI_ORIGIN: "origin-git",
|
|
70
|
-
BRANCH_NAME: git.getBranchName()
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function getConfig() {
|
|
75
|
-
const pkg = getPackageJson();
|
|
76
|
-
const [owner, projectName] = pkg.name.replace(/^@/, "").split("/");
|
|
77
|
-
const {
|
|
78
|
-
E2E_CMD,
|
|
79
|
-
PROJECT_NAME,
|
|
80
|
-
DOCKER_HUB_ID,
|
|
81
|
-
DOCKER_HUB_PWD,
|
|
82
|
-
REF_COMMIT,
|
|
83
|
-
GH_TOKEN,
|
|
84
|
-
SCM_TOKEN,
|
|
85
|
-
REPOSITORY_URL,
|
|
86
|
-
GIT_DISABLE_SSL,
|
|
87
|
-
GIT_USER_NAME,
|
|
88
|
-
GIT_USER_EMAIL,
|
|
89
|
-
GITLAB_USER_EMAIL,
|
|
90
|
-
GITLAB_USER_NAME,
|
|
91
|
-
GIT_FETCH_MAX_DEPTH,
|
|
92
|
-
JIRA_API,
|
|
93
|
-
JIRA_EMAIL,
|
|
94
|
-
JIRA_TOKEN,
|
|
95
|
-
DIRECTUS_URL,
|
|
96
|
-
DIRECTUS_FLOW_ID,
|
|
97
|
-
DIRECTUS_ACCESS_TOKEN,
|
|
98
|
-
HTTPS_PROXY
|
|
99
|
-
} = process.env;
|
|
100
|
-
|
|
101
|
-
const HAS_YARN = hasYarn();
|
|
102
|
-
const HAS_PNPM = fs.existsSync(join(process.cwd(), "pnpm-lock.yaml"));
|
|
103
|
-
const HAS_BUN = fs.existsSync(join(process.cwd(), "bun.lock")) || fs.existsSync(join(process.cwd(), "bun.lockb"));
|
|
104
|
-
const IS_YARN_BERRY = HAS_YARN ? fs.existsSync(join(process.cwd(), ".yamlrc.yml")) : false;
|
|
105
|
-
let BUMP_METHOD = get(pkg, "flow.bumpMethod", "default");
|
|
106
|
-
|
|
107
|
-
if ((IS_YARN_BERRY || HAS_PNPM || HAS_BUN) && ["native", "default"].includes(BUMP_METHOD)) {
|
|
108
|
-
BUMP_METHOD = "cmflow";
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return {
|
|
112
|
-
pkg,
|
|
113
|
-
E2E_CMD,
|
|
114
|
-
PACKAGE_MANAGER: HAS_PNPM ? "pnpm" : HAS_BUN ? "bun" : HAS_YARN ? "yarn" : "npm",
|
|
115
|
-
PROJECT_NAME: PROJECT_NAME || projectName,
|
|
116
|
-
HAS_YARN,
|
|
117
|
-
HAS_PNPM,
|
|
118
|
-
HAS_BUN,
|
|
119
|
-
IS_YARN_BERRY,
|
|
120
|
-
HAS_LERNA: (pkg.dependencies && pkg.dependencies.lerna) || (pkg.devDependencies && pkg.devDependencies.lerna),
|
|
121
|
-
CI_SKIP: "[ci skip]",
|
|
122
|
-
RELEASE_CANDIDATE_TAG: "[MEP]",
|
|
123
|
-
ORIGIN: "origin",
|
|
124
|
-
get PRODUCTION_BRANCH() {
|
|
125
|
-
return get(pkg, "flow.branch.production") || process.env.PRODUCTION_BRANCH || "production";
|
|
126
|
-
},
|
|
127
|
-
get DEVELOP_BRANCH() {
|
|
128
|
-
return get(pkg, "flow.branch.develop") || process.env.DEVELOP_BRANCH || "master";
|
|
129
|
-
},
|
|
130
|
-
get OWNER() {
|
|
131
|
-
return process.env.OWNER || owner;
|
|
132
|
-
},
|
|
133
|
-
get DOCKER_REPOSITORY() {
|
|
134
|
-
const { DOCKER_REPOSITORY, OWNER, PROJECT_NAME } = process.env;
|
|
135
|
-
return DOCKER_REPOSITORY || `${OWNER || owner}/${PROJECT_NAME || projectName}`;
|
|
136
|
-
},
|
|
137
|
-
DOCKER_HUB_ID,
|
|
138
|
-
DOCKER_HUB_PWD,
|
|
139
|
-
REF_COMMIT,
|
|
140
|
-
GH_TOKEN,
|
|
141
|
-
SCM_TOKEN: GH_TOKEN || SCM_TOKEN,
|
|
142
|
-
REPOSITORY_URL: get(pkg, "repository.url", get(pkg, "repository", REPOSITORY_URL)),
|
|
143
|
-
GIT_USER_NAME: GIT_USER_NAME || GITLAB_USER_NAME,
|
|
144
|
-
GIT_USER_EMAIL: GIT_USER_EMAIL || GITLAB_USER_EMAIL,
|
|
145
|
-
GIT_FETCH_MAX_DEPTH,
|
|
146
|
-
GIT_DISABLE_SSL,
|
|
147
|
-
BUMP_METHOD,
|
|
148
|
-
JIRA_API,
|
|
149
|
-
JIRA_EMAIL,
|
|
150
|
-
JIRA_TOKEN,
|
|
151
|
-
HTTPS_PROXY,
|
|
152
|
-
DIRECTUS_URL,
|
|
153
|
-
DIRECTUS_FLOW_ID,
|
|
154
|
-
DIRECTUS_ACCESS_TOKEN,
|
|
155
|
-
CAN_TRIGGER_WORKFLOW: DIRECTUS_ACCESS_TOKEN && DIRECTUS_FLOW_ID && DIRECTUS_URL,
|
|
156
|
-
WORKSPACES: pkg.workspaces || [],
|
|
157
|
-
...getCI()
|
|
158
|
-
};
|
|
159
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
|
|
4
|
-
export function getPackageJson() {
|
|
5
|
-
try {
|
|
6
|
-
const content = fs.readFileSync(`${process.cwd()}/package.json`, { encoding: "utf8" });
|
|
7
|
-
|
|
8
|
-
return JSON.parse(content);
|
|
9
|
-
} catch (error) {
|
|
10
|
-
console.error("Error while loading package.json", error);
|
|
11
|
-
return {
|
|
12
|
-
name: "@clubmed/root"
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { bun } from "./cli/bun.js";
|
|
3
|
-
import { npm } from "./cli/npm.js";
|
|
4
|
-
import { pnpm } from "./cli/pnpm.js";
|
|
5
|
-
import { yarn } from "./cli/yarn.js";
|
|
6
|
-
|
|
7
|
-
export function getPackageManager(pkgManager) {
|
|
8
|
-
if (pkgManager === "bun") {
|
|
9
|
-
return bun;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return pkgManager === "yarn" ? yarn : pkgManager === "pnpm" ? pnpm : npm;
|
|
13
|
-
}
|
package/src/common/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
export * from "./cli/bun.js";
|
|
3
|
-
export * from "./cli/cli.js";
|
|
4
|
-
export * from "./cli/docker.js";
|
|
5
|
-
export * from "./cli/git.js";
|
|
6
|
-
export * from "./cli/lerna.js";
|
|
7
|
-
export * from "./cli/npm.js";
|
|
8
|
-
export * from "./cli/pnpm.js";
|
|
9
|
-
export * from "./cli/yarn.js";
|
|
10
|
-
export * from "./configure-git-workspace.js";
|
|
11
|
-
export * from "./get-config.js";
|
|
12
|
-
export * from "./get-package-json.js";
|
|
13
|
-
export * from "./get-package-manager.js";
|
|
14
|
-
export * from "./run-command.js";
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
vi.mock("listr", () => {
|
|
3
|
-
return { default: vi.fn() };
|
|
4
|
-
});
|
|
5
|
-
|
|
6
|
-
const { default: Listr } = await import("listr");
|
|
7
|
-
const { runCommand } = await import("./run-command.js");
|
|
8
|
-
|
|
9
|
-
describe("runCommand", () => {
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
Listr.mockReturnValue({
|
|
12
|
-
run() {}
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
it("should call runCommand", async () => {
|
|
16
|
-
class Cmd {
|
|
17
|
-
mapContext(ctx) {
|
|
18
|
-
return {
|
|
19
|
-
...ctx,
|
|
20
|
-
test: true
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getTasks() {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
vi.spyOn(Cmd.prototype, "mapContext");
|
|
30
|
-
vi.spyOn(Cmd.prototype, "getTasks");
|
|
31
|
-
|
|
32
|
-
await runCommand(Cmd, {
|
|
33
|
-
prop: "1"
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
expect(Cmd.prototype.mapContext).toHaveBeenCalledWith({ prop: "1" }, expect.any(Object));
|
|
37
|
-
expect(Cmd.prototype.getTasks).toHaveBeenCalledWith({
|
|
38
|
-
prop: "1",
|
|
39
|
-
test: true
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
it("should call runCommand and catch error", async () => {
|
|
43
|
-
class Cmd {
|
|
44
|
-
mapContext(ctx) {
|
|
45
|
-
return {
|
|
46
|
-
...ctx,
|
|
47
|
-
test: true
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
getTasks() {
|
|
52
|
-
throw new Error("Error");
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
vi.spyOn(console, "error").mockReturnValue(undefined);
|
|
57
|
-
vi.spyOn(process, "exit").mockImplementation(() => {});
|
|
58
|
-
|
|
59
|
-
await runCommand(Cmd, {
|
|
60
|
-
prop: "1"
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
expect(console.error).toHaveBeenCalled();
|
|
64
|
-
expect(process.exit).toHaveBeenCalledWith(-1);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import figures from "figures";
|
|
3
|
-
import inquirer from "inquirer";
|
|
4
|
-
import { Listr, type ListrTask } from "listr2";
|
|
5
|
-
|
|
6
|
-
import type { CmContext, CommandConstructor } from "./types.js";
|
|
7
|
-
import { getConfig } from "./get-config.js";
|
|
8
|
-
import { getReleaseConfig } from "./get-release-config.js";
|
|
9
|
-
|
|
10
|
-
function createTasksRunner(tasks: ListrTask[], ctx: CmContext): Promise<void> {
|
|
11
|
-
return new Listr(tasks, {
|
|
12
|
-
concurrent: false,
|
|
13
|
-
renderer: !ctx.verbose ? "default" : "verbose"
|
|
14
|
-
}).run(ctx);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export async function runCommand(
|
|
18
|
-
klass: CommandConstructor,
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
-
opts: Record<string, any>
|
|
21
|
-
): Promise<void> {
|
|
22
|
-
try {
|
|
23
|
-
const config = getConfig();
|
|
24
|
-
|
|
25
|
-
let context = {
|
|
26
|
-
...getReleaseConfig(),
|
|
27
|
-
...config,
|
|
28
|
-
branch: { name: config.BRANCH_NAME as string },
|
|
29
|
-
config,
|
|
30
|
-
logger: console,
|
|
31
|
-
verbose: opts.verbose as number | undefined
|
|
32
|
-
} as unknown as CmContext;
|
|
33
|
-
|
|
34
|
-
const command = new klass();
|
|
35
|
-
|
|
36
|
-
if (command.mapContext) {
|
|
37
|
-
context = command.mapContext(opts as Record<string, unknown>, context);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (command.prompt) {
|
|
41
|
-
context = {
|
|
42
|
-
...context,
|
|
43
|
-
...((await (inquirer as unknown as { prompt: (q: unknown) => Promise<Record<string, unknown>> }).prompt(
|
|
44
|
-
command.prompt(context)
|
|
45
|
-
)) as Record<string, unknown>)
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
command.verifyConditions?.(context);
|
|
50
|
-
|
|
51
|
-
const tasks = command.getTasks(context);
|
|
52
|
-
|
|
53
|
-
await createTasksRunner(tasks, context);
|
|
54
|
-
|
|
55
|
-
command.success?.(context);
|
|
56
|
-
} catch (er) {
|
|
57
|
-
console.error(chalk.red(figures.cross + " " + String(er)));
|
|
58
|
-
if (opts.verbose) {
|
|
59
|
-
console.error(String((er as Error).stack ?? "").replace(String(er), ""));
|
|
60
|
-
}
|
|
61
|
-
process.exit(-1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
process.on("unhandledRejection", () => {
|
|
66
|
-
// avoid extra promise rejection when using toObservable
|
|
67
|
-
});
|
package/src/common/types.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ListrTask } from "listr2";
|
|
2
|
-
import type { BaseContext, LastRelease, NextRelease } from "semantic-release";
|
|
3
|
-
import type { getConfig } from "./get-config";
|
|
4
|
-
|
|
5
|
-
export type CmContext<Extended = any> = BaseContext & {
|
|
6
|
-
config: ReturnType<typeof getConfig>;
|
|
7
|
-
branch: { name: string; type?: string };
|
|
8
|
-
nextRelease?: Partial<NextRelease>;
|
|
9
|
-
lastRelease?: Partial<LastRelease>;
|
|
10
|
-
verbose?: number;
|
|
11
|
-
output?: string[];
|
|
12
|
-
} & Extended;
|
|
13
|
-
|
|
14
|
-
export type SemanticContext = CmContext;
|
|
15
|
-
|
|
16
|
-
export interface ICommand {
|
|
17
|
-
mapContext?(opts: Record<string, unknown>, context: CmContext): CmContext;
|
|
18
|
-
prompt?(context: CmContext): Array<Record<string, unknown>>;
|
|
19
|
-
verifyConditions?(context: CmContext): void;
|
|
20
|
-
getTasks(context: CmContext): ListrTask[];
|
|
21
|
-
success?(context: CmContext): void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type CommandConstructor = new () => ICommand;
|
|
25
|
-
|
|
26
|
-
export type { ListrTask };
|
package/src/common/vendor.d.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as commands from "./commands";
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
const __VERSION__: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export * from "./commands/release.js";
|
|
8
|
-
export * from "./common/index.js";
|
|
9
|
-
export * from "./semantic/define-config.js";
|
|
10
|
-
export * from "./semantic/utils/release-rules.js";
|
|
11
|
-
export * from "./semantic/utils/transform-writer.js";
|
|
12
|
-
export * from "./workflow/index.js";
|
|
13
|
-
|
|
14
|
-
export { commands };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as commitAnalyzerPlugins from "@semantic-release/commit-analyzer";
|
|
2
|
-
import type { ReleaseType } from "semantic-release";
|
|
3
|
-
import type { SemanticContext } from "../../common/types.js";
|
|
4
|
-
|
|
5
|
-
import { calculateSnapshotVersion } from "../utils/calculate-snapshot-version.js";
|
|
6
|
-
|
|
7
|
-
export async function analyzeCommits(pluginConfig: Record<string, unknown>, context: SemanticContext) {
|
|
8
|
-
if (context.branch && context.branch.type !== "prerelease") {
|
|
9
|
-
return commitAnalyzerPlugins.analyzeCommits(pluginConfig, context);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const analyzedCommits = await commitAnalyzerPlugins.analyzeCommits(pluginConfig, context);
|
|
13
|
-
context.nextRelease = context.nextRelease || {};
|
|
14
|
-
context.nextRelease.type = (analyzedCommits ?? undefined) as ReleaseType;
|
|
15
|
-
context.nextRelease.version = calculateSnapshotVersion(context);
|
|
16
|
-
if (context.lastRelease) {
|
|
17
|
-
(context.lastRelease as { version: string | null }).version = null;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return "patch";
|
|
21
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { getConfig } from "../../common/index.js";
|
|
2
|
-
import type { SemanticContext } from "../../common/types.js";
|
|
3
|
-
|
|
4
|
-
interface ConditionalPluginConfig {
|
|
5
|
-
when?: (context: SemanticContext) => boolean;
|
|
6
|
-
run?: string | string[];
|
|
7
|
-
[key: string]: unknown;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function prepare(pluginConfig: ConditionalPluginConfig, context: SemanticContext) {
|
|
11
|
-
return runAll("prepare", pluginConfig, context, context.branch?.type === "release");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function success(pluginConfig: ConditionalPluginConfig, context: SemanticContext) {
|
|
15
|
-
return runAll("success", pluginConfig, context, context.branch?.type === "release");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function publish(pluginConfig: ConditionalPluginConfig, context: SemanticContext) {
|
|
19
|
-
return runAll("publish", pluginConfig, context, context.branch?.type === "release");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function generateNotes(pluginConfig: ConditionalPluginConfig, context: SemanticContext) {
|
|
23
|
-
return runAll("generateNotes", pluginConfig, context, context.branch?.type === "release");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function fail(pluginConfig: ConditionalPluginConfig, context: SemanticContext) {
|
|
27
|
-
return runAll("fail", pluginConfig, context, context.branch?.type === "release");
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async function runAll(step: string, pluginConfig: ConditionalPluginConfig, context: SemanticContext, defaultCondition: boolean) {
|
|
31
|
-
context.config = getConfig();
|
|
32
|
-
|
|
33
|
-
const condition = pluginConfig.when !== undefined ? pluginConfig.when(context) : defaultCondition;
|
|
34
|
-
|
|
35
|
-
if (!condition) {
|
|
36
|
-
context.logger.info(`Skip step "${step}" of plugin(s) "${pluginConfig.run}"`);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (pluginConfig.run) {
|
|
41
|
-
const tasks: string[] = ([] as string[]).concat(pluginConfig.run as string);
|
|
42
|
-
|
|
43
|
-
for (const task of tasks) {
|
|
44
|
-
if (typeof task === "string") {
|
|
45
|
-
const mod = (await import(task)) as Record<string, (config: unknown, ctx: unknown) => Promise<void>>;
|
|
46
|
-
const taskFunction = mod[step];
|
|
47
|
-
|
|
48
|
-
if (taskFunction) {
|
|
49
|
-
context.logger.info(` Start conditional step "${step}" of plugin "${task}"`);
|
|
50
|
-
|
|
51
|
-
try {
|
|
52
|
-
await taskFunction(pluginConfig, context);
|
|
53
|
-
context.logger.success(` Completed conditional step "${step}" of plugin "${task}"`);
|
|
54
|
-
} catch (er) {
|
|
55
|
-
context.logger.error(` Fail conditional step "${step}" of plugin "${task}"`);
|
|
56
|
-
throw er;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { getConfig } from "../../common/index.js";
|
|
2
|
-
import type { SemanticContext } from "../../common/types.js";
|
|
3
|
-
|
|
4
|
-
export default async function exit(pluginConfig: Record<string, unknown>, context: SemanticContext) {
|
|
5
|
-
context.config = getConfig();
|
|
6
|
-
const condition = pluginConfig.when !== undefined ? (pluginConfig.when as (ctx: SemanticContext) => boolean)(context) : true;
|
|
7
|
-
|
|
8
|
-
if (condition) {
|
|
9
|
-
// avoid next semantic-release steps when is a prerelease or release branch with SKIP_GITHUB_PUBLISH
|
|
10
|
-
context.logger.success("Skip next semantic-release steps");
|
|
11
|
-
process.exit(0);
|
|
12
|
-
} else {
|
|
13
|
-
context.logger.success("Continue next semantic-release steps");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { getConfig, getPackageManager, lerna } from "../../../common/index.js";
|
|
2
|
-
import { bumpPackagesVersion } from "../../utils/bump-packages-version.js";
|
|
3
|
-
import type { SemanticContext } from "../../../common/types.js";
|
|
4
|
-
|
|
5
|
-
export async function prepare(_: unknown, context: SemanticContext) {
|
|
6
|
-
context.config = getConfig();
|
|
7
|
-
const {
|
|
8
|
-
config: { PACKAGE_MANAGER, HAS_LERNA, BUMP_METHOD, WORKSPACES },
|
|
9
|
-
logger
|
|
10
|
-
} = context;
|
|
11
|
-
const versionPackageManager = PACKAGE_MANAGER === "yarn" ? "npm" : (PACKAGE_MANAGER as string);
|
|
12
|
-
|
|
13
|
-
logger.info(`Start bump version for all packages using method: ${BUMP_METHOD}`);
|
|
14
|
-
|
|
15
|
-
const version = context.nextRelease?.version ?? "";
|
|
16
|
-
|
|
17
|
-
switch (BUMP_METHOD) {
|
|
18
|
-
case "native":
|
|
19
|
-
logger.info("Using package manager");
|
|
20
|
-
getPackageManager(PACKAGE_MANAGER as string).newVersion(version);
|
|
21
|
-
break;
|
|
22
|
-
case "lerna":
|
|
23
|
-
if (HAS_LERNA) {
|
|
24
|
-
await lerna.newVersion(version);
|
|
25
|
-
}
|
|
26
|
-
break;
|
|
27
|
-
case "cmflow":
|
|
28
|
-
await bumpPackagesVersion(version, WORKSPACES as string[]);
|
|
29
|
-
await getPackageManager(PACKAGE_MANAGER as string).install();
|
|
30
|
-
break;
|
|
31
|
-
case "native:lerna":
|
|
32
|
-
default:
|
|
33
|
-
getPackageManager(versionPackageManager).newVersion(version);
|
|
34
|
-
|
|
35
|
-
if (HAS_LERNA) {
|
|
36
|
-
await lerna.newVersion(version);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
logger.info("Bump version finished with success...");
|
|
41
|
-
}
|