@decaf-ts/utils 1.3.2 → 1.5.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/README.md +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/lib/cjs/bin/modules.cjs +14 -0
- package/lib/cjs/bin/modules.cjs.map +1 -0
- package/lib/cjs/bin/npm-link.cjs +14 -0
- package/lib/cjs/bin/npm-link.cjs.map +1 -0
- package/lib/cjs/bin/npm-token.cjs +14 -0
- package/lib/cjs/bin/npm-token.cjs.map +1 -0
- package/lib/cjs/bin/run-all.cjs +14 -0
- package/lib/cjs/bin/run-all.cjs.map +1 -0
- package/lib/cjs/cli/commands/help.cjs +29 -0
- package/lib/cjs/cli/commands/help.cjs.map +1 -0
- package/lib/cjs/cli/commands/index.cjs +5 -0
- package/lib/cjs/cli/commands/index.cjs.map +1 -1
- package/lib/cjs/cli/commands/modules.cjs +80 -0
- package/lib/cjs/cli/commands/modules.cjs.map +1 -0
- package/lib/cjs/cli/commands/npm-link.cjs +196 -0
- package/lib/cjs/cli/commands/npm-link.cjs.map +1 -0
- package/lib/cjs/cli/commands/npm-token.cjs +87 -0
- package/lib/cjs/cli/commands/npm-token.cjs.map +1 -0
- package/lib/cjs/cli/commands/release-chain.cjs +82 -0
- package/lib/cjs/cli/commands/release-chain.cjs.map +1 -1
- package/lib/cjs/cli/commands/run-all.cjs +78 -0
- package/lib/cjs/cli/commands/run-all.cjs.map +1 -0
- package/lib/cjs/cli/commands/tag-release-shell.cjs +229 -0
- package/lib/cjs/cli/commands/tag-release-shell.cjs.map +1 -0
- package/lib/cjs/cli/commands/tag-release.cjs +33 -2
- package/lib/cjs/cli/commands/tag-release.cjs.map +1 -1
- package/lib/cjs/index.cjs +1 -1
- package/lib/esm/bin/modules.js +10 -0
- package/lib/esm/bin/modules.js.map +1 -0
- package/lib/esm/bin/npm-link.js +10 -0
- package/lib/esm/bin/npm-link.js.map +1 -0
- package/lib/esm/bin/npm-token.js +10 -0
- package/lib/esm/bin/npm-token.js.map +1 -0
- package/lib/esm/bin/run-all.js +10 -0
- package/lib/esm/bin/run-all.js.map +1 -0
- package/lib/esm/cli/commands/help.js +25 -0
- package/lib/esm/cli/commands/help.js.map +1 -0
- package/lib/esm/cli/commands/index.js +5 -0
- package/lib/esm/cli/commands/index.js.map +1 -1
- package/lib/esm/cli/commands/modules.js +70 -0
- package/lib/esm/cli/commands/modules.js.map +1 -0
- package/lib/esm/cli/commands/npm-link.js +188 -0
- package/lib/esm/cli/commands/npm-link.js.map +1 -0
- package/lib/esm/cli/commands/npm-token.js +79 -0
- package/lib/esm/cli/commands/npm-token.js.map +1 -0
- package/lib/esm/cli/commands/release-chain.js +82 -0
- package/lib/esm/cli/commands/release-chain.js.map +1 -1
- package/lib/esm/cli/commands/run-all.js +70 -0
- package/lib/esm/cli/commands/run-all.js.map +1 -0
- package/lib/esm/cli/commands/tag-release-shell.js +221 -0
- package/lib/esm/cli/commands/tag-release-shell.js.map +1 -0
- package/lib/esm/cli/commands/tag-release.js +33 -2
- package/lib/esm/cli/commands/tag-release.js.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/types/bin/modules.d.cts +1 -0
- package/lib/types/bin/modules.d.mts +1 -0
- package/lib/types/bin/npm-link.d.cts +1 -0
- package/lib/types/bin/npm-link.d.mts +1 -0
- package/lib/types/bin/npm-token.d.cts +1 -0
- package/lib/types/bin/npm-token.d.mts +1 -0
- package/lib/types/bin/run-all.d.cts +1 -0
- package/lib/types/bin/run-all.d.mts +1 -0
- package/lib/types/cli/commands/help.d.cts +7 -0
- package/lib/types/cli/commands/help.d.mts +7 -0
- package/lib/types/cli/commands/index.d.cts +5 -0
- package/lib/types/cli/commands/index.d.mts +5 -0
- package/lib/types/cli/commands/modules.d.cts +19 -0
- package/lib/types/cli/commands/modules.d.mts +19 -0
- package/lib/types/cli/commands/npm-link.d.cts +34 -0
- package/lib/types/cli/commands/npm-link.d.mts +34 -0
- package/lib/types/cli/commands/npm-token.d.cts +23 -0
- package/lib/types/cli/commands/npm-token.d.mts +23 -0
- package/lib/types/cli/commands/release-chain.d.cts +2 -0
- package/lib/types/cli/commands/release-chain.d.mts +2 -0
- package/lib/types/cli/commands/run-all.d.cts +22 -0
- package/lib/types/cli/commands/run-all.d.mts +22 -0
- package/lib/types/cli/commands/tag-release-shell.d.cts +57 -0
- package/lib/types/cli/commands/tag-release-shell.d.mts +57 -0
- package/lib/types/cli/commands/tag-release.d.cts +1 -0
- package/lib/types/cli/commands/tag-release.d.mts +1 -0
- package/lib/types/index.d.cts +1 -1
- package/lib/types/index.d.mts +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { execSync } from "node:child_process";
|
|
4
|
+
import { Command } from "./../command.js";
|
|
5
|
+
import { UserInput } from "./../../input/input.js";
|
|
6
|
+
import { NoCIFLag } from "./../../utils/constants.js";
|
|
7
|
+
import { printCommandHelp } from "./help.js";
|
|
8
|
+
const options = {
|
|
9
|
+
public: {
|
|
10
|
+
type: "boolean",
|
|
11
|
+
default: false,
|
|
12
|
+
},
|
|
13
|
+
private: {
|
|
14
|
+
type: "boolean",
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
gitToken: {
|
|
18
|
+
type: "string",
|
|
19
|
+
default: ".token",
|
|
20
|
+
},
|
|
21
|
+
npmToken: {
|
|
22
|
+
type: "string",
|
|
23
|
+
default: ".npmtoken",
|
|
24
|
+
},
|
|
25
|
+
gitUser: {
|
|
26
|
+
type: "string",
|
|
27
|
+
default: undefined,
|
|
28
|
+
},
|
|
29
|
+
allowFromBranch: {
|
|
30
|
+
type: "boolean",
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
tag: {
|
|
34
|
+
type: "string",
|
|
35
|
+
default: undefined,
|
|
36
|
+
},
|
|
37
|
+
message: {
|
|
38
|
+
type: "string",
|
|
39
|
+
default: undefined,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export class TagReleaseCommand extends Command {
|
|
43
|
+
constructor() {
|
|
44
|
+
super("TagReleaseCommand", options);
|
|
45
|
+
}
|
|
46
|
+
async ensureReleaseBranch(allowFromBranch = false) {
|
|
47
|
+
if (allowFromBranch)
|
|
48
|
+
return;
|
|
49
|
+
const currentBranch = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
50
|
+
cwd: process.cwd(),
|
|
51
|
+
encoding: "utf8",
|
|
52
|
+
}).trim();
|
|
53
|
+
if (currentBranch !== "master" && currentBranch !== "main") {
|
|
54
|
+
throw new Error(`release must be run from 'master' or 'main' branch. Current branch: ${currentBranch}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async prepareTag(tag) {
|
|
58
|
+
tag = `${tag || ""}`.trim();
|
|
59
|
+
if (tag.length > 0) {
|
|
60
|
+
return tag;
|
|
61
|
+
}
|
|
62
|
+
execSync("git tag --sort=-taggerdate | head -n 5", {
|
|
63
|
+
cwd: process.cwd(),
|
|
64
|
+
stdio: "inherit",
|
|
65
|
+
});
|
|
66
|
+
return UserInput.insistForText("tag", "What should be the new tag? (accepts v*.*.*[-...])", (val) => !!val.toString().match(/^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9a-zA-Z-]+)?$/));
|
|
67
|
+
}
|
|
68
|
+
async prepareMessage(message) {
|
|
69
|
+
message = `${message || ""}`.trim();
|
|
70
|
+
if (message.length > 0) {
|
|
71
|
+
return message;
|
|
72
|
+
}
|
|
73
|
+
return UserInput.insistForText("message", "Tag Message", (val) => !!val && val.toString().length > 0);
|
|
74
|
+
}
|
|
75
|
+
hasToken(fileName) {
|
|
76
|
+
try {
|
|
77
|
+
return fs.statSync(path.join(process.cwd(), fileName)).size > 0;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
readToken(fileName) {
|
|
84
|
+
return fs.readFileSync(path.join(process.cwd(), fileName), "utf8").trim();
|
|
85
|
+
}
|
|
86
|
+
help() {
|
|
87
|
+
printCommandHelp(this.log, "tag-release", "Prepare a release, create a git tag, push, and optionally publish to npm.", "tag-release [options] [tag] [message]", [
|
|
88
|
+
{
|
|
89
|
+
flag: "--public",
|
|
90
|
+
description: "Publish to the public npm registry",
|
|
91
|
+
defaultValue: "false",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
flag: "--private",
|
|
95
|
+
description: "Publish to the restricted npm registry",
|
|
96
|
+
defaultValue: "false",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
flag: "--git-token <file>",
|
|
100
|
+
description: "File containing the token used for authenticated git pushes",
|
|
101
|
+
defaultValue: ".token",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
flag: "--npm-token <file>",
|
|
105
|
+
description: "File containing the token used for npm publish",
|
|
106
|
+
defaultValue: ".npmtoken",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
flag: "--git-user <name>",
|
|
110
|
+
description: "Git user name embedded in authenticated pushes",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
flag: "--allow-from-branch",
|
|
114
|
+
description: "Skip the master/main branch guard",
|
|
115
|
+
defaultValue: "false",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
flag: "--tag <version>",
|
|
119
|
+
description: "Release tag to create",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
flag: "--message <text>",
|
|
123
|
+
description: "Release message to use",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
flag: "-h, --help",
|
|
127
|
+
description: "Show this help text and exit",
|
|
128
|
+
},
|
|
129
|
+
], [
|
|
130
|
+
"If tag or message are omitted, the command prompts interactively.",
|
|
131
|
+
"The command uses .token for git pushes and .npmtoken for npm publish unless overridden.",
|
|
132
|
+
], [
|
|
133
|
+
"tag-release --public --tag v1.2.3 --message \"Release 1.2.3\"",
|
|
134
|
+
"tag-release --private --allow-from-branch --tag v1.2.3",
|
|
135
|
+
]);
|
|
136
|
+
}
|
|
137
|
+
async run(answers) {
|
|
138
|
+
await this.ensureReleaseBranch(answers.allowFromBranch === true);
|
|
139
|
+
const publishAccessFlag = answers.private === true ? "private" : "public";
|
|
140
|
+
const tag = await this.prepareTag(answers.tag);
|
|
141
|
+
const message = await this.prepareMessage(answers.message);
|
|
142
|
+
const gitTokenFile = `${answers.gitToken || ".token"}`;
|
|
143
|
+
const npmTokenFile = `${answers.npmToken || ".npmtoken"}`;
|
|
144
|
+
const gitUser = typeof answers.gitUser === "string" && answers.gitUser.trim().length > 0
|
|
145
|
+
? answers.gitUser.trim()
|
|
146
|
+
: execSync("git config user.name", {
|
|
147
|
+
cwd: process.cwd(),
|
|
148
|
+
encoding: "utf8",
|
|
149
|
+
}).trim();
|
|
150
|
+
execSync("npm run prepare-release", {
|
|
151
|
+
cwd: process.cwd(),
|
|
152
|
+
stdio: "inherit",
|
|
153
|
+
});
|
|
154
|
+
const status = execSync("git status --porcelain", {
|
|
155
|
+
cwd: process.cwd(),
|
|
156
|
+
encoding: "utf8",
|
|
157
|
+
});
|
|
158
|
+
if (status.trim().length > 0) {
|
|
159
|
+
execSync("git add .", { cwd: process.cwd(), stdio: "inherit" });
|
|
160
|
+
execSync(`git commit -m "${tag} - ${message} - after release preparation"`, {
|
|
161
|
+
cwd: process.cwd(),
|
|
162
|
+
stdio: "inherit",
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
execSync(`npm version "${tag}" -m "${message}"`, {
|
|
166
|
+
cwd: process.cwd(),
|
|
167
|
+
stdio: "inherit",
|
|
168
|
+
});
|
|
169
|
+
const remoteUrl = execSync("git remote get-url origin", {
|
|
170
|
+
cwd: process.cwd(),
|
|
171
|
+
encoding: "utf8",
|
|
172
|
+
}).trim();
|
|
173
|
+
if (this.hasToken(gitTokenFile)) {
|
|
174
|
+
const currentBranch = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
175
|
+
cwd: process.cwd(),
|
|
176
|
+
encoding: "utf8",
|
|
177
|
+
});
|
|
178
|
+
let upstream = "";
|
|
179
|
+
try {
|
|
180
|
+
upstream = execSync("git rev-parse --abbrev-ref --symbolic-full-name '@{u}'", {
|
|
181
|
+
cwd: process.cwd(),
|
|
182
|
+
encoding: "utf8",
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
upstream = "";
|
|
187
|
+
}
|
|
188
|
+
const token = this.readToken(gitTokenFile);
|
|
189
|
+
execSync(`git push "https://${gitUser}:${token}@${remoteUrl.replace(/^https:\/\//, "")}" --follow-tags`, {
|
|
190
|
+
cwd: process.cwd(),
|
|
191
|
+
stdio: "inherit",
|
|
192
|
+
});
|
|
193
|
+
if (upstream.trim().length > 0) {
|
|
194
|
+
try {
|
|
195
|
+
execSync(`git branch --set-upstream-to="${upstream.trim()}" "${currentBranch.trim()}"`, {
|
|
196
|
+
cwd: process.cwd(),
|
|
197
|
+
stdio: "inherit",
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// ignore restore failures
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
execSync("git push --follow-tags", {
|
|
207
|
+
cwd: process.cwd(),
|
|
208
|
+
stdio: "inherit",
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
const npmAccessValue = publishAccessFlag === "public" ? "public" : "restricted";
|
|
212
|
+
if (message.endsWith(NoCIFLag) && this.hasToken(npmTokenFile)) {
|
|
213
|
+
const npmToken = this.readToken(npmTokenFile);
|
|
214
|
+
execSync(`NPM_TOKEN="${npmToken}" npm publish --access "${npmAccessValue}"`, {
|
|
215
|
+
cwd: process.cwd(),
|
|
216
|
+
stdio: "inherit",
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=tag-release-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag-release-shell.js","sourceRoot":"","sources":["../../../../src/cli/commands/tag-release-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,wBAAmB;AAErC,OAAO,EAAE,SAAS,EAAE,+BAA0B;AAC9C,OAAO,EAAE,QAAQ,EAAE,mCAA8B;AACjD,OAAO,EAAE,gBAAgB,EAAE,kBAAe;AAE1C,MAAM,OAAO,GAAG;IACd,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,QAAQ;KAClB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,WAAW;KACrB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,SAAS;KACnB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf;IACD,GAAG,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,SAAS;KACnB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,SAAS;KACnB;CACF,CAAC;AAEF,MAAM,OAAO,iBAAkB,SAAQ,OAA6B;IAClE;QACE,KAAK,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAEO,KAAK,CAAC,mBAAmB,CAAC,eAAe,GAAG,KAAK;QACvD,IAAI,eAAe;YAAE,OAAO;QAE5B,MA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AC,aAAa,EAAE,EAAE,CAAC,iBAAiB,EAC9F;gBACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;gBAClB,KAAK,EAAE,SAAS;aACjB,CACF,CAAC;YAEF,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/B,IAAI,CAAC;oBACH,QAAQ,CACN,iCAAiC,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAa,CAAC,IAAI,EAAE,GAAG,EAC7E;wBACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;wBAClB,KAAK,EAAE,SAAS;qBACjB,CACF,CAAC;gBACJ,CAAC;gBAAC,MAAM,CAAC;oBACP,0BAA0B;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,wBAAwB,EAAE;gBACjC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;gBAClB,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;QACL,CAAC;QAED,MAAM,cAAc,GAClB,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC;QAC3D,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAC9D,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YAC9C,QAAQ,CAAC,cAAc,QAAQ,2BAA2B,cAAc,GAAG,EAAE;gBAC3E,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;gBAClB,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
|
|
@@ -3,6 +3,7 @@ import { runCommand } from "./../../utils/utils.js";
|
|
|
3
3
|
import { NoCIFLag, SemVersion, SemVersionRegex } from "./../../utils/constants.js";
|
|
4
4
|
import { UserInput } from "./../../input/input.js";
|
|
5
5
|
import { Command } from "./../command.js";
|
|
6
|
+
import { printCommandHelp } from "./help.js";
|
|
6
7
|
const options = {
|
|
7
8
|
ci: {
|
|
8
9
|
type: "boolean",
|
|
@@ -61,10 +62,12 @@ export class ReleaseScript extends Command {
|
|
|
61
62
|
const log = this.log.for(this.prepareVersion);
|
|
62
63
|
tag = this.testVersion(tag || "");
|
|
63
64
|
if (!tag) {
|
|
64
|
-
log.verbose("No release
|
|
65
|
+
log.verbose("No release version provided. Prompting for one:");
|
|
65
66
|
log.info(`Listing latest git tags:`);
|
|
66
67
|
await runCommand("git tag --sort=-taggerdate | head -n 5").promise;
|
|
67
|
-
return await UserInput.insistForText("tag", "Enter the new tag number (accepts v*.*.*[-...])", (val) => !!val
|
|
68
|
+
return await UserInput.insistForText("tag", "Enter the new tag number (accepts v*.*.*[-...])", (val) => !!val
|
|
69
|
+
.toString()
|
|
70
|
+
.match(/^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9a-zA-Z-]+)?$/));
|
|
68
71
|
}
|
|
69
72
|
return tag;
|
|
70
73
|
}
|
|
@@ -107,6 +110,34 @@ export class ReleaseScript extends Command {
|
|
|
107
110
|
}
|
|
108
111
|
return message;
|
|
109
112
|
}
|
|
113
|
+
help() {
|
|
114
|
+
printCommandHelp(this.log, "tag-release", "Prepare, tag, and publish a release from the current repository.", "tag-release [options]", [
|
|
115
|
+
{ flag: "--tag <version>", description: "Release tag to use" },
|
|
116
|
+
{
|
|
117
|
+
flag: "--message <text>",
|
|
118
|
+
description: "Release message or ticket reference",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
flag: "--ci <true|false>",
|
|
122
|
+
description: "Whether to treat the run as CI",
|
|
123
|
+
defaultValue: "true",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
flag: "--version",
|
|
127
|
+
description: "Print the package version and exit",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
flag: "-h, --help",
|
|
131
|
+
description: "Show this help text and exit",
|
|
132
|
+
},
|
|
133
|
+
], [
|
|
134
|
+
"If tag or message are omitted, the command prompts interactively.",
|
|
135
|
+
"A successful run updates the package version, creates a git tag, pushes tags, and optionally publishes to npm.",
|
|
136
|
+
], [
|
|
137
|
+
"tag-release --tag v1.2.3 --message \"Release 1.2.3\"",
|
|
138
|
+
"tag-release --tag patch --message \"Fix release\"",
|
|
139
|
+
]);
|
|
140
|
+
}
|
|
110
141
|
/**
|
|
111
142
|
* @description Runs the release script.
|
|
112
143
|
* @summary This method orchestrates the entire release process, including version preparation, message creation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-release.js","sourceRoot":"","sources":["../../../../src/cli/commands/tag-release.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,OAAO,EAAE,UAAU,EAAE,+BAA0B;AAC/C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,mCAA8B;AAC9E,OAAO,EAAE,SAAS,EAAE,+BAA0B;AAC9C,OAAO,EAAE,OAAO,EAAE,wBAAmB;
|
|
1
|
+
{"version":3,"file":"tag-release.js","sourceRoot":"","sources":["../../../../src/cli/commands/tag-release.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,OAAO,EAAE,UAAU,EAAE,+BAA0B;AAC/C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,mCAA8B;AAC9E,OAAO,EAAE,SAAS,EAAE,+BAA0B;AAC9C,OAAO,EAAE,OAAO,EAAE,wBAAmB;AAGrC,OAAO,EAAE,gBAAgB,EAAE,kBAAe;AAE1C,MAAM,OAAO,GAAG;IACd,EAAE,EAAE;QACF,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd;IACD,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;KACX;IACD,GAAG,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;KACnB;CACF,CA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AC;QACV,MAAM,UAAU,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC;QACnD,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,MAAM,UAAU,CAAC,wDAAwD,CAAC;iBACvE,OAAO,CAAC;QACb,CAAC;IACH,CAAC;CACF"}
|
package/lib/esm/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export * from "./release-chain/index.js";
|
|
|
27
27
|
* @const VERSION
|
|
28
28
|
* @memberOf module:utils
|
|
29
29
|
*/
|
|
30
|
-
export const VERSION = "1.
|
|
30
|
+
export const VERSION = "1.5.1";
|
|
31
31
|
/**
|
|
32
32
|
* @description Represents the current version of the module.
|
|
33
33
|
* @summary Stores the version for the @decaf-ts/utils package. The build replaces
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Logger } from "@decaf-ts/logging";
|
|
2
|
+
export type HelpOption = {
|
|
3
|
+
flag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function printCommandHelp(log: Logger, commandName: string, summary: string, usage: string, options: HelpOption[], notes?: string[], examples?: string[]): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Logger } from "@decaf-ts/logging";
|
|
2
|
+
export type HelpOption = {
|
|
3
|
+
flag: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function printCommandHelp(log: Logger, commandName: string, summary: string, usage: string, options: HelpOption[], notes?: string[], examples?: string[]): void;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export * from "./build-scripts.d.cts";
|
|
2
2
|
export * from "./tag-release.d.cts";
|
|
3
3
|
export * from "./release-chain.d.cts";
|
|
4
|
+
export * from "./modules.d.cts";
|
|
5
|
+
export * from "./npm-link.d.cts";
|
|
6
|
+
export * from "./npm-token.d.cts";
|
|
7
|
+
export * from "./run-all.d.cts";
|
|
8
|
+
export * from "./tag-release-shell.d.cts";
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export * from "./build-scripts.d.mts";
|
|
2
2
|
export * from "./tag-release.d.mts";
|
|
3
3
|
export * from "./release-chain.d.mts";
|
|
4
|
+
export * from "./modules.d.mts";
|
|
5
|
+
export * from "./npm-link.d.mts";
|
|
6
|
+
export * from "./npm-token.d.mts";
|
|
7
|
+
export * from "./run-all.d.mts";
|
|
8
|
+
export * from "./tag-release-shell.d.mts";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from "../command.d.cts";
|
|
2
|
+
import { DefaultCommandValues } from "../constants.d.cts";
|
|
3
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
4
|
+
export declare function readGitModules(basePath?: string): string[];
|
|
5
|
+
export declare function readGitModulesDeep(basePath?: string, maxTraversal?: number): string[];
|
|
6
|
+
declare const options: {
|
|
7
|
+
basePath: {
|
|
8
|
+
type: string;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare class ModulesCommand extends Command<typeof options, void> {
|
|
13
|
+
constructor();
|
|
14
|
+
protected help(): void;
|
|
15
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
16
|
+
basePath: string;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Command } from "../command.d.mts";
|
|
2
|
+
import { DefaultCommandValues } from "../constants.d.mts";
|
|
3
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
4
|
+
export declare function readGitModules(basePath?: string): string[];
|
|
5
|
+
export declare function readGitModulesDeep(basePath?: string, maxTraversal?: number): string[];
|
|
6
|
+
declare const options: {
|
|
7
|
+
basePath: {
|
|
8
|
+
type: string;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare class ModulesCommand extends Command<typeof options, void> {
|
|
13
|
+
constructor();
|
|
14
|
+
protected help(): void;
|
|
15
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
16
|
+
basePath: string;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
2
|
+
import { Command } from "../command.d.cts";
|
|
3
|
+
import { DefaultCommandValues } from "../constants.d.cts";
|
|
4
|
+
declare const options: {
|
|
5
|
+
maxTraversal: {
|
|
6
|
+
type: string;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
excludes: {
|
|
10
|
+
type: string;
|
|
11
|
+
multiple: boolean;
|
|
12
|
+
default: string[];
|
|
13
|
+
};
|
|
14
|
+
include: {
|
|
15
|
+
type: string;
|
|
16
|
+
multiple: boolean;
|
|
17
|
+
default: never[];
|
|
18
|
+
};
|
|
19
|
+
operation: {
|
|
20
|
+
type: string;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare class NpmLinkCommand extends Command<typeof options, void> {
|
|
25
|
+
constructor();
|
|
26
|
+
protected help(): void;
|
|
27
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
28
|
+
maxTraversal: unknown;
|
|
29
|
+
excludes: unknown;
|
|
30
|
+
include: unknown;
|
|
31
|
+
operation: unknown;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
2
|
+
import { Command } from "../command.d.mts";
|
|
3
|
+
import { DefaultCommandValues } from "../constants.d.mts";
|
|
4
|
+
declare const options: {
|
|
5
|
+
maxTraversal: {
|
|
6
|
+
type: string;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
excludes: {
|
|
10
|
+
type: string;
|
|
11
|
+
multiple: boolean;
|
|
12
|
+
default: string[];
|
|
13
|
+
};
|
|
14
|
+
include: {
|
|
15
|
+
type: string;
|
|
16
|
+
multiple: boolean;
|
|
17
|
+
default: never[];
|
|
18
|
+
};
|
|
19
|
+
operation: {
|
|
20
|
+
type: string;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare class NpmLinkCommand extends Command<typeof options, void> {
|
|
25
|
+
constructor();
|
|
26
|
+
protected help(): void;
|
|
27
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
28
|
+
maxTraversal: unknown;
|
|
29
|
+
excludes: unknown;
|
|
30
|
+
include: unknown;
|
|
31
|
+
operation: unknown;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
2
|
+
import { Command } from "../command.d.cts";
|
|
3
|
+
import { DefaultCommandValues } from "../constants.d.cts";
|
|
4
|
+
declare const options: {
|
|
5
|
+
maxTraversal: {
|
|
6
|
+
type: string;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
tokenFiles: {
|
|
10
|
+
type: string;
|
|
11
|
+
multiple: boolean;
|
|
12
|
+
default: string[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare class NpmTokenCommand extends Command<typeof options, void> {
|
|
16
|
+
constructor();
|
|
17
|
+
protected help(): void;
|
|
18
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
19
|
+
maxTraversal: unknown;
|
|
20
|
+
tokenFiles: unknown;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
2
|
+
import { Command } from "../command.d.mts";
|
|
3
|
+
import { DefaultCommandValues } from "../constants.d.mts";
|
|
4
|
+
declare const options: {
|
|
5
|
+
maxTraversal: {
|
|
6
|
+
type: string;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
tokenFiles: {
|
|
10
|
+
type: string;
|
|
11
|
+
multiple: boolean;
|
|
12
|
+
default: string[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare class NpmTokenCommand extends Command<typeof options, void> {
|
|
16
|
+
constructor();
|
|
17
|
+
protected help(): void;
|
|
18
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
19
|
+
maxTraversal: unknown;
|
|
20
|
+
tokenFiles: unknown;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -53,10 +53,12 @@ type ReleaseChainAnswerMap = {
|
|
|
53
53
|
};
|
|
54
54
|
export declare class ReleaseChainCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
|
|
55
55
|
constructor();
|
|
56
|
+
protected help(): void;
|
|
56
57
|
protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
|
|
57
58
|
}
|
|
58
59
|
export declare class ReleaseChainDispatchCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
|
|
59
60
|
constructor();
|
|
61
|
+
protected help(): void;
|
|
60
62
|
protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
|
|
61
63
|
}
|
|
62
64
|
export {};
|
|
@@ -53,10 +53,12 @@ type ReleaseChainAnswerMap = {
|
|
|
53
53
|
};
|
|
54
54
|
export declare class ReleaseChainCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
|
|
55
55
|
constructor();
|
|
56
|
+
protected help(): void;
|
|
56
57
|
protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
|
|
57
58
|
}
|
|
58
59
|
export declare class ReleaseChainDispatchCommand extends Command<CommandOptions<typeof releaseChainArgs>, void> {
|
|
59
60
|
constructor();
|
|
61
|
+
protected help(): void;
|
|
60
62
|
protected run(options: LoggingConfig & typeof DefaultCommandValues & ReleaseChainAnswerMap): Promise<void>;
|
|
61
63
|
}
|
|
62
64
|
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
2
|
+
import { Command } from "../command.d.cts";
|
|
3
|
+
import { DefaultCommandValues } from "../constants.d.cts";
|
|
4
|
+
declare const options: {
|
|
5
|
+
basePath: {
|
|
6
|
+
type: string;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
command: {
|
|
10
|
+
type: string;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare class RunAllCommand extends Command<typeof options, void> {
|
|
15
|
+
constructor();
|
|
16
|
+
protected help(): void;
|
|
17
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
18
|
+
basePath: unknown;
|
|
19
|
+
command: unknown;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
2
|
+
import { Command } from "../command.d.mts";
|
|
3
|
+
import { DefaultCommandValues } from "../constants.d.mts";
|
|
4
|
+
declare const options: {
|
|
5
|
+
basePath: {
|
|
6
|
+
type: string;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
command: {
|
|
10
|
+
type: string;
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare class RunAllCommand extends Command<typeof options, void> {
|
|
15
|
+
constructor();
|
|
16
|
+
protected help(): void;
|
|
17
|
+
protected run(answers: LoggingConfig & typeof DefaultCommandValues & {
|
|
18
|
+
basePath: unknown;
|
|
19
|
+
command: unknown;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|