@releasekit/version 0.2.0-next.9 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/{baseError-ZCZHF6A2.js → baseError-URNTPHR4.js} +1 -1
- package/dist/chunk-PVBHVUZB.js +71 -0
- package/dist/{chunk-7F6RMN2K.js → chunk-ZIZARLA7.js} +522 -324
- package/dist/cli.js +3 -3
- package/dist/index.d.ts +9 -211
- package/dist/index.js +2 -2
- package/package.json +41 -36
- package/dist/chunk-GQLJ7JQY.js +0 -18
- package/dist/cli.cjs +0 -2370
- package/dist/cli.d.cts +0 -4
- package/dist/index.cjs +0 -2288
- package/dist/index.d.cts +0 -211
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Sam Maister
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// ../core/dist/index.js
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
var LOG_LEVELS = {
|
|
4
|
+
error: 0,
|
|
5
|
+
warn: 1,
|
|
6
|
+
info: 2,
|
|
7
|
+
debug: 3,
|
|
8
|
+
trace: 4
|
|
9
|
+
};
|
|
10
|
+
var PREFIXES = {
|
|
11
|
+
error: "[ERROR]",
|
|
12
|
+
warn: "[WARN]",
|
|
13
|
+
info: "[INFO]",
|
|
14
|
+
debug: "[DEBUG]",
|
|
15
|
+
trace: "[TRACE]"
|
|
16
|
+
};
|
|
17
|
+
var COLORS = {
|
|
18
|
+
error: chalk.red,
|
|
19
|
+
warn: chalk.yellow,
|
|
20
|
+
info: chalk.blue,
|
|
21
|
+
debug: chalk.gray,
|
|
22
|
+
trace: chalk.dim
|
|
23
|
+
};
|
|
24
|
+
var currentLevel = "info";
|
|
25
|
+
var quietMode = false;
|
|
26
|
+
function shouldLog(level) {
|
|
27
|
+
if (quietMode && level !== "error") return false;
|
|
28
|
+
return LOG_LEVELS[level] <= LOG_LEVELS[currentLevel];
|
|
29
|
+
}
|
|
30
|
+
function log(message, level = "info") {
|
|
31
|
+
if (!shouldLog(level)) return;
|
|
32
|
+
const formatted = COLORS[level](`${PREFIXES[level]} ${message}`);
|
|
33
|
+
console.error(formatted);
|
|
34
|
+
}
|
|
35
|
+
var ReleaseKitError = class _ReleaseKitError extends Error {
|
|
36
|
+
constructor(message) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.name = this.constructor.name;
|
|
39
|
+
}
|
|
40
|
+
logError() {
|
|
41
|
+
log(this.message, "error");
|
|
42
|
+
if (this.suggestions.length > 0) {
|
|
43
|
+
log("\nSuggested solutions:", "info");
|
|
44
|
+
for (const [i, suggestion] of this.suggestions.entries()) {
|
|
45
|
+
log(`${i + 1}. ${suggestion}`, "info");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static isReleaseKitError(error2) {
|
|
50
|
+
return error2 instanceof _ReleaseKitError;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// src/errors/baseError.ts
|
|
55
|
+
var BaseVersionError = class _BaseVersionError extends ReleaseKitError {
|
|
56
|
+
code;
|
|
57
|
+
suggestions;
|
|
58
|
+
constructor(message, code, suggestions) {
|
|
59
|
+
super(message);
|
|
60
|
+
this.code = code;
|
|
61
|
+
this.suggestions = suggestions ?? [];
|
|
62
|
+
}
|
|
63
|
+
static isVersionError(error) {
|
|
64
|
+
return error instanceof _BaseVersionError;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
ReleaseKitError,
|
|
70
|
+
BaseVersionError
|
|
71
|
+
};
|