sigdiff 0.1.0 → 0.1.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/dist/cli.js +3 -2
- package/dist/errors.d.ts +4 -4
- package/dist/errors.js +4 -4
- package/dist/git.js +5 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const cac_1 = __importDefault(require("cac"));
|
|
8
|
+
const package_json_1 = require("../package.json");
|
|
8
9
|
const errors_1 = require("./errors");
|
|
9
10
|
const git_1 = require("./git");
|
|
10
11
|
const diff_1 = require("./diff");
|
|
@@ -28,7 +29,7 @@ cli
|
|
|
28
29
|
process.stdout.write(output);
|
|
29
30
|
}
|
|
30
31
|
catch (err) {
|
|
31
|
-
if (err instanceof errors_1.
|
|
32
|
+
if (err instanceof errors_1.SigdiffException) {
|
|
32
33
|
process.stderr.write(`Error: ${err.error.message}\n`);
|
|
33
34
|
process.exit(1);
|
|
34
35
|
}
|
|
@@ -36,5 +37,5 @@ cli
|
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
cli.help();
|
|
39
|
-
cli.version(
|
|
40
|
+
cli.version(package_json_1.version);
|
|
40
41
|
cli.parse();
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type SigdiffError = {
|
|
2
2
|
code: 'INVALID_REF';
|
|
3
3
|
message: string;
|
|
4
4
|
} | {
|
|
@@ -14,7 +14,7 @@ export type AstlogError = {
|
|
|
14
14
|
code: 'NOT_GIT_REPO';
|
|
15
15
|
message: string;
|
|
16
16
|
};
|
|
17
|
-
export declare class
|
|
18
|
-
readonly error:
|
|
19
|
-
constructor(error:
|
|
17
|
+
export declare class SigdiffException extends Error {
|
|
18
|
+
readonly error: SigdiffError;
|
|
19
|
+
constructor(error: SigdiffError);
|
|
20
20
|
}
|
package/dist/errors.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
class
|
|
3
|
+
exports.SigdiffException = void 0;
|
|
4
|
+
class SigdiffException extends Error {
|
|
5
5
|
constructor(error) {
|
|
6
6
|
super(error.message);
|
|
7
7
|
this.error = error;
|
|
8
|
-
this.name = '
|
|
8
|
+
this.name = 'SigdiffException';
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
exports.
|
|
11
|
+
exports.SigdiffException = SigdiffException;
|
package/dist/git.js
CHANGED
|
@@ -47,7 +47,7 @@ function assertGitRepo() {
|
|
|
47
47
|
(0, child_process_1.execSync)('git rev-parse --git-dir', { stdio: 'ignore' });
|
|
48
48
|
}
|
|
49
49
|
catch {
|
|
50
|
-
throw new errors_1.
|
|
50
|
+
throw new errors_1.SigdiffException({
|
|
51
51
|
code: 'NOT_GIT_REPO',
|
|
52
52
|
message: 'Not a git repository. Run sigdiff from inside a git repo.'
|
|
53
53
|
});
|
|
@@ -57,7 +57,7 @@ function resolveRefs(rangeArg) {
|
|
|
57
57
|
if (rangeArg) {
|
|
58
58
|
const parts = rangeArg.split('..');
|
|
59
59
|
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
60
|
-
throw new errors_1.
|
|
60
|
+
throw new errors_1.SigdiffException({
|
|
61
61
|
code: 'INVALID_REF',
|
|
62
62
|
message: `Invalid range format: "${rangeArg}". Expected format: <ref>..<ref>`
|
|
63
63
|
});
|
|
@@ -73,7 +73,7 @@ function resolveRefs(rangeArg) {
|
|
|
73
73
|
}).trim();
|
|
74
74
|
}
|
|
75
75
|
catch {
|
|
76
|
-
throw new errors_1.
|
|
76
|
+
throw new errors_1.SigdiffException({
|
|
77
77
|
code: 'NO_TAGS',
|
|
78
78
|
message: 'No git tags found. Provide an explicit range: sigdiff <ref>..<ref>'
|
|
79
79
|
});
|
|
@@ -83,7 +83,7 @@ function resolveRefs(rangeArg) {
|
|
|
83
83
|
function extractAtRef(ref, entrypoint) {
|
|
84
84
|
const files = discoverFiles(ref, entrypoint);
|
|
85
85
|
if (files.length === 0) {
|
|
86
|
-
throw new errors_1.
|
|
86
|
+
throw new errors_1.SigdiffException({
|
|
87
87
|
code: 'NO_TYPESCRIPT',
|
|
88
88
|
message: `No TypeScript files found at ref "${ref}".`
|
|
89
89
|
});
|
|
@@ -114,7 +114,7 @@ function validateRef(ref) {
|
|
|
114
114
|
(0, child_process_1.execSync)(`git rev-parse --verify ${ref}`, { stdio: 'ignore' });
|
|
115
115
|
}
|
|
116
116
|
catch {
|
|
117
|
-
throw new errors_1.
|
|
117
|
+
throw new errors_1.SigdiffException({
|
|
118
118
|
code: 'INVALID_REF',
|
|
119
119
|
message: `Git ref "${ref}" does not exist.`
|
|
120
120
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { extract } from './extract';
|
|
|
2
2
|
export { diff } from './diff';
|
|
3
3
|
export { classify } from './classify';
|
|
4
4
|
export { buildResult, format } from './format';
|
|
5
|
-
export {
|
|
5
|
+
export { SigdiffException } from './errors';
|
|
6
6
|
export type { ApiSurface, ExportedSymbol, Change, ClassifiedChange, ChangelogResult, SemverLevel, SymbolKind } from './types';
|
|
7
|
-
export type {
|
|
7
|
+
export type { SigdiffError } from './errors';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SigdiffException = exports.format = exports.buildResult = exports.classify = exports.diff = exports.extract = void 0;
|
|
4
4
|
var extract_1 = require("./extract");
|
|
5
5
|
Object.defineProperty(exports, "extract", { enumerable: true, get: function () { return extract_1.extract; } });
|
|
6
6
|
var diff_1 = require("./diff");
|
|
@@ -11,4 +11,4 @@ var format_1 = require("./format");
|
|
|
11
11
|
Object.defineProperty(exports, "buildResult", { enumerable: true, get: function () { return format_1.buildResult; } });
|
|
12
12
|
Object.defineProperty(exports, "format", { enumerable: true, get: function () { return format_1.format; } });
|
|
13
13
|
var errors_1 = require("./errors");
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "SigdiffException", { enumerable: true, get: function () { return errors_1.SigdiffException; } });
|