@ridiormf/version-control 1.1.0
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/LICENSE +21 -0
- package/README.md +708 -0
- package/bin/smart-commit.js +201 -0
- package/bin/version-control.js +4 -0
- package/dist/analyzer.d.ts +7 -0
- package/dist/analyzer.d.ts.map +1 -0
- package/dist/analyzer.js +109 -0
- package/dist/analyzer.js.map +1 -0
- package/dist/changelog.d.ts +49 -0
- package/dist/changelog.d.ts.map +1 -0
- package/dist/changelog.js +219 -0
- package/dist/changelog.js.map +1 -0
- package/dist/colors.d.ts +6 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +16 -0
- package/dist/colors.js.map +1 -0
- package/dist/commitGenerator.d.ts +27 -0
- package/dist/commitGenerator.d.ts.map +1 -0
- package/dist/commitGenerator.js +272 -0
- package/dist/commitGenerator.js.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +116 -0
- package/dist/config.js.map +1 -0
- package/dist/git.d.ts +7 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +18 -0
- package/dist/git.js.map +1 -0
- package/dist/gitCommands.d.ts +6 -0
- package/dist/gitCommands.d.ts.map +1 -0
- package/dist/gitCommands.js +55 -0
- package/dist/gitCommands.js.map +1 -0
- package/dist/i18n.d.ts +15 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +452 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +221 -0
- package/dist/index.js.map +1 -0
- package/dist/readline.d.ts +19 -0
- package/dist/readline.d.ts.map +1 -0
- package/dist/readline.js +129 -0
- package/dist/readline.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/updateChecker.d.ts +5 -0
- package/dist/updateChecker.d.ts.map +1 -0
- package/dist/updateChecker.js +117 -0
- package/dist/updateChecker.js.map +1 -0
- package/dist/updater.d.ts +22 -0
- package/dist/updater.d.ts.map +1 -0
- package/dist/updater.js +170 -0
- package/dist/updater.js.map +1 -0
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +69 -0
- package/dist/version.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commitGenerator.d.ts","sourceRoot":"","sources":["../src/commitGenerator.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,EAAE,CAuC/C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAoG7E"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStagedChanges = getStagedChanges;
|
|
4
|
+
exports.generateCommitMessage = generateCommitMessage;
|
|
5
|
+
const git_1 = require("./git");
|
|
6
|
+
/**
|
|
7
|
+
* Get staged file changes
|
|
8
|
+
*/
|
|
9
|
+
function getStagedChanges() {
|
|
10
|
+
const output = (0, git_1.git)("diff --cached --numstat");
|
|
11
|
+
if (!output) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const changes = [];
|
|
15
|
+
const lines = output.split("\n").filter(Boolean);
|
|
16
|
+
for (const line of lines) {
|
|
17
|
+
const [additions, deletions, path] = line.split("\t");
|
|
18
|
+
// Skip binary files
|
|
19
|
+
if (additions === "-" || deletions === "-") {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
// Determine status
|
|
23
|
+
let status = "modified";
|
|
24
|
+
const statusOutput = (0, git_1.git)(`diff --cached --name-status -- "${path}"`);
|
|
25
|
+
if (statusOutput.startsWith("A")) {
|
|
26
|
+
status = "added";
|
|
27
|
+
}
|
|
28
|
+
else if (statusOutput.startsWith("D")) {
|
|
29
|
+
status = "deleted";
|
|
30
|
+
}
|
|
31
|
+
else if (statusOutput.startsWith("R")) {
|
|
32
|
+
status = "renamed";
|
|
33
|
+
}
|
|
34
|
+
changes.push({
|
|
35
|
+
path,
|
|
36
|
+
status,
|
|
37
|
+
additions: parseInt(additions, 10),
|
|
38
|
+
deletions: parseInt(deletions, 10),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return changes;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Analyze changes and generate commit message
|
|
45
|
+
*/
|
|
46
|
+
function generateCommitMessage(changes) {
|
|
47
|
+
if (changes.length === 0) {
|
|
48
|
+
return {
|
|
49
|
+
type: "chore",
|
|
50
|
+
description: "update project files",
|
|
51
|
+
fullMessage: "chore: update project files",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Analyze file types and changes
|
|
55
|
+
const fileTypes = analyzeFileTypes(changes);
|
|
56
|
+
const changeTypes = analyzeChangeTypes(changes);
|
|
57
|
+
// Determine commit type
|
|
58
|
+
let type = "chore";
|
|
59
|
+
let scope;
|
|
60
|
+
let description = "";
|
|
61
|
+
// Check for new files (likely feat)
|
|
62
|
+
const newFiles = changes.filter((c) => c.status === "added");
|
|
63
|
+
const deletedFiles = changes.filter((c) => c.status === "deleted");
|
|
64
|
+
const modifiedFiles = changes.filter((c) => c.status === "modified");
|
|
65
|
+
// Documentation changes
|
|
66
|
+
if (fileTypes.docs > 0 && fileTypes.code === 0) {
|
|
67
|
+
type = "docs";
|
|
68
|
+
if (changes.length === 1) {
|
|
69
|
+
description = `update ${getFileName(changes[0].path)}`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
description = "update documentation";
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Test changes
|
|
76
|
+
else if (fileTypes.tests > 0 && fileTypes.code === 0) {
|
|
77
|
+
type = "test";
|
|
78
|
+
description = fileTypes.tests === 1 ? "add test" : "update tests";
|
|
79
|
+
}
|
|
80
|
+
// Config changes
|
|
81
|
+
else if (fileTypes.config > 0 && fileTypes.code === 0) {
|
|
82
|
+
type = "chore";
|
|
83
|
+
description = "update configuration";
|
|
84
|
+
}
|
|
85
|
+
// Style/formatting only
|
|
86
|
+
else if (changeTypes.totalChanges < 50 && fileTypes.style > 0) {
|
|
87
|
+
type = "style";
|
|
88
|
+
description = "format code";
|
|
89
|
+
}
|
|
90
|
+
// New features
|
|
91
|
+
else if (newFiles.length > 0 && newFiles.length > deletedFiles.length) {
|
|
92
|
+
type = "feat";
|
|
93
|
+
scope = detectScope(newFiles);
|
|
94
|
+
if (newFiles.length === 1) {
|
|
95
|
+
const fileName = getFileName(newFiles[0].path);
|
|
96
|
+
description = `add ${fileName}`;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const primaryType = getMostCommonFileType(newFiles);
|
|
100
|
+
description = `add ${primaryType} functionality`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Deletions
|
|
104
|
+
else if (deletedFiles.length > newFiles.length) {
|
|
105
|
+
type = "refactor";
|
|
106
|
+
description =
|
|
107
|
+
deletedFiles.length === 1
|
|
108
|
+
? `remove ${getFileName(deletedFiles[0].path)}`
|
|
109
|
+
: "remove unused code";
|
|
110
|
+
}
|
|
111
|
+
// Bug fixes (check for common patterns)
|
|
112
|
+
else if (containsFixPatterns(changes)) {
|
|
113
|
+
type = "fix";
|
|
114
|
+
scope = detectScope(changes);
|
|
115
|
+
description = generateFixDescription(changes);
|
|
116
|
+
}
|
|
117
|
+
// General updates
|
|
118
|
+
else if (modifiedFiles.length > 0) {
|
|
119
|
+
type = "refactor";
|
|
120
|
+
scope = detectScope(modifiedFiles);
|
|
121
|
+
if (modifiedFiles.length === 1) {
|
|
122
|
+
const fileName = getFileName(modifiedFiles[0].path);
|
|
123
|
+
description = `update ${fileName}`;
|
|
124
|
+
}
|
|
125
|
+
else if (changeTypes.totalChanges > 200) {
|
|
126
|
+
description = "major code refactoring";
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
description = "improve code structure";
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Build full message
|
|
133
|
+
const fullMessage = scope
|
|
134
|
+
? `${type}(${scope}): ${description}`
|
|
135
|
+
: `${type}: ${description}`;
|
|
136
|
+
return {
|
|
137
|
+
type,
|
|
138
|
+
scope,
|
|
139
|
+
description,
|
|
140
|
+
fullMessage,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Analyze file types in changes
|
|
145
|
+
*/
|
|
146
|
+
function analyzeFileTypes(changes) {
|
|
147
|
+
const types = {
|
|
148
|
+
code: 0,
|
|
149
|
+
tests: 0,
|
|
150
|
+
docs: 0,
|
|
151
|
+
config: 0,
|
|
152
|
+
style: 0,
|
|
153
|
+
};
|
|
154
|
+
for (const change of changes) {
|
|
155
|
+
const path = change.path.toLowerCase();
|
|
156
|
+
if (path.includes("test") || path.includes("spec")) {
|
|
157
|
+
types.tests++;
|
|
158
|
+
}
|
|
159
|
+
else if (path.match(/\.(md|txt|rst)$/)) {
|
|
160
|
+
types.docs++;
|
|
161
|
+
}
|
|
162
|
+
else if (path.match(/\.(json|yaml|yml|toml|ini|env|config)$/) ||
|
|
163
|
+
path.includes("package.json") ||
|
|
164
|
+
path.includes("tsconfig")) {
|
|
165
|
+
types.config++;
|
|
166
|
+
}
|
|
167
|
+
else if (path.match(/\.(css|scss|sass|less)$/)) {
|
|
168
|
+
types.style++;
|
|
169
|
+
}
|
|
170
|
+
else if (path.match(/\.(ts|js|tsx|jsx|py|java|go|rs|c|cpp|h)$/)) {
|
|
171
|
+
types.code++;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return types;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Analyze change magnitude
|
|
178
|
+
*/
|
|
179
|
+
function analyzeChangeTypes(changes) {
|
|
180
|
+
let totalAdditions = 0;
|
|
181
|
+
let totalDeletions = 0;
|
|
182
|
+
for (const change of changes) {
|
|
183
|
+
totalAdditions += change.additions;
|
|
184
|
+
totalDeletions += change.deletions;
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
totalAdditions,
|
|
188
|
+
totalDeletions,
|
|
189
|
+
totalChanges: totalAdditions + totalDeletions,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Detect scope from file paths
|
|
194
|
+
*/
|
|
195
|
+
function detectScope(changes) {
|
|
196
|
+
// Look for common directory patterns
|
|
197
|
+
const paths = changes.map((c) => c.path);
|
|
198
|
+
// Check for specific directories
|
|
199
|
+
const commonDirs = [
|
|
200
|
+
"src",
|
|
201
|
+
"lib",
|
|
202
|
+
"api",
|
|
203
|
+
"ui",
|
|
204
|
+
"components",
|
|
205
|
+
"utils",
|
|
206
|
+
"services",
|
|
207
|
+
];
|
|
208
|
+
for (const dir of commonDirs) {
|
|
209
|
+
if (paths.some((p) => p.startsWith(`${dir}/`))) {
|
|
210
|
+
return dir;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// Check for feature-based directories
|
|
214
|
+
const features = paths
|
|
215
|
+
.map((p) => p.split("/")[0])
|
|
216
|
+
.filter((p) => !["src", "dist", "node_modules"].includes(p));
|
|
217
|
+
if (features.length > 0 && features.every((f) => f === features[0])) {
|
|
218
|
+
return features[0];
|
|
219
|
+
}
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Get file name without extension
|
|
224
|
+
*/
|
|
225
|
+
function getFileName(path) {
|
|
226
|
+
const parts = path.split("/");
|
|
227
|
+
const fileName = parts[parts.length - 1];
|
|
228
|
+
return fileName.replace(/\.[^.]+$/, "");
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Get most common file type
|
|
232
|
+
*/
|
|
233
|
+
function getMostCommonFileType(changes) {
|
|
234
|
+
const extensions = changes
|
|
235
|
+
.map((c) => c.path.split(".").pop() || "")
|
|
236
|
+
.filter(Boolean);
|
|
237
|
+
if (extensions.length === 0)
|
|
238
|
+
return "files";
|
|
239
|
+
const counts = extensions.reduce((acc, ext) => {
|
|
240
|
+
acc[ext] = (acc[ext] || 0) + 1;
|
|
241
|
+
return acc;
|
|
242
|
+
}, {});
|
|
243
|
+
const mostCommon = Object.entries(counts).sort((a, b) => b[1] - a[1])[0][0];
|
|
244
|
+
const typeMap = {
|
|
245
|
+
ts: "TypeScript",
|
|
246
|
+
js: "JavaScript",
|
|
247
|
+
tsx: "React",
|
|
248
|
+
jsx: "React",
|
|
249
|
+
py: "Python",
|
|
250
|
+
md: "documentation",
|
|
251
|
+
};
|
|
252
|
+
return typeMap[mostCommon] || mostCommon;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Check if changes contain fix patterns
|
|
256
|
+
*/
|
|
257
|
+
function containsFixPatterns(changes) {
|
|
258
|
+
// Simple heuristic: more deletions than additions often indicates fixes
|
|
259
|
+
const totalAdditions = changes.reduce((sum, c) => sum + c.additions, 0);
|
|
260
|
+
const totalDeletions = changes.reduce((sum, c) => sum + c.deletions, 0);
|
|
261
|
+
return totalDeletions > totalAdditions * 0.7;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Generate fix description
|
|
265
|
+
*/
|
|
266
|
+
function generateFixDescription(changes) {
|
|
267
|
+
if (changes.length === 1) {
|
|
268
|
+
return `resolve issue in ${getFileName(changes[0].path)}`;
|
|
269
|
+
}
|
|
270
|
+
return "resolve issues";
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=commitGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commitGenerator.js","sourceRoot":"","sources":["../src/commitGenerator.ts"],"names":[],"mappings":";;AAyBA,4CAuCC;AAKD,sDAoGC;AAzKD,+BAA4B;AAsB5B;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,MAAM,MAAM,GAAG,IAAA,SAAG,EAAC,yBAAyB,CAAC,CAAC;IAE9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEjD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEtD,oBAAoB;QACpB,IAAI,SAAS,KAAK,GAAG,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;YAC3C,SAAS;QACX,CAAC;QAED,mBAAmB;QACnB,IAAI,MAAM,GAAyB,UAAU,CAAC;QAC9C,MAAM,YAAY,GAAG,IAAA,SAAG,EAAC,mCAAmC,IAAI,GAAG,CAAC,CAAC;QAErE,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACjC,MAAM,GAAG,OAAO,CAAC;QACnB,CAAC;aAAM,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,MAAM,GAAG,SAAS,CAAC;QACrB,CAAC;aAAM,IAAI,YAAY,CAAC,UAAU,CAA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ACtC,EAAE,EAAE,YAAY;QAChB,EAAE,EAAE,YAAY;QAChB,GAAG,EAAE,OAAO;QACZ,GAAG,EAAE,OAAO;QACZ,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,eAAe;KACpB,CAAC;IAEF,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,OAAqB;IAChD,wEAAwE;IACxE,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACxE,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAExE,OAAO,cAAc,GAAG,cAAc,GAAG,GAAG,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,OAAqB;IACnD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,oBAAoB,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IAC5D,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration interface
|
|
3
|
+
*/
|
|
4
|
+
export interface Config {
|
|
5
|
+
language?: "en" | "pt" | "es" | "fr";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Read configuration from file
|
|
9
|
+
* @returns Configuration object or empty object if file doesn't exist
|
|
10
|
+
*/
|
|
11
|
+
export declare function readConfig(): Config;
|
|
12
|
+
/**
|
|
13
|
+
* Write configuration to file
|
|
14
|
+
* @param config - Configuration object to save
|
|
15
|
+
*/
|
|
16
|
+
export declare function writeConfig(config: Config): void;
|
|
17
|
+
/**
|
|
18
|
+
* Get configured language
|
|
19
|
+
* @returns Configured language or undefined if not set
|
|
20
|
+
*/
|
|
21
|
+
export declare function getConfiguredLanguage(): "en" | "pt" | "es" | "fr" | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Set language configuration
|
|
24
|
+
* @param language - Language code to set
|
|
25
|
+
*/
|
|
26
|
+
export declare function setLanguage(language: "en" | "pt" | "es" | "fr"): void;
|
|
27
|
+
/**
|
|
28
|
+
* Clear language configuration (use system default)
|
|
29
|
+
*/
|
|
30
|
+
export declare function clearLanguage(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Check if language is configured
|
|
33
|
+
* @returns True if language is manually configured
|
|
34
|
+
*/
|
|
35
|
+
export declare function hasConfiguredLanguage(): boolean;
|
|
36
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CACtC;AAUD;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAcnC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQhD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAG7E;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAIrE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAIpC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAG/C"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.readConfig = readConfig;
|
|
37
|
+
exports.writeConfig = writeConfig;
|
|
38
|
+
exports.getConfiguredLanguage = getConfiguredLanguage;
|
|
39
|
+
exports.setLanguage = setLanguage;
|
|
40
|
+
exports.clearLanguage = clearLanguage;
|
|
41
|
+
exports.hasConfiguredLanguage = hasConfiguredLanguage;
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const os = __importStar(require("os"));
|
|
45
|
+
/**
|
|
46
|
+
* Get the configuration file path
|
|
47
|
+
* @returns Path to config file in user's home directory
|
|
48
|
+
*/
|
|
49
|
+
function getConfigPath() {
|
|
50
|
+
return path.join(os.homedir(), ".version-control-config.json");
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Read configuration from file
|
|
54
|
+
* @returns Configuration object or empty object if file doesn't exist
|
|
55
|
+
*/
|
|
56
|
+
function readConfig() {
|
|
57
|
+
const configPath = getConfigPath();
|
|
58
|
+
try {
|
|
59
|
+
if (fs.existsSync(configPath)) {
|
|
60
|
+
const content = fs.readFileSync(configPath, "utf8");
|
|
61
|
+
return JSON.parse(content);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
// If there's any error reading config, return empty config
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
return {};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Write configuration to file
|
|
72
|
+
* @param config - Configuration object to save
|
|
73
|
+
*/
|
|
74
|
+
function writeConfig(config) {
|
|
75
|
+
const configPath = getConfigPath();
|
|
76
|
+
try {
|
|
77
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(`Failed to write config file: ${error.message}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get configured language
|
|
85
|
+
* @returns Configured language or undefined if not set
|
|
86
|
+
*/
|
|
87
|
+
function getConfiguredLanguage() {
|
|
88
|
+
const config = readConfig();
|
|
89
|
+
return config.language;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Set language configuration
|
|
93
|
+
* @param language - Language code to set
|
|
94
|
+
*/
|
|
95
|
+
function setLanguage(language) {
|
|
96
|
+
const config = readConfig();
|
|
97
|
+
config.language = language;
|
|
98
|
+
writeConfig(config);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Clear language configuration (use system default)
|
|
102
|
+
*/
|
|
103
|
+
function clearLanguage() {
|
|
104
|
+
const config = readConfig();
|
|
105
|
+
delete config.language;
|
|
106
|
+
writeConfig(config);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Check if language is configured
|
|
110
|
+
* @returns True if language is manually configured
|
|
111
|
+
*/
|
|
112
|
+
function hasConfiguredLanguage() {
|
|
113
|
+
const config = readConfig();
|
|
114
|
+
return !!config.language;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,gCAcC;AAMD,kCAQC;AAMD,sDAGC;AAMD,kCAIC;AAKD,sCAIC;AAMD,sDAGC;AAxFD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AASzB;;;GAGG;AACH,SAAS,aAAa;IACpB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,8BAA8B,CAAC,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU;IACxB,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACpD,OAAO,IA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+
* Execute a git command and return the output
|
|
3
|
+
* @param command - Git command to execute (without 'git' prefix)
|
|
4
|
+
* @returns Command output or empty string on error
|
|
5
|
+
*/
|
|
6
|
+
export declare function git(command: string): string;
|
|
7
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM3C"}
|
package/dist/git.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.git = git;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
/**
|
|
6
|
+
* Execute a git command and return the output
|
|
7
|
+
* @param command - Git command to execute (without 'git' prefix)
|
|
8
|
+
* @returns Command output or empty string on error
|
|
9
|
+
*/
|
|
10
|
+
function git(command) {
|
|
11
|
+
try {
|
|
12
|
+
return (0, child_process_1.execSync)(`git ${command}`, { encoding: "utf8" }).trim();
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;AAOA,kBAMC;AAbD,iDAAyC;AAEzC;;;;GAIG;AACH,SAAgB,GAAG,CAAC,OAAe;IACjC,IAAI,CAAC;QACH,OAAO,IAAA,wBAAQ,EAAC,OAAO,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACjE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitCommands.d.ts","sourceRoot":"","sources":["../src/gitCommands.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAuDxD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeGitCommands = executeGitCommands;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const colors_1 = require("./colors");
|
|
6
|
+
const i18n_1 = require("./i18n");
|
|
7
|
+
/**
|
|
8
|
+
* Execute git commands to commit, tag, and push version
|
|
9
|
+
* @param version - Version string to commit and tag
|
|
10
|
+
*/
|
|
11
|
+
function executeGitCommands(version) {
|
|
12
|
+
console.log(`${colors_1.colors.bold}${(0, i18n_1.t)("executingGitCommands")}${colors_1.colors.reset}`);
|
|
13
|
+
console.log("");
|
|
14
|
+
try {
|
|
15
|
+
// git add -A
|
|
16
|
+
console.log(`${colors_1.colors.cyan}→${colors_1.colors.reset} git add -A`);
|
|
17
|
+
(0, child_process_1.execSync)("git add -A", { stdio: "inherit" });
|
|
18
|
+
console.log(`${colors_1.colors.green}✓${colors_1.colors.reset} ${(0, i18n_1.t)("filesAdded")}`);
|
|
19
|
+
// git commit
|
|
20
|
+
console.log(`${colors_1.colors.cyan}→${colors_1.colors.reset} git commit -m "chore: bump version to ${version}"`);
|
|
21
|
+
(0, child_process_1.execSync)(`git commit -m "chore: bump version to ${version}"`, {
|
|
22
|
+
stdio: "inherit",
|
|
23
|
+
});
|
|
24
|
+
console.log(`${colors_1.colors.green}✓${colors_1.colors.reset} ${(0, i18n_1.t)("commitCreated")}`);
|
|
25
|
+
// git tag
|
|
26
|
+
console.log(`${colors_1.colors.cyan}→${colors_1.colors.reset} git tag v${version}`);
|
|
27
|
+
(0, child_process_1.execSync)(`git tag v${version}`, { stdio: "inherit" });
|
|
28
|
+
console.log(`${colors_1.colors.green}✓${colors_1.colors.reset} ${(0, i18n_1.t)("tagCreated")}`);
|
|
29
|
+
// git push
|
|
30
|
+
console.log(`${colors_1.colors.cyan}→${colors_1.colors.reset} git push`);
|
|
31
|
+
(0, child_process_1.execSync)("git push", { stdio: "inherit" });
|
|
32
|
+
console.log(`${colors_1.colors.green}✓${colors_1.colors.reset} ${(0, i18n_1.t)("pushCompleted")}`);
|
|
33
|
+
// git push --tags
|
|
34
|
+
console.log(`${colors_1.colors.cyan}→${colors_1.colors.reset} git push --tags`);
|
|
35
|
+
(0, child_process_1.execSync)("git push --tags", { stdio: "inherit" });
|
|
36
|
+
console.log(`${colors_1.colors.green}✓${colors_1.colors.reset} ${(0, i18n_1.t)("tagsPushed")}`);
|
|
37
|
+
console.log("");
|
|
38
|
+
console.log(`${colors_1.colors.green}${colors_1.colors.bold}✓ ${(0, i18n_1.t)("versionPublished")}${colors_1.colors.reset}`);
|
|
39
|
+
console.log("");
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const err = error;
|
|
43
|
+
console.log("");
|
|
44
|
+
console.log(`${colors_1.colors.red}✗ ${(0, i18n_1.t)("errorExecutingGit")}${colors_1.colors.reset}`, err.message);
|
|
45
|
+
console.log("");
|
|
46
|
+
console.log(`${colors_1.colors.bold}${(0, i18n_1.t)("executeManually")}${colors_1.colors.reset}`);
|
|
47
|
+
console.log(` 1. git add -A`);
|
|
48
|
+
console.log(` 2. git commit -m "chore: bump version to ${version}"`);
|
|
49
|
+
console.log(` 3. git tag v${version}`);
|
|
50
|
+
console.log(` 4. git push && git push --tags`);
|
|
51
|
+
console.log("");
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=gitCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitCommands.js","sourceRoot":"","sources":["../src/gitCommands.ts"],"names":[],"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C,KAAK,EAAE,EACzD,GAAG,CAAC,OAAO,CACZ,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,GAAG,eAAM,CAAC,IAAI,GAAG,IAAA,QAAC,EAAC,iBAAiB,CAAC,GAAG,eAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QACpE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,8CAA8C,OAAO,GAAG,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalization (i18n) system using i18next
|
|
3
|
+
* Detects system language and provides translations
|
|
4
|
+
* Supported languages: English (default), Portuguese, Spanish, French
|
|
5
|
+
* Can be manually configured via config file
|
|
6
|
+
*/
|
|
7
|
+
import i18next from "i18next";
|
|
8
|
+
export type Language = "en" | "pt" | "es" | "fr";
|
|
9
|
+
export declare const currentLanguage: Language;
|
|
10
|
+
export declare const isLanguageConfigured: boolean;
|
|
11
|
+
export declare function getYesOptions(): string[];
|
|
12
|
+
export declare function getNoOptions(): string[];
|
|
13
|
+
export default i18next;
|
|
14
|
+
export declare const t: import("i18next").TFunction<["translation", ...string[]], undefined>;
|
|
15
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAucjD,eAAO,MAAM,eAAe,EAAE,QAA+B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,EAAE,OAAiC,CAAC;AAGrE,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAGD,eAAe,OAAO,CAAC;AACvB,eAAO,MAAM,CAAC,sEAA0B,CAAC"}
|